/* Muraselon — design tokens and the few things Tailwind utilities don't cover.
   Brand: the orange of the logo mark on a clean white/ink palette. */
:root {
  --brand: 249 100 24;                          /* logo orange — fills, marks, rules */
  --accent: 201 70 6;                           /* darker orange — readable as small text on white */
  --paper: 255 255 255;  --surface: 246 246 244;
  --ink: 17 17 17;       --muted: 97 97 94;
  --rule: 226 226 222;
  --breaking: 249 100 24; --up: 21 128 61;
  --font-display: "IBM Plex Sans Arabic", system-ui, sans-serif;
}
.dark {
  --accent: 255 132 64;
  --paper: 16 16 16;     --surface: 27 27 27;
  --ink: 242 242 240;    --muted: 163 163 158;
  --rule: 52 52 50;
  --up: 86 190 120;
}
/* One typeface everywhere: IBM Plex Sans Arabic (self-hosted, covers Arabic + Latin). */
html[lang="en"] { --font-display: "IBM Plex Sans Arabic", system-ui, sans-serif; }

html { scroll-behavior: smooth; }
/* Server-rendered fallback (for crawlers without JS): readers with JS see the skeleton instead */
.js [data-ssr] { visibility: hidden; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; border-top: 3px solid rgb(var(--brand)); }
::selection { background: rgb(var(--brand) / .25); }

/* ---------- Logo ---------- */
.dark .logo-light, html:not(.dark) .logo-dark { display: none; }

/* ---------- Headlines: Arabic needs air, Latin wants to be tight ---------- */
.hl { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
html[lang="ar"] .hl    { line-height: 1.5; }
html[lang="ar"] .hl-xl { line-height: 1.35; letter-spacing: -0.01em; }
html[lang="en"] .hl    { line-height: 1.16; letter-spacing: -0.012em; }
html[lang="en"] .hl-xl { line-height: 1.06; letter-spacing: -0.02em; }

.kicker { font-size: .75rem; font-weight: 700; color: rgb(var(--accent)); }
html[lang="en"] .kicker { text-transform: uppercase; letter-spacing: .09em; font-size: .68rem; }
html[lang="en"] .caps   { text-transform: uppercase; letter-spacing: .08em; }

/* Section titles carry a short brand bar */
.sec-title { position: relative; padding-inline-start: .85rem; }
.sec-title::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .28em; bottom: .28em; width: 4px;
  background: rgb(var(--brand));
}

/* ---------- Nav ---------- */
.nav-link { display: inline-flex; align-items: center; height: 100%; border-bottom: 3px solid transparent; transition: border-color .15s, color .15s; }
.nav-link:hover, .nav-link:focus-visible { border-bottom-color: rgb(var(--brand)); }
.nav-link.is-active { border-bottom-color: rgb(var(--brand)); font-weight: 700; }

/* Active language button */
html[lang="ar"] [data-set-lang="ar"],
html[lang="en"] [data-set-lang="en"] { background: rgb(var(--ink)); color: rgb(var(--paper)); }

/* ---------- Stories ---------- */
.story:hover .hl, a.hl:hover { color: rgb(var(--accent)); }
.story .hl { transition: color .15s; }
.story img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.story:hover img { transform: scale(1.03); }
/* Headlines set inside a photo stay white on hover (orange on the dark gradient is unreadable);
   an underline marks the hover instead. On dark bands the hover uses the lighter orange. */
/* The gradient is strong enough for light photos, and darkens further on hover (a second layer
   fades in, since gradients themselves can't be animated). */
.ov {
  isolation: isolate;
  background: linear-gradient(to top, rgb(0 0 0 / .92) 0%, rgb(0 0 0 / .72) 40%, rgb(0 0 0 / .35) 72%, transparent 100%);
}
.ov::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s;
  background: linear-gradient(to top, rgb(0 0 0 / .55) 0%, rgb(0 0 0 / .35) 55%, transparent 100%);
}
.story:hover .ov::before, .story:focus-visible .ov::before { opacity: 1; }
.ov .hl { text-shadow: 0 1px 12px rgb(0 0 0 / .45); }
.story:hover .ov .hl, .ov a.hl:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.on-dark .story:hover .hl, .on-dark a.hl:hover { color: #ff8a47; }
.on-dark .story:hover .ov .hl { color: #fff; }
#lens .story:hover .hl { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }

/* Photo placeholder (visible while loading or if the image is missing) */
figure:has(> img), .ph {
  background-color: rgb(var(--surface));
  background-image: repeating-linear-gradient(135deg, rgb(var(--ink) / .045) 0 1px, transparent 1px 12px);
}
img.img-failed { visibility: hidden; }

/* ---------- Breaking ticker ---------- */
@keyframes ticker-rtl { to { transform: translateX(50%); } }
@keyframes ticker-ltr { to { transform: translateX(-50%); } }
.ticker-track { animation: ticker-rtl 60s linear infinite; }
html[dir="ltr"] .ticker-track { animation-name: ticker-ltr; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes pulse-dot { 50% { opacity: .25; } }
.live-dot { animation: pulse-dot 1.4s ease-in-out infinite; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* ---------- Story page ---------- */
.prose-body { --fs: 1; font-size: calc(1.1875rem * var(--fs)); min-width: 0; overflow-wrap: anywhere; }
html[lang="ar"] .prose-body { line-height: 2.05; }
html[lang="en"] .prose-body { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; line-height: 1.72; font-size: calc(1.25rem * var(--fs)); }
.prose-body > p { margin-bottom: 1.35em; }
/* Full story body: section headings, links, quotes, lists, figures */
.prose-body h2, .prose-body h3, .prose-body h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.45; color: rgb(var(--ink)); }
.prose-body h2 { font-size: 1.45em; margin: 1.8em 0 .6em; padding-inline-start: .75rem; border-inline-start: 4px solid rgb(var(--brand)); }
.prose-body h3 { font-size: 1.2em; margin: 1.6em 0 .5em; }
.prose-body h4 { font-size: 1em; margin: 1.4em 0 .4em; color: rgb(var(--accent)); }
.prose-body a { color: rgb(var(--accent)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.prose-body a:hover { text-decoration-thickness: 2px; }
.prose-body ul, .prose-body ol { margin: 0 0 1.35em; padding-inline-start: 1.4em; }
.prose-body ul { list-style: disc; } .prose-body ol { list-style: decimal; }
.prose-body li { margin-bottom: .4em; } .prose-body li::marker { color: rgb(var(--brand)); }
.prose-body blockquote {
  margin: 1.8em 0; padding: .2em 1.2em; border-inline-start: 4px solid rgb(var(--brand));
  font-family: var(--font-display); font-size: 1.2em; font-weight: 600; line-height: 1.7;
}
.prose-body blockquote p { margin: 0; }
.prose-body blockquote cite, .prose-body blockquote footer { display: block; margin-top: .6em; font-size: .7em; font-style: normal; font-weight: 400; color: rgb(var(--muted)); }
.prose-body figure { margin: 1.8em 0; }
.prose-body figure img { width: 100%; }
.prose-body figcaption { margin-top: .5em; font-size: .75rem; line-height: 1.6; color: rgb(var(--muted)); }
/* "Read also": headlines only, inside the text */
.read-also { margin: 1.6em 0 2em; padding: 1rem 1.25rem; background: rgb(var(--surface)); border-inline-start: 4px solid rgb(var(--brand)); }
.read-also ul { margin: .5rem 0 0; padding: 0; list-style: none; }
.read-also li { margin: 0; padding: .55rem 0; font-size: .82em; line-height: 1.6; }
.read-also li + li { border-top: 1px solid rgb(var(--rule)); }
.prose-body .read-also a { color: rgb(var(--ink)); text-decoration: none; font-family: var(--font-display); font-weight: 700; }
.prose-body .read-also a:hover { color: rgb(var(--accent)); }
/* A drop cap would break Arabic letter-joining, so it is English-only */
html[lang="en"] .prose-body > p:first-of-type::first-letter {
  float: left; font-size: 4.1em; line-height: .82; font-weight: 700; padding: .06em .1em 0 0; color: rgb(var(--brand));
}

/* Live news containers dim briefly while headlines load */
[data-news], [data-view] { transition: opacity .25s; }
.news-pending { opacity: .35; }
.line-clamp-2, .line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* Ask Muraselon: typing indicator */
.ai-typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--brand)); animation: ai-dot 1s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Rails: horizontal shelves you swipe with a finger (arrows on desktop) ---------- */
.rail {
  display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  /* bleed to the screen edge on phones so the next card peeks in */
  margin-inline: -1rem; padding-inline: 1rem; scroll-padding-inline: 1rem;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 auto; scroll-snap-align: start; }
@media (min-width: 640px) { .rail { gap: 1.5rem; margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; } }
/* .rail-m: a swipe shelf on phones and tablets only; from 1024px it is whatever grid its utilities say */
@media (max-width: 1023px) {
  .rail-m {
    display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-inline: -1rem; padding-inline: 1rem; scroll-padding-inline: 1rem;
  }
  .rail-m::-webkit-scrollbar { display: none; }
  .rail-m > * { flex: 0 0 auto; scroll-snap-align: start; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .rail-m { gap: 1.5rem; margin-inline: 0; padding-inline: 0; scroll-padding-inline: 0; }
}
/* Home: keep the existing cards, but lay out selected shelves without mobile swiping. */
@media (max-width: 1023px) {
  [data-view="home"] .home-static-cards .rail-m {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    overflow: visible;
    scroll-snap-type: none;
    margin-inline: 0;
    cursor: auto;
  }
  [data-view="home"] .home-static-cards .rail-m { padding-inline: 0; }
  [data-view="home"] .home-static-cards .rail-m > * {
    width: auto;
    min-width: 0;
    scroll-snap-align: none;
  }
  [data-view="home"] .home-static-cards .rail-bar { display: none; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  [data-view="home"] .home-static-cards .rail-m { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Compact home blocks below the desktop breakpoint. */
@media (max-width: 1023px) {
  [data-view="home"] .home-editorial-cards .rail-m { grid-template-columns: minmax(0, 1fr); }
  [data-view="home"] .home-editorial-cards .rail-m > :nth-child(n+5) { display: none; }

  [data-view="home"] .home-editorial-cards .rail-m { gap: 0; }
  [data-view="home"] .home-editorial-cards .rail-m > article + article {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgb(var(--rule));
  }
  [data-view="home"] .home-editorial-cards .rail-m > article:not(:first-child) > a > div,
  [data-view="home"] .home-editorial-cards .rail-m > article > a > p { display: none; }
  [data-view="home"] .home-editorial-cards .rail-m > article:not(:first-child) .hl { margin-top: 0; }
}

/* Dragging a shelf with the mouse */
.rail a, .rail img, .rail-m a, .rail-m img { -webkit-user-drag: none; }
@media (hover: hover) and (pointer: fine) {
  .rail { cursor: grab; }
  @media (max-width: 1023px) { .rail-m { cursor: grab; } }
}
.is-dragging { scroll-snap-type: none !important; cursor: grabbing !important; user-select: none; }
.is-dragging * { pointer-events: none; }

/* ---------- Home: audio briefing ----------
   Light grey by day, a neutral dark grey at night. */
.brief {
  --brief-bg: 241 241 241; --brief-line: 214 214 214;   /* #F1F1F1, hairlines #D6D6D6 */
  background: rgb(var(--brief-bg)); border-radius: 4px; overflow: hidden;
}
.dark .brief { --brief-bg: 30 30 30; --brief-line: 58 58 58; }
.brief-list > li + li { border-top: 1px solid rgb(var(--brief-line)); }
.brief-play svg { width: 1.25rem; height: 1.25rem; margin-inline-start: 2px; }
.brief .is-playing .brief-play { box-shadow: 0 0 0 5px rgb(var(--brand) / .18); }
@media (max-width: 1023px) {
  .brief-audio { border-bottom: 1px solid rgb(var(--brief-line)); }
}
@media (min-width: 1024px) {
  .brief-list { border-inline-start: 1px solid rgb(var(--brief-line)); }
}

/* Sound waveform: one track masked into bars; the orange fill ([data-bar]) is the progress */
.brief-wave {
  position: relative; height: 2.25rem; background: rgb(var(--ink) / .14);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 357 40' preserveAspectRatio='none'%3E%3Crect x='0' y='9' width='3' height='22' rx='1.5'/%3E%3Crect x='6' y='5' width='3' height='30' rx='1.5'/%3E%3Crect x='12' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='18' y='1.5' width='3' height='37' rx='1.5'/%3E%3Crect x='24' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='30' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='36' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='42' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='48' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='54' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='60' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='66' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='72' y='1' width='3' height='38' rx='1.5'/%3E%3Crect x='78' y='5.5' width='3' height='29' rx='1.5'/%3E%3Crect x='84' y='2' width='3' height='36' rx='1.5'/%3E%3Crect x='90' y='4' width='3' height='32' rx='1.5'/%3E%3Crect x='96' y='9' width='3' height='22' rx='1.5'/%3E%3Crect x='102' y='7.5' width='3' height='25' rx='1.5'/%3E%3Crect x='108' y='7.5' width='3' height='25' rx='1.5'/%3E%3Crect x='114' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='120' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='126' y='3.5' width='3' height='33' rx='1.5'/%3E%3Crect x='132' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='138' y='2' width='3' height='36' rx='1.5'/%3E%3Crect x='144' y='8' width='3' height='24' rx='1.5'/%3E%3Crect x='150' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='156' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='162' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='168' y='3' width='3' height='34' rx='1.5'/%3E%3Crect x='174' y='3.5' width='3' height='33' rx='1.5'/%3E%3Crect x='180' y='5.5' width='3' height='29' rx='1.5'/%3E%3Crect x='186' y='1' width='3' height='38' rx='1.5'/%3E%3Crect x='192' y='5' width='3' height='30' rx='1.5'/%3E%3Crect x='198' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='204' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='210' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='216' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='222' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='228' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='234' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='240' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='246' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='252' y='5.5' width='3' height='29' rx='1.5'/%3E%3Crect x='258' y='7.5' width='3' height='25' rx='1.5'/%3E%3Crect x='264' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='270' y='2' width='3' height='36' rx='1.5'/%3E%3Crect x='276' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='282' y='3' width='3' height='34' rx='1.5'/%3E%3Crect x='288' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='294' y='8' width='3' height='24' rx='1.5'/%3E%3Crect x='300' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='306' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='312' y='9' width='3' height='22' rx='1.5'/%3E%3Crect x='318' y='3' width='3' height='34' rx='1.5'/%3E%3Crect x='324' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='330' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='336' y='1.5' width='3' height='37' rx='1.5'/%3E%3Crect x='342' y='5' width='3' height='30' rx='1.5'/%3E%3Crect x='348' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='354' y='7' width='3' height='26' rx='1.5'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 357 40' preserveAspectRatio='none'%3E%3Crect x='0' y='9' width='3' height='22' rx='1.5'/%3E%3Crect x='6' y='5' width='3' height='30' rx='1.5'/%3E%3Crect x='12' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='18' y='1.5' width='3' height='37' rx='1.5'/%3E%3Crect x='24' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='30' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='36' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='42' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='48' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='54' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='60' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='66' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='72' y='1' width='3' height='38' rx='1.5'/%3E%3Crect x='78' y='5.5' width='3' height='29' rx='1.5'/%3E%3Crect x='84' y='2' width='3' height='36' rx='1.5'/%3E%3Crect x='90' y='4' width='3' height='32' rx='1.5'/%3E%3Crect x='96' y='9' width='3' height='22' rx='1.5'/%3E%3Crect x='102' y='7.5' width='3' height='25' rx='1.5'/%3E%3Crect x='108' y='7.5' width='3' height='25' rx='1.5'/%3E%3Crect x='114' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='120' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='126' y='3.5' width='3' height='33' rx='1.5'/%3E%3Crect x='132' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='138' y='2' width='3' height='36' rx='1.5'/%3E%3Crect x='144' y='8' width='3' height='24' rx='1.5'/%3E%3Crect x='150' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='156' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='162' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='168' y='3' width='3' height='34' rx='1.5'/%3E%3Crect x='174' y='3.5' width='3' height='33' rx='1.5'/%3E%3Crect x='180' y='5.5' width='3' height='29' rx='1.5'/%3E%3Crect x='186' y='1' width='3' height='38' rx='1.5'/%3E%3Crect x='192' y='5' width='3' height='30' rx='1.5'/%3E%3Crect x='198' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='204' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='210' y='8.5' width='3' height='23' rx='1.5'/%3E%3Crect x='216' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='222' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='228' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='234' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='240' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='246' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='252' y='5.5' width='3' height='29' rx='1.5'/%3E%3Crect x='258' y='7.5' width='3' height='25' rx='1.5'/%3E%3Crect x='264' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='270' y='2' width='3' height='36' rx='1.5'/%3E%3Crect x='276' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='282' y='3' width='3' height='34' rx='1.5'/%3E%3Crect x='288' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='294' y='8' width='3' height='24' rx='1.5'/%3E%3Crect x='300' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='306' y='6.5' width='3' height='27' rx='1.5'/%3E%3Crect x='312' y='9' width='3' height='22' rx='1.5'/%3E%3Crect x='318' y='3' width='3' height='34' rx='1.5'/%3E%3Crect x='324' y='2.5' width='3' height='35' rx='1.5'/%3E%3Crect x='330' y='4.5' width='3' height='31' rx='1.5'/%3E%3Crect x='336' y='1.5' width='3' height='37' rx='1.5'/%3E%3Crect x='342' y='5' width='3' height='30' rx='1.5'/%3E%3Crect x='348' y='7' width='3' height='26' rx='1.5'/%3E%3Crect x='354' y='7' width='3' height='26' rx='1.5'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.brief-wave [data-bar] { position: absolute; inset-block: 0; inset-inline-start: 0; background: rgb(var(--brand)); transition: width .3s; }

/* Quick-read previews use the existing paper, ink, rule and brand tokens. */
.quick-title-preview { display: none; }
@media (min-width: 1024px) {
  .quick-title-link { position: relative; }
  .quick-title-link h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-wrap: wrap;
  }
  .quick-title-preview {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    margin-top: .5rem;
    padding: .75rem;
    background: rgb(var(--paper));
    color: rgb(var(--ink));
    border: 1px solid rgb(var(--rule));
    border-top: 2px solid rgb(var(--brand));
    box-shadow: 0 6px 18px rgb(0 0 0 / .12);
    font-size: .875rem;
    line-height: 1.7;
    font-weight: 600;
    text-wrap: pretty;
  }
  .quick-title-preview::before { content: ""; position: absolute; bottom: 100%; inset-inline: 0; height: .75rem; }
  .quick-title-link:hover, .quick-title-link:focus-visible { z-index: 5; }
  .quick-title-link:focus-visible:not(.title-preview-dismissed) .quick-title-preview { display: block; }
}
@media (min-width: 1024px) and (hover: hover) {
  .quick-title-link:hover:not(.title-preview-dismissed) .quick-title-preview { display: block; }
}

.rail-bar { height: 2px; background: rgb(var(--rule)); overflow: hidden; }
.rail-bar > i { display: block; height: 100%; width: 30%; background: rgb(var(--brand)); transition: margin .15s linear; }
.on-dark .rail-bar { background: rgb(255 255 255 / .18); }
.rail-btn {
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 1px solid rgb(var(--rule));
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.rail-btn:hover { background: rgb(var(--ink)); color: rgb(var(--paper)); border-color: rgb(var(--ink)); }
.rail-btn:disabled { opacity: .3; pointer-events: none; }
.on-dark .rail-btn { border-color: rgb(255 255 255 / .3); }
.on-dark .rail-btn:hover { background: #fff; color: #111; border-color: #fff; }

/* Hero slider: one slide per view */
.hero { margin-inline: -1rem; padding-inline: 0; gap: 0; scroll-padding-inline: 0; }
.hero > * { width: 100%; }
@media (min-width: 640px) { .hero { margin-inline: 0; } }
.hero-dot { height: 3px; flex: 1; background: rgb(255 255 255 / .35); overflow: hidden; }
.hero-dot > i { display: block; height: 100%; width: 0; background: rgb(var(--brand)); }
.hero-dot.is-on > i { width: 100%; }
.hero-dot.is-on.is-timed > i { animation: hero-fill var(--hero-ms, 6000ms) linear; }
@keyframes hero-fill { from { width: 0; } to { width: 100%; } }

/* ---------- Motion ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
/* Embedded editor previews show the finished design, without scroll reveal/fade states. */
.mur-embed { margin: 0; padding: 0; }
.mur-embed .rv, .mur-embed .rv > *, .mur-embed .ph img:not(.img-failed) {
  opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important;
}
.mur-embed .story .hl { transition: none; }
.play {
  width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center;
  background: rgb(var(--brand)); color: #fff; box-shadow: 0 0 0 0 rgb(var(--brand) / .55);
  transition: transform .2s; animation: play-pulse 2.4s ease-out infinite;
}
.play.sm { width: 2.25rem; height: 2.25rem; animation: none; }
.story:hover .play { transform: scale(1.08); }
@keyframes play-pulse { 70% { box-shadow: 0 0 0 14px rgb(var(--brand) / 0); } 100% { box-shadow: 0 0 0 0 rgb(var(--brand) / 0); } }
.sk { background: linear-gradient(90deg, rgb(var(--surface)) 25%, rgb(var(--rule)) 37%, rgb(var(--surface)) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
.on-dark .sk { background-image: linear-gradient(90deg, rgb(255 255 255 / .06) 25%, rgb(255 255 255 / .12) 37%, rgb(255 255 255 / .06) 63%); }
@keyframes sk { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ---------- Phone tab bar ---------- */
.tabbar { padding-bottom: env(safe-area-inset-bottom); }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .4rem; font-size: .68rem; font-weight: 600; color: rgb(var(--muted)); }
.tabbar .is-active { color: rgb(var(--accent)); }
.tabbar .is-active svg { stroke-width: 2.2; }
@media (max-width: 1023px) {
  body { padding-bottom: calc(3.6rem + env(safe-area-inset-bottom)); }
  .ask-fab { display: none !important; }
  /* Larger touch targets for the header language/theme controls */
  [data-set-lang] { min-height: 32px; min-width: 44px; }
  #themeBtn { min-width: 36px; min-height: 36px; }
}

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 60; background: rgb(8 8 8 / .96); color: #fff; display: none; flex-direction: column; }
.lb.is-open { display: flex; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Timeline on the story page */
.tl { position: relative; padding-inline-start: 1.5rem; }
.tl::before { content: ""; position: absolute; inset-inline-start: 4px; top: .6rem; bottom: .6rem; width: 2px; background: rgb(var(--rule)); }
.tl > li { position: relative; padding-bottom: 1.25rem; }
.tl > li::before { content: ""; position: absolute; inset-inline-start: -1.5rem; top: .55rem; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--paper)); border: 2px solid rgb(var(--brand)); }
.tl > li.is-now::before { background: rgb(var(--brand)); }

/* Long-form pages (about, privacy) */
.doc h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin: 2.2em 0 .6em; }
.doc p, .doc li { line-height: 2; color: rgb(var(--ink) / .88); }
html[lang="en"] .doc p, html[lang="en"] .doc li { line-height: 1.8; }
.doc p + p { margin-top: 1em; }
.doc ul { list-style: square; padding-inline-start: 1.2em; margin-top: .6em; }
.doc li::marker { color: rgb(var(--brand)); }

/* ---------- Light touches ---------- */
/* Photos fade in as they arrive instead of popping */
.ph img { opacity: 0; transition: opacity .45s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.ph img.is-loaded { opacity: 1; }
/* A story dims while a finger is on it */
@media (hover: none) {
  .story { transition: opacity .12s; }
  .story:active { opacity: .6; }
}
/* Blocks inside a revealed section follow one another */
.rv.in > * { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
.rv.in > *:nth-child(2) { animation-delay: .06s; }
.rv.in > *:nth-child(3) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Touch targets: small text links get a finger-sized hit area on touch screens */
@media (pointer: coarse) {
  .tap, footer ul a, #drawer ul a { display: inline-flex; align-items: center; min-height: 2.5rem; }
  footer ul { row-gap: 0 !important; }
  footer ul.space-y-2 > li + li { margin-top: 0 !important; }
}

:focus-visible { outline: 2px solid rgb(var(--brand)); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .live-dot, .play, .sk, .hero-dot.is-on.is-timed > i { animation: none !important; }
  .story img, .rv, .ph img, .story { transition: none; }
  .rv.in > * { animation: none; }
  .rv { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Keep news previews compact without clipping article page headings. */
[data-view="home"] .story h2.hl,
[data-view="home"] .story h3.hl,
[data-view="section"] .story h2.hl,
[data-view="section"] .story h3.hl {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.lead-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
:root{--brief-surface:240 240 240}.dark{--brief-surface:27 27 27}

.article-reading-layout{display:grid;grid-template-columns:auto minmax(0,1fr);direction:rtl;gap:16px;margin-top:32px;align-items:start}
.article-reading-layout>.prose-body{margin-top:0;min-width:0}
.article-font-controls{position:sticky;top:66px;flex-direction:column;background:rgb(var(--paper));align-self:start}
.article-font-controls button{min-width:36px;min-height:36px}
.article-font-controls button+button{border-inline-start:0;border-top:1px solid rgb(var(--rule))}
html[dir="ltr"] .article-reading-layout>.prose-body{direction:ltr}
@media(max-width:639px){.article-reading-layout{gap:10px}.article-font-controls button{padding:8px;min-width:32px}}
