/* Cambridge Gigs: shared styles for the listings page and gig pages */
/* Fonts are served from /fonts on this site (SIL Open Font License, see the OFL files there),
   not Google Fonts, so visitors' browsers never contact Google. Latin and Latin Extended only. */
@font-face {font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/anton-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face {font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/anton-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face {font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 400; font-stretch: 100%; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face {font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 400; font-stretch: 100%; font-display: swap; src: url(/fonts/bricolage-grotesque-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face {font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600; font-stretch: 100%; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face {font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600; font-stretch: 100%; font-display: swap; src: url(/fonts/bricolage-grotesque-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Phones have no Impact, so until Anton downloads they'd show Arial, which is far wider: the header
   wraps and then jumps back. These stand-ins are squeezed to Anton's width so nothing moves when it arrives. */
@font-face { font-family: "Anton Fallback"; src: local("Arial"), local("Helvetica"), local("Helvetica Neue"); size-adjust: 71%; }
@font-face { font-family: "Anton Fallback Roboto"; src: local("Roboto"); size-adjust: 76%; }

/* ---------- Light: warm paper ---------- */
:root {
  --bg: #f6efe3;
  --surface: #fffaf2;
  --text: #1d1a16;
  --muted: #6d6458;
  --line: #e4d9c6;
  --line-strong: #cdbfa9;
  --accent: #e2462c;
  --accent-soft: #fbe1d9;
  --on-accent: #ffffff;
  --block-bg: #1d1a16;
  --block-text: #f6efe3;
  --block-month: #ff7a5c;
  /* the poster headline font is shared by both themes; only colours change */
  --font: "Bricolage Grotesque", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Anton", Impact, "Anton Fallback", "Anton Fallback Roboto", "Arial Narrow", sans-serif;
  --display-weight: 400;
  --display-case: uppercase;
  --display-spacing: 0.5px;
  color-scheme: light;
}

/* ---------- Dark: gig poster ---------- */
:root[data-theme="dark"] {
  --bg: #141210;
  --surface: #1d1a17;
  --text: #f3eee6;
  --muted: #a39a8e;
  --line: #2c2824;
  --line-strong: #4a443d;
  --accent: #ff4a3d;
  --accent-soft: rgba(255, 74, 61, 0.15);
  --on-accent: #141210;
  --block-bg: transparent;
  --block-text: #f3eee6;
  --block-month: #ff4a3d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 6px; }
.logo {
  font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-spacing); font-size: 28px; line-height: 1; text-decoration: none;
  /* the wider backup font shown before Anton loads would otherwise wrap onto two lines on phones, then jump back */
  white-space: nowrap;
}
.logo span { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.link-button:hover { text-decoration: underline; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--text);
}
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .icon-moon, :root:not([data-theme="dark"]) .icon-sun { display: none; }

.intro { padding: 18px 0 4px; }
.intro h1 {
  margin: 0; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-spacing); font-size: 34px; line-height: 1.1;
}

/* Controls */
.controls { padding: 16px 0 4px; display: grid; gap: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; cursor: pointer;
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips.is-searching .chip[aria-pressed="true"],
:root[data-theme="dark"] .chips.is-searching .chip[aria-pressed="true"] {
  background: var(--surface); color: var(--text); border-color: var(--line-strong); font-weight: 400;
}
.date-pick { position: relative; display: inline-flex; }
.date-pick:hover .chip { border-color: var(--text); }
/* covers the chip so a tap lands on the input itself; 16px stops iOS zooming in */
.date-input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  border: 0; padding: 0; margin: 0; font-size: 16px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.date-input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.filters input, .filters select {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--surface);
}
.filters input:focus, .filters select:focus, .chip:focus-visible, .theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toggles { display: flex; gap: 18px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); cursor: pointer; }
.toggle input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.toggle:has(input:checked) { color: var(--text); }
.status { font-size: 14px; color: var(--muted); min-height: 21px; }

/* Listings: a date block per night, gigs beside it.
   Until gigs.json arrives the list is empty; holding a screen's height stops everything below it jumping down */
#listings:empty { min-height: 100vh; }
.day { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; margin-top: 22px; }
.date-block {
  position: sticky; top: 12px; align-self: start; text-align: center; border-radius: 12px; padding: 8px 0 7px;
  background: var(--block-bg); color: var(--block-text); line-height: 1.1;
}
:root[data-theme="dark"] .date-block { border: 1px solid var(--line-strong); }
.date-block .dow { display: block; font-size: 12px; font-weight: 600; letter-spacing: 1px; }
.date-block .dom { display: block; font-family: var(--display); font-weight: var(--display-weight); font-size: 32px; line-height: 1.05; }
:root[data-theme="dark"] .date-block .dom { color: var(--accent); }
.date-block .mon { display: block; font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--block-month); }
.date-block.today { background: var(--accent); color: var(--on-accent); }
.date-block.today .mon, :root[data-theme="dark"] .date-block.today .dom { color: var(--on-accent); }

.gig {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  padding: 2px 0 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--line-strong);
}
.day-gigs .gig:last-child { border-bottom: 0; margin-bottom: 0; }
.gig[data-url] { cursor: pointer; }
.gig[data-url]:hover .artist { color: var(--accent); }
.artist { font-weight: 600; font-size: 18px; line-height: 1.3; text-decoration: none; }
/* long programme titles stop at two lines in the list; the gig page has the full name */
.gig .artist { display: -webkit-inline-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.new {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent);
  margin-left: 6px; vertical-align: 2px;
}
.support { font-size: 14px; color: var(--text); opacity: 0.85; }
.sub { font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; font-size: 13px; }
.price { font-weight: 600; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--g-bg, var(--line)); color: var(--g-fg, var(--text)); }
:root[data-theme="dark"] .pill { background: transparent; border: 1px solid currentColor; color: var(--g-dk, var(--muted)); padding: 1px 8px; }
.pill.plain { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.sold-out {
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px; border-radius: 6px; padding: 2px 8px;
  color: var(--accent); background: var(--accent-soft);
}
:root[data-theme="dark"] .sold-out { background: var(--accent); color: var(--on-accent); text-transform: uppercase; }
.gig.is-sold-out .artist, .gig.is-postponed .artist { opacity: 0.6; }
.gig.is-cancelled .artist { opacity: 0.6; text-decoration: line-through; text-decoration-thickness: 2px; }

.cal {
  background: none; border: 0; padding: 6px; margin: -2px -6px 0 0; color: var(--muted); cursor: pointer;
  line-height: 0; border-radius: 8px; align-self: start;
}
.cal:hover { color: var(--accent); background: var(--accent-soft); }
.cal svg { width: 19px; height: 19px; }

/* Genre colours: soft fills in light mode, outlines in dark */
.g-rock       { --g-bg: #f6d4c8; --g-fg: #7a2a14; --g-dk: #ff9b7d; }
.g-indie      { --g-bg: #d6e4f5; --g-fg: #1d4a7a; --g-dk: #8fbaf0; }
.g-punk       { --g-bg: #f5cfd8; --g-fg: #7a1f3a; --g-dk: #f58fab; }
.g-metal      { --g-bg: #dcd8d2; --g-fg: #3a352f; --g-dk: #c9c2b8; }
.g-pop        { --g-bg: #f7d2ea; --g-fg: #7a1f5c; --g-dk: #f08fd0; }
.g-folk       { --g-bg: #cfe6c8; --g-fg: #28521c; --g-dk: #9fd68c; }
.g-jazz       { --g-bg: #f3d9a8; --g-fg: #6b4410; --g-dk: #f0c070; }
.g-electronic { --g-bg: #e0d6f5; --g-fg: #40287a; --g-dk: #b9a2f0; }
.g-soul       { --g-bg: #f5dcc0; --g-fg: #7a3f10; --g-dk: #f2ae6e; }
.g-hiphop     { --g-bg: #f5e6a8; --g-fg: #5c4a0a; --g-dk: #ecd46a; }
.g-reggae     { --g-bg: #d2ecc0; --g-fg: #2f5c12; --g-dk: #a8dc7e; }
.g-classical  { --g-bg: #dcdcf2; --g-fg: #2e2e6b; --g-dk: #aeb0ee; }
.g-country    { --g-bg: #eadfc8; --g-fg: #5c4520; --g-dk: #dcc293; }
.g-world      { --g-bg: #c8e8e6; --g-fg: #145c57; --g-dk: #7fd6cf; }

.more { text-align: center; padding: 28px 0 8px; }
.button {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 10px 22px; cursor: pointer; font-weight: 600;
}
.button:hover { border-color: var(--text); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* Submit form */
#submit { display: none; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
#submit.open { display: block; }
#submit h2 {
  margin: 0 0 4px; font-family: var(--display); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-spacing); font-size: 24px;
}
#submit > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg);
}
.field textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.form-note { font-size: 13px; color: var(--muted); }
.field-note { display: block; margin-top: 5px; font-size: 13px; color: var(--muted); }

/* Support card: sidebar on wide screens, once in the list on smaller ones */
.support-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
}
:root[data-theme="dark"] .support-card { border-color: var(--line-strong); }
.support-card h2 {
  margin: 0 0 8px; font-family: var(--display); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-spacing); font-size: 24px; line-height: 1.1;
}
.support-card h2 span { color: var(--accent); }
.support-card p { margin: 0 0 16px; font-size: 15px; color: var(--muted); }
.support-card .sig { color: var(--text); font-weight: 600; }
.coffee-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 11px 18px;
  font-weight: 600; text-decoration: none; transition: transform 0.15s;
}
.coffee-button:hover { transform: translateY(-1px); }
.coffee-button svg { width: 20px; height: 20px; }
.side-panel { display: none; }
.inline-support { margin-top: 22px; }
/* Weekly email sign-up: a support card in the page flow */
.signup { margin-top: 36px; }
.signup-form { display: flex; gap: 8px; }
.signup-form[hidden] { display: none; }
.signup-form input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; }
.signup-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.signup-form .coffee-button { width: auto; flex: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.support-card .signup-note { margin: 10px 0 0; font-size: 13px; }

@media (min-width: 1100px) {
  .wrap { max-width: 1100px; }
  main.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; align-items: start; }
  .side-panel { display: block; position: sticky; top: 24px; margin-top: 18px; }
  .inline-support { display: none; }
}

footer { margin: 48px 0 0; padding: 24px 0 40px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 6px; }

@media (max-width: 560px) {
  .logo { font-size: 24px; }
  .intro h1 { font-size: 28px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input { grid-column: 1 / -1; }
  /* a fixed two-column grid, so the toggles wrap the same with or without the web font loaded */
  .toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .day { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .date-block .dom { font-size: 26px; }
  .artist { font-size: 17px; }
}

/* clear focus rings for keyboard users */
.artist:focus-visible, .cal:focus-visible, .coffee-button:focus-visible, .link-button:focus-visible,
.button:focus-visible, .logo:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gig pages ---------- */
.back { margin: 18px 0 8px; font-size: 15px; }
.gig-page { padding-top: 8px; }
.gig-head { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; align-items: start; }
.gig-head .date-block { position: static; padding: 10px 0 9px; }
.gig-head .date-block .dom { font-size: 38px; }
.gig-page h1 {
  margin: 0; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-spacing); font-size: 44px; line-height: 1.05;
}
.gig-page.is-cancelled h1 { text-decoration: line-through; opacity: 0.6; }
.gig-support { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.gig-head p { margin: 8px 0 0; }
.gig-facts { margin: 26px 0; display: grid; gap: 14px; }
.gig-facts > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-strong); }
.gig-facts dt { font-size: 13px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.gig-facts dd { margin: 0; font-size: 17px; }
.muted { color: var(--muted); }
.form-why { font-size: 14px; color: var(--muted); margin-top: -4px; }
.add-gig { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tiers li { display: flex; justify-content: space-between; gap: 12px; max-width: 360px; }
.tier-price { font-weight: 600; white-space: nowrap; }
.gig-about { margin: -6px 0 26px; max-width: 640px; }
.gig-about p { margin: 0 0 12px; line-height: 1.55; }
.gig-actions { display: grid; gap: 12px; max-width: 420px; }
.gig-actions .coffee-button { font-size: 17px; padding: 14px 20px; }
.gig-actions .via { font-weight: 400; opacity: 0.85; font-size: 14px; }
.gig-secondary { display: flex; gap: 10px; flex-wrap: wrap; }
.gig-secondary .button { display: inline-flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
.gig-secondary svg { width: 18px; height: 18px; }
.same-night { margin-top: 40px; }
.same-night h2 {
  font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-spacing); font-size: 24px; margin: 0 0 10px;
}
.same-night ul { list-style: none; margin: 0; padding: 0; }
.same-night li { padding: 10px 0; border-bottom: 1px dashed var(--line-strong); }
.same-night a { font-weight: 600; text-decoration: none; }
.same-night a:hover { color: var(--accent); }
.same-night .muted { display: block; font-size: 14px; }
@media (max-width: 560px) {
  .gig-head { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; }
  .gig-head .date-block .dom { font-size: 30px; }
  .gig-page h1 { font-size: 34px; }
  .gig-facts > div { grid-template-columns: 76px minmax(0, 1fr); }
}
.gig-secondary .button { white-space: nowrap; padding: 10px 14px; }

/* ---------- Venue pages, past gigs, front-page venue list ---------- */
.venue-page h1 {
  margin: 8px 0 6px; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-spacing); font-size: 44px; line-height: 1.05;
}
.venue-address { margin: 0 0 8px; color: var(--muted); }
.venue-page .same-night { margin-top: 30px; }
/* plain reading pages (privacy) */
.text-page { max-width: 640px; }
.text-page h2 { margin: 28px 0 8px; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-spacing); font-size: 24px; }
.text-page p { margin: 0 0 12px; line-height: 1.6; }
.same-night .support-inline { color: var(--muted); }
.same-night a:not(.link-button) { color: inherit; }
.more-link { margin: 14px 0 0; }
.gig-facts a:not(.link-button) { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.gig-facts a:not(.link-button):hover { color: var(--accent); }
.past-note { font-weight: 600; color: var(--accent); }
.is-past h1 { opacity: 0.75; }
.venues { margin-top: 44px; }
.venues h2 {
  font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--display-case);
  letter-spacing: var(--display-spacing); font-size: 24px; margin: 0 0 10px;
}
.venue-index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; font-size: 15px; }
.venue-index li { padding: 4px 0; break-inside: avoid; }
.venue-index a { color: inherit; text-decoration: none; }
.venue-index a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 560px) { .venue-page h1 { font-size: 34px; } }
