/* Raising Petaluma — shared styles for every page on the site.
   Served at /site.css (output/site.css -> ../site.css).

   Pages opt into small variations with a class on <body>:
     .page-home     homepage: narrower column, bigger title
     .page-archive  archive: narrower column
     .page-simple   one-off Worker pages (/unsubscribe, /subscribe fallback)
   Guide editions use the defaults and need no class. */

:root {
  --paper: #F4EFE3;
  --paper-bright: #FFFCF5;
  --ink: #22304F;
  --ink-soft: #3C4867;
  --muted: #4A5673;
  --rule: #22304F;
  --rule-soft: #CFC6B0;
  --accent: #2A4BA0;
  --accent-dark: #1F3A80;
  --display: 'Zilla Slab', Rockwell, Georgia, serif;
  --text: 'Karla', 'Helvetica Neue', Helvetica, sans-serif;
  --column: 820px;
}
.page-home,
.page-archive { --column: 760px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 19px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 5rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ——— SITE NAV (top-right) ——— */
.site-nav {
  display: flex;
  justify-content: flex-end;
  gap: 1.6rem;
  padding: 1.6rem 2.5rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ——— MASTHEAD ——— */
.masthead {
  max-width: var(--column);
  margin: 3.5rem auto 0;
  padding: 0 2rem;
}
.masthead-top {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.masthead h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.6rem, 10vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.page-home .masthead h1 { font-size: clamp(3.6rem, 10vw, 7rem); }
.masthead h1 .place {
  color: var(--accent);
}
.masthead .subtitle {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.45;
  margin-top: 1.6rem;
}

/* ——— LAUNCH NOTE (homepage): when the next guide comes out ——— */
.launch-note {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.2rem;
  padding: 0.9rem 1.1rem;
  border: 2px dashed var(--accent);
  border-radius: 6px;
  background: var(--paper-bright);
  font-size: 1.1rem;
  line-height: 1.4;
}
.launch-note__icon {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.launch-note__when {
  color: var(--accent-dark);
}
.launch-note + .byline-sub--form { margin-top: 1.8rem; }

/* ——— SUBSCRIBE (homepage) ——— */
.byline-sub--form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.5rem;
  position: relative;
}
.byline-sub__intro {
  flex-basis: 100%;
  font-size: 1.1rem;
  font-weight: 700;
}
/* Email box and button always share one row: the box starts from zero
   width and grows up to 24rem, so it shrinks (and scrolls its text)
   rather than pushing the button onto a new line. */
.byline-sub input[type="email"] {
  flex: 1 1 0;
  max-width: 24rem;
  min-width: 0;
  height: 3.25rem;
  padding: 0 1rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper-bright);
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
}
.byline-sub input[type="email"]::placeholder {
  color: var(--muted);
}
.byline-sub button {
  height: 3.25rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: #FFFFFF;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.byline-sub button:hover {
  background: var(--accent-dark);
}
.byline-sub button[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.byline-sub__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.byline-sub__msg {
  flex-basis: 100%;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  min-height: 1.4em;
}
.byline-sub__msg--error {
  color: #9B2C1F;
}
.byline-sub__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ——— PRIORITIES ——— */
.priorities {
  max-width: var(--column);
  margin: 4rem auto 0;
  padding: 0 2rem;
}
.priorities-inner {
  border-top: 2px solid var(--rule);
  padding-top: 2rem;
}
.priorities h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 0.9rem;
}
.priorities p {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.6;
}
.priorities p + p { margin-top: 1rem; }
.priorities p strong {
  font-weight: 700;
  color: var(--accent);
}

/* ——— APPROACH NOTE (short "how this guide works" aside under the values) ——— */
.approach {
  max-width: var(--column);
  margin: 2.2rem auto 0;
  padding: 0 2rem;
}
.approach h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.approach p {
  max-width: 62ch;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ——— ARCHIVE LIST ——— */
.archive {
  max-width: var(--column);
  margin: 4rem auto 0;
  padding: 0 2rem;
}
.archive h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.archive-list {
  list-style: none;
}
.archive-item {
  border-top: 1px solid var(--rule-soft);
}
.archive-item:first-child {
  border-top: 2px solid var(--rule);
}
.archive-item:last-child {
  border-bottom: 1px solid var(--rule-soft);
}
.archive-item a {
  display: block;
  padding: 1.4rem 0;
  text-decoration: none;
}
.archive-item__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.archive-item__date {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}
.archive-item__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  line-height: 1.1;
  color: var(--accent);
}
.archive-item a:hover .archive-item__title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* ——— BALLOT AT A GLANCE ——— */
.ballot-at-a-glance {
  max-width: var(--column);
  margin: 4.5rem auto;
  padding: 0 2rem;
}
.section-heading {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.glance-table {
  width: 100%;
  border-collapse: collapse;
}
.glance-table th,
.glance-table td {
  text-align: left;
  padding: 1rem 1.25rem 1rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: baseline;
}
.glance-table thead th {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--rule);
}
.glance-table:not(.glance-table--guides) th,
.glance-table:not(.glance-table--guides) td.race {
  width: 50%;
}
/* Group headings inside the table (e.g. "Federal", "Local") */
.glance-table tr.group th {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--muted);
  padding: 2rem 0 0.6rem;
  border-bottom: 2px solid var(--rule);
}
.glance-table tbody tr.group:first-child th { padding-top: 0; }
.glance-table .race {
  font-size: 0.975rem;
  font-weight: 500;
}
.glance-table .race a {
  color: inherit;
  text-decoration: none;
}
.glance-table .race a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.glance-table .pick-col {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.425rem;
  line-height: 1.2;
  color: var(--accent);
}
.glance-table .pick-col a {
  color: inherit;
  text-decoration: none;
}
.glance-table .pick-col a:hover,
.glance-table .pick-col a:hover .pick-name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
/* With a jump arrow, underline just the name, not the space before the arrow */
.glance-table .pick-col a:hover:has(.pick-name) {
  text-decoration: none;
}
/* "Lean" before a pick name: lighter than the name itself */
.glance-table .lean {
  font-weight: 400;
  font-style: italic;
}
/* "Jump to the write-up below" marker after linked picks */
.glance-table .jump-arrow {
  display: inline-block; /* keeps the hover underline off the glyph */
  font-size: 0.7em;
  vertical-align: 0.12em;
  opacity: 0.55;
  transition: transform 0.15s, opacity 0.15s;
}
.glance-table .pick-col a:hover .jump-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* Full-width note at the end of the table (e.g. "for the other props…") */
.glance-table td.note-row {
  padding-top: 1.4rem;
  color: var(--muted);
  font-style: italic;
}

/* ——— REST OF THE BALLOT ——— */
.rest-of-ballot .intro {
  max-width: 62ch;
  margin: 0 0 1.5rem;
}
.rest-of-ballot .guide-list {
  padding-left: 1.3rem;
  margin: 0 0 2.2rem;
}
.rest-of-ballot .guide-list li {
  padding: 0.25rem 0;
  font-weight: 700;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.glance-table--guides {
  min-width: 620px;
}
.glance-table--guides th,
.glance-table--guides td {
  font-size: 0.95rem;
  padding: 0.9rem 0.6rem 0.9rem 0;
  vertical-align: top;
}
.glance-table--guides .race {
  font-size: 1rem;
}
.glance-table--guides td:not(.race) {
  font-weight: 700;
  color: var(--accent);
}
.glance-table--guides td.muted {
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

/* ——— RACE SECTIONS ——— */
main {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 2rem;
}
.race-section {
  margin: 5.5rem 0;
}
.race-meta {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.race-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1.6rem;
}
.pick-and-job {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule-soft);
  margin: 0 0 1.8rem;
}
.pick-and-job .recommendation-box {
  padding: 1.4rem 1.5rem 1.4rem 0;
  border-right: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pick-and-job .job-col {
  padding: 1.4rem 0 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rec-label,
.role-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}
.rec-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  line-height: 1.15;
  color: var(--accent);
}
.rec-name a {
  color: inherit;
  text-decoration: none;
}
.rec-name a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.role-intro {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.race-section > p {
  font-size: 1.1875rem;
  line-height: 1.7;
  margin: 0 0 1.1rem;
}
.race-section > p strong {
  font-weight: 700;
}

/* ——— DISCLAIMER ——— */
.disclaimer {
  max-width: calc(var(--column) - 4rem);
  margin: 5rem auto 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}
.disclaimer p {
  margin: 0 0 0.6rem;
}
.disclaimer p:last-child {
  margin-bottom: 0;
}

/* ——— SIMPLE PAGES (/unsubscribe, /subscribe fallback) ——— */
.page-simple main {
  margin-top: 3.5rem;
}
.page-simple h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.015em;
  padding-bottom: 1.6rem;
  margin-bottom: 1.6rem;
  border-bottom: 2px solid var(--rule);
}
.page-simple .masthead-top a { text-decoration: none; }
.page-simple .masthead-top a:hover { text-decoration: underline; }
.lede {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  max-width: 38ch;
  margin-bottom: 1.8rem;
}
.lede strong { color: var(--accent); overflow-wrap: anywhere; }
.aside { color: var(--ink-soft); }
.unsub-form label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.unsub-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.unsub-form input {
  flex: 1 1 18rem;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid var(--rule-soft);
  border-bottom: 2px solid var(--rule);
  padding: 0.6rem 0.8rem;
}
.unsub-form button {
  flex: 0 0 auto;
  font: inherit;
  font-weight: 700;
  color: var(--paper-bright);
  background: var(--accent);
  border: 0;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
}
.unsub-form button:hover { background: var(--accent-dark); }
.unsub-error {
  margin-top: 0.8rem;
  font-weight: 700;
  color: var(--accent-dark);
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-nav { padding: 1.2rem 1.2rem 0; }
  .masthead { margin-top: 2rem; padding: 0 1.2rem; }
  .priorities { margin-top: 3rem; padding: 0 1.2rem; }
  .approach { padding: 0 1.2rem; }
  .archive { margin-top: 3rem; padding: 0 1.2rem; }
  .ballot-at-a-glance { margin: 3.5rem auto; padding: 0 1.2rem; }
  main { padding: 0 1.2rem; }
  .page-simple main { margin-top: 2rem; }
  .race-section { margin: 4rem 0; }
  .pick-and-job { grid-template-columns: 1fr; }
  .pick-and-job .recommendation-box {
    padding: 1.1rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .pick-and-job .job-col { padding: 1.1rem 0; }
  .glance-table th,
  .glance-table td { padding: 0.85rem 1rem 0.85rem 0; }
  .glance-table .pick-col { font-size: 1.175rem; }
  .disclaimer { margin-left: 1.2rem; margin-right: 1.2rem; }
  .unsub-form button { flex-basis: 100%; }
}
