/* 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 { 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 */
  .menu-toggle { display: inline-flex; flex: none; 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 > 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: top left; 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; }
.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); }
/* 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-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); }
/* 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; }
.cal-menu summary::-webkit-details-marker { display: none; }
.cal-menu summary::after { content: ""; display: inline-block; margin-left: 0.5em; border: 0.3em solid transparent; border-top-color: currentColor; vertical-align: 0.05em; transition: transform 0.15s; transform-origin: 50% 25%; }
.cal-menu[open] summary::after { transform: rotate(180deg); }
.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; }
.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; }
.filters:has(~ #events .cal-grid) .filter-cell + .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; }
}
