/* =====================================================================
   AARU DESIGN SYSTEM · aaru.css · v1.0
   One stylesheet for everything Aaru: the public site, the admin
   portal, and any future module. Import it first, then add page CSS
   that uses ONLY these tokens. Rules live in DESIGN.md next to this.

   Direction: a Maldivian newsroom. Aaru Blue is the masthead and the
   only primary colour (light and dark). Cream comes from the brand
   sheet and is used as "paper". Maroon is the footer / deep tone.
   Rust is reserved for urgency (breaking, live) and nothing else.
   Written with logical properties so RTL (Dhivehi) and LTR (English)
   both work without overrides.
   ===================================================================== */

/* ---------- 0. Brand font: MV Faseyha (Dhivehi) ----------
   Regular for article text and UI; Bold for headlines and anything weight 600+. */
@font-face { font-family: "Aaru Faseyha"; src: url("fonts/MVFaseyha-Regular.ttf") format("truetype"); font-weight: 100 500; font-display: swap; }
@font-face { font-family: "Aaru Faseyha"; src: url("fonts/MVFaseyha-Bold.ttf") format("truetype"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "MV Funa"; src: url("fonts/MVFuna-Regular.ttf") format("truetype"); font-weight: 100 500; font-display: swap; }
@font-face { font-family: "MV Funa"; src: url("fonts/MVFuna-Bold.ttf") format("truetype"); font-weight: 600 900; font-display: swap; }
/* Dhivehi headlines: MV A Waheed (one weight; covers every weight so the browser never fakes bold) */
@font-face { font-family: "Aaru Waheed"; src: url("fonts/MVAWaheed.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

/* ---------- 1. Tokens: light (default) ---------- */
:root {
  /* Brand constants: never change between themes */
  --aaru-blue: #0A2C81;
  --aaru-maroon: #3F0E06;
  --aaru-rust: #7B280C;
  --aaru-cream: #E3E7D3;
  --aaru-stone: #BDC2BF;

  /* Surfaces. Brand rule: cream is Aaru's white. No pure #FFF anywhere. */
  --white: #F7F8F1;         /* "white" = lightest cream */
  --bg: #EEF0E6;            /* page: cream paper */
  --surface: #F7F8F1;       /* cards, panels, inputs */
  --surface-2: #E6E9DB;     /* hover, subtle fills */
  --band: #E3E7D3;          /* full-width feature bands (brand cream) */

  /* Text */
  --ink: #0F1730;           /* headlines, body */
  --ink-2: #353D51;         /* secondary text, deks */
  --muted: #5C6373;         /* meta, captions, timestamps (4.5:1 on bg) */
  --line: #D6DACB;          /* hairlines */
  --line-strong: #BCC1B2;   /* input borders, dividers that must show */

  /* Primary: Aaru Blue */
  --primary: #0A2C81;
  --primary-hover: #0C379F;
  --primary-ink: #F7F8F1;   /* text on primary */
  --primary-soft: #DDE3F1;  /* selected nav item, soft badge */
  --link: #0A2C81;          /* kickers, inline links */

  /* Secondary: Aaru Brown (maroon) */
  --secondary: #3F0E06;     /* footer, opinion bylines */
  --secondary-ink: #E3E7D3; /* text on secondary */
  --secondary-soft: #EBDDD6;/* opinion avatar ground */

  /* Masthead */
  --masthead-bg: #0A2C81;
  --masthead-ink: #E3E7D3;
  --masthead-muted: rgba(227, 231, 211, 0.72);
  --masthead-line: rgba(227, 231, 211, 0.16);

  /* Urgency (breaking / live only) */
  --alert: #7B280C;
  --alert-ink: #F7F8F1;
  --alert-soft: #F0E1D8;
  --breaking: #D0211C;     /* Breaking-news pill (red). Urgency only. */

  /* Footer */
  --footer-bg: var(--secondary);
  --footer-ink: #E3E7D3;
  --footer-muted: rgba(227, 231, 211, 0.64);
  --footer-line: rgba(227, 231, 211, 0.14);

  /* Status (admin + system messages). Not brand colours. */
  --ok: #1A6E44;      --ok-soft: #E2F1E8;
  --warn: #875500;    --warn-soft: #F7EDD6;
  --danger: #B3261E;  --danger-soft: #F8E3E1;
  --info: #0A2C81;    --info-soft: #E5EAF6;

  /* Photo placeholder tones (until real images exist) */
  --ph-1: #1C3E8F; --ph-2: #5E7A6E; --ph-3: #8A5A3C;
  --ph-4: #2C4A5E; --ph-5: #6B6F5A; --ph-6: #4A2E2A;
  --ph-light: rgba(255, 255, 255, 0.22);

  --focus: #2F5BD3;
  --shadow-1: 0 1px 2px rgba(15, 23, 48, 0.06);
  --shadow-2: 0 1px 2px rgba(15, 23, 48, 0.05), 0 10px 30px rgba(15, 23, 48, 0.08);

  /* Type */
  --font-dv: "Aaru Faseyha", "MV Faseyha", "Faruma", "Noto Sans Thaana", sans-serif;
  --font-ui: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: var(--font-dv);
  --font-dv-head: "Aaru Waheed", "MV A Waheed", var(--font-dv);
  --font-head: var(--font-dv-head);

  /* Type scale (Thaana sizes; English steps down via lang rule) */
  --fs-display: clamp(30px, 4.2vw, 46px);
  --fs-h1: clamp(26px, 3.2vw, 36px);
  --fs-h2: clamp(21px, 2.3vw, 26px);
  --fs-h3: 19px;
  --fs-h4: 17px;
  --fs-body: 17px;
  --fs-article: 19px;   /* story text on the reading page */
  --fs-row: 15.5px;     /* small headlines in lists */
  --fs-small: 14px;
  --fs-micro: 12.5px;
  --lh-head: 1.55;      /* Thaana needs room for its marks */
  --lh-body: 1.95;

  /* Spacing (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Shape. Brand rule: box shapes get 15px corners (photos, panels, cards).
     Controls 8, badges 4, pills 999. Base spacing unit is 8 (--s-2). */
  --r-xs: 4px; --r-sm: 8px; --r-md: 15px; --r-pill: 999px;

  --container: 1200px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-end: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- 2. Tokens: dark (system preference) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1219; --surface: #131B24; --surface-2: #1A2430; --band: #101821;
    --ink: #E8EBE1; --ink-2: #C2C8C3; --muted: #8D97A4;
    --line: #222E3C; --line-strong: #2F3D4F;
    --primary: #3A63D6; --primary-hover: #4A72E3; --primary-ink: #F7F8F1;
    --secondary: #D9B3A8; --secondary-ink: #1A0905; --secondary-soft: #2A1712; --white: #F7F8F1;
    --primary-soft: #17244A; --link: #93ADF6;
    --masthead-bg: #0A2471; --masthead-ink: #E3E7D3;
    --masthead-muted: rgba(238, 241, 230, 0.64); --masthead-line: rgba(238, 241, 230, 0.14);
    --alert: #A9553A; --alert-ink: #F7F8F1; --alert-soft: #2C1A13; --breaking: #E5483F; --breaking: #E5483F;
    --footer-bg: #080C11; --footer-ink: #E8EBE1;
    --footer-muted: rgba(232, 235, 225, 0.6); --footer-line: rgba(232, 235, 225, 0.1);
    --ok: #52C48C; --ok-soft: #12271D; --warn: #E2B24A; --warn-soft: #2A2312;
    --danger: #F0756B; --danger-soft: #2D1716; --info: #93ADF6; --info-soft: #17244A;
    --ph-1: #1A2F66; --ph-2: #34483F; --ph-3: #523626; --ph-4: #1E3344; --ph-5: #3E4134; --ph-6: #33201D;
    --ph-light: rgba(255, 255, 255, 0.12);
    --focus: #93ADF6;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
/* ---------- 3. Tokens: dark (explicit toggle) — keep identical to block 2 ---------- */
:root[data-theme="dark"] {
  --bg: #0C1219; --surface: #131B24; --surface-2: #1A2430; --band: #101821;
  --ink: #E8EBE1; --ink-2: #C2C8C3; --muted: #8D97A4;
  --line: #222E3C; --line-strong: #2F3D4F;
  --primary: #3A63D6; --primary-hover: #4A72E3; --primary-ink: #F7F8F1;
    --secondary: #D9B3A8; --secondary-ink: #1A0905; --secondary-soft: #2A1712; --white: #F7F8F1;
  --primary-soft: #17244A; --link: #93ADF6;
  --masthead-bg: #0A2471; --masthead-ink: #E3E7D3;
  --masthead-muted: rgba(238, 241, 230, 0.64); --masthead-line: rgba(238, 241, 230, 0.14);
  --alert: #A9553A; --alert-ink: #F7F8F1; --alert-soft: #2C1A13;
  --footer-bg: #080C11; --footer-ink: #E8EBE1;
  --footer-muted: rgba(232, 235, 225, 0.6); --footer-line: rgba(232, 235, 225, 0.1);
  --ok: #52C48C; --ok-soft: #12271D; --warn: #E2B24A; --warn-soft: #2A2312;
  --danger: #F0756B; --danger-soft: #2D1716; --info: #93ADF6; --info-soft: #17244A;
  --ph-1: #1A2F66; --ph-2: #34483F; --ph-3: #523626; --ph-4: #1E3344; --ph-5: #3E4134; --ph-6: #33201D;
  --ph-light: rgba(255, 255, 255, 0.12);
  --focus: #93ADF6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* English mode: one font (Figtree) for headlines and text, tighter leading */
:root[lang="en"] {
  --font-body: var(--font-ui);
  --font-head: var(--font-ui);
  --lh-head: 1.2;
  --lh-body: 1.65;
  --fs-body: 16.5px;
}

/* ---------- 4. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Every scroll bar (page, lists, portal) uses Aaru Brown, the secondary colour #3F0E06 */
/* Scroll bars: always visible, brown (secondary). Webkit styling keeps them shown on macOS; Firefox gets the standard properties. */
@supports (-moz-appearance: none) { :root { scrollbar-color: var(--secondary) var(--surface-2); } }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: var(--r-pill); border: 2px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--secondary) 80%, var(--ink)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  line-height: var(--lh-head);
  font-weight: 700;
  text-wrap: balance;
  color: var(--ink);
}
:root[lang="en"] h1, :root[lang="en"] h2, :root[lang="en"] h3 { font-weight: 600; letter-spacing: -0.012em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--font-ui); }
.num { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Icons: Hugeicons stroke-rounded font. <i class="icon hgi hgi-stroke hgi-NAME"></i>. Size with --icon. */
.icon {
  --icon: 20px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--icon); height: var(--icon); font-size: var(--icon); line-height: 1;
}
.icon--sm { --icon: 16px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[dir="ltr"] .flip-ltr { transform: scaleX(-1); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 32px);
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-end);
}

/* ---------- 5. Buttons, chips, controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding-inline: 18px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); font-size: var(--fs-small); font-weight: 600; line-height: 1;
  transition: background .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--outline:hover { border-color: var(--ink-2); }
.btn--quiet { background: transparent; color: var(--link); padding-inline: 10px; }
.btn--quiet:hover { background: var(--primary-soft); }
.btn--sm { min-height: 32px; padding-inline: 12px; font-size: var(--fs-micro); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; cursor: pointer;
  color: inherit; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--surface-2); }
.seg button {
  border: 0; background: transparent; cursor: pointer; border-radius: 6px;
  padding: 5px 11px; font-size: var(--fs-micro); font-weight: 600; color: var(--muted); line-height: 1.4;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button[data-lang="dv"] { font-family: var(--font-dv); }
.seg button[data-lang="en"] { font-family: var(--font-ui); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-small); line-height: 1.6;
  border: 1px solid var(--line);
}
a.chip:hover { border-color: var(--line-strong); color: var(--ink); }

.kicker { font-size: var(--fs-micro); font-weight: 700; color: var(--secondary); line-height: 1.6; } /* category label above headlines: secondary brown */
.kicker--alert { color: var(--alert); }
.live {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--alert); color: var(--alert-ink); font-size: var(--fs-micro); font-weight: 700; line-height: 1.7;
}
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-out infinite; }
/* Breaking news: red pill, pulsing dot */
.live--breaking { background: var(--breaking); color: var(--white); }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 75%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Category icon (Hugeicons) in a soft circle; replaces the blue dot on category section titles */
/* Category icon: plain line icon in Aaru Brown (secondary), no background */
.cat-ico { display: inline-grid; place-items: center; color: var(--secondary); flex: none; font-size: .7em; }
.cat-ico .icon { --icon: 1.35em; }
.section__title:has(> .cat-ico)::before { display: none; }
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-micro); line-height: 1.6; }
.meta .icon { --icon: 14px; }

/* ---------- 6. Photo placeholder (swap for <img> when content exists) ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: var(--r-md); max-width: 100%;
  aspect-ratio: 16 / 10; background: var(--ph-1);
  background-image:
    radial-gradient(120% 90% at 80% 10%, var(--ph-light), transparent 55%),
    linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.28));
}
.ph[data-tone="2"] { background-color: var(--ph-2); }
.ph[data-tone="3"] { background-color: var(--ph-3); }
.ph[data-tone="4"] { background-color: var(--ph-4); }
.ph[data-tone="5"] { background-color: var(--ph-5); }
.ph[data-tone="6"] { background-color: var(--ph-6); }
.ph--wide { aspect-ratio: 16 / 9; }
.ph--square { aspect-ratio: 1 / 1; }
.ph--tall { aspect-ratio: 9 / 16; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph__credit {
  position: absolute; inset-block-end: 8px; inset-inline-start: 10px;
  font-size: 11px; color: rgba(255, 255, 255, 0.78); line-height: 1.4;
}
.ph__badge {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--r-xs);
  background: rgba(8, 12, 20, 0.62); color: var(--white); font-size: 12px; font-family: var(--font-ui); line-height: 1.4;
}
.ph__badge .icon { --icon: 13px; }

/* ---------- 7. Story (the core content unit) ---------- */
.story { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.story__title { font-size: var(--fs-h4); }
/* Every headline: ink by default, primary blue on hover (cards, rows, lists) */
.story__title { transition: color .15s; }
a.story:hover .story__title, .story a:hover .story__title, .story__title a:hover { color: var(--link); }
.story__dek { color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-body); }
.story__foot { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }

/* Lead: the day's top story */
.story--lead .story__title { font-size: var(--fs-display); font-weight: 800; }
:root[lang="en"] .story--lead .story__title { font-weight: 600; }
.story--lead .story__dek { font-size: var(--fs-body); max-width: 62ch; }

/* Row: thumbnail beside text (latest lists, sidebars) */
.story--row { flex-direction: row; align-items: flex-start; gap: var(--s-4); }
.story--row .ph { width: 112px; flex: none; aspect-ratio: 4 / 3; border-radius: var(--r-sm); }
.story--row .story__body { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.story--row .story__title { font-size: var(--fs-row); font-weight: 600; line-height: 1.75; }
:root[lang="en"] .story--row .story__title { font-size: calc(var(--fs-row) + 0.5px); line-height: 1.3; }

/* ---------- 8. Section heading ---------- */
.section { padding-block: var(--s-7) 0; }
.section__head {
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  padding-block-end: var(--s-3); margin-block-end: var(--s-5);
  border-block-end: 1px solid var(--line);
}
/* One size for every section heading (Top stories, categories, Related, Comments) */
.section__title { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-h1); font-weight: 800; color: var(--secondary); } /* section headings: secondary brown */
:root[lang="en"] .section__title { font-weight: 600; }
.section__title::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); flex: none;
}
.section__more { margin-inline-start: auto; }
.tabs { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
/* Sub-category pills: thin outline, minimal */
.tabs a {
  padding: 2px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  font-size: var(--fs-small); color: var(--ink-2); line-height: 1.9; transition: border-color .15s, color .15s, background .15s;
}
.tabs a:hover { color: var(--link); border-color: var(--primary); }
.tabs a[aria-current="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
/* Divider between a section title and its tabs */
.section__head .section__title + .tabs:not(:empty) { padding-inline-start: var(--s-4); border-inline-start: 1px solid var(--line-strong); }

/* ---------- 9. Site chrome ---------- */
.topbar { background: var(--surface); border-block-end: 1px solid var(--line); font-size: var(--fs-micro); color: var(--muted); }
.topbar__inner { display: flex; align-items: center; gap: var(--s-4); min-height: 44px; flex-wrap: wrap; }
.topbar__date { display: inline-flex; gap: var(--s-3); align-items: center; }
.topbar__date span + span::before { content: "·"; margin-inline-end: var(--s-3); color: var(--line-strong); }
.topbar__end { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s-2); }
/* Phones: one tidy row — today's date, then theme + language (Hijri date and Portal link hidden) */
@media (max-width: 760px) {
  .topbar__inner { flex-wrap: nowrap; gap: var(--s-2); min-height: 48px; padding-block: 6px; }
  .topbar__date { min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
  .topbar__date #date-hijri, #portal-link { display: none; }
  .topbar__end { gap: 4px; flex: none; }
  .topbar .icon-btn { width: 34px; height: 34px; }
  .topbar .seg button { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }
}

.masthead { background: var(--masthead-bg); color: var(--masthead-ink); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
/* Masthead first, then the utility bar (date, theme, language) below it. Bigger bar since 21 Nov 2026. */
.masthead__inner { display: flex; align-items: center; gap: var(--s-5); min-height: 84px; }
.masthead .icon-btn:hover { background: var(--masthead-line); }
.nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 20px; font-weight: 600; color: var(--masthead-muted); line-height: 1.8;
}
.nav a:hover { color: var(--masthead-ink); background: var(--masthead-line); }
.nav a[aria-current="page"] { color: var(--masthead-ink); background: var(--masthead-line); }
/* English menu: smaller than Thaana (Latin letters look bigger at the same size) */
:root[lang="en"] .nav a { font-size: 16px; padding: 8px 12px; }

/* Menu drop-downs: sub-categories open on hover / keyboard focus (computers only) */
.nav__item { position: relative; display: flex; }
.nav__item > a, .nav > a { display: inline-flex; align-items: center; gap: 6px; }
.nav__caret { --icon: 14px; opacity: .7; transition: transform .15s; }
.nav__menu {
  position: absolute; inset-block-start: 100%; inset-inline-start: 0; z-index: 30; min-width: 200px;
  display: grid; gap: 2px; padding: var(--s-2); margin-block-start: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; translate: 0 4px; transition: opacity .15s, translate .15s, visibility .15s;
}
.nav__menu::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: -8px; height: 8px; } /* hover bridge */
.nav__menu a { color: var(--ink); font-size: var(--fs-body); font-weight: 500; padding: 6px 12px; }
.nav__menu a:hover, .nav__menu a[aria-current="page"] { color: var(--link); background: var(--primary-soft); }
.nav__item:hover > .nav__menu, .nav__item:focus-within > .nav__menu { opacity: 1; visibility: visible; translate: 0 0; }
.nav__item:hover .nav__caret, .nav__item:focus-within .nav__caret { transform: rotate(180deg); }
@media (min-width: 761px) { .nav { overflow: visible; } }
/* Menu button (three lines): phones only */
.menu-btn { display: none; }
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav { display: none; }
  .nav__caret { display: none; }
  /* Open: the sections drop down under the bar, one per line, with their sub-sections as small links */
  .masthead.is-open .nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; inset-inline: 0; inset-block-start: 100%; z-index: 40;
    max-height: calc(100vh - 68px); overflow-y: auto; padding: var(--s-3) var(--s-4) var(--s-5);
    background: var(--masthead-bg); border-block-start: 1px solid var(--masthead-line); box-shadow: 0 16px 30px rgba(0, 0, 0, .25);
    animation: menu-in .2s ease-out;
  }
  .masthead.is-open .nav a { font-size: 18px; padding: 10px 12px; }
  :root[lang="en"] .masthead.is-open .nav a { font-size: 17px; }
  .masthead.is-open .nav__item { flex-direction: column; align-items: stretch; }
  .masthead.is-open .nav > a, .masthead.is-open .nav__item { border-block-end: 1px solid var(--masthead-line); }
  .masthead.is-open .nav__menu { display: none; }   /* phones: main sections only, no sub-sections */
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; color: inherit; }
.logo img { height: 56px; width: auto; }
.masthead .logo img.logo--word { height: 46px; } /* cream wordmark on the blue bar */
.logo__fallback {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--aaru-cream); color: var(--aaru-blue);
  font-family: var(--font-dv); font-weight: 800; font-size: 19px; line-height: 1; padding-block-start: 2px;
}
.logo__word { font-family: var(--font-dv); font-weight: 800; font-size: 22px; line-height: 1; }
.logo__word small { display: block; font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: .14em; opacity: .7; margin-block-start: 5px; }

.ticker { background: var(--surface); border-block-end: 1px solid var(--line); }
.ticker__inner { display: flex; align-items: center; gap: var(--s-4); min-height: 48px; overflow: hidden; }
.ticker__item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-small); font-weight: 600; min-width: 0; }
.ticker__item:hover { color: var(--link); }

/* ---------- Video (homepage "screening room" + video cards) ---------- */
.vcard { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; color: var(--aaru-cream); isolation: isolate; }
.vcard .ph { border-radius: inherit; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.vcard:hover .ph { transform: scale(1.04); }
.vcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20, 10, 7, .85)); pointer-events: none; }
.vcard__play { position: absolute; inset: 0; margin: auto; z-index: 2; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--aaru-cream); color: var(--aaru-maroon); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); transition: transform .25s; }
.vcard__play .icon { --icon: 26px; margin-inline-start: 3px; }
.vcard__play::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--aaru-cream); opacity: 0; transform: scale(.8); transition: opacity .3s, transform .3s; }
.vcard:hover .vcard__play { transform: scale(1.08); }
.vcard:hover .vcard__play::before { opacity: .5; transform: scale(1); }
.vcard__len { position: absolute; z-index: 2; inset-block-end: 10px; inset-inline-start: 10px; padding: 1px 8px; border-radius: var(--r-xs);
  background: rgba(20, 10, 7, .78); color: var(--aaru-cream); font-family: var(--font-ui); font-size: 12px; font-weight: 600; direction: ltr; }
.vcard--sm .vcard__play { width: 40px; height: 40px; }
.vcard--sm .vcard__play .icon { --icon: 16px; margin-inline-start: 2px; }
/* Video card in a grid (video category page) */
.story--video .story__title { margin-block-start: 0; }
.vcard .ph img, .vtile .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Tall reel card */
.vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
.vtile__link { display: grid; gap: var(--s-2); }
.vtile__media { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; }
.vtile .ph--reel { aspect-ratio: 5 / 8; border-radius: inherit; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.vtile__link:hover .ph--reel { transform: scale(1.04); }
.vtile .vcard__play { width: 56px; height: 56px; }
.vtile .vcard__play .icon { --icon: 22px; }
.vtile__len { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(20, 10, 7, .7); color: var(--aaru-cream); font-family: var(--font-ui); font-size: 12px; direction: ltr; }
.vtile .vmeta { margin-block-start: var(--s-2); }
.vtile__title { font-family: var(--font-head); font-size: var(--fs-h4); font-weight: 800; line-height: var(--lh-head); }
.vtile__link:hover .vtile__title { color: var(--link); }
.vtile__dek { color: var(--muted); font-size: var(--fs-small); line-height: var(--lh-body); }
.vtile__date { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-micro); }
.vtile__date .icon { --icon: 14px; }
.vmeta { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-micro); flex-wrap: wrap; }
.vmeta__show { font-weight: 700; color: var(--secondary); }
.vmeta__date { color: var(--muted); font-family: var(--font-ui); }
@media (max-width: 1000px) { .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .vgrid { gap: var(--s-5) var(--s-3); } }


/* ---------- Breaking news (homepage bar + article flag) ---------- */
/* Breaking bar: red-tinted box, pulsing dot with ripples, headline slides in, next one every 5 seconds */
.ticker--boxed {
  position: relative; overflow: hidden; margin-block-start: var(--s-5); padding-inline: var(--s-4);
  border: 1px solid color-mix(in srgb, var(--breaking) 30%, transparent); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--breaking) 7%, var(--surface));
}
.ticker--boxed .ticker__inner { min-height: 60px; gap: var(--s-3); }
.ticker__dot { position: relative; width: 14px; height: 14px; flex: none; margin-inline: 14px 6px; }
.ticker__dot::before, .ticker__dot::after, .ticker__dot i {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--breaking);
}
.ticker__dot i { animation: brk-beat 1.2s ease-in-out infinite; }
.ticker__dot::before { animation: brk-ripple 1.8s ease-out infinite; }
.ticker__dot::after { animation: brk-ripple 1.8s ease-out .9s infinite; }
@keyframes brk-ripple { from { transform: scale(1); opacity: .55; } to { transform: scale(3.4); opacity: 0; } }
@keyframes brk-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(.78); } }
.ticker--boxed .live--breaking { font-size: var(--fs-small); padding-inline: 12px; }
.ticker--boxed .live--breaking::before { display: none; }
.ticker--boxed .ticker__item { font-size: var(--fs-body); font-weight: 700; color: var(--ink); flex: 1; }
.ticker--boxed .ticker__item:hover { color: var(--breaking); }
.ticker__item.is-in { animation: brk-in .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes brk-in { from { opacity: 0; transform: translateY(70%); } to { opacity: 1; transform: none; } }
/* No breaking stories: the same bar becomes a calm blue "Latest" slider */
.ticker__clock { display: none; color: var(--link); flex: none; margin-inline-start: 6px; }
.ticker--latest { border-color: color-mix(in srgb, var(--primary) 25%, transparent); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.ticker--latest .ticker__dot { display: none; }
.ticker--latest .ticker__clock { display: inline-grid; }
.ticker--latest .ticker__item:hover { color: var(--link); }
.ticker--latest .ticker__nav .icon-btn { color: var(--link); }
.ticker--latest .ticker__nav .icon-btn:hover { background: var(--primary-soft); }
.live--latest { background: var(--primary); color: var(--primary-ink); font-size: var(--fs-small); padding-inline: 12px; }
.live--latest::before { display: none; }
/* Prev / next arrows (shown when there is more than one story to step through) */
.ticker__nav { display: flex; gap: 2px; flex: none; }
.ticker__nav[hidden] { display: none; }
.ticker__nav .icon-btn { width: 34px; height: 34px; border-radius: 50%; color: var(--breaking); }
.ticker__nav .icon-btn:hover { background: color-mix(in srgb, var(--breaking) 14%, transparent); }
/* Breaking flag on an article page: same red box, dot and pill as the homepage bar */
.breaking-flag { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--breaking) 30%, transparent); background: color-mix(in srgb, var(--breaking) 7%, var(--surface)); overflow: hidden; }
.breaking-flag .live--breaking { font-size: var(--fs-small); padding-inline: 12px; }
.breaking-flag .live--breaking::before { display: none; }
.breaking-flag p { margin: 0; font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); }


.ad-slot {
  display: grid; place-items: center; gap: 2px; margin-inline: auto; max-width: 100%;
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2);
  color: var(--muted); font-size: var(--fs-micro); text-align: center; line-height: 1.6;
}
.ad-slot b { font-weight: 600; color: var(--ink-2); }
/* Ad sizes (bigger, 21 Nov 2026): wide ads fill the column; side ads fill the 336px rail */
.ad-slot--leader { width: 100%; aspect-ratio: 1200 / 200; }
.ad-slot--rect { width: 336px; aspect-ratio: 336 / 280; }
.ad-slot--sky { width: 336px; aspect-ratio: 336 / 672; }
.ad-slot--banner { width: 100%; aspect-ratio: 850 / 140; }
.ad-slot--mobile { width: 100%; max-width: 480px; aspect-ratio: 400 / 150; }
.ad-slot--leader + .ad-slot--mobile, .ad-slot--banner + .ad-slot--mobile { display: none; }
@media (max-width: 800px) {
  .ad-slot--banner { display: none; }
  .ad-slot--banner + .ad-slot--mobile { display: grid; }
}
@media (max-width: 1000px) {
  .ad-slot--leader { display: none; }
  .ad-slot--leader + .ad-slot--mobile { display: grid; }
}

/* Search bar that opens under the masthead */
.searchbar { background: var(--surface); border-block-end: 1px solid var(--line); }
.searchbar[hidden] { display: none; }
.searchbar form { display: flex; gap: var(--s-2); align-items: center; padding-block: var(--s-3); }
.searchbar .input { flex: 1; min-height: 46px; font-size: var(--fs-body); }
.searchbar .icon-btn { flex: none; }

/* An ad slot that has a real ad (set in the portal) */
.ad-slot--filled { position: relative; border: 0; background: none; overflow: hidden; }
.ad-slot--filled > a, .ad-slot--filled img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); }
.ad-slot__label {
  position: absolute; inset-block-start: 4px; inset-inline-end: 4px; padding: 0 6px; border-radius: var(--r-xs);
  background: var(--surface); color: var(--muted); font-size: 10.5px; line-height: 1.7; opacity: .9;
}

/* House ad (empty slots): primary blue, cream logo, "aarunews.com · Coming soon". Scales with the slot. */
.ad-slot--house { position: relative; border: 0; background: var(--aaru-blue); overflow: hidden; container-type: size; }
.ad-house { display: flex; align-items: center; justify-content: center; gap: 4cqh; width: 100%; height: 100%; padding-inline: 6cqw; color: var(--aaru-cream); text-decoration: none; }
.ad-house__logo { height: 58cqh; width: auto; flex: none; }
.ad-house__text { display: flex; align-items: baseline; gap: 4cqh; flex-wrap: wrap; justify-content: center; }
.ad-house__domain { font-family: var(--font-ui); font-weight: 700; font-size: 30cqh; line-height: 1.1; letter-spacing: -.01em; }
.ad-house__soon { padding: .15em .8em; border-radius: var(--r-pill); background: var(--aaru-cream); color: var(--aaru-blue); font-weight: 700; font-size: 15cqh; line-height: 1.6; white-space: nowrap; }
/* Tall slots (300×250, 300×600): stack logo above text */
.ad-slot--rect .ad-house, .ad-slot--sky .ad-house { flex-direction: column; gap: 6cqw; }
.ad-slot--rect .ad-house__text, .ad-slot--sky .ad-house__text { flex-direction: column; align-items: center; gap: 4cqw; }
.ad-slot--rect .ad-house__logo, .ad-slot--sky .ad-house__logo { height: auto; width: 36cqw; }
.ad-slot--rect .ad-house__domain, .ad-slot--sky .ad-house__domain { font-size: 10cqw; }
.ad-slot--rect .ad-house__soon, .ad-slot--sky .ad-house__soon { font-size: 5.5cqw; }
.ad-slot--sky .ad-house__logo { width: 52cqw; }
.ad-slot--sky .ad-house__domain { font-size: 11cqw; }
.ad-slot--house .ad-house, .ad-slot--house .ad-house:hover { color: var(--aaru-cream); text-decoration: none; } /* beats article link styles */
.ad-slot--house .ad-slot__label { background: transparent; color: var(--aaru-cream); opacity: .6; }

.masthead__end { display: flex; align-items: center; gap: var(--s-1); margin-inline-start: auto; }

.footer { background: var(--footer-bg); color: var(--footer-ink); margin-block-start: var(--s-8); }
.footer a { color: var(--footer-muted); }
.footer a:hover { color: var(--footer-ink); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s-6); padding-block: var(--s-7) var(--s-6); }
.footer h4 { color: var(--footer-ink); font-size: var(--fs-small); margin-block-end: var(--s-3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); font-size: var(--fs-small); }
.footer p { color: var(--footer-muted); font-size: var(--fs-small); max-width: 36ch; }
.footer__bottom {
  display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  border-block-start: 1px solid var(--footer-line); padding-block: var(--s-4) var(--s-5);
  font-size: var(--fs-micro); color: var(--footer-muted);
}
.socials { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.socials a {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 1px solid var(--footer-line);
}
.socials a:hover { background: var(--footer-line); }
.footer__brand { display: grid; gap: var(--s-4); align-content: start; }
.footer__brand .logo img { height: 72px; width: auto; }
.newsletter { display: flex; gap: var(--s-2); margin-block-start: var(--s-3); }
.newsletter .input { background: transparent; border-color: var(--footer-line); color: var(--footer-ink); min-width: 0; }
.newsletter .input::placeholder { color: var(--footer-muted); }
.footer .contact { display: grid; gap: var(--s-2); }
/* Footer is always English (lang="en" on #site-footer), whatever the page language */
.footer[lang="en"] { --font-body: var(--font-ui); --font-head: var(--font-ui); --lh-body: 1.65; font-family: var(--font-ui); }
.footer[lang="en"] h4 { font-family: var(--font-ui); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.follow a { display: inline-flex; align-items: center; gap: var(--s-2); }
.follow .icon { --icon: 18px; opacity: .8; }
.contact li { display: flex; align-items: center; gap: var(--s-2); }
.contact .icon { --icon: 16px; opacity: .7; }

/* ---------- 10. Forms (shared by site + admin) ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--fs-small);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field__hint { font-size: var(--fs-micro); color: var(--muted); }

/* ---------- 11. Admin portal primitives (portal itself not built yet) ---------- */
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; background: var(--bg); }
.admin__side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-5); }
.admin__main { min-width: 0; padding: var(--s-6); display: grid; gap: var(--s-5); align-content: start; }
.side__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-inline: 10px; margin-block-end: 4px; font-family: var(--font-ui); }
.side__item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: var(--fs-small); font-weight: 500; color: var(--ink-2); line-height: 1.6;
}
.side__item:hover { background: var(--surface-2); color: var(--ink); }
.side__item[aria-current="page"] { background: var(--primary-soft); color: var(--link); font-weight: 600; }
.side__count { margin-inline-start: auto; font-family: var(--font-ui); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); }

.page-head { display: flex; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-h1); color: var(--secondary); } /* portal page titles: secondary brown, like the site section headings */
.page-head p { color: var(--muted); font-size: var(--fs-small); }
.page-head__actions { margin-inline-start: auto; display: flex; gap: var(--s-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel__head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-block-end: 1px solid var(--line); }
.panel__head h3 { font-size: var(--fs-h4); color: var(--secondary); }

.stat { padding: var(--s-5); display: grid; gap: var(--s-2); }
.stat__label { font-size: var(--fs-small); color: var(--muted); }
.stat__value { font-family: var(--font-ui); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat__delta { font-family: var(--font-ui); font-size: var(--fs-micro); font-weight: 600; color: var(--ok); }
.stat__delta--down { color: var(--danger); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: var(--fs-micro); padding: 10px var(--s-5); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px var(--s-5); border-block-start: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.table td:first-child { color: var(--ink); font-weight: 600; }
.table tr:hover td { background: var(--surface-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-micro); font-weight: 600; line-height: 1.7; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--published { background: var(--ok-soft); color: var(--ok); }
.pill--review    { background: var(--warn-soft); color: var(--warn); }
.pill--scheduled { background: var(--info-soft); color: var(--info); }
.pill--draft     { background: var(--surface-2); color: var(--muted); }
.pill--rejected  { background: var(--danger-soft); color: var(--danger); }

/* Avatar with a photo: the picture fills the circle (framing from "Adjust photo") */
.avatar--photo { position: relative; overflow: hidden; padding: 0 !important; background: var(--surface-2); }
.avatar--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--secondary-soft); color: var(--secondary); font-weight: 700; font-size: 15px; line-height: 1;
}

/* Admin shell: top bar, drawer on small screens */
.admin__wrap { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.admin__top {
  position: sticky; inset-block-start: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-2);
  min-height: 60px; padding-inline: var(--s-5); background: var(--bg); border-block-end: 1px solid var(--line);
}
.admin__side { position: sticky; inset-block-start: 0; height: 100vh; overflow-y: auto; }
.admin__scrim { display: none; }
.side__group { display: grid; gap: 2px; }
.side__item .icon { --icon: 19px; }

/* Switch (on/off) */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--fs-small); color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: var(--r-pill);
  background: var(--line-strong); transition: background .15s;
}
.switch__track::after {
  content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--white); box-shadow: var(--shadow-1); transition: inset-inline-start .15s;
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { inset-inline-start: 19px; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--s-4); background: rgba(8, 12, 20, 0.5); }
.modal__box {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.modal__box--wide { width: min(980px, 100%); }
.modal__head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-block-end: 1px solid var(--line); }
.modal__head h3 { font-size: var(--fs-h4); flex: 1; }
.modal__body { padding: var(--s-5); display: grid; gap: var(--s-4); }
.modal__foot { display: flex; gap: var(--s-2); justify-content: flex-end; padding: var(--s-4) var(--s-5); border-block-start: 1px solid var(--line); flex-wrap: wrap; }
.btn--danger { background: var(--danger); color: var(--white); }
.btn--danger:hover { filter: brightness(1.08); }

/* Toast */
.toasts { position: fixed; inset-block-end: var(--s-5); inset-inline-start: 50%; translate: -50% 0; z-index: 70; display: grid; gap: var(--s-2); }
[dir="rtl"] .toasts { translate: 50% 0; }
.toast {
  display: flex; align-items: center; gap: var(--s-2); padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); font-size: var(--fs-small); font-weight: 600; box-shadow: var(--shadow-2);
}
.toast--error { background: var(--danger); color: var(--white); }

/* Drop zone for uploads */
.dropzone {
  display: grid; place-items: center; gap: var(--s-2); padding: var(--s-6) var(--s-4); text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: var(--fs-small);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); color: var(--link); background: var(--primary-soft); }
.dropzone .icon { --icon: 28px; }

/* Empty state */
.empty { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-7) var(--s-4); color: var(--muted); text-align: center; font-size: var(--fs-small); }
.empty .icon { --icon: 32px; }

/* ---------- 12. Responsive ---------- */
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .admin { grid-template-columns: 1fr; }
  .admin__side {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: min(300px, 86vw); height: auto;
    transform: translateX(-105%); transition: transform .2s;
  }
  [dir="rtl"] .admin__side { transform: translateX(105%); }
  .admin.is-open .admin__side { transform: none; }
  .admin.is-open .admin__scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 20, 0.45); }
  .admin__main { padding: var(--s-4); }
  .admin__top { padding-inline: var(--s-4); }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .story--row .ph { width: 92px; }
  .masthead__inner { gap: var(--s-3); min-height: 68px; }
  .logo img { height: 46px; }
  .masthead .logo img.logo--word { height: 38px; }
  .logo__word small { display: none; }
  .nav a { padding-inline: 12px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Phones: story cards keep their shape, with the text on the photo over a dark fade (grids on homepage, category pages, Related) */
@media (max-width: 560px) {
  :is(.grid-4, .cat-block) > .story > a.story {
    position: relative; display: grid; grid-template-rows: 1fr auto auto auto; gap: 0 !important;
    border-radius: var(--r-md); overflow: hidden; isolation: isolate;
  }
  :is(.grid-4, .cat-block) > .story > a.story > .ph { grid-row: 1 / -1; grid-column: 1; border-radius: 0; }   /* same shape as before (16:10) */
  :is(.grid-4, .cat-block) > .story > a.story::after {
    content: ""; grid-row: 1 / -1; grid-column: 1; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, .6) 55%, rgba(0, 0, 0, .92));
  }
  :is(.grid-4, .cat-block) > .story > a.story > :not(.ph) { grid-column: 1; z-index: 2; padding-inline: var(--s-4); }
  :is(.grid-4, .cat-block) > .story > a.story > .kicker { grid-row: 2; color: var(--aaru-cream); opacity: .9; }
  :is(.grid-4, .cat-block) > .story > a.story > .story__title { grid-row: 3; color: #fff; font-size: var(--fs-h3); line-height: var(--lh-head); padding-block: 2px 4px; max-width: none; }
  :is(.grid-4, .cat-block) > .story > a.story > .meta { grid-row: 4; color: rgba(255, 255, 255, .78); padding-block-end: var(--s-4); }
  :is(.grid-4, .cat-block) > .story > a.story > .meta .icon { color: inherit; }
}
