/* ============================================================
   HOUSE CIRCUIT — UI COMPONENTS
   Fields, dialogs (newsletter sheet, event dossier, lightbox),
   ticket card, small pages (errors, unsubscribe).
============================================================ */

/* ------------------------------------------------------------
   FIELDS
------------------------------------------------------------ */
.field {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--ink-3);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px; /* ≥16px: no iOS zoom on focus */
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.field::placeholder { color: var(--text-3); }
.field:hover { border-color: rgba(214, 255, 226, 0.32); }
.field:focus {
  outline: none;
  border-color: var(--signal);
  background: var(--ink-4);
  box-shadow: 0 0 0 3px rgba(57, 255, 127, 0.16);
}
.field.is-invalid { border-color: var(--danger); }
textarea.field { min-height: 140px; resize: vertical; line-height: 1.5; }

.signup { display: grid; gap: 10px; }
.signup-row { display: grid; gap: 10px; }
@media (min-width: 520px) {
  .signup-row { grid-template-columns: minmax(0, 1fr) auto; }
}
.signup-status {
  min-height: 1.4em;
  font-size: var(--fs-small);
  color: var(--text-2);
}
.signup-status.is-ok { color: var(--signal); }
.signup-status.is-error { color: var(--danger); }

/* ------------------------------------------------------------
   DIALOGS (native <dialog>; site.js adds .is-closing for the exit)
------------------------------------------------------------ */
dialog {
  padding: 0;
  border: 0;
  color: var(--text-2);
  background: transparent;
  max-width: none;
  max-height: none;
}
dialog::backdrop {
  background: rgba(2, 4, 3, 0.8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dlg-in 0.5s var(--ease-out); }
  dialog[open]::backdrop { animation: dlg-fade 0.4s ease; }
  dialog.is-closing { animation: dlg-out 0.22s ease forwards; }
  dialog.is-closing::backdrop { animation: dlg-fade 0.22s ease reverse forwards; }
}
@keyframes dlg-in {
  from { opacity: 0; transform: translate3d(0, 24px, 0) scale(0.98); }
}
@keyframes dlg-out {
  to { opacity: 0; transform: translate3d(0, 12px, 0); }
}
@keyframes dlg-fade {
  from { opacity: 0; }
}

/* Newsletter sheet */
.sheet {
  width: min(560px, calc(100vw - 24px));
  margin: auto;
}
.sheet-inner {
  position: relative;
  display: grid;
  gap: 18px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--signal);
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(57, 255, 127, 0.1), transparent 60%),
    var(--ink-2);
}
.sheet-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 0.96;
  text-transform: uppercase;
  color: var(--text);
}
.sheet-close,
.x-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--text);
  font-size: 16px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.sheet-close:hover,
.x-btn:hover { border-color: var(--signal); color: var(--signal); }

/* ------------------------------------------------------------
   TICKET CARD (upcoming events). Perforated stub on the right.
------------------------------------------------------------ */
.ticket {
  --notch: 12px;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--ink-2);
  border: 1px solid var(--line);
  transition: border-color var(--t-mid) var(--ease-out), transform var(--t-mid) var(--ease-out);
}
.ticket:hover,
.ticket:focus-within { border-color: rgba(57, 255, 127, 0.45); }

.ticket-poster {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #000;
  border-bottom: 1px dashed var(--line-2);
}
/* Blurred copy fills the frame; the real poster sits on top, uncropped. */
.ticket-poster-fill {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(22px) brightness(0.62) saturate(0.85);   /* square/landscape posters sit on their own colours */
}
.ticket-poster-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.8s var(--ease-out);
}
.ticket:hover .ticket-poster-img { transform: scale(1.03); }

/* Notches where the perforation meets the edges */
.ticket-poster::before,
.ticket-poster::after {
  content: '';
  position: absolute;
  bottom: calc(var(--notch) / -2 - 1px);
  z-index: 2;
  width: var(--notch);
  height: var(--notch);
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--line);
}
.ticket-poster::before { left: calc(var(--notch) / -2 - 1px); }
.ticket-poster::after { right: calc(var(--notch) / -2 - 1px); }

.ticket-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 18px;
  align-content: start;
  padding: 16px;
}
.ticket-date {
  grid-row: span 3;
  display: grid;
  justify-items: center;
  align-content: start;
  min-width: 58px;
  padding: 8px 6px;
  border: 1px solid var(--line-2);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}
.ticket-date strong {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--text);
}
.ticket-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(22px, 1.6vw, 28px);
  line-height: 1.08;
  text-transform: uppercase;
  color: var(--text);
  overflow-wrap: anywhere;
}
.ticket-meta { font-size: var(--fs-small); color: var(--text-2); }
.ticket-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ticket-actions .btn { flex: 1 1 auto; }

/* ------------------------------------------------------------
   EVENT DOSSIER (dialog) — poster + details + photos
------------------------------------------------------------ */
.dossier {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
}
.dossier-inner {
  position: relative;
  display: grid;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-2);
  background: var(--ink-2);
}
@media (min-width: 860px) {
  .dossier-inner { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}
.dossier-poster {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 70vh;
  max-height: 70dvh;
  background: #000;
  overflow: hidden;
}
@media (min-width: 860px) {
  .dossier-poster { max-height: none; }
}
.dossier-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dossier-info {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(24px, 4vw, 48px);
}
.dossier-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.96;
  text-transform: uppercase;
  color: var(--text);
  overflow-wrap: anywhere;
  padding-right: 48px;
}
.dossier-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.dossier-meta div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.dossier-meta dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.dossier-meta dd { color: var(--text); }
.dossier-photos { display: grid; gap: 12px; }
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}
.dossier-grid button {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  background: #000;
  overflow: hidden;
}
.dossier-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease-out), filter var(--t-mid);
  filter: grayscale(0.4);
}
.dossier-grid button:hover img { transform: scale(1.06); filter: none; }

/* ------------------------------------------------------------
   LIGHTBOX (dialog)
------------------------------------------------------------ */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  background: rgba(3, 4, 3, 0.97);
}
.lightbox::backdrop { background: transparent; }
.lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 64px clamp(8px, 6vw, 96px) 20px;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding-top: 14px;
  color: var(--text);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(5, 7, 6, 0.7);
  color: var(--text);
  font-size: 20px;
  transform: translateY(-50%);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.lightbox-nav:hover { border-color: var(--signal); color: var(--signal); }
.lightbox-nav[data-dir="-1"] { left: clamp(8px, 2vw, 28px); }
.lightbox-nav[data-dir="1"] { right: clamp(8px, 2vw, 28px); }
.lightbox .x-btn { top: 12px; right: 12px; }
@media (max-width: 640px) {
  .lightbox-nav { top: auto; bottom: 64px; transform: none; }
}

/* ------------------------------------------------------------
   SMALL PAGES — errors, unsubscribe
------------------------------------------------------------ */
.panel-page {
  min-height: 100vh;   /* fallback */
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 48px) var(--gutter) 80px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(57, 255, 127, 0.08), transparent 70%),
    var(--ink);
}
.panel {
  width: min(640px, 100%);
  display: grid;
  gap: 20px;
}
.panel { min-width: 0; }
.panel .display { font-size: clamp(44px, 15vw, 180px); overflow-wrap: anywhere; }
.panel-copy { color: var(--text-2); }
.panel-copy strong { color: var(--text); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel-result {
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--signal);
  color: var(--text);
}
.panel-result.is-error { border-left-color: var(--danger); }
