/*
 * Dark, editorial, film-first. The platform's design principles apply here as
 * much as to a film site: atmosphere first, the platform invisible, type
 * carrying the hierarchy.
 *
 * Colours come from the site's published design tokens as custom properties
 * (see views/layout.ts) with the values below as fallbacks, so a Doc Society
 * campaign site arrives in its own palette without this file knowing anything
 * about it.
 */

:root {
  --bg: #0d0d0c;
  --text: #f4f2ec;
  --accent: #e0503a;
  --font-heading: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --muted: color-mix(in srgb, var(--text) 60%, transparent);
  --hairline: color-mix(in srgb, var(--text) 16%, transparent);
  --surface: color-mix(in srgb, var(--text) 6%, transparent);
  --radius: 10px;
  --gutter: 20px;
  --measure: 34rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.9rem); margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.05rem; margin: 0.6rem 0 0.2rem; }

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: var(--gutter);
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius);
  z-index: 10;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- chrome ------------------------------------------------------------ */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px var(--gutter);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.92rem; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }
.site-header .account { color: var(--accent); }

main { padding: 0 var(--gutter) 64px; max-width: 1040px; margin: 0 auto; }

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 24px var(--gutter);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- blocks ------------------------------------------------------------ */

.hero { padding: 64px 0 40px; max-width: 28ch; }
.hero.compact { padding: 44px 0 20px; max-width: var(--measure); }
.standfirst { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--muted); margin: 0 0 8px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.85rem; }
.optional { color: var(--muted); font-weight: 400; font-size: 0.8em; }
.empty { color: var(--muted); }

.button, button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 13px 22px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { filter: brightness(1.08); }
button[disabled] { opacity: 0.6; cursor: progress; }

/* ---- films ------------------------------------------------------------- */

.film-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px 20px;
}
.film-card a { text-decoration: none; display: block; }
.film-card img, .poster-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
  display: block;
}
.film-card .licence { color: var(--muted); font-size: 0.85rem; margin: 2px 0 0; }
.film-card .credits { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }

/* ---- playlists --------------------------------------------------------- */

/* One column on a phone, which is where a host picks a collection, widening
   only when there is room for two cards side by side. */
.playlist-grid {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) {
  .playlist-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
.playlist-card a {
  display: block;
  text-decoration: none;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
}
.playlist-card h3 { margin: 14px 0 0; }
.playlist-card .blurb { margin: 6px 0 0; color: var(--muted); max-width: var(--measure); }
.playlist-card .count { margin: 10px 0 0; color: var(--muted); font-size: 0.85rem; }

/* Overlapping posters: a collection reads as a stack of films, and the strip
   never grows past the card on a narrow screen. */
.playlist-posters { display: flex; overflow: hidden; }
.playlist-posters img {
  width: 72px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) / 2);
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--surface);
  flex: 0 0 auto;
}
.playlist-posters img + img { margin-left: -18px; }

/* The "All films · N" marker sits beside its heading, not under it. */
.films h2 .count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  margin-left: 10px;
  white-space: nowrap;
}

.film-head { display: grid; gap: 28px; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: start; padding: 40px 0 0; }
.film-head .poster { border-radius: var(--radius); }
.synopsis { max-width: var(--measure); }
.trailer { margin: 32px 0; }
.trailer iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

@media (max-width: 640px) {
  .film-head { grid-template-columns: 1fr; }
  .film-head .poster { max-width: 200px; }
}

/* ---- screenings -------------------------------------------------------- */

.screening-list { list-style: none; margin: 0; padding: 0; }
.screening-list li { border-bottom: 1px solid var(--hairline); }
.screening-list a {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 18px 0;
  text-decoration: none;
}
.screening-list .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.screening-list .what { font-weight: 600; }
.screening-list .where { grid-column: 2; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 640px) {
  .screening-list a { grid-template-columns: 1fr; }
  .screening-list .where { grid-column: 1; }
}

.screening { max-width: var(--measure); padding: 48px 0 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 24px 0; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0; }
.notes { white-space: pre-wrap; }

.callout {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin: 28px 0;
}
.callout h2 { margin-top: 0; }
.callout.success { border-color: var(--accent); }
.callout.warn { border-color: var(--accent); }

.error {
  color: #ffb4a6;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

/* ---- forms ------------------------------------------------------------- */

form { max-width: var(--measure); }
form.rsvp { margin-top: 32px; }
label { display: block; margin: 0 0 18px; font-size: 0.9rem; color: var(--muted); }
label input, label textarea, label select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 11px 12px;
}
label textarea { resize: vertical; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
label.check input { width: auto; margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

form.danger { margin-top: 40px; }
form.danger button { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.narrow { max-width: var(--measure); padding: 48px 0 0; }
.narrow.wide { max-width: 52rem; }

.steps { color: var(--muted); max-width: var(--measure); }
.steps strong { color: var(--text); }

.film-picker, .host-screenings { list-style: none; margin: 0; padding: 0; }
.film-picker li, .host-screenings li { border-bottom: 1px solid var(--hairline); }
.film-picker a, .host-screenings a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  text-decoration: none;
}
.film-picker .licence { color: var(--muted); font-size: 0.9rem; }
.host-screenings li { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.host-screenings a { flex-direction: column; gap: 2px; flex: 1 1 18rem; }
.host-screenings .when { color: var(--muted); font-size: 0.88rem; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { color: var(--text); border-color: var(--text); }
.badge.warn { color: var(--accent); border-color: var(--accent); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }

table.rsvps { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-size: 0.92rem; }
table.rsvps th, table.rsvps td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hairline); }
table.rsvps th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Visually hidden, still announced. */
.sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The honeypot the RSVP form carries. Off-screen rather than display:none —
   a bot that filters on the latter would skip it, which is the opposite of
   what a honeypot is for. */
.hp {
  position: absolute;
  left: -9999px;
  top: 0;
  height: 0;
  overflow: hidden;
}

button.quiet {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--hairline);
  padding: 7px 14px;
  font-size: 0.85rem;
}

.terms { margin: 16px 0; color: var(--muted); }
.terms summary { cursor: pointer; }
.terms p { white-space: pre-wrap; }

form.acquire { margin-top: 28px; }

table.rsvps form { margin: 0; }

/* ---- the host question flow -------------------------------------------- */

/* One column, one question, one button. Mobile is the real target: the
   desktop rule at the end only centres what the phone already sees. */
.flow {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 20px 0 48px;
}

.flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 28px;
}

.flow-crumb {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  /* The crumb is whatever they last answered, and a venue name can be long. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-progress { display: flex; gap: 6px; flex: 0 0 auto; }
.flow-progress .seg {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--hairline);
}
.flow-progress .seg.on { background: var(--text); }

.flow h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin: 0 0 0.5rem; }
.flow .standfirst { font-size: 1rem; margin: 0 0 28px; }
.flow form { max-width: none; }

/* The button is the full width of the column on every screen, so the thumb
   never has to look for it. */
.flow-cta {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 16px 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 1rem;
}
.flow-cta.accent { background: var(--accent); color: #fff; }
.flow-cta[disabled] { background: var(--hairline); color: var(--muted); cursor: not-allowed; }

/* ---- choice cards (step 1) --------------------------------------------- */

.cards { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.cards .card { display: block; margin: 0; cursor: pointer; }
.cards .card input { position: absolute; opacity: 0; width: 0; height: 0; }
.card-body {
  display: block;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
}
.cards .card input:checked + .card-body { border-color: var(--accent); }
.cards .card input:focus-visible + .card-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-title { display: block; font-weight: 600; color: var(--text); }
.card-desc { display: block; margin-top: 4px; color: var(--muted); font-size: 0.92rem; }
.card-price { display: block; margin-top: 8px; color: var(--accent); font-style: italic; font-size: 0.9rem; }

/* ---- chips (steps 4 and 5) --------------------------------------------- */

.chips { border: 0; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.chips legend { color: var(--muted); font-size: 0.9rem; padding: 0 0 10px; }
.chip { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.chip input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--muted);
  font-size: 0.92rem;
}
.chip input:checked + span { border-color: var(--text); color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.other { gap: 8px; }
.chip.other span { border-style: dashed; }
.chip.other input[type="number"] {
  width: 6.5rem;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
}

/* ---- address search (step 2) ------------------------------------------- */

.address-search { position: relative; margin-bottom: 8px; }
.address-search input[type="search"] { margin-top: 0; }
.address-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.address-results li + li { border-top: 1px solid var(--hairline); }
.address-result {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 0;
  padding: 12px 14px;
  font: inherit;
}
.address-result:hover, .address-result:focus-visible { background: var(--surface); }
.address-result .name { display: block; font-weight: 600; font-size: 0.95rem; }
.address-result .detail { display: block; color: var(--muted); font-size: 0.85rem; }
.address-search .picked { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ---- when (step 3) ------------------------------------------------------ */

.when-row { align-items: end; }
.when-row .zone {
  margin: 0 0 18px;
  padding: 11px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- summary (step 5 and the submit screen) ----------------------------- */

.flow-summary {
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.92rem;
  color: var(--muted);
}
.flow-summary p { margin: 0 0 4px; }
.flow-summary strong { color: var(--text); }

@media (min-width: 640px) {
  .flow { padding-top: 40px; }
}

/* ---- notice pages ------------------------------------------------------ */

body.notice main { display: grid; place-content: center; min-height: 100vh; text-align: center; max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
