/* The website's tokens, type and controls (14-Website/src/style.css), for the forms and the admin pages.
   Mobile first. Colours: approved values and the D-24 tones only. */
@font-face { font-family: "Reem Kufi"; src: url("/fonts/ReemKufi.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/fonts/IBMPlexSansArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Michroma"; src: url("/fonts/Michroma-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --core-900: #0A0A0A; --core: #111111; --core-800: #1B1B1B; --core-700: #252525; --core-600: #353535;
  --grey: #767676; --white-300: #C1C1C1; --white: #F3F3F3; --lime: #B7FF35;
  --line: rgba(243,243,243,.14);
  --slant: 26.565deg;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body { background: var(--core); color: var(--white); font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 16px; line-height: 1.8; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
[lang="en"] { font-family: "Space Grotesk", system-ui, sans-serif; line-height: 1.7; }
[lang="ar"] { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }
::selection { background: var(--lime); color: var(--core); }
a { color: inherit; text-underline-offset: .22em; }
h1, h2 { font-family: "Reem Kufi", "IBM Plex Sans Arabic", sans-serif; font-weight: 700; line-height: 1.35; text-wrap: balance; }
h1 { font-size: clamp(30px, 6vw, 48px); margin-bottom: 14px; }
h2 { font-size: 22px; margin-bottom: 12px; }
[lang="en"] :is(h1, h2), h1[lang="en"] { font-family: "Michroma", "Space Grotesk", sans-serif; font-weight: 400; letter-spacing: .02em; overflow-wrap: break-word; }
[lang="en"] h1 { font-size: clamp(22px, 4.4vw, 34px); }
[lang="en"] h2 { font-size: 17px; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.wrap { width: min(760px, 90vw); margin-inline: auto; }
.admin .wrap { width: min(1100px, 92vw); }

.bar { border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 80px; }
.brand img { width: 240px; height: auto; }      /* approved minimum for the bilingual lockup */
@media (max-width: 760px) { .brand img { width: 140px; } .bar .wrap { min-height: 64px; } }
.bar nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.who { color: var(--white-300); overflow-wrap: anywhere; }
.bar a:not(.brand) { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; }
.bar a:not(.brand):hover { color: var(--lime); }
main { flex: 1; padding-block: 40px 64px; }
footer { border-top: 1px solid var(--line); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 22px; padding-block: 18px; }
footer a { display: inline-block; padding-block: 10px; }

.lead { font-size: 18px; max-width: 62ch; margin-bottom: 10px; white-space: pre-line; }
.hint { font-size: 14px; color: var(--white-300); }
.more { display: inline-block; padding-block: 8px; border-bottom: 2px solid var(--lime); text-decoration: none; }
.notice { padding-block: 24px; }
.notice p { margin-bottom: 14px; }
.ref { font-size: 30px; letter-spacing: .14em; font-family: "Space Grotesk", sans-serif; text-align: start; user-select: all; }
[dir="rtl"] .ref { text-align: right; }

.choices { list-style: none; display: grid; gap: 2px; margin-top: 24px; }
.choices a { display: block; padding: 20px 22px; background: var(--core-800); text-decoration: none; font-weight: 700; font-size: 19px; }
.choices a:hover { background: var(--core-700); color: var(--lime); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 24px; border: 1px solid var(--white); border-radius: 0; background: transparent; color: var(--white); font: inherit; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--white); color: var(--core); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--core); font-weight: 700; }
.btn.primary:hover { background: var(--white); border-color: var(--white); }
.btn:disabled { opacity: .6; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

label { display: block; font-size: 15px; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 52px; padding: 12px 14px; background: var(--core-800); color: var(--white); border: 1px solid var(--grey); border-radius: 0; font: inherit; font-size: 16px; caret-color: var(--lime); }
input[type="file"] { padding: 11px 12px; font-size: 14px; }
input[type="file"]::file-selector-button { font: inherit; background: var(--core-600); color: var(--white); border: 0; padding: 4px 14px; margin-inline-end: 12px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--white-300); opacity: .75; }
[dir="rtl"] :is(input, textarea)::placeholder { text-align: right; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); }
input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--lime); }
[aria-invalid="true"] { border-color: var(--white) !important; border-width: 2px !important; }
.err { font-size: 14px; font-weight: 700; }
.err:not(:empty)::before { content: ""; display: inline-block; width: 4px; height: 12px; background: var(--white); transform: skewX(calc(-1 * var(--slant))); margin-inline-end: 8px; }  /* C-03: no red */
.summary { list-style: none; padding: 14px 18px; background: var(--core-800); border: 1px solid var(--white); margin-block: 8px 20px; font-weight: 700; }

.entry { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 26px; }
.field > label { margin-bottom: 6px; }
.field small { color: var(--white-300); }
.check label, .tick { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-block: 8px; cursor: pointer; }
.check input, .tick input { margin-top: 4px; }
.full { grid-column: 1 / -1; }
.entry .btn { min-width: 200px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 641px) { .entry { grid-template-columns: 1fr 1fr; } }

.prose { max-width: 68ch; }
.prose h2 { margin-block: 28px 4px; }

/* ---------- admin ---------- */
.admin section { margin-top: 34px; }
.admin h2 { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 18px; margin-bottom: 12px; }   /* working headings stay easy to read */
.count { display: inline-block; padding: 0 10px; background: var(--lime); color: var(--core); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 14px; font-weight: 700; vertical-align: middle; }
.badge { display: inline-block; padding: 0 10px; border: 1px solid var(--grey); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 13px; font-weight: 400; vertical-align: middle; }
.badge.open { border-color: var(--lime); }
.badge.closed { color: var(--white-300); border-style: dashed; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; margin-top: 8px; }
th { text-align: start; font-size: 13px; font-weight: 700; color: var(--white-300); }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
td a { display: inline-block; font-weight: 700; }
tr.new td { background: var(--core-800); }
tr.new td:first-child::before { content: ""; display: inline-block; width: 4px; height: 13px; background: var(--lime); transform: skewX(calc(-1 * var(--slant))); margin-inline-end: 8px; }
.empty { padding: 22px; background: var(--core-800); }
.links { margin-block: 18px 6px; }
.links dt, .answers dt { font-size: 13px; color: var(--white-300); }
.links dd { overflow-wrap: anywhere; user-select: all; text-align: right; margin-bottom: 8px; }
.answers { margin-top: 10px; }
.answers dd { padding-block: 2px 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-wrap: anywhere; }
.answers dd[dir="ltr"] { text-align: right; }
.text { white-space: pre-wrap; }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 26px 10px; }
.search input { flex: 1; min-width: 200px; width: auto !important; }
.pages { display: flex; gap: 18px; align-items: center; margin-top: 18px; }
.danger { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--core-600); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.editor { display: grid; gap: 18px; margin-top: 12px; }
fieldset { border: 1px solid var(--core-600); padding: 16px; display: grid; grid-template-columns: 1fr; gap: 14px; min-width: 0; }
legend { padding-inline: 8px; font-weight: 700; }
fieldset details { grid-column: 1 / -1; }
fieldset details label { margin-top: 12px; }
summary { cursor: pointer; padding-block: 10px; font-size: 14px; }
.basic p { grid-column: 1 / -1; }
@media (min-width: 761px) { fieldset { grid-template-columns: 1fr 1fr; } }

@media (max-width: 760px) {
  table, tbody, tr, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { padding-block: 10px; border-bottom: 1px solid var(--core-600); }
  tr.new { background: var(--core-800); }
  td { display: flex; justify-content: space-between; gap: 16px; border: 0; padding: 4px 10px; }
  td::after { content: attr(data-label); order: -1; flex: none; font-size: 13px; color: var(--white-300); }
}
.preview { border: 1px dashed var(--core-600); padding: 20px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
