/* ================================================================
 * The African Health Sentinel — Stylesheet
 * H4D publication, powered by EvolveChain Healthcare
 * ----------------------------------------------------------------
 * v16 (5 May 2026) — Africa pattern wash production tune:
 *   - body::before opacity dropped from 0.90 (v15 diagnostic) to
 *     0.50. The v15 diagnostic confirmed the earlier 0.10 setting
 *     was below visual threshold on a near-white background — the
 *     map was rendering correctly all along, just imperceptibly.
 *   - 0.50 is an interim production value following Matt's visual
 *     review at 0.90. May tune further once seen in context with
 *     landing v10 (which removes the cover-section grey wash and
 *     white tile boxes, allowing the silhouette to show through
 *     more of the page).
 *   - All other rules unchanged from v14/v15.
 *
 * v15 (5 May 2026) — opacity diagnostic on Africa pattern wash:
 *   - body::before opacity raised from 0.10 -> 0.90 as a deliberate
 *     diagnostic. v14 set 10% opacity but the silhouette has been
 *     reported invisible across desktop sessions. File presence and
 *     HTTP serve confirmed (39.8 KB, HTTP/2 200), so the failure
 *     mode is either: (a) 10% Celtic Green on near-white is below
 *     visual threshold, or (b) a stacking / section-background
 *     issue covering the centred shape. 90% will resolve which.
 *   - This is a TEST value. After visual confirmation, opacity
 *     should be tuned back down to a sensible production value
 *     (likely 0.15-0.25 depending on what 90% reveals).
 *   - All other rules unchanged from v14.
 *
 * v14 (29 April 2026) — fixes after v13 visual review:
 *   - Footer logo: removed white pillbox background from .footer-mark
 *     class. The class was previously designed to wrap a white version
 *     of the logo on a white pillbox; now that we use the green/grey
 *     full lockup directly on dark-grey footer, the white background
 *     was creating an unwanted white box around the logo.
 *   - Africa background pattern wash: repositioned and resized for
 *     proper visibility per Approach A. Now centred in viewport at
 *     ~70% viewport height, fixed position, 10% opacity. Was previously
 *     anchored to right side at 36vw width, which kept it small and
 *     mostly off-screen.
 *
 * v13 (29 April 2026) — fixes after v12 visual review:
 *   - Footer H4D logo: revert to full SVG lockup at 40px (icon-footer.png
 *     had a baked-in white background that showed on dark grey footer).
 *   - Africa silhouette pattern wash promoted from hero-only to global
 *     fixed body background. Visible across every page (landing, gate,
 *     archive, subscribe, legal pages). Opacity bumped to 10% for
 *     visibility, anchored to right side of viewport so densest content
 *     areas have clean background.
 *
 * v12 (29 April 2026) — three small fixes after v11 visual review:
 *   - Footer H4D logo: drop the brightness/invert filter (was destroying
 *     colour information), bump height from 32px to 60px, to match parent
 *     site's footer treatment using icon-footer.png (h4 mark only, no
 *     wordmark — see base.html v7).
 *   - No structural changes; fix-only follow-up to v11.
 *
 * v11 (29 April 2026) — visual alignment with health4development.com
 *   Masthead refactor:
 *     - Background changed from Celtic Green to white
 *     - H4D logo lockup now sits directly on white (no white pill)
 *     - Logo height bumped from 36px to 50px for visual parity
 *     - Masthead height bumped from 72px to 90px (mobile 56→64)
 *     - H4D logo and Sentinel wordmark are now SEPARATE anchors
 *       (H4D → health4development.com, Sentinel → /)
 *     - Vertical divider rule between H4D logo and Sentinel wordmark
 *     - Nav expanded to 4 items: Sentinel Home / Archive / Subscribe /
 *       Health 4 Development → (last item opens parent site in new tab)
 *     - All-caps nav with 0.12em letter-spacing matching parent site
 *   New mobile hamburger drawer (visible <720px):
 *     - Right-aligned hamburger button replaces hidden desktop nav
 *     - Slide-from-right drawer with 4-item nav
 *     - Tap-outside / Esc / link-tap all close drawer
 *     - Body scroll locked while drawer open
 *   No changes to story-type pills, typography tokens, palette,
 *   or any other design system primitive — the brand foundation
 *   established in v3-v10 remains intact.
 *
 * v10 (29 April 2026) — promote pricing-grid CSS to global
 *   The .plan / .pricing__grid pattern was previously defined
 *   inline in landing.html only. With subscribe.html v3 also
 *   needing the three-card pricing grid, the rules are now
 *   promoted to a new PRICING section in this stylesheet.
 *   Rules are byte-identical to landing.html's inline version
 *   except for the responsive breakpoint, which uses the
 *   project-wide 980px breakpoint already used elsewhere here.
 *   landing.html v3 and subscribe.html v3 deploy together with
 *   this v10. The inline CSS in landing.html v3 is reduced
 *   accordingly.
 *
 * v9 (26 April 2026) — category-key list column alignment fix
 *   v8 fixed pill row spacing but the four description columns still
 *   started at different x-coordinates because `auto 1fr` sized
 *   column 1 to each pill's individual width (Announcement is much
 *   wider than Action). v9 fixes column 1 to a 140px lane wide enough
 *   for the longest pill, so all four descriptions begin at the same
 *   vertical line and there's a consistent gutter between pill and text.
 *
 * v8 (26 April 2026) — category-key list spacing and bullet fix
 *   v7's grid layout fixed pill/description column alignment, but two
 *   small issues remained: (a) pills were vertically crowding each other
 *   because per-row padding was too tight against pill height, and
 *   (b) the default browser <ul> bullets were rendering to the left of
 *   each pill. v8 increases row padding, vertical-centres the pill
 *   against the description's first line, and removes the <ul>
 *   list-style and indent.
 *
 * v7 (26 April 2026) — category-key-list pill alignment fix
 *   In the embedded briefing's "About these categories" block, when a
 *   pill description wraps to a second line, the wrap was sliding
 *   underneath the pill instead of staying aligned to the pill's first
 *   line. Switched .category-key-list li to a two-column grid layout
 *   (auto 1fr) — same pattern as .story-li below. Pill stays in column
 *   one; description and any wrapping stays in column two.
 *
 * v6 (26 April 2026) — embedded-briefing footer leak fix
 *   The static-HTML briefing files written by generate_briefing_commercial.py
 *   (v5 and earlier) emit their own <style> block containing a
 *   `.footer { background: #41A336; ... }` rule. When app.py's
 *   strip_briefing_wrapper() preserves that <style> block and injects it
 *   into gate.html, the rule leaks out of #briefing-container and
 *   overrides the global page-footer background. v6 bumps the page-footer
 *   selector specificity and hides the duplicate inner footer that the
 *   embedded briefing also carries. See bottom of file.
 *
 * v5 (26 April 2026) — Claude Design integration (Watch #66)
 *   New design system from `colors_and_type.css` is the foundation.
 *   "Legacy preserved" section at the bottom carries the live v3
 *   rules that the existing webapp templates (gate.html, archive.html,
 *   subscribe.html, terms.html, privacy.html, error.html) still
 *   reference, plus the .embedded-briefing and .story-pill rules
 *   used by content injected via strip_briefing_wrapper().
 *
 * v3 (22 Apr 2026) was the previous live version — H4D rebrand of
 * the original EvolveChain teal/navy/gold palette.
 * v4 was documented but never deployed (no dark-mode @media block
 * is present in production). Watch #51 dark-mode hardening
 * remains open for Yolanda's Phase 6 review.
 * ================================================================ */

:root {
  /* ---- BRAND PALETTE — exact, mandatory ---- */
  --celtic-green:     #41A336;  /* primary brand: masthead, primary CTAs */
  --dark-green:       #007337;  /* headings, links, "why this matters" italic, rules */
  --dark-grey:        #494949;  /* body text, headlines (NEVER pure black) */
  --light-grey:       #7B7B7B;  /* captions, metadata, category tags */
  --light-bg:         #E7E6E6;  /* section backgrounds, callout blocks */
  --white:            #FFFFFF;

  /* ---- STORY-TYPE PILLS ---- */
  --pill-announcement-bg:   #FCC551;
  --pill-announcement-fg:   #494949;
  --pill-action-bg:         #6E4022;
  --pill-action-fg:         #FFFFFF;
  --pill-opportunity-bg:    #ED7103;
  --pill-opportunity-fg:    #FFFFFF;
  --pill-insight-bg:        #761753;
  --pill-insight-fg:        #FFFFFF;

  /* ---- SEMANTIC ---- */
  --fg-primary:    var(--dark-grey);
  --fg-heading:    var(--dark-green);
  --fg-meta:       var(--light-grey);
  --fg-link:       var(--dark-green);
  --bg-page:       var(--white);
  --bg-section:    var(--light-bg);
  --rule:          #D9D9D9;          /* 1px dividers between cards/list items */
  --rule-strong:   var(--celtic-green);

  /* ---- TYPOGRAPHY ---- */
  --font-stack: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* type scale — desktop / mobile via clamp */
  --fs-hero:        clamp(36px, 5vw, 56px);   /* hero H1 */
  --fs-page-title:  clamp(28px, 3.6vw, 40px); /* briefing date */
  --fs-cat-banner:  clamp(24px, 2.6vw, 32px); /* category banner */
  --fs-headline:    clamp(20px, 1.9vw, 24px); /* full-card headline */
  --fs-headline-sm: clamp(17px, 1.5vw, 18px); /* list-form headline */
  --fs-subhead:     clamp(18px, 1.6vw, 20px);
  --fs-body:        16px;                     /* same on mobile */
  --fs-meta:        14px;
  --fs-pill:        12px;
  --fs-pill-sm:     10px;

  --lh-tight: 1.3;
  --lh-body:  1.6;

  --weight-regular:  400;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ---- SPACING ---- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  80px;

  /* ---- LAYOUT ---- */
  --reader-max:    720px;          /* web reader content width */
  --page-max:      1180px;         /* landing page content width */
  --email-max:     600px;
  --masthead-h:    90px;        /* v11: bumped from 72px for parent-site parity */
  --masthead-h-mobile: 64px;    /* v11: bumped from 56px */

  /* ---- FOCUS ---- */
  --focus-ring: 0 0 0 2px var(--dark-green);
}

/* ================================================================
 * BASE
 * ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fg-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* v16: Global Africa silhouette pattern wash.
   Fixed position, 70% viewport height, 50% opacity. Tuned down from
   the v15 0.90 diagnostic now that visibility is confirmed. Sits
   behind all content via z-index. Hidden on mobile (<980px). */
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 70vh;
  width: 70vh;     /* maintain aspect-ratio approximating square */
  background: url("/static/icons/africa_map.png") no-repeat center / contain;
  opacity: 0.50;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}
@media (max-width: 980px) {
  body::before { display: none; }
}

/* Ensure all primary content stacks above the body background pattern */
.masthead, main, .footer {
  position: relative;
  z-index: 1;
}

a {
  color: var(--fg-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--dark-green); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--weight-bold);
  line-height: var(--lh-tight);
  color: var(--dark-grey);
}

p { margin: 0; }

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; cursor: pointer; }

/* ================================================================
 * SEMANTIC TYPE CLASSES
 * ================================================================ */

.t-hero        { font-size: var(--fs-hero); font-weight: 700; line-height: 1.1; color: var(--dark-grey); letter-spacing: -0.01em; }
.t-page-title  { font-size: var(--fs-page-title); font-weight: 700; color: var(--dark-grey); line-height: 1.15; }
.t-cat-banner  { font-size: var(--fs-cat-banner); font-weight: 700; color: var(--dark-green); line-height: 1.2; }
.t-headline    { font-size: var(--fs-headline); font-weight: 700; color: var(--dark-grey); line-height: var(--lh-tight); }
.t-headline-sm { font-size: var(--fs-headline-sm); font-weight: 700; color: var(--dark-grey); line-height: var(--lh-tight); }
.t-subhead     { font-size: var(--fs-subhead); font-weight: 600; color: var(--dark-grey); line-height: 1.3; }
.t-body        { font-size: var(--fs-body); font-weight: 400; color: var(--dark-grey); line-height: var(--lh-body); }
.t-why         { font-size: var(--fs-body); font-weight: 400; font-style: italic; color: var(--dark-green); line-height: var(--lh-body); }
.t-meta        { font-size: var(--fs-meta); font-weight: 400; color: var(--light-grey); line-height: 1.4; }
.t-eyebrow     { font-size: var(--fs-meta); font-weight: 700; color: var(--dark-green); letter-spacing: 0.12em; text-transform: uppercase; }
.t-tag         { font-size: var(--fs-meta); font-weight: 600; color: var(--light-grey); letter-spacing: 0.08em; text-transform: uppercase; }

/* ================================================================
 * STORY-TYPE PILLS (new design — used in landing/briefing/email surfaces)
 * Note: legacy `.story-pill` rules also preserved at the bottom for
 * the embedded-briefing content injected by strip_briefing_wrapper().
 * ================================================================ */
.pill {
  display: inline-block;
  padding: 4px 10px;
  font-size: var(--fs-pill);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 0;
}
.pill--sm { font-size: var(--fs-pill-sm); padding: 3px 8px; }
.pill--announcement { background: var(--pill-announcement-bg); color: var(--pill-announcement-fg); }
.pill--action       { background: var(--pill-action-bg);       color: var(--pill-action-fg); }
.pill--opportunity  { background: var(--pill-opportunity-bg);  color: var(--pill-opportunity-fg); }
.pill--insight      { background: var(--pill-insight-bg);      color: var(--pill-insight-fg); }

/* ================================================================
 * BUTTONS
 * ================================================================ */
.btn {
  display: inline-block;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  border-radius: 2px;
  text-align: center;
  text-decoration: none !important;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary    { background: var(--celtic-green); color: var(--white); border-color: var(--celtic-green); }
.btn--primary:hover { background: var(--dark-green); border-color: var(--dark-green); }
.btn--outline    { background: transparent; color: var(--dark-green); border-color: var(--dark-green); }
.btn--outline:hover { background: var(--dark-green); color: var(--white); }
.btn--invert     { background: var(--white); color: var(--dark-green); border-color: var(--white); }
.btn--invert:hover { background: var(--light-bg); }
.btn--lg         { padding: 16px 28px; font-size: 16px; }

/* Legacy alias buttons — preserved for templates that still reference
   .btn-primary / .btn-secondary (gate.html submit, subscribe.html CTA).
   These map to the new visual language. */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--celtic-green);
  color: var(--white);
  border: 2px solid var(--celtic-green);
  border-radius: 2px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary:hover { background: var(--dark-green); border-color: var(--dark-green); text-decoration: none; }

.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--white);
  color: var(--dark-green);
  border: 2px solid var(--dark-green);
  border-radius: 2px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--dark-green); color: var(--white); text-decoration: none; }

/* ================================================================
 * MASTHEAD (shared) — v11
 * White background masthead matching health4development.com.
 * H4D logo links to parent site; Sentinel wordmark links to /.
 * Logo size and masthead height match parent site for visual parity.
 * Nav items are all-caps with letter-spacing per parent site.
 * ================================================================ */
.masthead {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  height: var(--masthead-h);
  display: flex;
  align-items: center;
}
.masthead__inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand container — holds the two separate links */
.masthead__brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* H4D logo link — opens parent site in new tab */
.masthead__h4d-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.masthead__h4d-logo {
  height: 50px;
  width: auto;
  display: block;
}

/* Sentinel wordmark link — goes to Sentinel home */
.masthead__sentinel-link {
  text-decoration: none;
  color: var(--dark-grey);
  border-left: 1px solid var(--rule);
  padding-left: 20px;
}
.masthead__sentinel-link:hover .masthead__brand-text {
  color: var(--dark-green);
}
.masthead__brand-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--dark-grey);
  transition: color 0.15s ease;
}

/* Right-side nav — all-caps to match parent site */
.masthead__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.masthead__nav a {
  color: var(--dark-grey);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.masthead__nav a:hover {
  color: var(--dark-green);
}
.masthead__nav .nav-link--external::after {
  content: " \2192";       /* right-arrow character */
  display: inline-block;
  margin-left: 4px;
  font-weight: 400;
}
.masthead__nav .btn--invert { padding: 10px 18px; }

/* Mobile breakpoint for masthead */
@media (max-width: 720px) {
  .masthead { height: var(--masthead-h-mobile); }
  .masthead__inner { padding: 0 16px; gap: 12px; }
  .masthead__nav { display: none; }
  .masthead__h4d-logo { height: 36px; }
  .masthead__sentinel-link {
    padding-left: 12px;
  }
  .masthead__brand-text { font-size: 13px; }
  .masthead__brand { gap: 12px; }
}

/* ================================================================
 * MOBILE HAMBURGER MENU — v11
 * Visible only on mobile (<720px). Slides in from the right with
 * smooth animation. Tap outside or on a link to dismiss.
 * ================================================================ */

/* Hamburger button — hidden on desktop, visible on mobile */
.masthead__hamburger {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--dark-grey);
  margin-left: auto;
}
.masthead__hamburger:hover { color: var(--dark-green); }
.masthead__hamburger svg { display: block; width: 24px; height: 24px; }
.masthead__hamburger:focus-visible {
  outline: 2px solid var(--dark-green);
  outline-offset: 2px;
}

/* Drawer overlay — full-screen dim layer behind the drawer */
.masthead__drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 998;
}
.masthead__drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Drawer panel — slides in from right */
.masthead__drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--white);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.masthead__drawer.is-open {
  transform: translateX(0);
}

/* Close button inside drawer */
.masthead__drawer-close {
  align-self: flex-end;
  background: none;
  border: none;
  padding: 8px 24px;
  cursor: pointer;
  color: var(--dark-grey);
  font-size: 24px;
  line-height: 1;
}
.masthead__drawer-close:hover { color: var(--dark-green); }
.masthead__drawer-close:focus-visible {
  outline: 2px solid var(--dark-green);
  outline-offset: 2px;
}

/* Drawer nav items */
.masthead__drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
}
.masthead__drawer-nav a {
  color: var(--dark-grey);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.masthead__drawer-nav a:hover,
.masthead__drawer-nav a:focus-visible {
  color: var(--dark-green);
  background: var(--light-bg);
  border-left-color: var(--celtic-green);
  outline: none;
}
.masthead__drawer-nav .nav-link--external::after {
  content: " \2192";
  margin-left: 4px;
  font-weight: 400;
}

/* Body lock when drawer is open */
body.drawer-open {
  overflow: hidden;
}

/* Mobile activation — show hamburger */
@media (max-width: 720px) {
  .masthead__hamburger { display: inline-flex; align-items: center; }
}

/* ================================================================
 * FOOTER (shared)
 * ================================================================ */
.footer {
  background: var(--dark-grey);
  color: var(--white);
}
.footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 56px 24px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
}
.footer h4 { color: var(--white); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; }
.footer p, .footer li { color: rgba(255,255,255,0.78); font-size: 14px; line-height: 1.6; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: rgba(255,255,255,0.95); }
.footer__brand img { height: 40px; margin-bottom: 16px; }
.footer__legal {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 24px;
  padding: 18px 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
}

/* Footer logo lockup — sits directly on dark-grey footer (no pillbox). */
.footer-mark {
  display: inline-block;
  margin-bottom: 14px;
}
.footer-mark img { height: 40px; width: auto; display: block; }

/* "Sign out on this device" form, styled to match other footer links.
   Renders only when has_remember_cookie is truthy in base.html. */
.footer-signout-form {
  display: inline;
  margin: 0;
  padding: 0;
}
.footer-signout-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.95);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.footer-signout-btn:hover { text-decoration: none; }

@media (max-width: 820px) {
  .footer__inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 16px 16px; }
}

/* ================================================================
 * STORY CARD — full variant (highlights & lead stories)
 * ================================================================ */
.story {
  padding: 32px 0;
  border-left: 2px solid transparent;
  padding-left: 0;
  transition: border-color .15s ease, padding-left .15s ease;
}
.story + .story { border-top: 1px solid var(--rule); }
.story:hover {
  border-left-color: var(--celtic-green);
  padding-left: 16px;
}
.story__tagrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.story__headline {
  font-size: var(--fs-headline);
  font-weight: 700;
  color: var(--dark-grey);
  line-height: var(--lh-tight);
  margin-bottom: 14px;
  text-wrap: pretty;
}
.story__summary { margin-bottom: 14px; }
.story__why {
  font-style: italic;
  color: var(--dark-green);
  margin-bottom: 16px;
  text-wrap: pretty;
}
.story__why::before {
  content: "Why this matters — ";
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dark-green);
  display: block;
  margin-bottom: 4px;
}
.story__source {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-meta);
  color: var(--light-grey);
}
.story__source strong { color: var(--dark-grey); font-weight: 600; }
.story__source a { color: var(--dark-green); font-weight: 600; }
.story__source .dot { color: var(--rule); }

/* List-form variant */
.story-li {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}
.story-li:first-of-type { border-top: 1px solid var(--rule); }
.story-li__pill { padding-top: 2px; }
.story-li__body { min-width: 0; }
.story-li__headline {
  font-size: var(--fs-headline-sm);
  font-weight: 700;
  color: var(--dark-grey);
  line-height: var(--lh-tight);
  margin-bottom: 6px;
}
.story-li__stand { font-size: 16px; color: var(--dark-grey); margin-bottom: 8px; }
.story-li__source { font-size: var(--fs-meta); color: var(--light-grey); }
.story-li__source a { color: var(--dark-green); font-weight: 600; }

/* ================================================================
 * CATEGORY BANNER (web reader)
 * ================================================================ */
.cat-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.cat-banner__title { font-size: var(--fs-cat-banner); color: var(--dark-green); font-weight: 700; }
.cat-banner__count { font-size: 14px; color: var(--light-grey); }
.cat-rule {
  height: 2px;
  width: 60%;
  background: var(--celtic-green);
  margin: 0 0 12px 0;
}

/* ================================================================
 * UTILITIES
 * ================================================================ */
.container { max-width: var(--page-max); margin: 0 auto; padding: 0 24px; }
.reader    { max-width: var(--reader-max); margin: 0 auto; padding: 0 24px; }
.section   { padding: 80px 0; }
.section--tight { padding: 56px 0; }
.section--bg    { background: var(--bg-section); }

@media (max-width: 720px) {
  .section { padding: 48px 0; }
  .container, .reader { padding: 0 16px; }
}

main { padding: 40px 0 60px; }


/* ================================================================
 * PRICING (landing & subscribe pages)
 *
 * Three-card pricing grid used by:
 *   - landing.html  (Free / Professional / Team)
 *   - subscribe.html (Professional / Team / Enterprise)
 *
 * Modern token-based design — uses brand variables defined at top.
 * Promoted from landing.html's inline <style> in v10 so subscribe.html
 * can reuse the same visual language without duplicating CSS.
 * ================================================================ */

.pricing__head { text-align: center; margin-bottom: 40px; }
.pricing__head h2 { font-size: var(--fs-cat-banner); color: var(--dark-green); margin-bottom: 8px; }
.pricing__head p { color: var(--light-grey); }

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.plan {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.plan--featured { border: 2px solid var(--celtic-green); }

.plan__badge {
  position: absolute;
  top: -12px;
  left: 28px;
  background: var(--celtic-green);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  text-transform: uppercase;
}

.plan h3 { font-size: 20px; color: var(--dark-green); margin-bottom: 8px; }
.plan__price { font-size: 36px; color: var(--dark-green); font-weight: 700; line-height: 1; margin-top: 8px; }
.plan__cycle { font-size: 14px; color: var(--light-grey); margin-top: 6px; }
.plan__cycle .save { color: var(--celtic-green); font-weight: 700; }

.plan__bestfor {
  font-size: 14px;
  color: var(--dark-grey);
  font-style: italic;
  margin: 16px 0 16px;
  line-height: 1.5;
}

.plan__hr { height: 1px; background: var(--rule); margin: 0 0 16px; border: 0; }

.plan__features {
  font-size: 14px;
  color: var(--dark-grey);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 24px;
}

.plan .btn { width: 100%; }

.pricing__seats {
  text-align: center;
  font-size: 14px;
  color: var(--light-grey);
  margin-top: 28px;
}

@media (max-width: 980px) {
  .pricing__grid { grid-template-columns: 1fr; }
}


/* ================================================================
 * ================================================================
 *                    LEGACY PRESERVED
 *
 * Rules below are kept verbatim (or lightly retoned to brand) from
 * style.css v3. They support templates and content that we are NOT
 * redesigning in this v5 integration:
 *   - gate.html (gate card, trial banner, paywall states)
 *   - archive.html (archive list)
 *   - subscribe.html (subscribe hero, FAQ, single-card pricing)
 *   - terms.html / privacy.html (legal-page styling)
 *   - error.html (404/500)
 *   - .embedded-briefing — content injected by strip_briefing_wrapper()
 *     in app.py, rendered inside gate.html's #briefing-container
 *   - .story-pill — pills inside the embedded briefing content
 *   - .category-key, .category-grid, .how-to-read — landing-page
 *     "How to read the briefing" four-pill grid (legacy landing
 *     section preserved for now; redesign in a later session)
 *
 * These rules use the new H4D tokens (--dark-green, --dark-grey,
 * --light-bg, --celtic-green, --light-grey, etc.) so they remain
 * visually coherent with the new design.
 * ================================================================
 * ================================================================ */

/* --- Legacy palette aliases — preserved so v3 selectors still resolve --- */
:root {
  --h4d-celtic-green:      var(--celtic-green);
  --h4d-dark-green:        var(--dark-green);
  --h4d-dark-green-hover:  #004D24;
  --h4d-dark-grey:         var(--dark-grey);
  --h4d-warm-gold:         #FCC551;
  --h4d-body-text:         var(--dark-grey);
  --h4d-light-bg:          var(--light-bg);
  --grey-100:              #F7F7F7;
  --grey-200:              #E5E5E5;
  --grey-400:              #999999;
  --grey-600:              #666666;
  --radius:                8px;
  --shadow:                0 2px 8px rgba(0,0,0,0.08);
}

/* --- Legacy gate page --- */
.gate-card, .free-card {
  max-width: 520px;
  margin: 40px auto;
  background: var(--h4d-light-bg);
  padding: 40px 36px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.gate-card h2, .free-card h2 {
  color: var(--h4d-dark-grey);
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.gate-card p, .free-card > p {
  color: var(--grey-600);
  margin-bottom: 20px;
}

.gate-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.gate-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 12px 16px;
  border: 2px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.gate-form input[type="email"]:focus { border-color: var(--h4d-dark-green); }

.gate-error { color: #c0392b; font-size: 0.9rem; }

.gate-note { font-size: 0.85rem; color: var(--grey-400); margin-top: 16px; }

/* --- Free Tier / Paywall Prompt (gate.html) --- */
.free-card .highlights-list {
  text-align: left;
  margin: 20px 0;
}

.paywall-prompt {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--grey-200);
}

.paywall-prompt h3 { color: var(--h4d-dark-grey); margin-bottom: 8px; }
.paywall-prompt p { color: var(--grey-600); margin-bottom: 16px; }

.trial-note { font-size: 0.85rem; color: var(--grey-400); margin-top: 8px; }

.highlights-list { display: flex; flex-direction: column; gap: 16px; }

.highlight-item {
  padding: 16px 20px;
  border-left: 4px solid var(--h4d-dark-green);
  background: var(--grey-100);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.highlight-headline {
  font-weight: 600;
  color: var(--h4d-dark-grey);
  line-height: 1.45;
}

.highlight-source {
  font-size: 0.85rem;
  color: var(--grey-400);
  font-style: italic;
  margin-top: 4px;
}

/* --- Legacy archive --- */
.archive-section h2 {
  color: var(--h4d-dark-grey);
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.archive-section > p { color: var(--grey-600); margin-bottom: 24px; }

.archive-list { display: flex; flex-direction: column; gap: 8px; }

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--grey-100);
  border-radius: var(--radius);
  color: var(--h4d-dark-grey);
  font-weight: 500;
  transition: background 0.15s;
}

.archive-item:hover { background: var(--h4d-light-bg); text-decoration: none; }

.archive-arrow { color: var(--h4d-dark-green); font-size: 1.2rem; }

.no-content { color: var(--grey-400); font-style: italic; }

/* --- Legacy subscribe page --- */
.subscribe-hero {
  text-align: center;
  margin-bottom: 40px;
}

.subscribe-hero h2 { color: var(--h4d-dark-grey); font-size: 1.8rem; margin-bottom: 12px; }
.subscribe-hero p { color: var(--grey-600); max-width: 600px; margin: 0 auto; }

.faq { max-width: 640px; margin: 48px auto 0; }
.faq h2 { color: var(--h4d-dark-grey); margin-bottom: 24px; font-size: 1.5rem; }

.faq-item { margin-bottom: 24px; }
.faq-item h3 { color: var(--h4d-dark-grey); font-size: 1.05rem; margin-bottom: 6px; }
.faq-item p { color: var(--grey-600); }

.pricing-section { margin-bottom: 48px; }

.pricing-section h2 {
  text-align: center;
  color: var(--h4d-dark-grey);
  margin-bottom: 32px;
  font-size: 1.5rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--h4d-dark-green);
  box-shadow: var(--shadow);
}

.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--h4d-dark-green);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 16px;
  border-radius: 20px;
}

.pricing-card h3 { color: var(--h4d-dark-grey); font-size: 1.3rem; margin-bottom: 8px; }

.price {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--h4d-dark-grey);
  margin-bottom: 4px;
}
.price span { font-size: 1rem; font-weight: 400; color: var(--grey-600); }

.price-detail { font-size: 0.85rem; color: var(--grey-400); margin-bottom: 20px; }

.pricing-card ul {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
}

.pricing-card li {
  padding: 6px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--grey-100);
}

.pricing-card li.muted { color: var(--grey-400); }

.card-note { font-size: 0.8rem; color: var(--grey-400); margin-top: 10px; }

/* --- Legacy legal pages (terms.html, privacy.html) --- */
.legal-page { max-width: 720px; }

.legal-page h2 {
  color: var(--h4d-dark-grey);
  margin-bottom: 4px;
  font-size: 1.5rem;
}

.legal-updated {
  color: var(--grey-400);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.legal-page h3 {
  color: var(--h4d-dark-grey);
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.legal-page p { margin-bottom: 12px; }

/* --- Legacy error page --- */
.error-page {
  text-align: center;
  padding: 60px 0;
}

.error-page h2 { font-size: 3rem; color: var(--h4d-dark-grey); margin-bottom: 12px; }
.error-page p { color: var(--grey-600); margin-bottom: 24px; }

/* --- Embedded-briefing container ---
   The injected briefing HTML (after strip_briefing_wrapper in app.py)
   is wrapped in <div class="embedded-briefing"> ... </div>. This rule
   constrains its width and resets default margins. */
#briefing-container {
  max-width: var(--max-width, 880px);
  margin: 0 auto;
  padding: 20px 0;
}
.embedded-briefing { max-width: 880px; margin: 0 auto; }

/* --- Story-type pills inside the embedded briefing ---
   These are the .story-pill rules used by HTML emitted by
   generate_briefing_commercial.py. They are visually equivalent to
   the new design's .pill rules but use the legacy class names so
   we don't need to rewrite the generator's pill output. */
.story-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 10px;
  vertical-align: 2px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: help;
}
.story-pill-announcement { background: #FCC551; color: #494949; }
.story-pill-action       { background: #6E4022; color: #FFFFFF; }
.story-pill-opportunity  { background: #ED7103; color: #FFFFFF; }
.story-pill-insight      { background: #761753; color: #FFFFFF; }

/* --- Category key block (collapsible, lives inside the injected briefing) --- */
.category-key {
  background: var(--grey-100);
  border-radius: var(--radius);
  padding: 14px 22px;
  margin: 16px 0 24px;
}
.category-key summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--h4d-dark-grey);
  list-style: none;
  position: relative;
  padding-right: 24px;
  font-size: 0.95rem;
}
.category-key summary::-webkit-details-marker { display: none; }
.category-key summary::after {
  content: "\25B8";
  position: absolute;
  right: 0;
  top: 0;
  transition: transform 0.2s;
  color: var(--grey-400);
}
.category-key[open] summary::after { transform: rotate(90deg); }
.category-key-list {
  list-style: none;
  margin: 12px 0 0 0;
  padding: 0;
}
.category-key-list li {
  /* v9: column 1 has fixed 140px width — wide enough for the longest
     pill text ("ANNOUNCEMENT") with its padding. This makes all four
     description columns begin at the same x-coordinate.
     v8 carried-forward: more vertical breathing room between rows so
     pills don't crowd each other; centre-align the pill against the
     description's first line so the pill's overhang sits inside the
     row's padding, not touching the row above. */
  padding: 10px 0;
  font-size: 0.92rem;
  color: var(--grey-600);
  line-height: 1.55;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.category-key-list li .story-pill {
  /* In the fixed-width column, the pill sits at its natural width with
     space to its right. Reset margin-right (set globally for inline
     use) and vertical-align (the grid centre handles alignment). */
  margin-right: 0;
  vertical-align: baseline;
  /* Don't justify-self so the pill sits at the start of its lane,
     not stretched to fill it. */
  justify-self: start;
}

/* --- Trial banner (gate.html) --- */
.trial-banner {
  background-color: #FFF8E1;
  border: 1px solid var(--h4d-warm-gold);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 24px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--h4d-dark-grey);
}
.trial-banner a {
  color: var(--h4d-dark-green);
  font-weight: 600;
}

/* --- Remember-me checkbox (gate.html) --- */
.remember-me {
  margin: 12px 0 4px 0;
  font-size: 0.92rem;
  color: var(--h4d-dark-grey);
  display: flex;
  align-items: center;
  gap: 8px;
}
.remember-me input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--h4d-dark-green);
}
.remember-me label {
  cursor: pointer;
  user-select: none;
}

/* --- Responsive (legacy) --- */
@media (max-width: 600px) {
  .gate-form { flex-direction: column; }
  .gate-form input[type="email"] { min-width: unset; }
  .pricing-grid { grid-template-columns: 1fr; }
  main { padding: 24px 0 40px; }
}

/* ================================================================
 * v6 — embedded-briefing footer leak fix
 *
 * The legacy generate_briefing_commercial.py (v5) emits a self-
 * contained HTML page including its own footer styled `background:
 * #41A336`. When app.py's strip_briefing_wrapper() preserves that
 * <style> block and re-injects it inside gate.html's
 * #briefing-container, the rule cascades to the page-level <footer
 * class="footer"> and turns it green.
 *
 * Two fixes:
 *   1. Bump specificity on the page footer so the leaked rule loses.
 *      `body > footer.footer` is more specific than `.footer`.
 *   2. Hide the briefing's own internal footer (rendered inside the
 *      embedded briefing) — duplicates the page footer that
 *      base.html v4 already provides.
 *
 * Once generate_briefing_commercial_v6.py is deployed, the new
 * generator will stop emitting both the leaked rule AND the inner
 * footer — but archived briefings already on disk (2026-04-22 to
 * 2026-04-26) carry the old chrome forever, so these scoped CSS
 * fixes protect those archives indefinitely.
 * ================================================================ */
body > footer.footer {
    background: var(--dark-grey) !important;
}

.embedded-briefing .footer,
.embedded-briefing > .footer {
    display: none !important;
}
