/* SevenTrain event photos. One stylesheet for the gallery, the photo pages and the event index. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/inter-latin-opsz.woff2) format("woff2-variations"), url(/assets/inter-latin-opsz.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;
}

:root {
  --ink: #05090F;        /* 7TV Quantum ground */
  --raised: #0D141E;     /* photo placeholders, quiet buttons */
  --line: rgba(236, 240, 245, 0.14);
  --text: #ECF0F5;
  --muted: #A1ACBA;      /* 8.6:1 on ink */
  --gold: #E8C96A;       /* 7TV Quantum gold: the one primary action */
  --gold-hover: #F1D788;
  --gap: 4px;
  --pad: 16px;
  --radius: 4px;
  --font: "Inter Variable", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
@media (min-width: 768px) { :root { --gap: 6px; --pad: 32px; } }
@media (min-width: 1200px) { :root { --gap: 8px; --pad: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; left: var(--pad); top: 8px; z-index: 10;
  padding: 12px 16px; background: var(--gold); color: var(--ink); font-weight: 600; text-decoration: none; border-radius: 999px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ------------------------------------------------------------ top bar */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 10px var(--pad) 0;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 22px; width: auto; }
.bar-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px;
  color: var(--muted); font-size: 15px; text-decoration: none;
  text-decoration-line: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
}
.bar-link:hover { color: var(--text); text-decoration-color: currentColor; }
@media (min-width: 768px) { .brand img { height: 26px; } }

/* ------------------------------------------------------------ gallery hero */
.hero {
  display: grid; gap: 12px;
  padding: 18px var(--pad) 24px;
}
.hero-title {
  margin: 0;
  font-size: clamp(2.75rem, 1.5rem + 6vw, 7.25rem);
  font-weight: 600; line-height: 0.95; letter-spacing: -0.04em;
  text-wrap: balance;
}
/* SplitText line masks: room for descenders (p, Q) so nothing is clipped mid-entrance */
.hl-mask { padding-bottom: 0.14em; margin-bottom: -0.14em; }
.hero-side { display: grid; gap: 10px; align-content: end; }
.hero-series { color: var(--muted); font-size: 15px; }
.hero-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 15px; }
.hero-meta li:last-child { color: var(--gold); font-weight: 500; }
.hero-lede { color: var(--muted); font-size: 15px; max-width: 42ch; }
@media (min-width: 768px) {
  .hero { gap: 16px; padding-top: 32px; padding-bottom: 32px; }
  .hero-meta { font-size: 16px; }
}
@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: end; column-gap: 64px;
    padding-top: 72px; padding-bottom: 48px;
  }
  .hero-side { gap: 14px; }
  .hero-meta { font-size: 17px; }
}

/* ------------------------------------------------------------ justified grid
   Without JS the flex trick below keeps rows justified; site.js then sets exact row heights. */
.grid {
  display: flex; flex-wrap: wrap; gap: var(--gap);
  padding: 0 var(--pad) 72px;
  outline: none;
}
.grid::after { content: ""; flex: 9999 1 0; }
.tile {
  position: relative; display: block;
  overflow: clip; /* not hidden: hidden makes the tile a scroll container and freezes the view() reveal */
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 150px);
  aspect-ratio: var(--ar);
  min-height: 44px;
  background: var(--raised);
  border-radius: var(--radius);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:focus-visible { outline-offset: 2px; z-index: 1; }
.grid.is-laid::after { display: none; }
.grid.is-laid .tile { flex: none; aspect-ratio: auto; }
.grid.is-laid .tile.row-end { flex-grow: 1; }

/* scroll-scrubbed reveal: each photo settles into its frame as it scrolls in (no timers) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .tile img {
      animation: tile-settle linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 85%;
    }
  }
}
@keyframes tile-settle {
  from { opacity: 0; transform: scale(1.12); }
  to { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(236, 240, 245, 0.06); color: var(--text);
  font: 500 15px/1 var(--font); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(236, 240, 245, 0.12); border-color: rgba(236, 240, 245, 0.24); }
.btn:active { transform: scale(0.98); }
.btn-post { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.btn-post:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-quiet { min-height: 44px; padding: 0 16px; background: transparent; }
.i { width: 18px; height: 18px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px;
  background: rgba(5, 9, 15, 0.55); color: var(--text);
  cursor: pointer;
  transition: background-color .2s;
}
.icon-btn:hover { background: rgba(236, 240, 245, 0.14); }
.icon-btn .i { width: 22px; height: 22px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.actions .btn-post { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .actions { grid-template-columns: auto auto auto; width: auto; }
  .actions .btn-post { grid-column: auto; }
}
.tip { color: var(--muted); font-size: 13px; line-height: 1.45; max-width: 60ch; }

/* ------------------------------------------------------------ lightbox */
.lb {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--ink); color: var(--text);
  overflow: hidden;
}
.lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb::backdrop { background: var(--ink); }
.lb:focus, .lb:focus-visible { outline: none; }
.lb-top {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: max(6px, env(safe-area-inset-top)) 8px 0;
}
.lb-pager { display: flex; align-items: center; gap: 2px; }
.lb-count { min-width: 4.5em; color: var(--muted); font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.lb-stage {
  position: relative; min-height: 0; overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.lb-frame {
  position: absolute; inset: 4px 8px;
  background: center / contain no-repeat;
  will-change: transform;
}
.lb-frame.is-settling { transition: transform .32s var(--ease); }
.lb-img {
  width: 100%; height: 100%; object-fit: contain;
  -webkit-user-drag: none; user-select: none;
}
.lb-img.is-loading { opacity: 0; }
.lb-bottom {
  display: grid; justify-items: center; gap: 10px;
  padding: 12px var(--pad) max(16px, env(safe-area-inset-bottom));
}
.lb-bottom .tip { text-align: center; }
@media (min-width: 768px) {
  /* arrows move from the top bar to the sides of the photo */
  .lb-top { padding-left: var(--pad); }
  .lb-count { text-align: left; }
  .lb-nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 1; }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .lb-frame { inset: 8px 72px; }
  .lb-bottom { padding-top: 16px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 20;
  translate: -50% 12px; opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1.4; text-align: center; text-wrap: balance;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: opacity .25s, translate .35s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }
.lb .toast { top: calc(max(6px, env(safe-area-inset-top)) + 58px); bottom: auto; translate: -50% -8px; } /* clear of the actions */
.lb .toast.is-on { translate: -50% 0; }

/* ------------------------------------------------------------ photo page */
.photo-page {
  display: grid; gap: 28px;
  padding: 12px var(--pad) 64px;
}
.photo-frame { margin: 0; display: flex; justify-content: center; }
.photo-frame img {
  width: auto; height: auto; max-width: 100%; max-height: 76svh;
  border-radius: var(--radius);
}
.panel { display: grid; gap: 18px; align-content: start; }
.panel-title { margin: 0; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; }
.panel-head { display: grid; gap: 14px; margin-bottom: 8px; } /* header to actions >= 24px */
.panel-meta { color: var(--muted); font-size: 15px; }
.caption-label { margin: 8px 0 -10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.caption-text {
  white-space: pre-line; font-size: 15px; line-height: 1.55;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  overflow-wrap: anywhere;
}
.pager { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.pager .btn { flex: 1 1 0; justify-content: center; padding: 0 14px; }
@media (min-width: 1024px) {
  .photo-page { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 48px; padding-top: 24px; }
  .photo-frame { justify-content: flex-end; }
  .photo-frame img { max-height: calc(100svh - 120px); }
  .panel { position: sticky; top: 24px; }
  .panel .actions { grid-template-columns: 1fr 1fr; width: 100%; }
  .panel .actions .btn-post { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) {
  .photo-frame img { animation: photo-in .9s var(--ease) both; }
}
@keyframes photo-in { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ footer + event index */
.foot {
  display: grid; gap: 6px;
  padding: 28px var(--pad) max(40px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.foot a { color: var(--text); text-underline-offset: 3px; }
.foot a:hover { color: var(--gold); }
.root { padding: 48px var(--pad) 96px; display: grid; gap: 28px; }
.root-title { margin: 0; font-size: clamp(2.5rem, 1.5rem + 4vw, 5rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.event-link { display: grid; gap: 4px; padding: 20px 0; min-height: 44px; border-bottom: 1px solid var(--line); text-decoration: none; }
.event-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.event-meta { color: var(--muted); font-size: 15px; }
.event-link:hover .event-name { color: var(--gold); }

/* ------------------------------------------------------------ entrance (site.js runs it; hidden only until then) */
.motion [data-hero], .motion [data-hero-sub], .motion .grid { visibility: hidden; }

/* review 30 Oct: footer links get a 44px tap height without moving the line; the lightbox takes focus itself */
.foot a { display: inline-block; padding: 13px 0; margin: -13px 0; }
dialog.lb:focus { outline: none; }
