/* The public site: one typeface, one size, weight and gray for hierarchy, blue underlined links. */
@font-face { font-family: 'Apfel Grotezk'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/apfel-grotezk-regular.woff2') format('woff2'); }
@font-face { font-family: 'Apfel Grotezk'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('/fonts/apfel-grotezk-mittel.woff2') format('woff2'); }
@font-face { font-family: 'Apfel Grotezk'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/apfel-grotezk-fett.woff2') format('woff2'); }
:root {
  color-scheme: light;
  --font: 'Apfel Grotezk', Helvetica, Arial, sans-serif;
  --measure: 760px;
  --bg: #fff;
  --ink: #171717;
  --text: #333;
  --gray: #767676;
  --link: #0864c7;
  --tag: #f0f0f0;
  --tag-ink: #555;
  --rule: #e4e4e4;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scrollbar-gutter: stable; overscroll-behavior-y: none; }
body { margin: 0; color: var(--text); background: var(--bg); font: 400 16px/24px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; font-size: inherit; }
h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: normal; }
a, a:visited { color: var(--link); text-underline-offset: 3px; }
:is(a, button, summary):focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
::selection { background: #dbe9f8; color: var(--ink); }
.gray { color: var(--gray); }

.editorial { position: relative; z-index: 1; max-width: var(--measure); margin: 0 auto; padding: 24px; }

/* A wash across the top of the page: rose and periwinkle light through haze (scripts/make-wash.py), with real film grain on top. */
body { position: relative; }
body::before, body::after { content: ""; position: absolute; inset: 0 0 auto; height: 400px; pointer-events: none; }
body::before { background: url('/images/wash-v2.webp') center top / 100% 100% no-repeat; }
body::after { background: url('/images/grain.png') 0 0 / 160px 160px; mix-blend-mode: overlay; opacity: .55; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.site-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.editorial__name, .editorial__crumb { color: var(--ink); font-weight: 400; line-height: normal; }
.editorial__name { font-weight: 600; }
.editorial__crumb a, .editorial__crumb a:visited { color: var(--ink); text-decoration: none; }
.editorial__crumb :is(h1, .here) { display: inline; font-weight: 600; }
.topnav { display: flex; align-items: baseline; gap: 8px; margin-left: auto; }
.topnav__dot { color: var(--gray); }

p, ul, ol, blockquote { margin-top: 18px; }
.site-header + :is(p, ul, figure) { margin-top: 0; }
h2 { margin-top: 18px; }
h2 + ul { margin-top: 8px; }
ul, ol { padding-left: 22px; }
li::marker { color: var(--gray); }
.tag { display: inline-block; margin-left: 4px; padding: 0 6px; background: var(--tag); color: var(--tag-ink); font-size: 12px; line-height: 18px; vertical-align: 1px; }
.tex { display: inline; width: auto; height: .74em; vertical-align: -.06em; }

.carousel { position: relative; margin-top: 8px; }
/* photos are stacked and crossfade; the track only takes focus for the arrow keys */
.carousel__track { display: grid; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tag); touch-action: pan-y; }
.carousel__track:focus-visible { outline: none; }
.carousel:has(.carousel__track:focus-visible) { outline: 1px solid var(--ink); outline-offset: 3px; }
.carousel__track img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.carousel__track img.is-on { opacity: 1; }
.carousel__track .carousel__bottom { object-position: 50% 100%; }
/* controls sit under the photo, not on it */
.carousel__controls { display: flex; justify-content: center; align-items: center; gap: 2px; margin-top: 10px; }
.carousel__dots { display: flex; align-items: center; }
.carousel__dot { display: flex; align-items: center; justify-content: center; height: 16px; padding: 0 3px; border: 0; background: none; cursor: pointer; }
.carousel__dot::before { content: ""; width: 5px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .22; transition: width .45s cubic-bezier(.3, .7, .2, 1), opacity .45s ease; }
.carousel__dot:hover::before { opacity: .5; }
.carousel__dot[aria-current="true"]::before { width: 16px; opacity: .75; }
.carousel__arrow { display: flex; align-items: center; justify-content: center; width: 20px; height: 16px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; opacity: .4; transition: opacity .25s ease; }
.carousel__arrow:hover, .carousel__arrow:focus-visible { opacity: 1; }
.carousel__arrow:focus-visible, .carousel__dot:focus-visible { outline: none; }
.carousel__dot:focus-visible::before { opacity: .6; }
.carousel__arrow svg { width: 11px; height: 11px; }
.carousel + p { margin-top: 28px; }
.about-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: center; }   /* same frame as the home carousel */
.about-photo + p { margin-top: 18px; }
.press-photo img { aspect-ratio: 3 / 2; }   /* the whole frame: at 16:9 the top of the head is cut */
.press-photo + ul { margin-top: 18px; }

.plate { margin-top: 44px; }
.plate > img { width: 100%; border: 1px solid var(--rule); }
.plate__caption { margin-top: 14px; }
.plate__title { margin-top: 0; }
.plate__year { color: var(--gray); font-weight: 400; }
.plate__note { margin-top: 8px; }
.plate__data, .plate__download, .plate__math summary { margin-top: 8px; color: var(--gray); font-size: 14px; line-height: 20px; }
.plate__math summary { display: inline-block; cursor: pointer; list-style: none; }
.plate__math summary::-webkit-details-marker { display: none; }
.plate__math summary::after { content: " +"; }
.plate__math[open] summary::after { content: " \2212"; }
.plate__eq { margin-top: 14px; overflow-x: auto; }
.plate__eq img { margin: 0 auto; }

.article { max-width: 640px; }
.article-meta { margin-top: 2px; color: var(--gray); }
.article-body h2 { margin-top: 30px; }
.article-body li + li { margin-top: 6px; }
.article-body blockquote { padding-left: 16px; border-left: 2px solid var(--tag); }
.article-body hr { margin: 30px 0 0; border: 0; border-top: 1px solid var(--rule); }
.article-body sup { font-size: 11px; line-height: 0; }

.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; padding: 10px; background: var(--bg); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 768px) { .editorial { padding-top: 40px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0s !important; transition: none !important; }
}
@media print {
  .editorial { max-width: none; padding: 0; }
  .topnav, .skip-link { display: none; }
  body { color: #000; }
  a, a:visited { color: #000; text-decoration: none; }
}
.site-header + h2 { margin-top: 0; }

/* 404: a ReCom chain redraws the districts; borders pile up into a soft heatmap with one precinct no line touches */
.map404 { margin: 28px 0 0; }
.map404 canvas { display: block; width: 100%; aspect-ratio: 2 / 1; }
.map404 figcaption { margin-top: 12px; color: var(--gray); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.map404 + p { margin-top: 24px; }
@media (max-width: 559px) { .map404 canvas { aspect-ratio: 1 / 1; } }
