/* The Monrovia Times — mechanics only: Big Story slideshow + scrolling
   Developing ticker. The design stylesheet (style.css) is the sample's,
   byte-for-byte; this file adds no new design language, only the moving
   parts, using the design's own tokens and fonts. */

/* ---------- Light scheme lock (Orion, Nov 17, 2026) ----------
   The design is a light newspaper theme, but the sample stylesheet
   ships a prefers-color-scheme: dark token flip: on dark-mode phones
   the page went near-black while the navy masthead name, tagline, nav
   links and ticker text stayed navy and nearly vanished. Pin the
   light scheme for everyone: declare it, give html/body explicit
   light colours (so forced-dark algorithms keyed to computed colours
   leave the page alone), and re-pin the design tokens to their light
   values under dark mode so the sample's flip never takes effect.
   Light mode renders exactly as before. */
:root { color-scheme: light only; }
html { background-color: #ffffff; }
body { background-color: #ffffff; color: #16181d; }
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #ffffff;
    --paper-2: #f6f5f1;
    --ink: #16181d;
    --ink-2: #454a54;
    --ink-3: #767c88;
    --rule: #ddd9d0;
    --rule-dark: #16181d;
    --accent: #a31621;
    --accent-soft: #fbeeee;
    --gold: #9a6b1f;
    --chip: #efede7;
    --shadow: 0 18px 50px rgba(10, 12, 20, .28);
    color-scheme: light only;
  }
}

/* ---------- Big Story slideshow ---------- */
.bigstory-slides { display: grid; }
.bigstory-slide {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease, visibility 0s linear .6s;
}
.bigstory-slide.is-active {
  opacity: 1; visibility: visible; z-index: 1;
  transition: opacity .6s ease;
}
.bigstory-slide .slide-link { display: block; color: inherit; text-decoration: none; }
.bigstory-slide .slide-link:hover h1, .bigstory-slide .slide-link:hover h2 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.bigstory-slide h2 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.04; font-weight: 800; letter-spacing: -.01em;
  margin: 0 0 12px;
}
.bigstory-controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.bs-btn {
  font-family: "Libre Franklin", sans-serif;
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-dark); cursor: pointer;
}
.bs-btn:hover { border-color: var(--accent); color: var(--accent); }
.bs-btn svg { width: 16px; height: 16px; }
.bs-dots { display: inline-flex; align-items: center; gap: 8px; }
.bs-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--ink-3); cursor: pointer;
}
.bs-dot.is-active { background: var(--accent); border-color: var(--accent); }
.bs-count {
  font-family: "Libre Franklin", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .08em; color: var(--ink-3);
}

/* ---------- Developing ticker: seamless scrolling loop ---------- */
.ticker-track {
  display: flex; white-space: nowrap; will-change: transform;
  animation: mt-ticker-scroll var(--ticker-dur, 120s) linear infinite;
}
.ticker-seq { display: flex; align-items: center; gap: 28px; padding-right: 28px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes mt-ticker-scroll { to { transform: translateX(-50%); } }
/* DEVELOPING flag pinned to the bar's left edge (Orion, Nov 19, 2026):
   the flag leaves the centred wrap and sits flush at the screen edge,
   full bar height; the scrolling items keep the bar's 40px height and
   pass beneath the flag's solid block where they meet it. */
.ticker { position: relative; }
.ticker .flag { position: absolute; left: 6px; top: 0; bottom: 0; z-index: 3; padding-right: 28px; }
.ticker .items { min-height: 40px; }
@media (max-width: 760px) {
  /* mechanics only: the sample's static-ticker rule hides items 2+ on
     small screens; a scrolling ticker needs them all in the track. */
  .ticker .items { white-space: nowrap; }
  .ticker .items .ticker-seq span:nth-child(n+2) { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .bigstory-slide { transition: none; }
}

/* ---------- Story share row + read count (Orion, Nov 19, 2026) ---------- */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0 6px; padding-top: 18px; border-top: 1px solid var(--border, #ddd); }
.share-label { font-family: "Libre Franklin", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #001840; margin-right: 4px; }
.share-btn { font-family: "Libre Franklin", sans-serif; font-size: 13px; font-weight: 600; color: #001840; background: transparent; border: 1px solid #001840; border-radius: 999px; padding: 7px 14px; text-decoration: none; cursor: pointer; line-height: 1.2; }
.share-btn:hover { background: #001840; color: #fff; }
.share-feedback { font-family: "Libre Franklin", sans-serif; font-size: 12.5px; color: #001840; }
.mr-reads { font-family: "Libre Franklin", sans-serif; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; color: #001840; opacity: .75; }

/* ---------- Masthead colour (Orion, Nov 15): paper name + tagline in navy blue ---------- */
.masthead .brand, footer .brand-sm { color: #001840; }
.masthead .tagline { color: #001840; font-weight: 700; }

/* ---------- Masthead name on phones (Orion, Nov 17, 2026): keep
   "The Monrovia Times" on ONE line. The base size clamp(44px, 8.5vw,
   84px) never drops below 44px, and at 44px the name is wider than a
   phone screen minus the masthead's 16px side padding, so it wrapped
   ("The Monrovia / Times"). Serif measure puts the name at ~10.2px
   wide per 1px of font size (Noto Serif, mixed italic-500 "The" +
   ExtraBold rest, letter-spacing included; ~11.3 worst case in the
   wider DejaVu Serif). 7.5vw keeps the whole name inside the padded
   width with at least ~5% slack at every phone width (320px: 24px
   type, <=271px of text in 288px; 360px: 27px type, <=305px in
   328px; 390px: 29.25px type, <=330px in 358px), and nowrap forbids
   the wrap outright, so the name cannot push the page sideways
   either. Above 640px the base clamp rules exactly as before —
   desktop and tablet mastheads are unchanged. ---------- */
@media (max-width: 640px) {
  .masthead .brand { font-size: 7.5vw; white-space: nowrap; }
}

/* ---------- Ticker bar (Orion, Nov 15): navy blue instead of black ---------- */
.ticker { background: #001840; }


/* ---------- Nav (Orion, Nov 15): section links in navy blue ---------- */
.nav .nav-links button { color: #001840; }
.nav .nav-links button.active { color: #001840; }
.nav .nav-links button:hover { color: #001840; background: var(--paper-2); }
.nav .nav-links button.home-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; }

/* ---------- Support Our Journalism (Orion, Nov 15): link under the tagline,
   above the nav divider line. Points to /support/ since Nov 19, 2026 —
   Orion's donation page (Cash App $Monroviatimes, Venmo @themonroviatimes). ---------- */
.support-line { position: absolute; right: 20px; bottom: 12px; margin: 0; }
@media (max-width: 760px) {
  .support-line { position: static; text-align: center; margin-top: 10px; }
}
.support-link { font-family: "Libre Franklin", sans-serif; font-size: 13.5px; font-weight: 700; letter-spacing: .04em; color: #001840; }
.support-link .heart { color: var(--accent); }
.support-link:hover { text-decoration: underline; }

/* ---------- Support page donate buttons (Orion, Nov 19, 2026) ---------- */
.donate-group { margin: 26px 0 6px; }
.donate-group h2 { font-family: "Libre Franklin", sans-serif; font-size: 17px; color: #001840; margin: 0 0 4px; }
.donate-handle { font-family: "Libre Franklin", sans-serif; font-size: 13.5px; color: #444; margin: 0 0 12px; }
.donate-row { display: flex; flex-wrap: wrap; gap: 10px; }
.donate-btn { display: inline-block; background: #001840; color: #fff; font-family: "Libre Franklin", sans-serif; font-size: 16px; font-weight: 800; letter-spacing: .02em; padding: 12px 22px; border-radius: 4px; text-decoration: none; }
.donate-btn:hover { background: #b5892e; color: #fff; text-decoration: none; }

/* ---------- Footer (Orion, Nov 15): all links in navy blue ---------- */
footer nav a, footer .fine a { color: #001840; }
footer nav a:hover, footer .fine a:hover { color: #001840; text-decoration: underline; }

/* ---------- Front-page top, FPA-style (Orion, Nov 15): lead photo with the
   headline on it, numbered strip beneath, Latest News rail beside it.
   Masthead stays exactly as the sample has it. ---------- */
.fpa-stage { position: relative; display: block; border-radius: 6px; overflow: hidden; background: var(--ink); }
.fpa-stage img { display: block; width: 100%; aspect-ratio: 16 / 9.2; object-fit: cover; transition: opacity .35s ease; }
.fpa-overlay { position: absolute; left: 0; right: 0; bottom: 0; display: block; padding: 20px 22px; transition: opacity .35s ease; }
.fpa-lead.is-fading .fpa-stage img, .fpa-lead.is-fading .fpa-overlay { opacity: .15; }
.fpa-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 8, 15, .88) 0%, rgba(5, 8, 15, .45) 30%, rgba(5, 8, 15, 0) 52%); }
.fpa-chip { display: inline-block; background: var(--accent); color: #fff; font-family: "Libre Franklin", sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border-radius: 2px; margin-bottom: 10px; }
.fpa-headline { display: block; font-family: "Newsreader", serif; font-weight: 700; font-size: clamp(25px, 3.3vw, 39px); line-height: 1.12; color: #fff; }
.fpa-byline { display: block; margin-top: 10px; font-family: "Libre Franklin", sans-serif; font-size: 12px; letter-spacing: .04em; color: rgba(255, 255, 255, .75); }
.fpa-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin-top: 6px; border-bottom: 1px solid #e4e1d8; }
.fpa-num { display: flex; gap: 8px; align-items: flex-start; text-align: left; background: none; border: 0; border-top: 3px solid #d8d4c8; padding: 10px 10px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.fpa-num .n { font-family: "Libre Franklin", sans-serif; font-weight: 800; font-size: 13px; color: var(--ink-3); }
.fpa-num .t { font-family: "Newsreader", serif; font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fpa-num.is-active { border-top-color: var(--accent); }
.fpa-num.is-active .n { color: var(--accent); }
.fpa-num:hover { background: var(--paper-2); }
.fpa-rail .fpa-rail-head { font-family: "Libre Franklin", sans-serif; font-size: 19px; font-weight: 800; border-left: 4px solid var(--accent); padding-left: 10px; margin: 0 0 6px; color: var(--ink); }
.fpa-rail .fpa-latest-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e7e4da; cursor: pointer; align-items: flex-start; }
.fpa-rail .fpa-latest-item img { width: 96px; height: 70px; object-fit: cover; border-radius: 4px; flex: none; }
.fpa-rail .fpa-latest-item h4 { font-family: "Newsreader", serif; font-size: 15.5px; font-weight: 600; line-height: 1.3; margin: 0 0 4px; }
.fpa-rail .fpa-latest-item time { font-family: "Libre Franklin", sans-serif; font-size: 12px; color: var(--ink-3); }
.fpa-rail .fpa-latest-item:hover h4 { color: var(--accent); }

/* ---------- Featured Video (Orion, Nov 15): his weekly pick, before In Focus ---------- */
.featured-video { margin-top: 36px; }
.featured-video .video-embed { max-width: 680px; margin: 0 auto; padding-top: 0; aspect-ratio: 16 / 9; border: 8px solid #001840; border-radius: 8px; }
.fv-caption { text-align: center; font-family: "Libre Franklin", sans-serif; font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.fv-row { display: flex; gap: 22px; justify-content: center; align-items: flex-start; }
.fv-main { flex: 0 1 680px; min-width: 0; }
.fv-side { flex: 0 0 300px; display: flex; flex-direction: column; gap: 14px; }
.fv-side-head { font-family: "Libre Franklin", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 2px 0 0; }
.fv-card .fv-thumb { position: relative; display: block; width: 100%; padding: 0; border: 2px solid var(--rule); border-radius: 6px; overflow: hidden; cursor: pointer; background: #000; }
.fv-card .fv-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.fv-card.is-active .fv-thumb { border: 3px solid #001840; }
.fv-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 24, 64, 0.85); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.fv-card-title { display: block; margin-top: 6px; font-family: "Newsreader", Georgia, serif; font-size: 15.5px; line-height: 1.25; color: var(--ink); text-decoration: none; }
.fv-card-title:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .fv-row { flex-direction: column; align-items: center; }
  .fv-main { flex: none; width: 100%; max-width: 680px; }
  .fv-side { flex: none; width: 100%; max-width: 680px; }
}

/* ---------- Front-page fill (Orion, Nov 17, 2026): Top Stories rises
   into the main column directly under the slideshow, and the rail
   (Latest News + What to Watch + Most Read) spans both rows beside it,
   so no dead white space sits under the numbered strip. ---------- */
.front { grid-template-areas: "lead rail" "topstories rail"; }
.front > .lead { grid-area: lead; }
.front > .topstories { grid-area: topstories; padding-right: 28px; border-right: 1px solid var(--rule); margin-top: 30px; }
.front > .fpa-rail { grid-area: rail; }
.fpa-rail .mostread { padding-left: 0; margin-top: 28px; }
@media (max-width: 900px) {
  .front { grid-template-areas: "lead" "topstories" "rail"; }
  .front > .topstories { padding-right: 0; border-right: none; }
}

/* ---------- Top Stories picture boxes (Orion, Nov 15) ---------- */
.topstories .top-item { display: flex; gap: 14px; align-items: flex-start; }
.topstories .top-item img.top-thumb { width: 110px; height: 80px; object-fit: cover; border-radius: 4px; flex: none; }
.topstories .top-item h3 { margin-top: 2px; }
.fpa-rail .analysis { margin-top: 18px; }
@media (max-width: 760px) {
  .fpa-strip { display: flex; overflow-x: auto; }
  .fpa-num { min-width: 150px; }
  .fpa-overlay { padding: 14px 16px; }
}

/* The Latest thumbnails + In Focus placeholder (Orion, Nov 15, 2026) */
.latest-list li { grid-template-columns: 74px 72px 1fr; }
.latest-list .latest-thumb {
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--rule); display: block;
}
.focus-empty {
  font-family: "Newsreader", Georgia, serif; font-style: italic;
  font-size: 17px; color: var(--ink-2); margin: 6px 0 2px;
}
@media (max-width: 640px) {
  .latest-list li { grid-template-columns: 58px 56px 1fr; gap: 10px; }
  .latest-list .latest-thumb { width: 56px; height: 56px; }
}

/* In-story figures + YouTube embed (marathon story, Nov 15, 2026) */
.reader .body figure { margin: 24px 0; }
.reader .body figure img { width: 100%; height: auto; display: block; border-radius: 6px; }
.reader .body figcaption {
  font-family: "Libre Franklin", sans-serif; font-size: 12.5px;
  color: var(--ink-3); margin-top: 7px;
}
.video-embed { position: relative; padding-top: 56.25%; margin: 24px 0; }
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: 6px;
}

/* ---------- Watch on YouTube button (Orion, Nov 16, 2026): sits under
   every video player — story embeds and the homepage featured player.
   The players themselves are unchanged; the button opens the same video
   on YouTube in a new tab and its clicks are tracked in GA4 as
   watch_on_youtube_click (listener in the page script). ---------- */
.watch-yt { text-align: center; margin: 10px 0 26px; }
.featured-video .watch-yt { margin: 12px 0 2px; }
.watch-yt-btn {
  display: inline-block;
  font-family: "Libre Franklin", sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  color: #fff; background: #001840;
  padding: 10px 22px; border-radius: 999px;
  text-decoration: none;
}
.watch-yt-btn:hover { background: #001840; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Face-safe framing (Orion, Nov 17, 2026): every frame that
   shows a story's 1200x630 main image crops it with object-fit: cover
   (lead 16/9.2, reader hero 16/9, cards 3/2, rail thumbs 96x70, Top
   Stories thumbs 110x80), so an off-centre face could be cut even
   though the file itself is standard size. Two defences, both applied
   in the builder: (1) portrait mains are composed with the whole head
   inside the centre safe zone of the 1200x630 canvas; (2) a story may
   carry a "focus" field, emitted as an inline object-position on its
   images (and swapped with the lead slideshow's data), so each frame's
   crop window centres on the face. No frame ratio changes: the design
   stays exactly as approved. ---------- */

/* ---------- Mobile horizontal-overflow fix (Orion, Nov 17, 2026):
   on phones the whole page panned left and right because two boxes
   could not shrink below their content's min-content width, so they
   forced the layout wider than the viewport:
   (1) .ticker .items — a flex item whose child .ticker-track is
       thousands of px wide BY DESIGN (the scrolling loop). The base
       sheet gives .items overflow:hidden, but a flex item's automatic
       minimum size only falls to 0 through that overflow in engines
       that implement the rule reliably; where it does not (mobile
       Safari is the known weak spot), .items lays out at full track
       width and drags the whole page sideways with it.
   (2) .front's grid items — grid items also default to
       min-width:auto, and .lead's min-content includes the mobile
       numbered strip: a flex row of six .fpa-num buttons at
       min-width:150px (~900px) sitting in an overflow-x:auto strip,
       which could hold the single mobile column open past the
       viewport.
   Explicit min-width:0 lets both shrink in every engine. The ticker
   track stays wide INSIDE its clipped .items wrapper and keeps
   animating exactly as before; the numbered strip keeps its own
   internal sideways scroll, as designed. The same hardening covers
   the other grid/flex children whose content could ever exceed a
   phone-width track. Desktop layout is untouched: at desktop widths
   every one of these boxes is already wider than its min-content. */
.ticker .items { min-width: 0; }
.front > .lead, .front > .topstories, .front > .fpa-rail { min-width: 0; }
.two-col > .latest, .two-col > .mostread { min-width: 0; }
.focus-grid > .card, .opinion-grid > .op, .newsletter > * { min-width: 0; }
.fpa-rail .fpa-latest-item > div, .topstories .top-item > div { min-width: 0; }
.search-row .search-note { min-width: 0; }

/* Final safety net: clip any residual horizontal overflow at the page
   level. overflow-x: clip (not hidden) creates no scroll container, so
   the sticky .nav keeps sticking. The root-cause fixes above are the
   real cure; this only catches anything unforeseen. */
html, body { overflow-x: clip; }

/* ---------- Mobile nav tidy-up (Orion, Nov 17, 2026): on phones the
   section nav wrapped raggedly over four uneven lines (home, Breaking
   News, Politics / Development, Business, People & Lifestyle / Liberia
   & Beyond, International News / Sports, Opinion) and the search
   button — a vertically-centred sibling of the whole wrapping block —
   floated stranded at the right edge. Orion: "organize them to at
   least 2 lines." Phones (<=640px) now get exactly two balanced lines:
     line 1: home, Breaking News, Politics, Business,
             People & Lifestyle  (+ the search button at its right end)
     line 2: Development, Liberia & Beyond, International News,
             Sports, Opinion
   Only one pair trades places (Development <-> People & Lifestyle);
   every other link keeps its order. The break is deterministic, not
   left to wherever the text happens to wrap: a zero-height ::before
   row-breaker sits at order 1, the five line-2 buttons carry order 2,
   and the buttons are flex:none + nowrap so no line can re-wrap. The
   search button leaves the flow (absolute, top-right of the sticky
   nav, on the first line's row, beside the home button's line) and
   People & Lifestyle — the last button on line 1 — keeps a 48px right
   margin so nothing slides under it; on pages without a search
   button that margin is invisible (space-between just spreads line 1
   across the remaining width). Sizes come from measuring the real
   labels in Libre Franklin 600 (the nav's own font): the nine labels
   total 594px of text at 11px, so two phone-width lines need 10.5px
   type with 2px button padding — simulated against the measured
   widths at every viewport 320-430px, both lines fit with slack at
   every width (tightest: ~6px on line 1 at 320px). Two step-downs
   keep the same two lines on smaller phones: 10px at <=380px, 9px
   with 8px page padding at <=359px. Above 640px nothing in this
   block applies — the desktop/tablet nav is exactly as before. ---- */
@media (max-width: 640px) {
  .nav .wrap { padding: 0 12px; }
  .nav .nav-links { min-width: 0; justify-content: space-between; }
  .nav .nav-links::before { content: ""; order: 1; flex: 0 0 100%; height: 0; }
  .nav .nav-links button { flex: none; white-space: nowrap; font-size: 10.5px; padding: 0 2px; letter-spacing: -.01em; }
  .nav .nav-links button.home-btn { padding: 0 2px; }
  .nav .nav-links button:nth-child(4),
  .nav .nav-links button:nth-child(7),
  .nav .nav-links button:nth-child(8),
  .nav .nav-links button:nth-child(9),
  .nav .nav-links button:nth-child(10) { order: 2; }
  .nav .nav-links button:nth-child(6) { margin-right: 48px; }
  .nav .search-btn { position: absolute; top: 0; right: 12px; min-width: 40px; }
}
@media (max-width: 380px) {
  .nav .nav-links button { font-size: 10px; }
}
@media (max-width: 359px) {
  .nav .wrap { padding: 0 8px; }
  .nav .nav-links button { font-size: 9px; }
  .nav .search-btn { right: 8px; }
}
