/* ==========================================================================
   Spanberger Votes — stylesheet
   Mobile-first. No build step, no framework.
   ========================================================================== */

:root {
  --ink: #171717;
  --ink-soft: #404040;
  --muted: #737373;
  --line: #e5e5e5;
  --bg-alt: #f5f5f5;
  --near-black: #0a0a0a;
  --red: #b40202;
  --red-dark: #8f0101;
  --link: #0033a0;
  --blue: #0000c8;
  --max: 72rem;
  --font: Montserrat, "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid #d4d4d4;
  margin: 1.5rem 0;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-block;
  border-radius: 0.375rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background-color 0.15s ease;
}

.btn-donate {
  background: var(--red);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.btn-donate:hover {
  background: var(--red-dark);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--near-black);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.25);
}

.header-bar {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  flex-shrink: 0;
  text-decoration: none;
}

.brand img {
  height: 2.75rem;
  width: auto;
}

.brand-sub {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-style: italic;
  color: #a3a3a3;
}

/* The tagline gets its own band under the bar until there is room beside it. */
.header-tagline {
  display: none;
  flex: 1;
  padding: 0 1rem;
  text-align: center;
}

.header-tagline-mobile {
  border-top: 1px solid rgb(255 255 255 / 0.1);
  padding: 0.625rem 1rem;
  text-align: center;
}

.tagline-quote {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.tagline-sub {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  font-style: italic;
  color: #d4d4d4;
}

.header-nav {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #e5e5e5;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

/* Hero ------------------------------------------------------------------- */

.hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem;
  display: grid;
  gap: 2rem;
}

.portrait {
  margin: 0 auto;
  max-width: 16rem;
  text-align: center;
}

.portrait img {
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.22);
}

.portrait figcaption {
  margin-top: 1rem;
}

.portrait-name {
  display: block;
  font-weight: 700;
}

.portrait-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.analysis h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.analysis-copy {
  max-width: 48rem;
  margin: 1rem auto 0;
  text-align: center;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.analysis-copy a {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.analysis-copy .socialist {
  color: var(--blue);
}

.spectrum-card {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.spectrum {
  width: 100%;
  height: auto;
  display: block;
}

.only-wide {
  display: none;
}

/* Categories ------------------------------------------------------------- */

.categories {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

.categories > h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

/*
  Divi rendered these as a single row that collapsed into an unreadable stack
  under ~980px. Here the strip scrolls horizontally on phones and wraps on
  desktop, and the active tab carries the category's own rating colour.
*/
.tabs {
  margin: 1.5rem -1rem 0;
  padding: 0 1rem 0.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
  border: 0;
  border-radius: 9999px;
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: #f0f0f0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab:hover {
  background: #e2e2e2;
}

.tab.is-active {
  color: #fff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.15);
}

.tab:focus-visible {
  outline: 3px solid #1a1acc;
  outline-offset: 2px;
}

.panel {
  margin-top: 2rem;
}

.panel[hidden] {
  display: none;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.panel-findings {
  margin: 0.75rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #262626;
}

.u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* Vote cards ------------------------------------------------------------- */

.votes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.vote {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.vote-body {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
}

.vote-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: #171717;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vote-text {
  min-width: 0;
}

.vote-headline {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.45;
  color: #262626;
}

.vote-headline strong {
  color: var(--ink);
}

.vote-compare {
  margin: 0.75rem 0 0;
  padding: 0.625rem 0.75rem 0.625rem 1rem;
  border-left: 4px solid #d4d4d4;
  background: #fafafa;
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-soft);
}

.vote-figure {
  margin: 0;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

/*
  The comparison graphics are ~3.5:1. Shrinking one to a 375px viewport makes the
  member labels unreadable, so on small screens it scrolls at a legible minimum
  width instead.
*/
.vote-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vote-scroll img {
  width: 100%;
  min-width: 680px;
}

.vote-figure figcaption {
  padding: 0 1rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: #a3a3a3;
}

/* Call to action --------------------------------------------------------- */

.cta {
  background: var(--bg-alt);
}

.cta-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1rem;
  text-align: center;
}

.cta-inner h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.cta-inner p {
  max-width: 36rem;
  margin: 0.75rem auto 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.cta-inner .btn {
  margin-top: 1.5rem;
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--near-black);
  color: #a3a3a3;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

.footer-inner p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.footer-nav a {
  text-decoration: none;
}

.footer-nav a:hover {
  color: #fff;
}

/* About page ------------------------------------------------------------- */

/*
  Divi used a JS parallax layer here, which jitters on mobile and pins the
  section height in pixels. A fixed background gives the same effect on desktop
  and degrades to a normal cover background on touch devices, which ignore it.
*/
.about-intro,
.about-quote {
  position: relative;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.about-intro {
  background-color: var(--near-black);
}

.scrim {
  position: absolute;
  inset: 0;
}

.scrim-dark {
  background: rgb(10 10 10 / 0.7);
}

.scrim-light {
  background: rgb(255 255 255 / 0.75);
}

.about-inner {
  position: relative;
  max-width: 56rem;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #a3a3a3;
}

.about-intro h1 {
  margin-top: 1rem;
  font-size: 1.875rem;
  font-weight: 700;
  color: #fff;
}

.rule {
  width: 6rem;
  margin: 2rem 0;
  border-top: 4px solid var(--red);
}

.about-copy {
  max-width: 48rem;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.7;
  color: #e5e5e5;
}

.about-copy a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.about-quote blockquote {
  margin: 0;
  text-align: center;
}

.quote {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.attribution {
  margin-top: 1.25rem;
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
  color: var(--ink-soft);
}

.contact {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgb(23 23 23 / 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #262626;
}

.contact a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact a:hover {
  color: var(--red);
}

.contact address {
  font-style: normal;
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 640px) {
  .brand img {
    height: 3.5rem;
  }
  .brand-sub {
    display: block;
  }
  .btn-donate {
    padding: 0.5rem 1.25rem;
  }
  .tagline-quote {
    font-size: 1.125rem;
  }
  .tagline-sub {
    font-size: 0.875rem;
  }
  .only-wide {
    display: block;
  }
  .only-narrow {
    display: none;
  }
  .hero-inner,
  .categories,
  .about-inner,
  .cta-inner,
  .footer-inner,
  .header-bar {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .spectrum-card {
    padding: 1.5rem;
  }
  .vote-body {
    gap: 1.25rem;
    padding: 1.5rem;
  }
  .analysis h1,
  .categories > h2,
  .panel-title,
  .cta-inner h2 {
    font-size: 1.875rem;
  }
  .quote {
    font-size: 1.875rem;
  }
  .attribution {
    font-size: 1.125rem;
  }
  .contact {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: minmax(0, 16rem) 1fr;
    gap: 2.5rem;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .portrait {
    margin: 0;
  }
  .categories {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .vote-scroll img {
    min-width: 0;
  }
  .vote-figure figcaption {
    display: none;
  }
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .about-inner {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
  .about-intro h1 {
    font-size: 3rem;
  }
  .quote {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .header-bar {
    gap: 2rem;
  }
  .header-tagline {
    display: block;
  }
  .header-tagline-mobile {
    display: none;
  }
  .header-tagline .tagline-quote {
    font-size: 1.25rem;
  }
  .tabs {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }
}

@media (min-width: 1280px) {
  .header-tagline .tagline-quote {
    font-size: 1.5rem;
  }
}

/* Respect reduced-motion and print ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .tabs,
  .cta {
    display: none;
  }
  .panel[hidden] {
    display: block;
  }
}
