/* Brand tokens and base type, shared by every page. Change a colour here, not in the pages.
   Fonts: Atkinson Hyperlegible Next for Latin (OFL, self-hosted by the build, see src/layouts/Base.astro) and
   AK Rasmee for Thaana (public/fonts/rasmee.otf: used unchanged with the designer's written permission of
   19-11-2026, never converted, subset, renamed or committed). Noto Sans Thaana (OFL, bundled) takes over only
   if rasmee.otf is missing, so phones without a Thaana font never show empty boxes. */

/* AK Rasmee, Thaana letters only: used everywhere, so Thaana inside English text renders in Rasmee.
   size-adjust 135%: Rasmee's letter bodies are 0.30em tall, Atkinson's x-height is 0.50em. */
@font-face{font-family:"Rasmee";src:url("fonts/rasmee.otf") format("opentype");font-display:swap;size-adjust:135%;
  unicode-range:U+0780-07BF,U+060C,U+061B,U+061F,U+FDF2}
/* The same file plus space and basic punctuation, for Dhivehi text (:lang(dv)). Rasmee's space is 0.47em against
   Atkinson's 0.28em: without it Dhivehi words sit too close. Digits and Latin letters stay Atkinson. */
@font-face{font-family:"Rasmee Text";src:url("fonts/rasmee.otf") format("opentype");font-display:swap;size-adjust:135%;
  unicode-range:U+0780-07BF,U+060C,U+061B,U+061F,U+FDF2,U+0020-002F,U+003A-003B,U+003F,U+005B-005D,U+00AB,U+00BB}

/* AHN Plain Zero: Atkinson's own zero without the slash, one glyph per weight (public/assets/ahn-zero, SIL OFL 1.1,
   OFL.txt there). unicode-range is the zero only, so every other character is still Atkinson. 600 takes the 700. */
@font-face{font-family:"AHN Plain Zero";font-weight:200;src:url("assets/ahn-zero/ahn-zero-200.woff2") format("woff2");unicode-range:U+0030;font-display:swap}
@font-face{font-family:"AHN Plain Zero";font-weight:300;src:url("assets/ahn-zero/ahn-zero-300.woff2") format("woff2");unicode-range:U+0030;font-display:swap}
@font-face{font-family:"AHN Plain Zero";font-weight:400;src:url("assets/ahn-zero/ahn-zero-400.woff2") format("woff2");unicode-range:U+0030;font-display:swap}
@font-face{font-family:"AHN Plain Zero";font-weight:500;src:url("assets/ahn-zero/ahn-zero-500.woff2") format("woff2");unicode-range:U+0030;font-display:swap}
@font-face{font-family:"AHN Plain Zero";font-weight:700;src:url("assets/ahn-zero/ahn-zero-700.woff2") format("woff2");unicode-range:U+0030;font-display:swap}

:root{
  /* primary */
  --orange:#F16122;        /* UNFPA orange (logo file) and the campaign colour. Text on it is always ink (5.6:1). */
  --orange-ink:#B23F0A;    /* orange for small text on white (AA) */
  --orange-tint:#FDEDE5;
  --blue:#2171EC;          /* UNFPA blue */
  --blue-ink:#1A5BC0;
  --blue-tint:#E9F1FD;
  /* neutrals: white page */
  --ink:#131619;
  --ink-2:#585D63;
  --ink-3:#686E75;
  --surface:#EFF1F7;
  --line:#D9DDE6;
  --line-2:#B9C0CC;
  --grey:#A2AFBC;
  --bg:#FFFFFF;
  --ok:#1E7A4C; --ok-bg:#E7F3EC;
  --bad:#B3261E; --bad-bg:#FBECEA;
  --wait:#8A5A00; --wait-bg:#FBF3DF;
  /* night map and display */
  --night:#131619; --night-2:#1C2127; --night-line:#2E3640; --night-text:#F4F6F8; --night-text-2:#B4BCC6;

  /* category colours (--p-<id>) are set by src/config/campaign.json, inlined by Base.astro */

  --font-latin:"AHN Plain Zero","Atkinson Hyperlegible Next Variable",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font:"Rasmee","Noto Sans Thaana",var(--font-latin);
  --font-dv:"Rasmee Text","Rasmee","Noto Sans Thaana",var(--font-latin);
  /* Dhivehi headlines (board title, story, display, form title). Today the same face as the text: a display
     face for Thaana is one line here. */
  --font-dv-display:var(--font-dv);
  --focus:3px solid var(--blue);
  --r:4px;
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;font-synthesis-weight:none}   /* Rasmee has one weight: never fake a bold */
body{font-family:var(--font);color:var(--ink);background:var(--bg);font-weight:400;line-height:1.55;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
/* Thaana: Rasmee's word spacing, and room for the marks above and below the line */
:lang(dv){font-family:var(--font-dv);line-height:1.9;letter-spacing:0}
:lang(dv) a{text-underline-offset:.55em;text-decoration-skip-ink:none}
:lang(en){font-family:var(--font)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
:focus-visible{outline:var(--focus);outline-offset:2px}
[tabindex="-1"]:focus{outline:none}                           /* headings focused by script show no ring */

/* Campaign rule: the thin orange line at the very top of every page */
.campaign-rule{height:6px;background:var(--orange)}

/* Label above titles */
.eyebrow{font-size:14px;color:var(--orange-ink);font-weight:400}

/* Logo lockup: the Ministry logo (the UNFPA logo left on 22-11-2026; Support.astro credits UNFPA) */
.lockup{display:flex;align-items:center;gap:18px;flex:none}
.lockup img{display:block;height:44px;width:auto}
/* "Supported by UNFPA" and the disclaimer (Support.astro): small; the disclaimer italic and muted, never faded, so it
   keeps its contrast. Thaana has no italic: the Dhivehi one stays upright. */
.support .sup-by{font-size:13px;line-height:1.4;color:var(--soft)}
.support .sup-dis{margin-block-start:2px;font-size:12px;line-height:1.45;font-style:italic;color:var(--muted)}
.support:lang(dv) .sup-dis{font-style:normal}
.support:lang(dv) p{line-height:1.8}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line-2);background:var(--bg);color:var(--ink);
  padding:9px 16px;border-radius:var(--r);font-size:14px;font-weight:600;text-decoration:none;line-height:1.2;
  transition:background .15s,border-color .15s,color .15s}
.btn:hover{border-color:var(--ink)}
.btn.primary{background:var(--ink);border-color:var(--ink);color:#fff}
.btn.primary:hover{background:#2b3036}
.btn.accent{background:var(--orange);border-color:var(--orange);color:var(--ink)}
.btn.accent:hover{background:#FF7A3D;border-color:#FF7A3D}

/* Pill buttons (redesign). Text on orange is always ink: 5.6:1. White on this orange is 3.24:1 and fails AA for
   Thaana, which has no bold. */
.btn-primary,.btn-secondary{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:8px 28px;
  border-radius:999px;border:1px solid transparent;font-size:1.0625rem;font-weight:700;line-height:1.3;text-align:center;
  text-decoration:none;cursor:pointer}
.btn-primary{background:var(--orange);color:var(--ink)}
.btn-primary:hover{background:#FF7A3D}
.btn-secondary{background:#fff;border-color:var(--orange);color:var(--ink)}
.btn-secondary:hover{background:#FFF3EC}
:lang(dv) .btn-primary,:lang(dv) .btn-secondary,.btn-primary:lang(dv),.btn-secondary:lang(dv){font-weight:400;line-height:1.6}

/* Text link and link-styled button: orange underline */
.link{color:inherit;font-weight:700;text-decoration:underline;text-decoration-color:var(--orange);text-decoration-thickness:2px;
  text-underline-offset:.25em;background:none;border:0;padding:0;cursor:pointer;text-align:start}
:lang(dv) .link,.link:lang(dv){font-weight:400;text-underline-offset:.55em;text-decoration-skip-ink:none}

/* Skip link and visually hidden text */
.skip{position:absolute;inset-inline-start:8px;top:-60px;z-index:2000;background:var(--ink);color:#fff;padding:10px 16px;border-radius:999px}
.skip:focus{top:8px}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Category dot: .p-<id> sets --c (and --c-night for dark backgrounds), from src/config/campaign.json */
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:none;background:var(--c,var(--orange))}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- Colourways for the board, the form and the display (prompt F+ section 9) ----------
   data-theme on <html> (board and form: "dusk" by default, "light" with the switch, kept in localStorage) or on
   the display layer (always "dusk"). The review page sets none and keeps the tokens above.
   --bg page and map, --panel story, list and results, --text, --muted, --soft (secondary text), --isl islands,
   --il island names, --near the selected commitment's atoll, --hi focus ring and focused name, --warm accent text,
   --orange-text orange for small text and the title, --scrim backing for text over the map, --field inputs over
   the map, --edge, --story-edge, --pshadow, --drop and --list-shadow the edges and shadows of the panels (story,
   list, search results). The tide lines blend from --sea-in (near the islands) to --sea-out (far), at --sea-a; their fill is
   --sea-fill at --sea-fa. The map canvas reads these with getComputedStyle, so every colour is set here only. */
[data-theme="dusk"]{color-scheme:dark;
  --bg:#150A1F;--bg-paint:radial-gradient(130% 95% at 50% 105%,#2B0F35 0%,#170B22 52%,#0F0717 100%);--panel:#1E0E28;--text:#FBF1F5;
  --muted:#C6AAC4;--soft:#E8D5E2;--ring:#9C6FC9;--isl:#FFE3EA;--il:#ECD5E3;--near:#FFC29A;--hi:#FFFFFF;--warm:#FFB98A;
  --orange-text:#F16122;--err:#FF9B8A;--line:#35213F;--line-2:#573B63;--scrim:rgba(21,10,31,.8);--field:rgba(30,14,40,.95);
  --hover:rgba(251,241,245,.035);--ripple:#F7A877;--glow:#FF9A5C;--core-line:#FFE3D2;--gold:#FFC83D;--gold-glow:#FFD97A;--gold-text:#FFD266;--shadow:rgba(0,0,0,.55);--focus:3px solid var(--warm);
  --edge:color-mix(in srgb,#9C6FC9 40%,transparent);--story-edge:transparent;--pshadow:0 16px 40px rgba(0,0,0,.55);--drop:0 24px 40px rgba(0,0,0,.55);--list-shadow:none;
  --sea-in:246,150,178;--sea-out:128,94,216;--sea-fill:150,90,180;--sea-a:.72;--sea-fa:.055}
[data-theme="light"]{color-scheme:light;
  --bg:#FFFFFF;--bg-paint:#FFFFFF;--panel:#FFFFFF;--text:#16121C;
  --muted:#5C5766;--soft:#2E2836;--ring:#C9C4D2;--isl:#2A2431;--il:#2A2431;--near:#E0561A;--hi:#16121C;--warm:#B4400C;
  --orange-text:#C8460F;--err:#A3310B;--line:#ECEAF0;--line-2:#D9D5E0;--scrim:rgba(255,255,255,.92);--field:#FFFFFF;
  --hover:rgba(22,18,28,.035);--shadow:rgba(22,18,28,.14);--focus:3px solid #B4400C;--ripple:#E0561A;--glow:#FF9A5C;--core-line:#FFFFFF;--gold:#B07F00;--gold-glow:#FFC83D;--gold-text:#8A6100;
  --edge:#ECEAF0;--story-edge:#ECEAF0;--pshadow:0 10px 30px rgba(22,18,28,.14);--drop:0 10px 30px rgba(22,18,28,.14);--list-shadow:0 10px 30px rgba(22,18,28,.14);
  --sea-in:110,104,128;--sea-out:186,182,198;--sea-fill:110,104,128;--sea-a:.5;--sea-fa:.022}
/* The logos: the colour Ministry logo in light mode, the white one in dark mode and on the display (Lockup.astro).
   Light mode keeps a white plate behind them, so the map never runs under them; dark mode has none (the UNFPA
   symbol's colours work on the dark ground). The plate's padding stays, so nothing moves when the mode changes.
   Custom properties, so the nearest data-theme decides (the display is dark even on a light page). */
[data-theme="dusk"]{--on-dark:block;--on-light:none;--plate:transparent}
[data-theme="light"]{--on-dark:none;--on-light:block;--plate:#FFFFFF}
.lockup .on-dark{display:var(--on-dark,none)}
.lockup .on-light{display:var(--on-light,block)}
.plate{border-radius:10px;padding:8px 14px;background:var(--plate,#FFFFFF)}
/* Dropdowns (the form's atoll, kind and time frame, the list's "From"): still real <select> elements, so the
   keyboard, screen readers, autofill and the form's code work as before. Where the browser lets the open list be
   styled (appearance: base-select: Chrome and Edge), it is the design's panel, like the search results: the
   panel colour, a hairline edge, 14 px corners, 44 px rows, the page's font, an orange tick on the chosen one.
   Other browsers show their own list, in the colourway's light or dark (color-scheme above). The closed control
   keeps each page's style and its own arrow. */
@supports (appearance: base-select) {
  /* :not([multiple]) outranks the pages' own appearance:none on their selects */
  [data-theme] select:not([multiple]),[data-theme] select:not([multiple])::picker(select){appearance:base-select}
  [data-theme] select::picker-icon{display:none}
  [data-theme] select::picker(select){background:var(--panel);color:var(--text);border:1px solid var(--edge);border-radius:14px;padding:6px;
    box-shadow:var(--pshadow);max-height:min(60vh,420px);overflow-y:auto;margin-block:6px;scrollbar-width:thin}
  [data-theme] select option{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px 12px;border-radius:9px;background:transparent;color:var(--text);cursor:pointer}
  [data-theme] select option:hover,[data-theme] select option:focus{background:color-mix(in srgb,var(--text) 8%,transparent);outline:none}
  [data-theme] select option:focus-visible{outline:2px solid var(--warm);outline-offset:-2px}
  [data-theme] select option::checkmark{color:var(--orange-text)}
  [data-theme] select option:checked{background:color-mix(in srgb,var(--orange) 12%,transparent)}
}

/* Pill buttons over the dark or light page */
[data-theme] .btn-primary{color:#0B0B0B}
.pill-btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid color-mix(in srgb,var(--text) 28%,transparent);
  background:var(--scrim);color:var(--text);font-size:15px;line-height:1.2;white-space:nowrap;text-decoration:none;cursor:pointer}
.pill-btn:hover{border-color:var(--text)}
.pill-btn svg,.round-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
[dir="rtl"] .pill-btn .chev{transform:scaleX(-1)}
.round-btn{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;border:1px solid color-mix(in srgb,var(--text) 28%,transparent);
  background:var(--scrim);color:var(--text);padding:0;cursor:pointer}
.round-btn:hover{border-color:var(--text)}
.round-btn[aria-disabled="true"]{opacity:.32;cursor:default}
.round-btn[aria-disabled="true"]:hover{border-color:color-mix(in srgb,var(--text) 28%,transparent)}
.mode-btn svg{width:17px;height:17px;stroke-width:1.6}

/* Dev / staging strip, added by env-banner.js only when ENV_LABEL is set */
.env-banner{background:var(--ink);color:#fff;
  font-size:12px;font-weight:600;letter-spacing:.04em;text-align:center;padding:5px 12px}
body.display .env-banner{display:none}
