/* Zuhg Life theme, screen-print style: square corners, thin ink lines, and flat color blocks knocked
   slightly out of register instead of ink shadows. Colors pulled from Zuhg's paintings.
   The 70s theme lives on the theme-70s branch. Tweak the tokens below to re-skin. */
:root {
  --bg: #f7f1e3;
  --surface: #fffdf7;
  --ink: #161616;
  --muted: #5f5a52;
  --sage: #a2bd92;
  --sand: #e4ecd9; /* soft fill: pale sage */
  --coral: #f2624f;
  --mustard: #f2c12e;
  --teal: #1fa2b8;
  --purple: #7a4fb5;
  --clay: #c47a4f;
  --red: #b8382a; /* coral dark enough for text */
  --line: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--sage); /* flat color offset, like a misregistered print layer */
  --waves: url("/assets/zuhg/wave-band-1e564b8d.jpg") 0 50% / auto 100% repeat-x var(--sage);
  --radius: 2px;
  --display: "Archivo Black", "Arial Black", sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
/* Inline links: a mustard highlighter stroke that floods up behind the text on hover. */
a {
  color: var(--ink); font-weight: 700; text-decoration: none;
  background: linear-gradient(var(--mustard), var(--mustard)) 0 100% / 100% 0.3em no-repeat;
  transition: background-size 0.18s ease-out;
}
a:hover { background-size: 100% 100%; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: var(--radius); }
img { max-width: 100%; display: block; }
h1, h2, h3, .brand { font-family: var(--display); font-weight: 400; line-height: 1.15; letter-spacing: 0.01em; }
h1 { text-transform: uppercase; }
h2 { margin-top: 2.5rem; text-transform: uppercase; }
h3 { margin: 0.25rem 0; }
h3 a, h1 a { color: inherit; font-weight: inherit; background-size: 100% 0; background-image: linear-gradient(var(--sage), var(--sage)); }
h3 a:hover, h1 a:hover { background-size: 100% 0.45em; }

/* Surf-shop header: announcement bar, centered hand-lettered brand, nav, then a strip of Zuhg's waves. */
.announce { margin: 0; padding: 0.45rem 1rem; background: var(--ink); color: var(--bg); text-align: center; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; }
.announce a { color: var(--mustard); background: none; }
.announce a:hover { text-decoration: underline; }
.site-header {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 1.25rem; margin-bottom: calc(56px + 2rem); position: relative; background: var(--surface);
}
.site-header::after, .cover::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 56px; background: var(--waves); border-block: var(--line); }
.brand { font-size: clamp(1.8rem, 4vw, 3rem); color: var(--ink); background: none; text-transform: uppercase; }
.brand span { color: var(--coral); }
nav { display: flex; gap: 0.75rem; }
nav a { background: none; padding: 0.25rem 0.9rem; border-radius: var(--radius); border: 3px solid transparent; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
nav a:hover { border-color: var(--ink); background: var(--mustard); }
@media (min-width: 900px) {
  .site-header { flex-direction: column; text-align: center; }
}
/* Phones/tablets: the nav becomes a drawer from the right, toggled by drawer_controller.js. */
.menu-toggle, .menu-close { display: none; }
@media (max-width: 899px) {
  .site-header { flex-wrap: nowrap; align-items: flex-start; } /* the brand wraps its own words; the toggle stays top right */
  .site-header { padding-right: calc(clamp(1rem, 4vw, 2.5rem) + 3rem); } /* room for the fixed toggle */
  /* Fixed where it sits in the header (under the announce bar), so the menu stays a tap away down long pages. */
  .menu-toggle { display: inline-flex; position: fixed; z-index: 15; top: calc(0.9rem + 0.85rem * 1.55 + 1rem); right: clamp(1rem, 4vw, 2.5rem); padding: 0.5rem; line-height: 0; }
  .menu-close { display: block; align-self: flex-end; margin-bottom: 1rem; }
  .site-nav {
    position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(18rem, 85vw); overflow-y: auto;
    flex-direction: column; gap: 0.25rem; padding: 1.25rem; background: var(--surface); border-left: var(--line);
    box-shadow: -8px 0 0 var(--sage);
    transform: translateX(calc(100% + 12px)); visibility: hidden; transition: transform 0.2s, visibility 0.2s;
  }
  .nav-open .site-nav { transform: none; visibility: visible; }
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem) 3rem; }

.card { background: var(--surface); border-radius: var(--radius); border: var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.12s ease-out, box-shadow 0.12s ease-out; }
.card:hover { box-shadow: 9px 9px 0 var(--mustard); }
.card:has(.cal-menu[open]) { overflow: visible; position: relative; z-index: 5; } /* let the calendar menu escape the card and sit over the next one */
.card > img:first-child { border-bottom: var(--line); }
.card-body { padding: 1rem 1.25rem; }
.hero-stage { display: grid; gap: 1.5rem 2.5rem; align-items: start; }
.hero-stage:has(.hero-pic) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: 1.5rem; }
.hero-art { grid-column: 2; grid-row: 1; position: relative; isolation: isolate; }
.hero-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--coral); transform: translate(18px, 16px) rotate(2.5deg); }
.hero-pic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; transform: rotate(-1.5deg); }
/* The headline runs past its column and over the picture, on a strip of paper so it stays readable. */
.hero-stage:has(.hero-pic) .hero-copy { position: relative; z-index: 1; }
.hero-stage:has(.hero-pic) .hero-copy h1 { margin-right: -7rem; }
.hero-stage:has(.hero-pic) .hero-copy h1 a { background-color: var(--bg); padding: 0 0.15em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (max-width: 760px) {
  .hero-stage:has(.hero-pic) { grid-template-columns: 1fr; }
  .hero-art { grid-column: 1; margin-right: 18px; }
  .hero-stage:has(.hero-pic) .hero-copy h1 { margin-right: 0; }
}
.card-pic { width: 100%; aspect-ratio: 600 / 340; object-fit: cover; object-position: top left; }
.wide-pic { width: 100%; aspect-ratio: 12 / 5; object-fit: cover; object-position: top left; }
/* Homepage cover photo: full bleed between the header and the wave strip, which moves below it. */
.site-header:has(+ .cover) { margin-bottom: 0; }
.site-header:has(+ .cover)::after { content: none; }
.cover { position: relative; margin-bottom: calc(56px + 2rem); background: var(--surface); } /* sides past max-width match the header */
.cover img { width: 100%; max-width: 1600px; height: clamp(180px, 26vw, 400px); margin: 0 auto; object-fit: cover; object-position: 50% 35%; }

/* Artist profile: photo beside the details; stacked on phones. */
.sample { margin: 1rem 0 0; }
.sample figcaption { font-weight: 800; font-size: 0.9rem; }
.sample audio { width: 100%; }
.profile:has(.profile-pic) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.profile .card-body { padding: 1.75rem 2rem; align-self: center; }
.profile > .profile-pic { width: 100%; height: 100%; min-height: 22rem; object-fit: cover; object-position: top center; border-bottom: 0; border-right: var(--line); }
@media (max-width: 760px) {
  .profile:has(.profile-pic) { grid-template-columns: 1fr; }
  .profile .card-body { padding: 1.25rem; }
  .profile > .profile-pic { height: auto; min-height: 0; aspect-ratio: 4 / 3; border-right: 0; border-bottom: var(--line); }
}
.hero-copy { max-width: 36rem; }
.hero-copy h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0.25rem 0 0.5rem; }
.countdown { margin-left: 0.4em; padding: 0.1rem 0.6rem; border-radius: var(--radius); background: var(--purple); color: #fff; white-space: nowrap; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.25rem; }

/* Venue map: tiles tinted toward the art, framed like a print, with Zuhg's PNGs as pins. */
.map-frame { margin: 0 0 2.5rem; border: var(--line); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--teal); overflow: hidden; background: var(--sage); }
.map { height: clamp(320px, 55vh, 520px); background: var(--sage); isolation: isolate; } /* keep Leaflet's 400–1000 z-indexes inside the map, under the nav drawer */
@media (max-width: 760px) { .map { height: 38vh; min-height: 240px; } } /* leave room on phones to scroll past it */
/* Venue page: the venue's picture and its map side by side (stacked on phones); the map alone spans the row. */
.venue-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.venue-media .map-frame { margin: 0; min-height: 320px; }
.venue-media .map { height: 100%; }
.venue-card { margin-bottom: 2rem; }
.venue-card h1 { margin: 0; }
.map-toggle { display: none; }
@media (max-width: 760px) {
  .map-toggle { display: block; justify-self: start; }
  .venue-media:not(.map-open) .map-frame { display: none; }
}
.venue-pic { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: var(--line); box-shadow: 10px 10px 0 var(--coral); }
.map .leaflet-tile-pane { filter: sepia(0.25) contrast(1.1); } /* no saturate: it turns gray land-use shading yellow */
.map-defs { position: absolute; }
/* The art is multiplied into the map's own water and forest colors, so it reads as texture and labels stay on top. */
.map .leaflet-overlay-pane { mix-blend-mode: multiply; }
.map-pin { filter: drop-shadow(2px 2px 0 rgb(22 22 22 / 0.35)); transition: transform 0.12s; }
.map-pin:hover { transform: translateY(-3px); }
.map .leaflet-popup-content-wrapper { border: var(--line); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--sage); background: var(--surface); font-family: var(--body); }
.map .leaflet-popup-tip { background: var(--ink); }
.map .leaflet-popup-content { margin: 0.75rem 1rem; display: grid; gap: 0.35rem; justify-items: start; }
.map .leaflet-popup-content p { margin: 0; color: var(--muted); }
.map-popup-name { font: 1.15rem var(--display); }
.map .leaflet-bar { border: var(--line); box-shadow: 4px 4px 0 var(--mustard); }
.map .leaflet-bar a { color: var(--ink); background: var(--surface); }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* Tonight's 2-3 shows stretch to fill the row instead of leaving empty columns. */
.tonight .grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.eyebrow, .when { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 800; color: var(--purple); margin: 0; }
.meta, .muted { color: var(--muted); margin: 0.25rem 0; }
.tag { display: inline-block; background: var(--sand); border-radius: var(--radius); padding: 0.1rem 0.65rem; font-size: 0.8rem; margin-right: 0.35rem; }
.tag-sponsored { background: var(--mustard); }
/* Artist website/social icon buttons: ink-outlined squares that lift onto a print layer on hover. */
.socials { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0 0; }
.social {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; color: var(--ink); background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--radius); transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s;
}
.social svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.social:hover { background: var(--mustard); box-shadow: 3px 3px 0 var(--ink); transform: translate(-2px, -2px); }
/* Venue / artist chips: small tags you can tap, each marked by what it is. */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.2rem 0.75rem 0.2rem 0.55rem;
  border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface);
  font-size: 0.85rem; line-height: 1.3; transition: background-color 0.15s, color 0.15s;
}
.chip { max-width: 100%; white-space: nowrap; }
.chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip::before { flex-shrink: 0; }
.chip-venue::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--coral); box-shadow: 0 0 0 1.5px var(--ink); }
.chip-artist::before { content: "♪"; color: var(--teal); font-size: 1.05em; line-height: 1; }
.chip-venue:hover { background: var(--coral); }
.chip-artist:hover { background: var(--teal); }
.chip-artist:hover::before { color: var(--ink); }

/* Secondary actions: outlined pill. */
.cal-link {
  display: inline-block; padding: 0.15rem 0.7rem; border-radius: var(--radius); border: 2px dashed var(--ink);
  color: var(--ink); font-size: 0.85rem; background: none; transition: background-color 0.15s, color 0.15s;
}
.cal-link:hover { border-style: solid; border-color: var(--ink); background: var(--teal); color: var(--ink); }
.more { margin-top: 2rem; }

/* Add-to-calendar menu: a native <details> that drops a small card of calendar apps. */
.cal-menu { position: relative; display: inline-block; }
.cal-menu summary { list-style: none; cursor: pointer; }
.cal-menu summary::-webkit-details-marker { display: none; }
.cal-menu summary svg { width: 1.15em; height: 1.15em; margin-right: 0.4em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-options {
  position: absolute; z-index: 10; top: calc(100% + 0.6rem); left: 0; min-width: 14rem;
  display: grid; padding: 0.4rem; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cal-options a { padding: 0.55rem 0.75rem; border-radius: var(--radius); background: none; white-space: nowrap; }
.cal-options a:hover { background: var(--sand); }

/* Buttons: flat color with an offset print layer that they press down onto when clicked. */
.button, input[type=submit], button {
  display: inline-block; background: var(--coral); color: var(--ink); border: var(--line); border-radius: var(--radius);
  padding: 0.5rem 1.3rem; font: 800 0.95rem var(--body); text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer;
  box-shadow: 4px 4px 0 var(--mustard); transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
  margin: 0 4px 4px 0;
}
.button-alt { background: var(--teal); }
.button:hover, input[type=submit]:hover, button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--mustard); background-size: auto; }
.button:active, input[type=submit]:active, button:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--mustard); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

input, select, textarea { font: inherit; padding: 0.5rem 0.75rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); color: var(--ink); max-width: 100%; }
/* Shows filter: labeled cells with icons over a search box. */
.filters { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; padding: 1rem; background: var(--surface); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters svg { width: 1.6rem; height: 1.6rem; flex: none; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem 0; }
@media (max-width: 640px) { /* phones: venue gets its own row under dates and genre */
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-venue { grid-column: 1 / -1; }
  .filter-row .filter-cell.filter-venue { border-left: 0; padding-left: 0; }
}
.filter-cell, .filter-search { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.filter-cell + .filter-cell { border-left: 2px solid var(--sand); padding-left: 1rem; }
.filter-cell > span, .filter-search > span { display: grid; flex: 1; min-width: 0; }
.filter-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; }
.filters select, .filters input[type=search] { border: 0; padding: 0; background: none; color: var(--muted); font-size: 1.1rem; width: 100%; }
.filters select:focus-visible, .filters input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.filter-search { border: 2px solid var(--sand); border-radius: var(--radius); padding: 0.6rem 1rem; }
.filter-search:focus-within { border-color: var(--teal); }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.stacked-form { display: grid; gap: 0.4rem; max-width: 520px; }
.stacked-form label { font-weight: 600; margin-top: 0.6rem; }
.stacked-form .button { justify-self: start; margin-top: 1rem; }
.stacked-form fieldset { display: grid; gap: 0.4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.stacked-form legend { font: 400 1.3rem/1.15 var(--display); margin-bottom: 0.4rem; }
.slide-nav { display: flex; gap: 0.5rem; margin-top: 1rem; }
.slide-nav .button { margin-top: 0; }
.slide-preview { max-width: 240px; border-radius: var(--radius); margin-top: 0.5rem; }
[hidden] { display: none !important; }

.flash { background: var(--sand); padding: 0.75rem 1rem; border-radius: var(--radius); }
.error { color: var(--red); margin: 0.25rem 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-footer { background: var(--sage); text-align: center; padding: calc(56px + 1.5rem) 1rem 2rem; position: relative; margin-top: 4rem; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 56px; background: var(--waves); border-block: var(--line); }
/* Phones: signup centered with Zuhg's trees along the bottom. Desktop: trees on the left, signup on the right. */
.footer-trees { display: block; width: auto; height: 96px; margin: 1.5rem auto -2rem; }
@media (min-width: 900px) {
  .site-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 3rem; text-align: left;
    padding-inline: max(clamp(1rem, 4vw, 2.5rem), (100% - 1100px) / 2 + 2.5rem); /* line up with .container */
  }
  .footer-trees { order: -1; align-self: flex-end; height: 160px; margin: 0 0 -2rem; }
  .footer-signup .inline-form { justify-content: flex-start; }
}
.site-footer a { background-image: linear-gradient(var(--surface), var(--surface)); }

/* Admin */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.toolbar > div { display: flex; flex-wrap: wrap; gap: 0.5rem; }
form.inline, .actions form { display: inline; }
.table-wrap { overflow-x: auto; background: var(--surface); border: var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--sand); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.actions { white-space: nowrap; }
.actions > * { margin-right: 0.6rem; }
.small { font-size: 0.85rem; }
.checkbox { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; margin-top: 0.6rem; }
.link-button, .link-button:hover, .link-button:active {
  background: none; color: var(--ink); padding: 0; margin: 0; border: 0; font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--mustard); text-decoration-thickness: 0.2em; box-shadow: none; transform: none;
}
.danger, .link-button.danger { color: var(--red); }
.button-danger { background: var(--coral); margin-top: 2rem; }

/* Results bar: segmented list/calendar toggle + download link */
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1.25rem; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--sand); border-radius: var(--radius); }
.view-toggle a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.95rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: color 0.15s, background-color 0.15s; }
.view-toggle a:hover { color: var(--ink); }
.view-toggle a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(61 43 31 / 0.18); }
.view-toggle svg, .ics-link svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ics-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.ics-link:hover { text-decoration: underline; }
/* The month replaces the date filter in calendar view. */
.filters:has(~ #events .cal-grid) .filter-dates { display: none; }
.filters:has(~ #events .cal-grid) .filter-row { grid-template-columns: 1fr 1fr; }
.filters:has(~ #events .cal-grid) .filter-dates + .filter-cell { border-left: 0; padding-left: 0; }

/* Month calendar: 7-column grid, collapsing to an agenda of days with shows on phones */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.cal-nav h3 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-weight: 600; font-size: 0.85rem; text-align: center; color: var(--muted); padding-bottom: 0.25rem; }
.cal-day { min-height: 6.5rem; background: var(--surface); border: 1px solid var(--sand); border-radius: var(--radius); padding: 0.35rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cal-outside { opacity: 0.45; }
.cal-today { border: var(--line); }
.cal-date { font-weight: 600; font-size: 0.9rem; }
.cal-dow { display: none; }
.cal-event { font-size: 0.8rem; line-height: 1.25; text-decoration: none; color: var(--ink); background: var(--sand); border-radius: var(--radius); padding: 0.15rem 0.35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover { background: var(--teal); color: var(--ink); }
.cal-event time { font-weight: 800; color: var(--purple); }
.cal-event:hover time { color: inherit; }
@media (max-width: 760px) {
  .cal-grid { grid-template-columns: 1fr; }
  .cal-head, .cal-day:not(:has(.cal-event)) { display: none; }
  .cal-day { min-height: 0; }
  .cal-dow { display: inline; }
  .cal-event { white-space: normal; font-size: 0.95rem; padding: 0.4rem 0.5rem; }
}

.back-link { display: inline-block; margin-bottom: 0.75rem; font-weight: 600; color: var(--teal); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Admin navigation: grouped links; a sticky sidebar on desktop, the drawer on phones. */
.admin-nav .nav-heading { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0.9rem 0.8rem 0.2rem; }
.admin-nav .nav-heading:first-of-type { padding-top: 0; }
.admin-nav .nav-foot { display: flex; flex-direction: column; gap: 0.15rem; margin-top: auto; padding-top: 1.25rem; }
.admin-nav a[aria-current] { background: var(--sand); border-color: var(--ink); }
@media (min-width: 900px) {
  .admin-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
  .admin-sidebar.site-header {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; margin: 0;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 1.5rem;
    padding: 1.5rem calc(1rem + 20px) 1.5rem 1rem; background: var(--surface); text-align: left;
  }
  /* A strip of Zuhg's waves runs down the sidebar's right edge. */
  .admin-sidebar.site-header::after {
    top: 0; bottom: 0; left: auto; right: 0; width: 20px; height: auto;
    background: var(--waves); border-block: 0; border-left: var(--line);
  }
  .admin-sidebar .brand { font-size: 1.7rem; padding-left: 0.8rem; }
  .admin-sidebar .brand span { display: block; font-size: 1.1rem; }
  .admin-nav { flex: 1; flex-direction: column; gap: 0.15rem; }
  .admin-nav a { border-radius: var(--radius); padding: 0.4rem 0.8rem; }
  .admin-shell > main { width: 100%; padding-top: 2rem; }
}

/* Show pass (/pass): a standalone one-screen page. A ticket with a perforated stub and rubber-stamp punches;
   venues with art in images/stamps get their logo inked in, the rest get an initials ring. */
/* One screen tall, but not locked, so pull-to-refresh still works. The page clips its own overflow so a stamp
   mid-animation can't stretch it. */
.pass-page {
  position: relative; min-height: 100dvh; overflow: clip; max-width: 760px; margin: 0 auto; padding: 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center;
}
.pass-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.pass-top form { margin: 0; }
.pass-back { align-self: flex-start; font-size: 0.8rem; }
.pass-intro { margin: auto 0 0; font-weight: 700; max-width: 32rem; }
/* The card is a ticket: zig-zag cut ends, a perforated stub with half-moon notches cut out where it tears off, and
   grain in the paper. The shape is a mask, so the cuts are real holes. Borders, box-shadows and drop-shadow filters
   can't trace a mask cleanly (Safari redraws filters on every repaint, so the outline flickered), so the outline and
   offset shadow are two more copies of the shape behind the card: the card sits --o inside them and its own shape is
   cut --k = --o further in (holes --o wider), leaving an even band of ink all the way round.
   Teeth are a fixed size centered on the edge, so the card's teeth line up with the outline's.
   Desktop: stub on the right, so the zig-zags run down the left and right ends and the notches sit top and bottom. */
.pass-ticket {
  --z: 7px; --r: 0.75rem; --stub: 10rem; --o: 2px; --k: 0px;
  position: relative; isolation: isolate; width: 100%; display: grid;
}
.pass-ticket::before, .pass-ticket::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); }
.pass-ticket::before { background: var(--sage); translate: 6px 6px; }
.pass-ticket::before, .pass-ticket::after, .pass {
  mask:
    conic-gradient(from 45deg at left, #000 90deg, #0000 0) left center / var(--z) calc(2 * var(--z)) repeat-y,
    conic-gradient(from 225deg at right, #000 90deg, #0000 0) right center / var(--z) calc(2 * var(--z)) repeat-y,
    radial-gradient(circle at right calc(var(--stub) + var(--o) - var(--k) - var(--z) + 1px) top calc(-1 * var(--k)), #0000 calc(var(--r) + var(--k)), #000 calc(var(--r) + var(--k) + 0.5px)) center / calc(100% - 2 * var(--z) + 2px) 100% no-repeat,
    radial-gradient(circle at right calc(var(--stub) + var(--o) - var(--k) - var(--z) + 1px) bottom calc(-1 * var(--k)), #0000 calc(var(--r) + var(--k)), #000 calc(var(--r) + var(--k) + 0.5px)) center / calc(100% - 2 * var(--z) + 2px) 100% no-repeat;
  mask-composite: add, add, intersect;
}
.pass {
  --k: var(--o); margin: var(--o);
  position: relative; display: grid; grid-template-columns: 1fr var(--stub); background: var(--surface); text-align: left;
}
.pass::before { /* paper grain */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; opacity: 0.025;
  background: url("/assets/stamps/ink-texture-3dcb86c8.png") 0 0 / 220px repeat;
}
.pass-main { padding: 1rem 1.25rem 1.25rem calc(1.25rem + var(--z)); }
.punches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.punch {
  position: relative; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center;
  border: 2px dashed var(--print); color: var(--print); font-family: var(--display); font-size: 1.1rem;
  --print: rgb(95 90 82 / 0.45); /* light pre-printed ink, so stamps read on top of it */
}
.punch.is-reward { border-style: solid; border-color: var(--mustard); }
.punch.is-next { border: 3px solid var(--coral); color: var(--ink); animation: next-pulse 1.6s ease-in-out infinite; }
@keyframes next-pulse { 50% { box-shadow: 0 0 0 6px rgb(242 98 79 / 0.25); } }
.punch-button, .punch-button:hover, .punch-button:active {
  position: absolute; inset: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; transform: none;
  display: grid; place-content: center; line-height: 1.1; font: inherit; color: inherit; cursor: pointer;
}
.punch-button small { font: 800 0.75rem var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
/* A stamp is its own ink layer over the printed slot: multiplied into the paper so the print shows through,
   nudged off-center and tilted, with a faint bleed at the edges. */
.stamp {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; color: var(--c);
  transform: translate(var(--dx), var(--dy)) rotate(var(--tilt));
  mix-blend-mode: multiply; /* no filters: iOS Safari renders filtered, rotated layers at 1x, so they blur */
}
.stamp-ink {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1;
  border: 3px solid var(--c);
  /* Rubber on paper: grainy ink, shifted per stamp so no two match, and one side pressed harder than the other. */
  mask: url("/assets/stamps/ink-texture-3dcb86c8.png") calc(var(--i) * -53px) calc(var(--i) * -31px) / 320px repeat,
        linear-gradient(calc(var(--tilt) * 25), #000 40%, rgb(0 0 0 / 0.75));
  mask-composite: intersect;
}
.stamp-ink::before { content: ""; position: absolute; inset: 3px; border: 2px solid var(--c); border-radius: 50%; } /* double ring, like a rubber stamp */
/* A few droplets flicked off one edge, turned differently on each stamp. */
.stamp-splat {
  position: absolute; inset: -14%; background: var(--c); opacity: 0.55;
  mask: url("/assets/stamps/splatter-94aba506.png") center / contain no-repeat; transform: rotate(calc(var(--tilt) * 23));
}
/* Venue art is the whole stamp: no rings, printed bigger than the slot so it spills over the line. */
.stamp-ink.has-art { inset: -20%; border: 0; border-radius: 0; }
.stamp-ink.has-art::before { content: none; }
/* Venue art is a mask, so the venue's ink color shows through its shape. Stacked three times so half-worn ink
   builds up (30% becomes 66%) while bare paper stays bare. */
.stamp-art {
  position: absolute; inset: 0; background: var(--c);
  mask: var(--art) center / contain no-repeat, var(--art) center / contain no-repeat, var(--art) center / contain no-repeat;
}
.stamp-venue { font-family: var(--display); font-size: clamp(0.85rem, 3.2vw, 1.3rem); }
.stamp-date { font-family: var(--body); font-weight: 800; font-size: 0.7rem; letter-spacing: 0.05em; }
.stamp.is-new { animation: stamp 0.45s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes stamp {
  from { transform: translate(var(--dx), var(--dy)) scale(2.4) rotate(calc(var(--tilt) - 20deg)); opacity: 0; }
  60% { transform: translate(var(--dx), var(--dy)) scale(0.9) rotate(var(--tilt)); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--tilt)); }
}
@media (prefers-reduced-motion: reduce) { .stamp.is-new { animation: none; } }
/* Reduced motion still needs the pop-up to go away: no slide, it just disappears. */
@media (prefers-reduced-motion: reduce) { .pass-toast { animation: toast 3.2s step-end forwards !important; } }
.prize-page { text-align: left; align-items: stretch; max-width: 34rem; }
.prize-page h1 { margin: 0.5rem 0 0; }
.prize-main, .prize-combos li { background: var(--surface); border: var(--line); padding: 1rem 1.25rem; }
.prize-main { background: var(--mustard); box-shadow: 6px 6px 0 var(--ink); }
.prize-main h2, .prize-combos h3 { margin: 0 0 0.25rem; }
.prize-main p, .prize-combos p { margin: 0; }
.prize-combos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.prize-combos li { box-shadow: 4px 4px 0 var(--sage); }
.prize-fine { color: var(--muted); font-size: 0.9rem; margin: 0; }
.prize-signup h3 { font-size: 1rem; }
.prize-collage { width: 100%; height: auto; margin: 0.5rem 0 1rem; }
/* Flash messages pop up at the top of the page, then fade away on their own. Anchored to the page column
   (which is exactly one screen tall) rather than the viewport, so it centers over the card everywhere. */
.pass-toast {
  position: absolute; top: 1rem; left: 1rem; right: 1rem; z-index: 10; max-width: 20rem; margin: 0 auto; padding: 1rem 1.25rem;
  background: var(--surface); border: var(--line); box-shadow: 6px 6px 0 var(--mustard); font-weight: 800; text-align: center;
  pointer-events: none; animation: toast 3.2s ease-in-out forwards;
}
@keyframes toast {
  0% { opacity: 0; transform: translateY(-0.75rem); }
  10%, 80% { opacity: 1; transform: none; }
  100% { opacity: 0; visibility: hidden; }
}
.pass-stub {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.25rem; padding: 1rem calc(1rem + var(--z)) 1rem 1rem;
  background: var(--mustard); border-left: 3px dotted var(--ink); text-align: center; font-weight: 800; line-height: 1.25;
}
.stub-big { font-family: var(--display); font-weight: 400; font-size: 2.6rem; line-height: 1; }
.stub-big small { font-size: 0.5em; }
.pass-actions { margin-bottom: auto; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.pass-actions form { margin: 0; }
.pass-status { margin: 0.5rem 0 0; min-height: 1.5em; color: var(--muted); font-weight: 700; }
/* Phones: a tall ticket the width of the screen (capped), stamps in 5 rows of 2 with one --gap between them and
   around them on every side. It may run past the bottom of the screen; the page scrolls. */
@media (max-width: 600px) {
  .pass-page { gap: 0.5rem; padding: 0.75rem; }
  .pass-back { font-size: 0.7rem; padding: 0.3rem 0.8rem; }
  .pass-intro { margin: 0; font-size: 0.85rem; line-height: 1.35; }
  .pass-actions { margin: 0; }
  .pass-ticket { --stub: 3.4rem; max-width: 24rem; }
  /* Stub at the bottom, so the zig-zags run across the top and bottom ends and the notches sit left and right. */
  .pass-ticket::before, .pass-ticket::after, .pass {
    mask:
      conic-gradient(from 135deg at top, #000 90deg, #0000 0) center top / calc(2 * var(--z)) var(--z) repeat-x,
      conic-gradient(from -45deg at bottom, #000 90deg, #0000 0) center bottom / calc(2 * var(--z)) var(--z) repeat-x,
      radial-gradient(circle at left calc(-1 * var(--k)) bottom calc(var(--stub) + var(--o) - var(--k) - var(--z) + 1px), #0000 calc(var(--r) + var(--k)), #000 calc(var(--r) + var(--k) + 0.5px)) center / 100% calc(100% - 2 * var(--z) + 2px) no-repeat,
      radial-gradient(circle at right calc(-1 * var(--k)) bottom calc(var(--stub) + var(--o) - var(--k) - var(--z) + 1px), #0000 calc(var(--r) + var(--k)), #000 calc(var(--r) + var(--k) + 0.5px)) center / 100% calc(100% - 2 * var(--z) + 2px) no-repeat;
    mask-composite: add, add, intersect;
  }
  .pass { --gap: 2.25rem; grid-template-columns: 1fr; }
  .pass-main { padding: calc(var(--z) + var(--gap)) var(--gap) var(--gap); }
  .punches { grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
  .pass-stub span { font-size: 0.8rem; }
  .pass-stub { border-left: 0; border-top: 3px dotted var(--ink); flex-direction: row; justify-content: space-between; gap: 0.75rem; text-align: left;
    height: var(--stub); padding: 0 1rem var(--z); }
  .stub-big { font-size: 1.8rem; }
  .pass-status { margin-top: 0; min-height: 1.2em; }
}
