/* Pilsen Community Cleanup — site styles. Every colour is a token from tokens.css; no hex literals here.
   Structure: fonts · base · scrolling · grid (breakouts) · header · type · sections · hero · map · lists · forms · footer · gate · motion · preferences. */

/* Fonts (self-hosted, latin subsets; OFL licenses in /static/fonts/) */
@font-face { font-family: 'Public Sans Variable'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/public-sans-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'Public Sans Variable'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/public-sans-latin-wght-italic.woff2') format('woff2-variations'); }
@font-face { font-family: 'Big Shoulders Display Variable'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/static/fonts/big-shoulders-display-latin-wght-normal.woff2') format('woff2-variations'); }

@font-face { font-family: 'Public Sans Fallback'; src: local('Arial'), local('Liberation Sans'), local('Helvetica');
  size-adjust: 104.1%; ascent-override: 91.2%; descent-override: 21.6%; line-gap-override: 0%; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: var(--step-0); line-height: var(--lh);
  font-variant-numeric: tabular-nums lining-nums;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
p, ul, ol, h1, h2, h3 { margin: 0; }
p + p, .prose > * + * { margin-top: 1lh; }
p { text-wrap: pretty; }
h1, h2, .fact { text-wrap: balance; }
:lang(es) { quotes: "“" "”" "‘" "’"; }
blockquote { hanging-punctuation: first last; }
strong { font-weight: 650; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--sky); color: var(--pin-numeral-dark); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--brand); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }
.nowrap { white-space: nowrap; }

/* Scrolling and the scrollbar: standard properties only (Firefox 64, Chrome 121, Safari 18.2 / 26.2) */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--brand) var(--paper);
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
:target { scroll-margin-top: 1rem; }

/* Breakout grid (brief §8): the reading column is `content`; media and lists may take popout, feature or full.
   Applied to the main column, the header band and the footer so hairlines and the masthead share one set of lines. */
.grid, .main, .band, .foot {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [feature-start] minmax(0, var(--feature-w))
    [popout-start] minmax(0, var(--popout-w))
    [content-start] min(var(--measure), 100% - var(--gutter) * 2) [content-end]
    minmax(0, var(--popout-w)) [popout-end]
    minmax(0, var(--feature-w)) [feature-end]
    minmax(var(--gutter), 1fr) [full-end];
}
.grid > *, .main > *, .band > *, .foot > * { grid-column: content; min-width: 0; }
.grid > .wrap, .main > .wrap, .band > .wrap, .foot > .wrap { max-width: none; margin: 0; padding: 0; width: 100%; }
/* Inside the main column the wrap, its sections and post rows are subgrids, so margin notes can sit beside their heading */
.main > .wrap { grid-column: full; display: grid; grid-template-columns: subgrid; }
.main > .wrap > * { grid-column: content; min-width: 0; }
.main > .wrap > .section, .main > .wrap > .posts { grid-column: full; display: grid; grid-template-columns: subgrid; }
.main > .wrap > .section > *, .posts > .post-row > * { grid-column: content; min-width: 0; }
.posts > .post-row { grid-column: full; display: grid; grid-template-columns: subgrid; }
.marginal { font-size: var(--step--1); color: var(--muted); line-height: 1.35; margin: 0 0 4px; }
@media (min-width: 1200px) {
  .main > .wrap > .section > .marginal, .main > .wrap > .marginal, .posts > .post-row > .marginal, .main > .map-block > .marginal {
    grid-column: feature-start / content-start; grid-row: 1; align-self: start; max-width: 14rem; padding: 0.35em var(--gutter) 0 0; margin: 0;
  }
  .main > .wrap > .section > .marginal + *, .main > .wrap > .marginal + *, .posts > .post-row > .marginal + *, .main > .map-block > .marginal + * { grid-row: 1; }
}
@media (min-width: 1440px) { .main > .wrap > .section > .marginal, .main > .wrap > .marginal, .posts > .post-row > .marginal, .main > .map-block > .marginal { max-width: 16rem; } }
.grid > .wrap-wide, .main > .wrap-wide { grid-column: feature; max-width: none; margin: 0; padding: 0; width: 100%; }
.popout { grid-column: popout; }
.feature { grid-column: feature; }
.full { grid-column: full; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }      /* outside a grid (gate, admin) */
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.main { padding: 28px 0 56px; }
.main-admin { padding-top: 24px; padding-bottom: 56px; }

/* Header band: cream, one step deeper than the paper; the masthead row spans the feature width (brief §8) */
.band { background: var(--band); border-bottom: 1px solid var(--hairline); }
.band > .band-row, .band > .nav { grid-column: feature; }
.band-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-h); padding-top: 8px; }
.masthead { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-height: 44px; }
.badge { width: 40px; height: 40px; flex: none; }
.masthead-name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1; letter-spacing: 0; }
.masthead-small { font-size: var(--step-1); }
@media (max-width: 719px) { .masthead-name { font-size: 1.25rem; line-height: 0.95; } .tool { padding: 10px 4px; } }
.band-tools { display: flex; gap: 4px; }
.tool { background: none; border: 0; padding: 10px 8px; min-height: 44px; color: var(--brand); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; font-size: var(--step--1); white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: 0; padding-bottom: 6px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); text-decoration: none; font-size: var(--step--1); font-weight: 500; }
.nav a:first-child { padding-left: 0; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brand); }
.nav .nav-report { margin-left: auto; color: var(--brand); padding-right: 0; }
@media (min-width: 1024px) { .nav a + a:not(.nav-report) { border-left: 1px solid var(--hairline); } }

/* Type */
.title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-4); line-height: 1.05; margin-bottom: 20px; }
.h2 { font-size: var(--step-1); font-weight: 650; line-height: 1.25; margin-bottom: 10px; }
.h2 a { color: var(--ink); text-decoration: none; }
.h2 a:hover { text-decoration: underline; }
.h2-mark { display: flex; align-items: center; gap: 12px; }
.lead { font-size: var(--step-0); margin-top: 20px; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.prose h3 { font-size: var(--step-0); font-weight: 650; margin-top: 1.25em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote { margin: 0.75em 0; padding-left: 12px; border-left: 2px solid var(--hairline); color: var(--muted); }

/* Sections separated by hairlines that run edge to edge while the text keeps the measure; never boxes */
.section { position: relative; padding: 28px 0; }
.section::before { content: ""; position: absolute; top: 0; left: calc(50% - 50vw); width: 100vw; height: 1px; background: var(--hairline); }
.section:first-child { padding-top: 0; }
.section:first-child::before { display: none; }
.list, .posts, .dates { list-style: none; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--hairline); }
.list li:first-child { border-top: 0; }

/* Hero: the Saturday fact */
.hero { padding-bottom: 8px; }
.fact { font-size: var(--step-2); font-weight: 600; line-height: 1.2; }
.fact + .fact { margin-top: 4px; }
.next { margin-top: 14px; font-size: var(--step-0); }
.next-label { color: var(--muted); }
.next-note { display: block; margin-top: 4px; }
.hero-desc { margin-top: 14px; }
.actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.actions a { min-height: 44px; display: inline-flex; align-items: center; }
.status { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: var(--radius); font-size: var(--step--1); font-weight: 600; line-height: 1.7; vertical-align: 2px; }
.status-cancelled { background: var(--needs); color: var(--pin-numeral-light); }
.status-moved { background: var(--proposed); color: var(--pin-numeral-dark); }
.status-note { border: 1px solid var(--hairline); color: var(--muted); }

/* Map preview: the centrepiece; the figure takes the feature width, the text stays on the measure */
.map-block { grid-column: full; display: grid; grid-template-columns: subgrid; position: relative; margin-top: 32px; padding-top: 28px; }
.map-block::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--hairline); }
.map-block > * { grid-column: content; min-width: 0; }
.map-block > .map-figure { grid-column: feature; }
.map-lead { margin-bottom: 16px; }
.map-figure { display: block; margin: 16px 0 0; border: 1px solid var(--hairline); padding: 8px; background: var(--paper); }
.map-figure:hover { border-color: var(--brand); }
.mappreview { width: 100%; height: auto; }
.mappreview-phone { display: none; }
@media (max-width: 719px) { .mappreview-desk { display: none; } .mappreview-phone { display: block; } }
.count-line { margin-top: 14px; font-size: var(--step-0); }
.map-actions { margin-top: 10px; }
.map-note { margin-top: 12px; padding-bottom: 8px; }
.map-block + .wrap > .section:first-child { padding-top: 28px; margin-top: 28px; }
.map-block + .wrap > .section:first-child::before { display: block; }
.pin {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: var(--pin-numeral-light); font-size: 11px; font-weight: 600;
  box-shadow: 0 0 0 2px var(--pin-halo), 0 0 0 3px var(--pin-ring);
}

/* Date rows on Clean-ups and Sweeping: a date column and a details column from 720 px (the list takes the popout track) */
.date-row { display: block; padding: 12px 0; border-top: 1px solid var(--hairline); }
.date-day { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); line-height: 1.1; letter-spacing: 0; }
.date-meta { margin-top: 2px; }
.date-details > * + * { margin-top: 4px; }
@media (min-width: 720px) {
  .main > .wrap > .section > .dates-cols { grid-column: popout; }
  .dates-cols .date-row { display: grid; grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr); column-gap: var(--gutter); align-items: baseline; }
  .dates-cols .date-line { margin: 0; }
  .dates-cols .date-details { min-width: 0; }
}
.date-row:first-child { border-top: 0; }
.date-line { font-weight: 600; }
.date-line time { font-variant-numeric: tabular-nums; }
.date-time { font-weight: 400; color: var(--muted); }
.date-title { margin-top: 4px; font-weight: 600; }
.is-oneoff { padding: 16px 0; }
.is-oneoff .date-line { font-weight: 400; color: var(--muted); }
.date-note { margin-top: 4px; }
.date-details > .date-rsvp { margin-top: 0; }
.rsvp-when { margin-top: 14px; font-size: var(--step-1); font-weight: 600; }
.input-short { max-width: 8rem; }
.is-cancelled .date-line time, .is-cancelled .date-title { color: var(--muted); }
.is-cancelled .date-line time { text-decoration: line-through; text-decoration-thickness: 1px; }
.dates .is-today { box-shadow: inset 4px 0 0 var(--sky); padding-left: 10px; }

/* News */
.post-row { padding: 20px 0; border-top: 1px solid var(--hairline); }
.post-row:first-child { border-top: 0; padding-top: 0; }
.figure { margin: 20px 0; }
.credit { color: var(--muted); font-size: var(--step--1); }

/* Hero photo: full-bleed under the Saturday fact, caption on the measure */
.hero-photo { margin: 24px 0 0; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; max-height: 62vh; }
@media (min-width: 1024px) { .hero-photo img { aspect-ratio: 21 / 9; } }
.hero-photo figcaption { max-width: var(--measure); margin: 8px auto 0; padding: 0 16px; }
.ig-fig { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.ig-fig picture, .ig-fig > img { display: block; width: 112px; flex: none; }
.ig-fig img { width: 100%; height: auto; }
.ig-fig figcaption { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@media (min-width: 720px) { .ig-fig picture, .ig-fig > img { width: 160px; } }
/* Instagram strip: a list of plain photos with captions at every width (no three-up grid) */
.ig { list-style: none; padding: 0; }
.ig-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.ig-item:first-child { border-top: 0; padding-top: 0; }
.ig-link { display: flex; flex-direction: row; align-items: flex-start; gap: 14px; color: var(--ink); text-decoration: none; }
.ig-link:hover .ig-caption { text-decoration: underline; }
.ig-thumb { display: block; width: 112px; flex: none; }
.ig-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ig-caption { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--step--1); }
@media (min-width: 720px) { .ig-thumb { width: 160px; } }

/* Controls: one radius, 44 px, brand fill */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); border-radius: var(--radius);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-quiet { background: transparent; color: var(--brand); border-color: var(--hairline); }
.input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--muted); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.input:focus { border-color: var(--brand); }
@media (hover: hover) {
  .btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
  .btn-quiet:hover { background: var(--hover-wash); color: var(--brand); border-color: var(--hairline); }
}

/* Lookup form (sweeping): label above, field and button on one row, stacked on narrow phones */
.lookup { margin-top: 8px; padding-bottom: 16px; }
.label { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 6px; }
.lookup-row { display: flex; gap: 8px; }
.lookup-row .input { flex: 1; min-width: 0; }
@media (max-width: 420px) { .lookup-row { flex-direction: column; } }
.form-error { margin-top: 10px; color: var(--needs-text); font-weight: 600; }
.vform { margin-top: 20px; }
.vform .field + .field, .vform .field + p { margin-top: 18px; }
.field textarea.input { min-height: 7lh; resize: vertical; field-sizing: content; }
.checks { border: 0; padding: 0; margin: 18px 0 0; }
.checks legend { padding: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.input[aria-invalid="true"] { border-color: var(--needs-text); }
.chooser summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.chooser .list li { padding: 12px 0; }

/* Footer: hairline edge to edge, the content on the feature width in columns from 720 px */
.foot { position: relative; padding: 28px 0 40px; font-size: var(--step--1); color: var(--muted); }
.foot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--hairline); }
.foot > .wrap { grid-column: feature; }
.foot p + p { margin-top: 0.5lh; }
.foot-cols { display: grid; gap: 20px var(--gutter); }
@media (min-width: 720px) { .foot-cols { grid-template-columns: 1.4fr 1fr; align-items: start; } .foot-col .foot-links { margin-top: 0; } }
.foot-line { color: var(--muted); }
.foot-line strong { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 16px; }
.foot-links a { min-height: 44px; display: inline-flex; align-items: center; }
.foot-btns { display: flex; flex-wrap: wrap; gap: 10px 12px; }

.preview-banner { background: var(--proposed); color: var(--pin-numeral-dark); text-align: center; padding: 8px 16px; font-size: var(--step--1); }

/* Landing / gate / error pages: the only centred pages */
.gate-body { display: grid; min-height: 100vh; min-height: 100svh; place-items: center; padding: 24px 16px; }
.gate { text-align: center; max-width: 28rem; width: 100%; }
.gate-badge { width: 128px; height: 128px; margin: 0 auto 20px; }
.gate-name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-5); line-height: 1; }
.gate-line { margin-top: 14px; }
.gate-line + .gate-line { margin-top: 4px; color: var(--muted); }
.gate-form { margin-top: 28px; text-align: left; }
.gate-label { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 6px; }
.gate-row { display: flex; gap: 8px; }
.gate-row .input { flex: 1; }
.gate-error { margin-top: 10px; color: var(--needs-text); font-weight: 600; }
@media (max-width: 420px) { .gate-row { flex-direction: column; } }

/* Motion (brief §12): colour hovers, a press, the hero once per load; nothing moves on scroll. All inside no-preference. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .btn, .tool, .nav a, .input, .map-figure {
    transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
      text-decoration-thickness var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
  }
  .btn:active { transform: scale(0.97); transition: transform var(--dur-press) var(--ease-out); }
  .home .hero { animation: hero-in var(--dur-slow) var(--ease-out) both; }
  @keyframes hero-in { from { opacity: 0; transform: translateY(8px); } }
}

/* Preferences: dark photos a touch softer; more contrast means solid hairlines and no washes; forced colours keep the cues */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.figure, .ig-thumb, .hero-photo, .ig-fig) img { filter: brightness(0.9); } }
:root[data-theme="dark"] :is(.figure, .ig-thumb, .hero-photo, .ig-fig) img { filter: brightness(0.9); }
@media (prefers-contrast: more) {
  :root { --hairline: var(--ink); --hover-wash: transparent; }
  .muted, .credit, .label, .foot { color: var(--ink); }
}
@media (forced-colors: active) {
  .nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
  .status { border: 1px solid CanvasText; }
  .dates .is-today { border-left: 4px solid CanvasText; }
  .btn { border: 1px solid ButtonText; }
}
