/* ==========================================================================
   site-chrome.css - the projects.gelliottmorris.com page chrome, framework-free.

   Hand-ported from ~/github/projects-hub (commit 96e1288; hashes of every source
   in provenance.json, drift reported by scripts/sync_projects_theme.py --check):
     shared/components/Header.svelte, Footer.svelte, KeyTakeaways.svelte,
       MethodologySection.svelte, ShareButtons.svelte, InlineNewsletterCTA.svelte
     shared/components/RelatedProjects.svelte, LatestPosts.svelte   (commit 2aa429a:
                                              the bottom block, DECISIONS_v0.3 D18)
     projects/landing/src/App.svelte          intro: headline, dek
     shared/components/PageIntro.svelte       .site-intro--project (projects-hub 72d96f6;
                                              live on /congress-2026-what-if/)
     projects/_template/src/App.svelte        main column, section cards, dividers
     projects/congress-2026-what-if/src/...   tabs, segmented control, footnote,
                                              tool buttons, map tooltip
     projects/senate-2026/src/components/RaceList.svelte   data table
   Sizes, colors, spacing and breakpoints (850px / 560px) are copied exactly.
   Svelte scoped every class; here everything is prefixed `site-` so nothing
   collides with page CSS (the original class name is noted beside each block).

   Load order: fonts.css, base.css (imports design-tokens.css + utilities.css),
   site-chrome.css, ratings.css. One theme only: the site's light theme
   (DECISIONS_v0.3 D15; no dark mode, no theme switch). No author byline (D16).
   Header/footer markup comes from chrome.js.
   ========================================================================== */


/* --------------------------------------------------------------------------
   0. Sticky header fix
   base.css sets overflow-x: hidden on html, body and .app. That turns them into
   scroll containers, so Header.svelte's `position: sticky` never engages on the
   live site (measured 2026-10-16: after scrolling 900px the header sits at
   top = -900px). `clip` hides horizontal overflow the same way without creating
   a scroll container, so the header really sticks here, as Header.svelte intends.
   (Browsers without overflow: clip keep the site's behavior.)
   -------------------------------------------------------------------------- */
html,
body,
.app {
  overflow-x: clip;
}


/* --------------------------------------------------------------------------
   1. Page shell                                   (.app / main / .main)
   -------------------------------------------------------------------------- */
.site-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

/* Main column: the landing page's rhythm (32px top, 24px sides) at the project
   template's width (1100px). .site-main--narrow is the landing's 900px column. */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--width-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

.site-main--narrow {
  max-width: var(--width-lg);
}

/* Project-page column (congress-2026-what-if App.svelte .main): 24px top/bottom and 16px
   sides; 16px / 12px up to 700px; 16px all round up to 560px. With .site-intro--project and
   the bottom block below, a page matches the site's project pages from intro to footer. */
.site-main--project {
  padding: var(--space-5) var(--space-4);
}

@media (max-width: 700px) {
  .site-main--project {
    padding: var(--space-4) var(--space-3);
  }
}

@media (max-width: 560px) {
  .site-main--project {
    padding: var(--space-4) var(--space-4);
  }
}

/* A chrome piece turned off in mountSiteChrome() leaves an empty hidden slot. */
[data-site-header][hidden],
[data-site-methodology][hidden],
[data-site-related][hidden],
[data-site-latest][hidden],
[data-site-footer][hidden] {
  display: none !important;
}

/* Skip link (landing App.svelte .skip-link); chrome.js inserts it. */
.site-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-text-primary);
  color: var(--color-bg-card);
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.site-skip-link:focus {
  top: 0;
}

/* Text for screen readers only (what-if app.css .visually-hidden). */
.site-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* --------------------------------------------------------------------------
   2. Header                                       (Header.svelte)
   -------------------------------------------------------------------------- */

/* Placeholder reserves the header's height (87px + 1px border; 64 + 1 on phones)
   so nothing jumps when chrome.js swaps in the real header. */
div[data-site-header] {
  display: block;
  height: 88px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border-strong);
}

.site-header {                                     /* .header */
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border-strong);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header--static {
  position: relative;
}

.site-header-content {                             /* .header-content */
  width: 100%;
  height: 87px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.site-header-left {                                /* .header-left */
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.site-header-center {                              /* .header-center */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.site-header-right {                               /* .header-right */
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.site-home-link {                                  /* .site-link */
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: var(--font-size-source);
  flex-shrink: 0;
}

.site-home-link:hover {
  text-decoration: underline;
}

.site-logo {                                       /* .logo */
  width: 40px;
  height: 40px;
}

.site-url {                                        /* .site-url */
  white-space: nowrap;
}

.site-banner-link {                                /* .banner-link */
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-banner {                                     /* .site-banner */
  height: 36px;
  width: auto;
  display: block;
}

.site-subscribe {                                  /* .newsletter-link */
  height: 40px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background-color: #4f46e5;
  text-decoration: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.2), inset 0px -1px 0px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  white-space: nowrap;
}

.site-subscribe:hover {
  background-color: #3a30e2;
  color: white;
}

/* Not on the site: a quiet mode tag ("Local") for the operator's read-write
   dashboard, styled like the landing page's project tags. Hidden on phones. */
.site-mode-badge {
  display: inline-block;
  margin-right: var(--space-3);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Tablet: 560px - 850px */
@media (max-width: 850px) {
  .site-url {
    display: none;
  }

  .site-header-center {
    justify-content: flex-start;
  }

  .site-header-left {
    flex: 0 0 auto;
  }

  .site-header-right {
    flex: 1;
  }
}

/* Mobile: < 560px */
@media (max-width: 560px) {
  div[data-site-header] {
    height: 65px;
  }

  .site-header-content {
    height: 64px;
    padding: 0 12px;
    gap: 6px;
  }

  .site-logo {
    width: 32px;
    height: 32px;
  }

  .site-banner {
    height: 22px;
  }

  .site-subscribe {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 6px;
  }

  .site-mode-badge {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   3. Intro                                        (landing App.svelte .page-header)
   -------------------------------------------------------------------------- */
.site-intro {                                      /* .page-header */
  text-align: center;
  margin-bottom: var(--space-8);
}

.site-headline {                                   /* .page-header h1 */
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-2);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.site-dek {                                        /* .subtitle (+ template .dek max-width) */
  font-size: var(--font-size-subtitle);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* No author byline on our pages (DECISIONS_v0.3 D16): the landing's .author-line is
   deliberately not ported. The intro is headline + dek (+ "Updated" line). */

/* "Updated ..." line: use utilities.css .updated-date (14px, muted). */
.site-intro .updated-date {
  margin-top: var(--space-2);
}

.site-share-row {                                  /* template .share-row */
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}

.site-intro-divider {                              /* template .intro-divider */
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0 0;
}

/* Project-page intro: shared/components/PageIntro.svelte (projects-hub 72d96f6),
   live on the site's newest forecast tool, /congress-2026-what-if/ (the other
   project pages were still moving to it on 2026-10-16). Add to .site-intro to
   use it: tighter headline, 28px headline and 17px dek on phones, underlined
   dek links, "Updated at: <date>" line (.updated-date), shorter gap below. */
.site-intro--project {
  margin-bottom: var(--space-5);
}

.site-intro--project .site-headline {
  margin: 0 auto var(--space-3) auto;
  letter-spacing: var(--letter-spacing-tight);
  max-width: var(--width-lg);
}

.site-intro--project .site-dek {
  line-height: var(--line-height-relaxed);
}

.site-intro--project .site-dek a {
  color: var(--color-dem);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-intro--project .site-dek a:hover {
  color: var(--color-text-primary);
}

@media (max-width: 600px) {
  .site-intro--project .site-headline {
    font-size: 28px;
  }

  .site-intro--project .site-dek {
    font-size: var(--font-size-body);
  }
}


/* --------------------------------------------------------------------------
   4. Content sections and cards                   (template App.svelte)
   -------------------------------------------------------------------------- */
.site-section {                                    /* .content-section */
  margin-bottom: var(--space-4);
}

.site-card {                                       /* .section-card */
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.site-section-title {                              /* .section-title (template, 22px) */
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.site-section-text {                               /* .section-text */
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-4) 0;
}

.site-section-text:last-child {
  margin-bottom: 0;
}

.site-divider {                                    /* .divider */
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

.site-placeholder-viz {                            /* .placeholder-viz */
  background: var(--color-bg-subtle);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-label);
}

.site-footnote {                                   /* what-if .footnote */
  font-size: 13px;
  color: var(--color-text-tertiary);
  line-height: 1.45;
  margin: var(--space-3) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}


/* --------------------------------------------------------------------------
   4b. Data table                                  (senate-2026 RaceList.svelte)
   <div class="site-table-wrap"><table class="site-table">...</table></div>
   -------------------------------------------------------------------------- */
.site-table-wrap {                                 /* .table-container */
  overflow-x: auto;
}

.site-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-label);
}

.site-table thead {
  border-bottom: 2px solid var(--color-border);
}

.site-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  font-size: var(--font-size-source);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.site-table tbody tr:hover {
  background: var(--color-interactive-hover);
}

.site-table tbody tr.selected {
  background: var(--color-dem-bg);
}

.site-table td {
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
}

/* Not on the site: right-aligned tabular figures for number columns. */
.site-table .site-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-party-badge {                                /* .party-badge */
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  margin-left: var(--space-1);
}

.site-party-badge--d {
  background: var(--color-dem-bg);
  color: var(--color-dem);
}

.site-party-badge--r {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-rep);
}

.site-table-note {                                 /* .table-note */
  font-size: var(--font-size-source);
  color: var(--color-text-muted);
  margin: var(--space-3) 0 0 0;
  text-align: center;
}


/* --------------------------------------------------------------------------
   5. Key takeaways                                (KeyTakeaways.svelte)
   <section class="site-takeaways"><h2 class="site-takeaways-title">Key Takeaways</h2>
     <ul class="site-takeaways-list"><li class="site-takeaway">
       <span class="site-takeaway-number">1</span><span class="site-takeaway-text">...</span>
   -------------------------------------------------------------------------- */
.site-takeaways {                                  /* .takeaways */
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-dem);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-4) auto;
  width: fit-content;
  max-width: 900px;
}

.site-takeaways-title {                            /* .takeaways-title */
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-3) 0;
}

.site-takeaways-list {                             /* .takeaways-list */
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.site-takeaway {                                   /* .takeaway-item */
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.site-takeaway-number {                            /* .takeaway-number */
  flex-shrink: 0;
  color: var(--color-dem);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
}

.site-takeaway-text {                              /* .takeaway-text */
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  line-height: var(--line-height-relaxed);
  padding-top: 2px;
  text-align: left;
}


/* --------------------------------------------------------------------------
   6. Methodology                                  (MethodologySection.svelte)
   chrome.js wraps <div data-site-methodology><p>...</p></div> in this markup:
   <section id="methodology" class="site-methodology">
     <h2 class="site-methodology-label">Methodology</h2>
     <div class="site-methodology-content"><p>...</p></div></section>
   -------------------------------------------------------------------------- */
.site-methodology {                                /* .methodology-section */
  margin-bottom: var(--space-5);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.site-methodology-label {                          /* .methodology-label */
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 var(--space-2) 0;
}

.site-methodology-content {                        /* .methodology-content */
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2);
}

.site-methodology-content p {
  font-size: var(--font-size-label);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin: var(--space-2) 0 0 0;
}

.site-methodology-content p:first-child {
  margin-top: 0;
}

.site-methodology-content strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.site-methodology-content h3 {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: var(--space-3) 0 var(--space-1) 0;
}

.site-methodology-content h3:first-child {
  margin-top: 0;
}

.site-methodology-content ul {
  margin: var(--space-1) 0 0 0;
  padding-left: var(--space-3);
  font-size: var(--font-size-label);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.site-methodology-content li {
  margin-bottom: 2px;
}

.site-methodology-content a {                      /* what-if app.css */
  color: var(--color-dem-dark);
  text-underline-offset: 2px;
}


/* --------------------------------------------------------------------------
   7. Buttons and controls
   -------------------------------------------------------------------------- */

/* Primary: the header's indigo Subscribe button, for a page's main action. */
.site-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background-color: #4f46e5;
  border: none;
  border-radius: 8px;
  box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.2), inset 0px -1px 0px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.site-btn-primary:hover:not(:disabled) {
  background-color: #3a30e2;
  color: white;
}

.site-btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Secondary tool button (what-if ShareReset .btn): 36px, bordered. */
.site-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  font-family: inherit;
  font-size: var(--font-size-source);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.site-btn:hover:not(:disabled) {
  background: var(--color-bg-subtle);
  border-color: var(--color-text-muted);
}

.site-btn:disabled {
  color: var(--color-text-muted);
  cursor: default;
}

/* Segmented control (what-if .subtabs / .subtab).
   <div class="site-segmented" role="tablist"><button class="active" aria-selected="true">Races</button>... */
.site-segmented {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  width: max-content;
  max-width: 100%;
  overflow: hidden;
}

.site-segmented > button {
  font-family: inherit;
  font-size: var(--font-size-source);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: none;
  padding: 7px 18px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.site-segmented > button + button {
  border-left: 1px solid var(--color-border-strong);
}

.site-segmented > button:hover:not(.active):not([aria-selected='true']) {
  background: var(--color-bg-subtle);
  color: var(--color-text-primary);
}

.site-segmented > button.active,
.site-segmented > button[aria-selected='true'],
.site-segmented > button[aria-pressed='true'] {
  background: var(--color-text-primary);
  color: #fff;
}

.site-segmented > button:focus-visible {
  outline-offset: -3px;
}

/* Underlined tabs (what-if .chamber-tabs / .chamber-tab).
   <div class="site-tabs" role="tablist"><button class="site-tab active">
     <span class="site-tab-name">Senate</span><span class="site-tab-count">· 35 races</span> */
.site-tabs {
  display: flex;
  gap: var(--space-5);
  border-bottom: 1px solid var(--color-border-strong);
}

.site-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: inherit;
  font-size: var(--font-size-subtitle);
  color: var(--color-text-tertiary);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 6px 2px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.site-tab:hover:not(.active):not([aria-selected='true']) {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-border-strong);
}

.site-tab.active,
.site-tab[aria-selected='true'] {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-text-primary);
}

.site-tab-name {
  font-weight: var(--font-weight-bold);
}

.site-tab-count {
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
}

.site-tab-badge {                                  /* .tab-picks */
  align-self: center;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-bg-card);
  background: var(--color-text-primary);
  border-radius: 999px;
  padding: 1px 7px;
}

@media (max-width: 560px) {
  .site-tabs {
    gap: var(--space-3);
  }

  .site-tab {
    gap: 4px;
    font-size: var(--font-size-body);
  }

  .site-tab-count {
    font-size: 13px;
  }

  .site-tab-badge {
    padding: 0 6px;
  }
}

@media (max-width: 360px) {
  .site-tab-count {
    display: none;
  }
}

/* Category tag (landing .project-tag): ELECTIONS / POLLS. */
.site-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
}

.site-tag--polls {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-dem);
}

.site-tag--elections {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-rep);
}

/* Outlined chip (what-if RaceCell .tag), e.g. "Special". */
.site-chip {
  display: inline-block;
  padding: 0 5px;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  line-height: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   8. Share buttons                                (ShareButtons.svelte)
   chrome.js mountShareButtons() renders the markup and click handlers.
   -------------------------------------------------------------------------- */
.site-share {                                      /* .share-buttons */
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.site-share-label {                                /* .share-label */
  font-size: var(--font-size-label);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

.site-share-btn {                                  /* .share-btn */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.site-share-btn:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.site-share-btn--bluesky:hover {
  background: #1185fe;
  border-color: #1185fe;
  color: white;
}

.site-share-btn--twitter:hover {
  background: #000;
  border-color: #000;
  color: white;
}

.site-share-btn--linkedin:hover {
  background: #0A66C2;
  border-color: #0A66C2;
  color: white;
}

.site-share-btn--copy:hover {
  background: var(--color-dem);
  border-color: var(--color-dem);
  color: white;
}


/* --------------------------------------------------------------------------
   9. Inline newsletter nudge                      (InlineNewsletterCTA.svelte)
   <aside class="site-inline-cta"><p class="site-inline-cta-text">Like this? <strong>Strength In
   Numbers</strong> sends ...</p><a class="site-inline-cta-btn" href="...">Subscribe free →</a></aside>
   -------------------------------------------------------------------------- */
.site-inline-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-dem-bg);
  border-left: 3px solid var(--color-dem);
  border-radius: var(--radius-md);
}

.site-inline-cta-text {
  font-size: var(--font-size-label);
  color: var(--color-text-primary);
  margin: 0;
  line-height: var(--line-height-normal);
}

.site-inline-cta-btn {
  flex-shrink: 0;
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dem-dark);
  text-decoration: none;
  padding: 6px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-dem);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.site-inline-cta-btn:hover {
  background: var(--color-dem);
  color: #fff;
}


/* --------------------------------------------------------------------------
   10. Chart helpers                               (docs/chart-styleguide.md §1, §7, §8;
                                                    what-if MapTooltip.svelte)
   -------------------------------------------------------------------------- */
.site-chart-title {                                /* styleguide: 16px semibold */
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 10px;
}

.site-legend {                                     /* styleguide §7 custom legend */
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.site-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.site-legend-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Card tooltip used by the site's newest forecast tool (what-if MapTooltip). */
.site-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: max-content;
  max-width: min(280px, calc(100vw - 16px));
  padding: 10px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(26, 25, 24, 0.12);
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-text-primary);
  pointer-events: none;
}

.site-tooltip-title {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.005em;
}

.site-tooltip-rows {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 3px;
}

/* Styleguide §8 near-black tooltip (white text), for charts that follow the
   Chart.js recipe. A tooltip style, not a theme. */
.site-tooltip--dark {
  background: rgba(17, 24, 39, 0.95);
  border-color: transparent;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.site-tooltip--dark .site-tooltip-title {
  font-size: 12px;
  margin-bottom: 2px;
}


/* --------------------------------------------------------------------------
   11. Explore More                                (RelatedProjects.svelte)
   chrome.js renders it into <div data-site-related>:
   <hr class="site-related-divider" /><section class="site-related">
     <h2 class="site-related-title">Explore More</h2><div class="site-related-grid">
       <a class="site-project-card" href="..."><span class="site-project-tag
         site-project-tag-elections">Elections</span><h3 class="site-project-title">...</h3>
         <p class="site-project-desc">...</p></a> ...
   (The site's h2 also carries utilities.css .section-title; every property of that
   rule is overridden by the component's, so .site-related-title is the whole style.)
   -------------------------------------------------------------------------- */
.site-related-divider {                            /* .section-divider */
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

.site-related {                                    /* .related-projects */
  padding-top: var(--space-4);
}

.site-related-title {                              /* .section-title */
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-4) 0;
  text-align: center;
}

.site-related-grid {                               /* .projects-grid */
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .site-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.site-project-card {                               /* .project-card */
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.site-project-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.site-project-tag {                                /* .project-tag (10px; the landing's is 11px: .site-tag) */
  display: inline-block;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: var(--space-2);
}

.site-project-tag-polls {                          /* .tag-polls */
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-dem);
}

.site-project-tag-elections {                      /* .tag-elections */
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-rep);
}

.site-project-title {                              /* .project-title */
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-1) 0;
}

.site-project-desc {                               /* .project-desc */
  font-size: var(--font-size-label);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: var(--line-height-relaxed);
}


/* --------------------------------------------------------------------------
   12. Latest from Strength in Numbers             (LatestPosts.svelte)
   chrome.js renders it into <div data-site-latest> (skeleton while the feed
   loads; the block hides itself if the feed can't be loaded, as on the site):
   <hr class="site-latest-divider" /><section class="site-latest">
     <div class="site-latest-header"><span class="site-latest-label">Latest from
       Strength in Numbers</span></div><div class="site-latest-carousel">
       <a class="site-post-card" href="..."><div class="site-post-image"><img
         class="site-post-thumb"><div class="site-post-placeholder"><img logo></div></div>
         <span class="site-post-title">...</span></a> ...
   </section><hr class="site-latest-divider" />
   -------------------------------------------------------------------------- */
.site-latest-divider {                             /* .section-divider */
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

.site-latest {                                     /* .latest-posts */
  margin: 0;
}

.site-latest-header {                              /* .section-header */
  margin-bottom: var(--space-3);
}

.site-latest-label {                               /* .section-label */
  font-size: var(--font-size-source);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-latest-carousel {                            /* .carousel */
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}

.site-latest-carousel::-webkit-scrollbar {
  display: none;
}

.site-post-card {                                  /* .post-card */
  flex: 0 0 200px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.site-post-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.site-post-image {                                 /* .post-image */
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
}

/* Both images (thumbnail and the logo placeholder), as the site's `.post-image img`. */
.site-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.site-post-placeholder {                           /* .image-placeholder */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
}

.site-post-placeholder img {
  width: 40%;
  height: auto;
  object-fit: contain;
}

.site-post-title {                                 /* .post-title */
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Not on the site: the post date, shown only with latestPosts: { showDates: true }. */
.site-post-date {
  margin-top: auto;
  font-size: 12px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Skeleton loading styles */
.site-post-card--skeleton {                        /* .post-card.skeleton */
  pointer-events: none;
}

.site-skeleton-image {                             /* .skeleton-image */
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-bg-subtle) 25%, var(--color-bg-hover) 50%, var(--color-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: site-shimmer 1.5s infinite;
}

.site-skeleton-title {                             /* .skeleton-title */
  height: 14px;
  width: 80%;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
}

@keyframes site-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.site-post-card:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   13. Footer                                      (Footer.svelte)
   chrome.js renders it into <div data-site-footer>, the Substack signup iframe on
   by default (local and published, D18).
   -------------------------------------------------------------------------- */
.site-footer {                                     /* .footer */
  background: var(--color-bg-card);
  border-top: 2px solid var(--color-border-strong);
  padding: var(--space-6) var(--space-3) var(--space-4);
  margin-top: var(--space-6);
  text-align: center;
}

.site-newsletter {                                 /* .newsletter-section */
  max-width: 480px;
  margin: 0 auto var(--space-5);
}

.site-social-proof {                               /* .social-proof */
  font-size: var(--font-size-label);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-1);
  font-weight: var(--font-weight-medium);
}

.site-newsletter-heading {                         /* .newsletter-heading */
  font-size: var(--font-size-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2);
}

.site-newsletter-desc {                            /* .newsletter-desc */
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-4);
}

.site-newsletter-embed {                           /* .newsletter-embed */
  display: flex;
  justify-content: center;
}

.site-newsletter-embed iframe {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* Stand-in for the Substack iframe when the browser is offline (or showNewsletter: false):
   the header's Subscribe button. Not on the site. */
.site-newsletter-embed .site-subscribe {
  display: inline-flex;
}

.site-footer-links {                               /* .footer-content */
  font-size: var(--font-size-source);
  color: var(--color-text-muted);
  margin: 0;
}

.site-footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer-links a:hover {
  text-decoration: underline;
  color: var(--color-text-secondary);
}

.site-footer-sep {                                 /* .footer .separator */
  color: var(--color-text-muted);
  margin: 0 var(--space-1);
}
