/* ──────────────────────────────────────────────────────────────
   Event detail — Haus Vajbz.  Phones (≤400px): a full-width square photo
   over the red band, buy box pinned to the bottom. 401–767px: the photo
   (408px max) sits centered in a full-bleed strip filled with a blurred
   copy of itself (.ev-backdrop), margin above and below; band, buy bar and
   sections run the full width. 768px+: the two-column desktop (sticky 277px
   square photo on the left; band, buy box and editorial sections on the right).
   Reads only tokens from tokens.css + hv/theme.css: radius 0, no shadows.
   ────────────────────────────────────────────────────────────── */

.ev { display: block; }
.ev-backdrop { display: none; }

/* ── Hero: a square photo, share in its corner. Phones: edge to edge (pulled
   out of .hv-wrap's gutter, straight under the site bar), still 1:1; tablets:
   up to 408px (the 440px design canvas minus gutters) centered above the
   band; desktop: a fixed 277px square in the left column. ── */
.ev-hero { position: relative; display: grid; justify-items: center; gap: 0.75rem; margin-inline: calc(-1 * var(--gutter)); padding: 0; }   /* phones: the band starts right under the photo */
.ev-hero__media { position: relative; width: min(408px, 100%); aspect-ratio: 1; overflow: hidden; background: var(--ink-2); }
.ev-hero__media picture { display: block; width: 100%; height: 100%; }
.ev-hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; filter: contrast(1.05) saturate(0.95); }
.ev-hero__empty {                      /* no photo: ink field with the wordmark */
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--paper); font-size: 1.05rem;
}
/* share: pinned to the photo's bottom-right corner, paper-on-ink like the
   flow hero's back button (hv/flow.css .fl-hero__nav) */
.ev-share { position: absolute; right: 0.75rem; bottom: 0.75rem; z-index: 1; display: flex; gap: 0.5rem; }
.ev-share .hv-icon-btn { border-color: var(--paper); color: var(--paper); background: rgba(13, 13, 13, 0.55); }
.ev-share .hv-icon-btn:hover { background: var(--paper); color: var(--ink); }

/* Red band: full-bleed on phones/tablets (pulled back out of .hv-wrap's gutter);
   the desktop grid resets this. */
.ev-band { margin-inline: calc(-1 * var(--gutter)); padding: 1.1rem var(--gutter) 1.25rem; background: var(--bg); color: var(--text); }
.ev-band .hv-tag { margin-bottom: 0.7rem; }
.ev-band__title { font-size: clamp(2rem, 9.5vw, 3.4rem); color: var(--text); }   /* plain paper title, no two-tone <em> */
.ev-band__meta { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; color: var(--text-dim); }
.ev-band__meta span + span::before { content: '·'; margin-right: 0.8rem; }

/* ── Buy box: fixed bottom bar on mobile, in-flow under the band on desktop ── */
.ev-buy {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--paper); color: var(--ink);
  border-top: 2px solid var(--ink);
  padding: 0.8rem var(--gutter) calc(0.8rem + env(safe-area-inset-bottom));
}
.ev-buy__price { font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.ev-buy__price small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.35rem; }
.ev-buy__price--sm { font-size: 1.05rem; line-height: 1.2; }
.ev-buy__price .hv-tag { font-size: 0.8rem; padding: 0.5em 0.7em 0.45em; }
.ev-buy__note { margin-top: 0.4rem; }
.ev-buy .hv-btn { width: auto; min-width: 9.5rem; flex: none; }
body.ev-has-bar .ev-main { padding-bottom: var(--ev-bar-h, 96px); }
/* phones: own layer + the paper carried below the edge, so the page never flashes through
   while the browser toolbar slides back in on scroll-up (same fix as .fl-bar, hv/flow.css) */
@media (max-width: 767.98px) {
  .ev-buy { transform: translateZ(0); backface-visibility: hidden; }
  .ev-buy::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 100vh; background: inherit; pointer-events: none; }
}

/* ── Waitlist (sold out): the buy box becomes a form ────────── */
.ev-waitlist { width: 100%; }
.ev-waitlist .waitlist-form { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 0.6rem; align-items: center; }
.ev-waitlist .hv-tag, .ev-waitlist .ev-buy__note { grid-column: 1 / -1; }
.ev-waitlist .hv-tag { justify-self: start; }
.ev-waitlist .hv-input { min-width: 0; padding: 0.55rem 0.7rem; }
.ev-waitlist .hv-btn { min-width: 0; }
.ev-waitlist .ev-buy__note { margin-top: 0; color: var(--text-dim); }

/* ── Notices: lock error (red) and the waitlist flash (ink) ───── */
.ev-notice { margin-top: 1rem; padding: 0.9rem 1rem; background: var(--red); color: var(--paper); border-left: 4px solid var(--red-deep); }
.ev-notice p { margin: 0; font-family: var(--font-sub); font-weight: 600; }
.ev-notice--ok { background: var(--ink); border-left-color: var(--red); }

/* ── Sections ────────────────────────────────────────────────── */
.ev-main { padding-top: 0; }
.ev-buy + * { margin-top: 0.4rem; }
.ev-section { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.ev-section:last-child { border-bottom: 0; padding-bottom: 2.4rem; }
.ev-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.ev-section__title { font-size: 1.05rem; }

/* about: clamped, mono "read more" toggle */
.ev-about { color: var(--ink-2); max-width: 62ch; }
.ev-about p { margin: 0; }
.ev-about p + p { margin-top: 0.7rem; }
.ev-about.is-clamped { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.ev-more {
  display: none; margin-top: 0.8rem; padding: 0;
  border: 0; background: transparent; color: var(--red); cursor: pointer;
}
.ev-more.is-visible { display: inline-block; }
.ev-more:hover { color: var(--red-deep); }

/* lineup: ruled rows, square avatar, name, time, follow */
.ev-lineup > li { align-items: center; gap: 0.9rem; }
.ev-avatar {
  flex: none; width: 44px; height: 44px; overflow: hidden;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-hero); font-weight: 900; font-size: 1.1rem; text-transform: uppercase;
}
.ev-avatar img, .ev-avatar picture { width: 100%; height: 100%; object-fit: cover; }
.ev-lineup__name { flex: 1; min-width: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.ev-lineup__time { flex: none; font-variant-numeric: tabular-nums; }
.ev-follow {
  flex: none; display: inline-flex; align-items: center; gap: 0.4em;
  min-height: 34px; padding: 0.4rem 0.7rem;
  border: 2px solid var(--ink); color: var(--ink); text-decoration: none;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ev-follow:hover { background: var(--ink); color: var(--paper); }
.ev-tba { margin: 0; }

/* venue: text left, square photo right */
.ev-venue { display: flex; gap: 1rem; align-items: flex-start; }
.ev-venue__info { flex: 1; min-width: 0; }
.ev-venue__name { font-size: 1.5rem; margin: 0; overflow-wrap: break-word; }
.ev-venue__addr { margin: 0.3rem 0 0.9rem; color: var(--ink-2); }
.ev-venue__btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ev-venue__name + .ev-venue__btns { margin-top: 0.9rem; }   /* no address line */
.ev-venue__doors { margin-top: 0.9rem; }
.ev-venue__thumb { flex: none; width: 112px; height: 112px; overflow: hidden; background: var(--ink); }
.ev-venue__thumb img, .ev-venue__thumb picture { width: 100%; height: 100%; object-fit: cover; }

/* organizer */
.ev-org { display: flex; align-items: center; gap: 0.9rem; }
.ev-org__logo { width: 48px; height: 48px; font-size: 1.2rem; }
.ev-org__name { flex: 1; min-width: 0; font-size: 1.05rem; }
.ev-org__links { display: flex; gap: 0.5rem; }

/* toast: ink band that slides over the bottom bar */
.ev-toast {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(var(--ev-bar-h, 96px) + 0.5rem);
  z-index: 50; padding: 0.8rem 1rem;
  background: var(--ink); color: var(--paper);
  transform: translateY(0.5rem); opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ev-toast.is-visible { opacity: 1; transform: none; }

/* ── Wider than a phone: the photo alone sits on its blurred copy ── */
@media (min-width: 401px) {
  .ev-hero { overflow: hidden; padding: 1.5rem var(--gutter); background: var(--ink); }
  .ev-backdrop { display: block; position: absolute; inset: 0; pointer-events: none; }
  .ev-backdrop picture, .ev-backdrop img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .ev-backdrop img { filter: blur(40px) saturate(1.15); transform: scale(1.2); opacity: 0.7; }   /* scale hides the blur's soft edge; the ink behind calms it */
  .ev-hero__media { width: min(408px, 100%); }
  .ev-venue__thumb { width: 140px; height: 140px; }
  .ev-toast { left: auto; max-width: 360px; }
}

/* ── Desktop (768px+): sticky event panel + editorial column ──── */
@media (min-width: 768px) {
  .ev { display: grid; grid-template-columns: 277px 1fr; gap: 0 clamp(2rem, 5vw, 5rem); align-items: start; padding-top: 1.5rem; }
  .ev-hero { position: sticky; top: calc(var(--nav-h, 60px) + 1.5rem); align-self: start; justify-items: start; margin-inline: 0; padding: 0; overflow: visible; background: none; }   /* under the site bar (js/hv/nav.js publishes --nav-h) */
  .ev-backdrop { display: none; }
  .ev-hero__media { width: 277px; }
  .ev-hero__empty { font-size: 1.8rem; }
  .ev-band { margin-inline: 0; padding: 1.4rem 1.5rem 1.6rem; }
  .ev-band__title { font-size: clamp(2.4rem, 3.6vw, 3.6rem); }
  .ev-buy {
    position: static; z-index: auto;
    padding: 1.1rem 1.5rem;
    border-top: 0; border-bottom: 2px solid var(--ink);
  }
  body.ev-has-bar .ev-main { padding-bottom: 0; }
  .ev-buy + * { margin-top: 0.6rem; }
  .ev-toast { bottom: 1.5rem; right: 1.5rem; }
}
