/* ============================================================
   fcc-editorial.css — subtle editorial signature for fcc.cc pages
   ------------------------------------------------------------
   Opt-in classes that nod to The Commons editorial style without
   replacing each page's local design. Adds:

     .fcc-onair           — pulsing red dot (brand wink)
     .fcc-ticker          — date / separator chrome for the topbar
     .fcc-eyebrow         — small-caps tracking label
     .fcc-section-head    — section title with single-rule underline
     .fcc-section-head__hint — uppercase microcopy, right side

   Designed to coexist with each site's --bg / --accent tokens.
   The on-air red is a fixed brand signature, not themed.
   ============================================================ */

:root {
  --fcc-editorial-red: #d4593f; /* warm editorial red, ~oklch(.62 .14 30) */
  --fcc-editorial-red-soft: rgba(212, 89, 63, 0.55);
}

/* On-air pulsing dot — Commons midnight accent ----------------- */
.fcc-onair {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(0.80 0.10 27);
  box-shadow: 0 0 0 0 color-mix(in oklch, oklch(0.80 0.10 27) 55%, transparent);
  animation: fcc-onair-pulse 2.4s ease-in-out infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes fcc-onair-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, oklch(0.80 0.10 27) 55%, transparent); opacity: 1; }
  50%      { box-shadow: 0 0 0 5px color-mix(in oklch, oklch(0.80 0.10 27) 0%,  transparent); opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .fcc-onair { animation: none; }
}

/* Meta-bar — bit-for-bit copy of fcc.cc/community's .topbar so every
   page wears identical chrome. All values are absolute (no var()
   fallbacks to host page tokens) so a page's own bg/accent can't
   shift the appearance. The bar paints opaquely over whatever sits
   behind it (e.g. fcc.cc/'s fixed topbar gradient). */
.fcc-meta-bar {
  background: oklch(0.16 0.012 260) !important;
  border-bottom: 1px solid oklch(0.92 0.008 85);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  font-weight: 400;
  color: oklch(0.77 0.008 85);
  position: relative;
  z-index: 60;
  /* Defensive — kill anything the host topbar might add (gradients,
     blurs, shadows) bleeding through if we're nested inside it. */
  backdrop-filter: none;
  box-shadow: none;
}
.fcc-meta-bar__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  /* Reserve the final auth-row height so pre-render skeletons and the
     signed-out state don't grow when econav fills in bell + msg + auth
     (meta-bar ends at 49px with 1px border + 48px inner box). */
  min-height: 48px;
}
.fcc-meta-bar__spacer {
  flex: 1 1 auto;
  min-width: 0.5rem;
}
.fcc-meta-bar__right {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Once we've relocated theme + auth into the meta-bar, hide any copies
   that econav re-injects into the topbar plane. Scoped to direct
   children of .topbar-content so the meta-bar versions stay visible.
   Using !important because econav sets inline display styles. */
.topbar-content > .fcc-econav-desktop-themes,
.topbar-content > .fcc-econav-auth,
.topbar-content > .topbar-auth {
  display: none !important;
}

/* When econav widgets land in the meta-bar, slim them down so the
   bar stays a single 28px-ish strip. We override the bottom-row sizes
   only when these elements are inside [data-fcc-meta-right]. */
.fcc-meta-bar__right .fcc-econav-desktop-themes,
.fcc-meta-bar__right .fcc-econav-auth,
.fcc-meta-bar__right .topbar-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
/* Theme picker — match Commons .theme-picker / .theme-label / .theme-dot exactly */
.fcc-meta-bar__right .fcc-econav-desktop-themes {
  gap: 6px !important;
  padding: 0 4px !important;
}
.fcc-meta-bar__right .fcc-econav-desktop-themes-label {
  font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.62 0.008 85);
  margin-right: 4px;
}
.fcc-meta-bar__right .fcc-econav-theme-chip,
.fcc-meta-bar__right .fcc-econav-desktop-theme-btn {
  width: 14px;
  height: 14px;
  padding: 0;
  /* Strong border so the black chip stays distinguishable from the
     page bg (which is also near-black on the default theme). The
     inner box-shadow adds a subtle dark ring so light-theme chips
     don't disappear into a white meta-bar either. */
  border: 1.5px solid oklch(0.78 0.006 85);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.fcc-meta-bar__right .fcc-econav-theme-chip:hover,
.fcc-meta-bar__right .fcc-econav-desktop-theme-btn:hover {
  transform: scale(1.12);
}
.fcc-meta-bar__right .fcc-econav-theme-chip.active,
.fcc-meta-bar__right .fcc-econav-desktop-theme-btn.active,
.fcc-meta-bar__right .fcc-econav-theme-chip[aria-pressed="true"],
.fcc-meta-bar__right .fcc-econav-desktop-theme-btn[aria-pressed="true"] {
  border-color: oklch(0.92 0.008 85);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 0 2px oklch(0.55 0.05 27 / 0.55);
}
.fcc-meta-bar__right .fcc-auth-btn {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0;
  line-height: 1.4;
  color: oklch(0.92 0.008 85);
  background: transparent;
  border: 0;
  text-decoration: none;
}
.fcc-meta-bar__right .fcc-auth-btn:hover {
  color: oklch(0.80 0.10 27);
}
.fcc-meta-bar__right .fcc-auth-btn-logout {
  margin-left: 0 !important;
}
.fcc-meta-bar__right .fcc-msg-icon,
.fcc-meta-bar__right .fcc-notif-bell {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: oklch(0.77 0.008 85);
  position: relative;
}
.fcc-meta-bar__right .fcc-msg-icon:hover,
.fcc-meta-bar__right .fcc-notif-bell:hover {
  color: oklch(0.92 0.008 85);
}
/* Auth host visual order: bell → envelope → @USERNAME (matches Commons).
   The DOM inside the host is [logout-btn, msg-icon, notif-bell] from
   econav, so we use flex `order` to render them in the desired order. */
.fcc-meta-bar__right .fcc-econav-auth,
.fcc-meta-bar__right .topbar-auth {
  gap: 12px;
}
.fcc-meta-bar__right .fcc-notif-bell { order: 1; }
.fcc-meta-bar__right .fcc-msg-icon { order: 2; }
.fcc-meta-bar__right .fcc-auth-btn-logout { order: 3; }
.fcc-meta-bar__right .fcc-auth-btn:not(.fcc-auth-btn-logout) { order: 4; }
.fcc-meta-bar__right .fcc-msg-icon:hover,
.fcc-meta-bar__right .fcc-notif-bell:hover {
  color: var(--text, #f5f6f7);
}
.fcc-meta-bar__right .fcc-msg-icon-svg,
.fcc-meta-bar__right .fcc-notif-bell-icon {
  width: 14px;
  height: 14px;
}
.fcc-meta-bar__right .fcc-msg-icon-badge,
.fcc-meta-bar__right .fcc-notif-bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(0.80 0.10 27);
  border: 1px solid oklch(0.16 0.012 260);
  padding: 0;
}
.fcc-ticker {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  min-width: 0;
  color: oklch(0.77 0.008 85);
}
.fcc-ticker__sep,
.fcc-meta-bar__sep {
  color: oklch(0.40 0.018 260); /* Commons --rule-2 on midnight */
  font-weight: 400;
  user-select: none;
}
.fcc-ticker__date,
.fcc-ticker__version,
.fcc-ticker__update {
  font-variant-numeric: tabular-nums;
  color: oklch(0.77 0.008 85);
}

.fcc-meta-bar__home {
  color: oklch(0.77 0.008 85);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
}
.fcc-meta-bar__home:hover {
  color: oklch(0.92 0.008 85);
}
/* Slot wrappers — only render the slot when it has children (otherwise
   pipes around an empty slot would leave odd gaps). */
.fcc-meta-bar__slot {
  display: inline-flex;
  align-items: center;
}
.fcc-meta-bar__slot:empty,
.fcc-meta-bar__slot:empty + .fcc-meta-bar__sep,
.fcc-meta-bar__sep + .fcc-meta-bar__slot:empty {
  display: none;
}

/* Auth slot stays hidden until JS verifies the final state (signed-in
   logout + bell + msg present, or signed-out Sign-in visible) — kills
   the Sign-in→My Account→@USERNAME and filled→outlined icon flicker
   that econav's async hydration would otherwise expose. */
.fcc-meta-bar__slot[data-fcc-slot="auth"] {
  visibility: hidden;
}
.fcc-meta-bar__slot[data-fcc-slot="auth"].is-ready {
  visibility: visible;
}

@media (max-width: 720px) {
  /* Trim secondary chrome on narrow screens so the date keeps room. */
  .fcc-ticker__update,
  .fcc-ticker [data-fcc-update-sep] { display: none !important; }
}
@media (max-width: 540px) {
  .fcc-meta-bar__inner { padding: 0.35rem 0.85rem; gap: 0.5rem; }
  .fcc-ticker { gap: 0.55em; }
  .fcc-ticker__version,
  .fcc-ticker__sep { display: none; }
  .fcc-meta-bar__home,
  .fcc-meta-bar__right .fcc-meta-bar__home::before,
  .fcc-meta-bar__right .fcc-econav-auth::before,
  .fcc-meta-bar__right .topbar-auth::before { display: none; }
  .fcc-meta-bar__right .fcc-econav-desktop-themes-label { display: none; }
}

/* Editorial typography stack (Source Serif 4 self-hosted via
   /shared/fonts/fonts.css — pages must load that). */
:root {
  --fcc-serif: "Source Serif 4", Charter, "Iowan Old Style", Georgia, serif;
  --fcc-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Eyebrow — small-caps tracking label -------------------------- */
/* Double-class for defensive specificity against host page rules. */
.fcc-eyebrow.fcc-eyebrow {
  display: inline-block;
  font-family: var(--fcc-sans);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--dim, #9aa3b2);
  opacity: 0.85;
  margin: 0 0 0.85rem;
  line-height: 1.3;
}

/* Display title — italic Source Serif 4, hero scale. Used for h1
   inside .fcc-masthead. ----------------------------------------- */
.fcc-display.fcc-display {
  font-family: var(--fcc-serif);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--text, var(--ink, #f5f6f7));
  text-wrap: balance;
}
.fcc-display .fcc-display__accent {
  color: var(--fcc-editorial-red);
  font-style: italic;
  font-weight: 500;
  padding: 0 0.05em;
}

/* Sub-tagline — uppercase tracking caps row under display ------ */
.fcc-sub.fcc-sub {
  margin: 1rem 0 0;
  font-family: var(--fcc-sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim, #9aa3b2);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  line-height: 1.6;
}
.fcc-sub .fcc-sub__bullet {
  color: var(--muted, #6b7280);
  opacity: 0.6;
}

/* Masthead — editorial title block with double-rule bottom ----- */
.fcc-masthead {
  text-align: center;
  padding: 2.5rem 0 1.75rem;
  border-bottom: 3px double var(--border, var(--line, rgba(120, 120, 120, 0.35)));
  margin: 0 0 2.25rem;
}
.fcc-masthead .fcc-eyebrow {
  display: block;
  margin-bottom: 0.85rem;
  text-align: center;
  color: var(--dim, #9aa3b2);
  opacity: 0.75;
}

/* Section head — title + thin red rule + optional hint ------- */
.fcc-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--text, var(--ink, currentColor));
  padding-bottom: 0.55rem;
  margin-bottom: 1.4rem;
  position: relative;
}
.fcc-section-head::after {
  /* Editorial red whisker on the left edge of the rule */
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 56px;
  background: var(--fcc-editorial-red);
}
.fcc-section-head > :first-child {
  margin: 0;
}
.fcc-section-head h1,
.fcc-section-head h2,
.fcc-section-head h3 {
  font-family: var(--fcc-serif);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text, var(--ink, currentColor));
}
.fcc-section-head__hint.fcc-section-head__hint {
  font-family: var(--fcc-sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted, var(--dim, #9aa3b2));
  white-space: nowrap;
  font-weight: 500;
}
@media (max-width: 540px) {
  .fcc-section-head { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .fcc-section-head__hint { font-size: 0.65rem; }
  .fcc-masthead { padding: 1.5rem 0 1.25rem; margin-bottom: 1.5rem; }
}

/* Prose — editorial reading column (opt-in) ------------------- */
/* Apply to the article wrapper (e.g. <article class="prose fcc-prose">)
   to swap the page's local sans body for Source Serif 4 with Commons-
   style measure & rhythm. Defensive double-class selectors so we win
   against the host page's existing prose rules. */
.fcc-prose.fcc-prose {
  font-family: var(--fcc-serif);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  color: var(--text, var(--ink, #f5f6f7));
  text-wrap: pretty;
}
.fcc-prose.fcc-prose p,
.fcc-prose.fcc-prose li {
  font-family: var(--fcc-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text, var(--ink, #f5f6f7));
  text-wrap: pretty;
}
.fcc-prose.fcc-prose .lead.lead {
  font-family: var(--fcc-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--dim, var(--ink-2, #9aa3b2));
  border-left: 3px solid var(--fcc-editorial-red);
  padding-left: 1.1rem;
  text-wrap: pretty;
}
.fcc-prose.fcc-prose strong {
  font-weight: 700;
  color: var(--text, var(--ink, currentColor));
}
.fcc-prose.fcc-prose em {
  font-style: italic;
}
.fcc-prose.fcc-prose li.fcc-prose-bullet,
.fcc-prose.fcc-prose ul li {
  position: relative;
  padding-left: 1.4rem;
}
.fcc-prose.fcc-prose ul li::before {
  content: "\2022";
  color: var(--fcc-editorial-red);
  position: absolute;
  left: 0;
  top: 0.45rem;
  font-weight: 700;
  line-height: 1;
}
.fcc-prose.fcc-prose a {
  color: var(--text, currentColor);
  text-decoration: underline;
  text-decoration-color: var(--fcc-editorial-red);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.fcc-prose.fcc-prose a:hover {
  text-decoration-thickness: 2px;
}
.fcc-prose.fcc-prose section {
  margin-bottom: 2.5rem;
}

/* ============================================================
   Econav strip — dark-paint in light themes
   ------------------------------------------------------------
   When the page paper is a light theme (newsprint, paper), the
   topbar's econav row would otherwise inherit the light paper and
   wash out — every econav pill is designed against a dark backdrop.
   Paint the same hardcoded midnight as the meta-bar so the two
   strips read as one dark band above the editorial page.

   IMPORTANT: scope to .topbar / .topbar-content / .fcc-econav-plane
   only, NOT to .site-header. Some pages (news, games) nest extra
   chrome inside .site-header (e.g. .view-tabs filter row) that needs
   to render on the light page, not on the dark strip.
   ============================================================ */
html[data-mode="light"] .site-header > .topbar,
html[data-mode="light"] .site-header > .topbar-content,
html[data-mode="light"] .site-header > .fcc-econav-plane,
html[data-mode="light"] .site-header > .topbar .topbar-content,
html[data-mode="light"] .site-header > .topbar .fcc-econav-plane {
  background: oklch(0.16 0.012 260);
  color: oklch(0.77 0.008 85);
  border-bottom-color: oklch(0.32 0.018 260);
}
html[data-mode="light"] .site-header > .topbar .brand,
html[data-mode="light"] .site-header > .topbar-content .brand,
html[data-mode="light"] .site-header > .topbar .brand a,
html[data-mode="light"] .site-header > .topbar-content .brand a {
  color: oklch(0.77 0.008 85);
}
html[data-mode="light"] .site-header > .topbar nav.ecosystem-nav[data-fcc-econav] a,
html[data-mode="light"] .site-header > .topbar-content nav.ecosystem-nav[data-fcc-econav] a,
html[data-mode="light"] .site-header > .topbar nav.ecosystem-nav[data-fcc-econav] a:visited,
html[data-mode="light"] .site-header > .topbar-content nav.ecosystem-nav[data-fcc-econav] a:visited {
  color: oklch(0.77 0.008 85);
}
html[data-mode="light"] .site-header > .topbar nav.ecosystem-nav[data-fcc-econav] a:hover,
html[data-mode="light"] .site-header > .topbar-content nav.ecosystem-nav[data-fcc-econav] a:hover,
html[data-mode="light"] .site-header > .topbar nav.ecosystem-nav[data-fcc-econav] a:focus-visible,
html[data-mode="light"] .site-header > .topbar-content nav.ecosystem-nav[data-fcc-econav] a:focus-visible {
  color: oklch(0.95 0.008 85);
  background: rgba(255, 255, 255, 0.06);
}
/* Econav scroll arrows + overflow gradients also need to read dark */
html[data-mode="light"] .site-header > .topbar .fcc-econav-scroll-btn,
html[data-mode="light"] .site-header > .topbar-content .fcc-econav-scroll-btn {
  color: oklch(0.77 0.008 85);
  background: oklch(0.16 0.012 260);
}
html[data-mode="light"] .site-header > .topbar .fcc-econav-scroll-btn:hover,
html[data-mode="light"] .site-header > .topbar-content .fcc-econav-scroll-btn:hover {
  color: oklch(0.95 0.008 85);
}

/* Page chrome nested inside .site-header (e.g. news + games .view-tabs
   category filter row) needs a subtle light-wash bg + ensure text is
   readable even if its original styling assumed a dark backdrop.
   Includes `#viewTabs` variants so specificity matches news/static/
   styles.css's own #viewTabs .view-tab[data-active="1"] rule; without
   the ID, their translucent pastel-blue active bg keeps winning. */
html[data-mode="light"] .site-header .view-tabs,
html[data-mode="light"] #viewTabs.view-tabs {
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.12));
}
html[data-mode="light"] .site-header .view-tab,
html[data-mode="light"] .site-header .view-tab:visited,
html[data-mode="light"] #viewTabs .view-tab,
html[data-mode="light"] #viewTabs .view-tab:visited {
  color: var(--text-dim, #5a6370);
  background: transparent;
}
html[data-mode="light"] .site-header .view-tab:hover,
html[data-mode="light"] .site-header .view-tab:focus-visible,
html[data-mode="light"] #viewTabs .view-tab:hover,
html[data-mode="light"] #viewTabs .view-tab:focus-visible {
  color: var(--text, #1a1a1a);
  background: rgba(0, 0, 0, 0.05);
}
html[data-mode="light"] .site-header .view-tab.active,
html[data-mode="light"] .site-header .view-tab[aria-current="page"],
html[data-mode="light"] .site-header .view-tab[aria-selected="true"],
html[data-mode="light"] #viewTabs .view-tab.active,
html[data-mode="light"] #viewTabs .view-tab[aria-current="page"],
html[data-mode="light"] #viewTabs .view-tab[aria-selected="true"],
html[data-mode="light"] #viewTabs .view-tab[data-active="1"] {
  color: var(--text, #1a1a1a);
  background: rgba(0, 0, 0, 0.08);
}
