/* ==========================================================================
   Pollab design kit - base.css
   Shared chrome for every page: design tokens, reset/base, typography
   helpers, buttons + floating action buttons, navbar, footer, reveal
   animations, and the shared share/language popover primitives.
   Load first on every page; add one area stylesheet after it
   (site.css, local.css, or pulse.css).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

/* #28 P7 - one palette with the app.
   NEUTRALS are the Local's two interface choices, with the values the app uses (frontend/ui/src/styles/appearance.css
   is the source; backend/app/themes/public_surfaces_test.go keeps the defaults below equal to it):
     Background tint → --bg (page), --line (hairlines), --field (the boundary of a control)
     Surface family  → --surface (cards, navbar, menus), --ink-1 (text), --bg-soft (soft fills), --ink-3 (quiet text)
   The values here are the defaults (tint "paper", surface "paper"); another choice arrives in the page's style block
   (PrefsCSS), together with the Local's colour.
   BRAND is the Local's colour: --accent (the colour as text and line on the page) and --accent-solid /
   --accent-solid-fg / --accent-solid-hover (a fill with its own text). Without a Local colour the brand is the page's
   own ink, as in the app.
   The names --gold* (the brand as text / line) and --navy* (the neutral solid) are the pollab kit's; they are kept so
   the component rules below did not have to change, and no longer mean a gold or a navy. */

:root,
[data-theme="light"] {
  /* Neutrals (tint "paper" + surface "paper") */
  --bg: hsl(40 33% 98%);
  --line: hsl(35 14% 88%);
  --field: hsl(35 10% 70%);
  --surface: hsl(42 35% 99%);
  --ink-1: hsl(24 10% 10%);
  --bg-soft: hsl(40 24% 95%);
  --ink-3: hsl(25 12% 36%);
  /* Secondary text sits between the two; it follows whatever --ink-1 and --bg are. */
  --ink-2: color-mix(in srgb, var(--ink-1) 78%, var(--bg));

  /* Lines + elevation */
  --border: var(--line);
  --line-soft: color-mix(in srgb, var(--line) 55%, var(--bg));
  --btn-line: var(--field);
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.05), 0 10px 28px rgb(0 0 0 / 0.07);
  --scrim: rgb(0 0 0 / 0.55); /* mobile drawer overlay */
  --ring: var(--ink-1); /* focus outline - AA on every surface */

  /* Brand as text and line (the Local's ink colour, else the page's own ink) */
  --gold: var(--accent, var(--ink-1));
  --gold-2: var(--accent, var(--ink-1));
  --gold-text: var(--accent, var(--ink-1));
  --gold-tint: color-mix(in srgb, var(--gold) 14%, transparent);
  --gold-line: color-mix(in srgb, var(--gold) 55%, transparent);

  /* The neutral solid and what goes on it */
  --navy: var(--ink-1);
  --navy-2: color-mix(in srgb, var(--ink-1) 86%, var(--bg));
  --on-navy: var(--bg);
  --on-gold: var(--bg);

  /* Fills (solid buttons, avatar, category chip): the Local's fill with its own readable text (#28 P6), else the
     neutral solid - black on a light page, near-white on a dark one, as the app's own primary. */
  --solid: var(--accent-solid, var(--navy));
  --on-solid: var(--accent-solid-fg, var(--on-navy));
  --solid-hover: var(--accent-solid-hover, var(--navy-2));

  /* The band (the footer's "band" style): the page inverted - the ink as the surface. */
  --band-bg: var(--ink-1);
  --band-ink: var(--bg);
  --band-ink-2: color-mix(in srgb, var(--bg) 82%, var(--ink-1));
  --band-ink-3: color-mix(in srgb, var(--bg) 66%, var(--ink-1));
  --band-line: color-mix(in srgb, var(--bg) 16%, var(--ink-1));
  --band-btn-line: color-mix(in srgb, var(--bg) 42%, var(--ink-1));
  --band-gold: var(--bg);
  --band-btn-fg: var(--ink-1);
  --band-gold-hover: color-mix(in srgb, var(--bg) 88%, var(--ink-1));
  --band-edge: transparent;

  /* Fonts (body switchable by the reading-font option; display overridable by the heading-font choice) */
  --font-sans: "Inter", "Noto Sans Devanagari", "Noto Sans Telugu", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Lora", "Noto Serif Devanagari", "Noto Serif Telugu", ui-serif, Georgia, serif;

  /* Card radius (the radius choice overrides) */
  --radius: 16px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 160ms;
  --base: 240ms;
}

[data-theme="dark"] {
  /* Neutrals (tint "paper" + surface "paper", dark) */
  --bg: hsl(24 10% 6%);
  --line: hsl(26 8% 16%);
  --field: hsl(26 8% 36%);
  --surface: hsl(18 12% 9%);
  --ink-1: hsl(35 20% 96%);
  --bg-soft: hsl(18 10% 14%);
  --ink-3: hsl(28 12% 70%);

  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.25), 0 10px 28px rgb(0 0 0 / 0.28);

  /* The band in dark is a lifted surface, not an inverted (light) one. */
  --band-bg: var(--surface);
  --band-ink: var(--ink-1);
  --band-ink-2: var(--ink-2);
  --band-ink-3: var(--ink-3);
  --band-line: var(--line);
  --band-btn-line: var(--field);
  --band-gold: var(--ink-1);
  --band-btn-fg: var(--bg);
  --band-gold-hover: var(--ink-2);
  --band-edge: var(--line);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-1);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* #28 P7 - the footer sits at the bottom of the screen on a short page: the page is a column at least one screen
     tall and <main> takes the room that is left (100vh first for browsers without dvh). */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  min-width: 0;
  /* Room between the last thing on the page and the footer (the listings ended right on it). */
  padding-bottom: clamp(32px, 5vw, 56px);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  color: inherit;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--ring); /* F22: was --gold — 1.93:1 on light bg (I5/A1) */
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip-to-content link (F22, A5/A-rules): visually hidden until focused */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background-color: var(--navy);
  color: var(--on-navy);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

::selection {
  background: var(--gold);
  color: var(--accent-fg, var(--bg)); /* #28 P7: without a Local colour, selected text is the page colour on ink */
}

/* Icon system (inline Lucide sprite) */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Layout containers */
.container {
  max-width: calc(1160px * var(--pub-w-scale, 1));
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.container-narrow {
  max-width: calc(800px * var(--pub-w-scale, 1));
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.section {
  padding-block: clamp(72px, 9vw, 120px);
}

.section-alt {
  background-color: var(--surface);
}

/* Navy band sections */
.band {
  background-color: var(--band-bg);
  color: var(--band-ink);
}

/* --------------------------------------------------------------------------
   3. Typography helpers
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-text);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background-color: var(--gold);
}

.band .eyebrow {
  color: var(--band-gold);
}

.band .eyebrow::before {
  background-color: var(--band-gold);
}

.display {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 0.45em;
}

.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  max-width: 20ch;
}

.section-title.centered {
  margin-inline: auto;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.75;
  color: var(--ink-2);
}

.band .lead {
  color: var(--band-ink-2);
}

.text-soft {
  color: var(--ink-2);
}

.text-faint {
  color: var(--ink-3);
}

.text-gold {
  color: var(--gold-text);
}

.text-center {
  text-align: center;
}

.measure {
  max-width: 62ch;
}

.measure-center {
  max-width: 62ch;
  margin-inline: auto;
}

/* Shared editorial primitives (site + local): the base card surface,
   inner-page hero, and pull quote. Moved from site.css in F46 P08 so
   local pages keep their card borders/shadows on the split assets. */
.card {
  background-color: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.page-hero {
  padding-block: clamp(64px, 8vw, 104px) clamp(40px, 5vw, 64px);
  text-align: center;
}

.page-hero .display {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
}

.pull-quote {
  border-left: 2px solid var(--gold);
  padding: 6px 0 6px 26px;
  margin: 36px 0 0;
}

.pull-quote p {
  font-family: "Lora", "Noto Serif Devanagari", "Noto Serif Telugu", ui-serif, Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.55;
  margin: 0;
}

.pull-quote cite {
  display: block;
  font-style: normal;
  font-family: "Inter", "Noto Sans Devanagari", "Noto Sans Telugu", sans-serif;
  font-size: 0.875rem;
  color: var(--ink-3);
  margin-top: 12px;
}

/* Category chip (local cards + pulse cards; links on the local). */
.article-cat {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-text);
}

a.article-cat {
  transition: color var(--fast) var(--ease);
}

a.article-cat:hover {
  color: var(--ink-1);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--pub-btn-rad, 999px);
  box-shadow: var(--pub-btn-shadow, none);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.btn .icon {
  width: 1em;
  height: 1em;
}

/* Solid: the Local's fill colour with its own text; without one, navy on light surfaces and gold in the dark theme
   (#28 P6: --solid / --on-solid / --solid-hover, defined per scheme at the top). */
.btn-solid {
  background-color: var(--solid);
  color: var(--on-solid);
}

.btn-solid:hover {
  background-color: var(--solid-hover);
}

/* Solid inside navy bands: always gold */
.band .btn-solid {
  background-color: var(--band-gold);
  color: var(--band-btn-fg);
}

.band .btn-solid:hover {
  background-color: var(--band-gold-hover);
}

/* Outline */
.btn-outline {
  border-color: var(--btn-line);
  color: var(--ink-1);
  background-color: transparent;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-text);
}

.band .btn-outline {
  border-color: var(--band-btn-line);
  color: var(--band-ink);
}

.band .btn-outline:hover {
  border-color: var(--band-gold);
  color: var(--band-gold);
}

/* Inline text link with arrow */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold-text);
}

.link-more .icon {
  transition: transform var(--fast) var(--ease);
}

.link-more:hover .icon {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   5. Navbar
   -------------------------------------------------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  /* shadow always on (same as the old scrolled state) */
  box-shadow: var(--shadow-1);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
}

.nav-link:hover {
  color: var(--ink-1);
}

.nav-link.active {
  color: var(--ink-1);
  font-weight: 600;
}

.nav-cta {
  margin-left: 10px;
  padding: 11px 24px;
  font-size: 0.9rem;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* Phones: hide the navbar Join / Sign in buttons (still in the drawer) */
@media (max-width: 639px) {
  .nav-actions .btn {
    display: none;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme toggle icon visibility (button itself is a floating .fab) */
[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Floating action buttons (bottom-right): one slot only. The theme
   switcher shows by default; once the page is scrolled far enough it
   fades out and back-to-top fades in in its place (never both at once). */
.fab-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

.fab-stack .theme-toggle {
  display: inline-flex;
  transition:
    opacity var(--base) var(--ease),
    visibility var(--base) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.fab-stack:has(#toTop.show) .theme-toggle {
  opacity: 0;
  visibility: hidden;
}

.fab {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  box-shadow: var(--shadow-1);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.fab:hover {
  border-color: var(--gold);
  color: var(--gold-text);
}

.fab .icon {
  width: 19px;
  height: 19px;
}

#toTop {
  position: absolute;
  right: 0;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--base) var(--ease), visibility var(--base) var(--ease),
    transform var(--base) var(--ease), border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

#toTop.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Mobile menu button */
.menu-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-1);
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }

  .menu-btn {
    display: none;
  }
}

/* Mobile drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: var(--scrim);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--base) var(--ease), visibility var(--base) var(--ease);
}

.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(320px, 86vw);
  background-color: var(--surface);
  border-left: 1px solid var(--line-soft);
  transform: translateX(100%);
  transition: transform var(--base) var(--ease);
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.drawer.show {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-title {
  font-family: "Lora", "Noto Serif Devanagari", "Noto Serif Telugu", ui-serif, Georgia, serif;
  font-size: 1.1rem;
}

.drawer-link {
  display: block;
  padding: 14px 4px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}

.drawer-link.active,
.drawer-link:hover {
  color: var(--ink-1);
}

.drawer .btn {
  margin-top: 24px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--band-line);
}

.footer-main {
  padding-block: clamp(56px, 7vw, 88px);
  display: grid;
  gap: 44px;
}

@media (min-width: 768px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 4fr 2fr 3fr 3fr;
  }
}

.footer-logo-img {
  height: 40px;
  width: auto;
  margin-bottom: 20px;
}

.footer-blurb {
  font-size: 0.92rem;
  color: var(--band-ink-2);
  max-width: 34ch;
}

.footer-title {
  font-family: "Lora", "Noto Serif Devanagari", "Noto Serif Telugu", ui-serif, Georgia, serif;
  font-size: 1.05rem;
  color: var(--band-gold);
  margin-bottom: 20px;
}

.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.footer-menu a {
  font-size: 0.92rem;
  color: var(--band-ink-2);
}

.footer-menu a:hover {
  color: var(--band-gold);
}

.footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.footer-contact li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--band-ink-2);
  line-height: 1.6;
}

.footer-contact .icon {
  width: 17px;
  height: 17px;
  margin-top: 4px;
  color: var(--band-gold);
}

.footer-contact a:hover {
  color: var(--band-gold);
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--band-line);
  color: var(--band-ink-2);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.social-link:hover {
  border-color: var(--band-gold);
  color: var(--band-gold);
}

.social-link .icon {
  width: 17px;
  height: 17px;
}

.footer-bottom {
  border-top: 1px solid var(--band-line);
  padding-block: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--band-ink-3);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-bottom a {
  color: var(--band-ink-2);
}

.footer-bottom a:hover {
  color: var(--band-gold);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   7. Minimal footer (local + account pages)
   Compact single-row footer; .footer-bare variant is transparent and
   centered for auth/account pages.
   -------------------------------------------------------------------------- */

/* The footer (#28 P7). One layout: the Local's name and tagline with the site's links beside them, then a base line
   (copyright, credit). Three styles - Settings → Interface → Public site → Footer style - only choose five colours:
   band  = the page inverted (a lifted surface in the dark theme);
   brand = the Local's fill colour with its own text (the same as band for a Local without a colour);
   plain = the page itself, with a hairline above.
   It sits at the bottom of the screen on a short page (body is a column, <main> grows - see "2. Base"). */
.footer-min {
  --fm-bg: var(--band-bg);
  --fm-ink: var(--band-ink);
  --fm-ink-2: var(--band-ink-2);
  --fm-ink-3: var(--band-ink-3);
  --fm-line: var(--band-line);
  flex: none;
  background-color: var(--fm-bg);
  color: var(--fm-ink);
  /* In the dark theme the band is only a little lighter than the page: a hairline marks its edge. */
  border-top: 1px solid var(--band-edge);
}

.footer-min.footer-brand {
  border-top-color: transparent;
  --fm-bg: var(--solid);
  --fm-ink: var(--on-solid);
  /* Text on a colour keeps its full contrast: the levels differ by size and weight, not by fading. */
  --fm-ink-2: var(--on-solid);
  --fm-ink-3: var(--on-solid);
  --fm-line: color-mix(in srgb, var(--on-solid) 24%, var(--solid));
}

.footer-min.footer-plain {
  --fm-bg: transparent;
  --fm-ink: var(--ink-1);
  --fm-ink-2: var(--ink-2);
  --fm-ink-3: var(--ink-3);
  --fm-line: var(--line-soft);
  border-top: 1px solid var(--border);
}

.fm-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 40px;
  padding-block: clamp(26px, 4vw, 40px) clamp(20px, 3vw, 28px);
}

.fm-brand {
  min-width: 0;
  max-width: 46ch;
}

.fm-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--fm-ink);
  overflow-wrap: anywhere;
}

.fm-tagline {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fm-ink-2);
  overflow-wrap: anywhere;
}

.fm-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  font-size: 0.9rem;
}

.fm-links a {
  color: var(--fm-ink-2);
  padding-block: 6px; /* a comfortable tap target on a phone */
}

.fm-links a:hover {
  color: var(--fm-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fm-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 18px;
  padding-block: 14px 18px;
  border-top: 1px solid var(--fm-line);
  font-size: 0.8rem;
  color: var(--fm-ink-3);
}

/* On a phone the two base lines stack on the left: the floating buttons (light / dark, back to top) sit in the
   bottom right corner and must not cover them. */
@media (max-width: 640px) {
  .fm-base {
    flex-direction: column;
    align-items: flex-start;
    padding-inline-end: 64px;
  }
}

/* --------------------------------------------------------------------------
   8. Reveal on scroll + reduced motion
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.on {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   9. Shared share + language popover primitives (F38)
   Core pieces used by content areas (local articles, pulse cards): the share
   popover, its toast, and the language switcher pills. Area-specific
   placement tweaks live in local.css / pulse.css.
   -------------------------------------------------------------------------- */

.share-wrap {
  position: relative;
  display: inline-flex;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--btn-line);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.share-btn:hover {
  border-color: var(--gold-line);
  color: var(--gold-text);
}

.share-btn .icon {
  width: 14px;
  height: 14px;
}

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 200px;
  padding: 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}

.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-1);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.share-item:hover {
  background-color: var(--gold-tint);
  color: var(--gold-text);
}

.share-item .icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.share-item:hover .icon {
  color: var(--gold-text);
}

.share-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 9px 18px;
  border-radius: 999px;
  background-color: var(--band-bg);
  color: var(--band-ink);
  border: 1px solid var(--band-line);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-1);
}

/* Language switcher pills */
.lang-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.lang-row-center {
  justify-content: center;
}

.lang-icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.lang-pill {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--pub-btn-rad, 999px);
  padding: 5px 14px;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.lang-pill:hover {
  border-color: var(--gold-line);
  color: var(--gold-text);
}

.lang-pill.active {
  border-color: var(--gold-line);
  background-color: var(--gold-tint);
  color: var(--gold-text);
}

