/* ═══════════════════════════════════════════════
   Event photos — Instagram-style grids + full-screen viewer (assets/js/event-gallery.js)
   Uses the homepage tokens (body.home): ink / volt / signal / paper / chalk.
   ═══════════════════════════════════════════════ */

/* ── tiles (shared by the homepage teaser and the photos page) ── */
.ig-tile { position: relative; display: block; overflow: hidden; background: var(--ink-soft, #1A2466); aspect-ratio: 1 / 1; }
/* reveal: the photo wipes up and settles from a slight zoom (the tile itself stays unclipped so it can be observed + clicked) */
.ig-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); clip-path: inset(100% 0 0 0);
  transition: clip-path .9s cubic-bezier(.22,1,.36,1) var(--d, 0ms), transform 1.1s cubic-bezier(.22,1,.36,1) var(--d, 0ms), filter .5s; }
.ig-tile.in img { transform: scale(1); clip-path: inset(0 0 0 0); }
.ig-tile-ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,16,54,.42); opacity: 0;
  transition: opacity .45s cubic-bezier(.22,1,.36,1); }
.ig-tile-ov svg { width: 34px; height: 34px; fill: none; stroke: var(--volt, #FFD400); stroke-width: 2; transform: scale(.7);
  transition: transform .5s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) {
  .ig-tile:hover img { transform: scale(1.07); transition-delay: 0ms; }
  .ig-tile:hover .ig-tile-ov { opacity: 1; }
  .ig-tile:hover .ig-tile-ov svg { transform: scale(1); }
}
.ig-tile:focus-visible { outline: 3px solid var(--volt, #FFD400); outline-offset: -3px; }

/* the photo someone tapped on the homepage: a yellow frame pulses twice */
.ig-tile.ig-spot::after { content: ""; position: absolute; inset: 0; border: 4px solid var(--volt, #FFD400); pointer-events: none;
  animation: ig-spot 1.3s cubic-bezier(.22,1,.36,1) 2; }
@keyframes ig-spot { 0% { opacity: 0; transform: scale(1.06); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

/* ── homepage teaser: explore-style 3×3 — first photo takes a 2×2 block ── */
.h-event { background: var(--paper); }
.h-event .h-k { color: var(--signal); }
.ig-teaser { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ig-teaser .ig-tile:first-child { grid-column: span 2; grid-row: span 2; }
.ev-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 32px; margin-top: 40px; }
.h-event .h-btn { box-shadow: 5px 5px 0 var(--ink); }
.h-event .h-btn:active { box-shadow: 0 0 0 var(--ink); }
.h-event .h-link { color: var(--ink); }
@media (min-width: 900px) { .ig-teaser { gap: 10px; } }

/* ── photos page ── */
body.home.ig-page { background: var(--ink); color: var(--chalk); min-height: 100vh; padding-bottom: 96px; }
.ig-page .wrap { max-width: 980px; }
.ig-head { display: grid; grid-template-columns: auto 1fr; gap: 28px 56px; align-items: center; padding: 56px 0 36px; }
.ig-avatar { width: 150px; height: 150px; border-radius: 50%; padding: 4px; position: relative;
  background: conic-gradient(from 210deg, var(--volt), var(--signal), var(--volt)); animation: ig-ring 9s linear infinite; }
.ig-avatar span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--chalk);
  border: 4px solid var(--ink); overflow: hidden; animation: ig-ring 9s linear infinite reverse; }
.ig-avatar img { width: 78%; height: auto; }
@keyframes ig-ring { to { transform: rotate(360deg); } }
.ig-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.ig-handle { font-family: var(--font-body); font-weight: 600; font-size: 1.5rem; letter-spacing: 0; margin-right: 10px; }
.ig-verified { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; background: var(--volt);
  color: var(--ink); font-size: .7rem; font-weight: 800; vertical-align: 3px; }
.ig-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-family: var(--font-body); font-weight: 700; font-size: .88rem;
  text-decoration: none; color: var(--chalk); background: rgba(255,255,255,.1); border: 0; border-radius: 8px;
  transition: background .25s, transform .2s; }
.ig-btn:hover { background: rgba(255,255,255,.18); }
.ig-btn:active { transform: scale(.97); }
.ig-btn--primary { background: var(--volt); color: var(--ink); }
.ig-btn--primary:hover { background: #FFE14D; }
.ig-stats { display: flex; gap: 40px; list-style: none; margin: 22px 0 18px; font-size: 1rem; }
.ig-stats b { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; margin-right: 4px; }
.ig-bio { font-size: .98rem; line-height: 1.55; color: rgba(255,255,255,.85); max-width: 52ch; }
.ig-bio strong { color: var(--chalk); font-weight: 700; }
.ig-bio .ig-tags { color: var(--volt); }

.ig-highlights { display: flex; gap: 26px; overflow-x: auto; padding: 8px 2px 26px; scrollbar-width: none; scroll-snap-type: x proximity; }
.ig-highlights::-webkit-scrollbar { display: none; }
.ig-hl { flex: none; display: grid; justify-items: center; gap: 9px; background: none; border: 0; color: var(--chalk); cursor: pointer;
  font-family: var(--font-body); font-size: .78rem; font-weight: 600; scroll-snap-align: start; }
.ig-hl-ring { width: 78px; height: 78px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, var(--volt), var(--signal), var(--volt));
  transition: transform .45s cubic-bezier(.22,1,.36,1); }
.ig-hl-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--ink); display: block; }
.ig-hl:hover .ig-hl-ring { transform: scale(1.07) rotate(-4deg); }
.ig-hl:focus-visible .ig-hl-ring { outline: 3px solid var(--volt); outline-offset: 3px; }

.ig-tabs { display: flex; justify-content: center; border-top: 1px solid rgba(255,255,255,.18); margin-bottom: 4px; }
.ig-tabs span { display: inline-flex; align-items: center; gap: 8px; padding: 16px 4px 14px; margin-top: -1px; border-top: 1px solid var(--chalk);
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ig-tabs svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ig-grid .ig-tile { aspect-ratio: 4 / 5; }                       /* Instagram's portrait grid */
.ig-foot { margin-top: 56px; text-align: center; color: rgba(255,255,255,.7); font-size: .95rem; }
.ig-foot .ig-btn { margin-top: 16px; }

@media (max-width: 735px) {
  .ig-head { grid-template-columns: auto 1fr; gap: 18px 22px; padding: 28px 0 22px; }
  .ig-avatar { width: 86px; height: 86px; padding: 3px; }
  .ig-avatar span { border-width: 3px; }
  .ig-handle { font-size: 1.15rem; }
  .ig-stats { gap: 22px; margin: 10px 0 0; font-size: .85rem; }
  .ig-bio { grid-column: 1 / -1; font-size: .9rem; }
  .ig-row { gap: 10px; }
  .ig-row .ig-btn--primary { flex: 1 1 100%; justify-content: center; }
  .ig-row .ig-btn:not(.ig-btn--primary) { display: none; }            /* Home is already in the nav */
  .ig-stats { flex-wrap: wrap; row-gap: 4px; gap: 4px 16px; font-size: .8rem; }
  /* Instagram mobile layout: avatar beside name + stats, bio full width underneath */
  .ig-head > div:last-child { display: contents; }
  .ig-avatar { grid-row: 1 / span 2; align-self: center; }
  .ig-row, .ig-stats { grid-column: 2; }
  .ig-stats { margin: 0; }
  .ig-highlights { gap: 16px; }
  .ig-hl-ring { width: 64px; height: 64px; }
  .ig-grid { gap: 2px; }
}

/* ── full-screen viewer ── */
html.gv-lock, html.gv-lock body { overflow: hidden; }
.gv { position: fixed; inset: 0; z-index: 1000; color: #fff; font-family: var(--font-body, system-ui, sans-serif); }
.gv[hidden] { display: none; }
.gv-bg { position: absolute; inset: 0; background: rgba(8,12,40,.94); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .5s cubic-bezier(.22,1,.36,1); }
.gv.is-open .gv-bg { opacity: 1; }
.gv-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.gv.is-dragging .gv-stage { cursor: grabbing; }
.gv-track { position: absolute; inset: 0; will-change: transform; }
.gv-slide { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10px; }
.gv-frame { position: relative; background: var(--ink-soft, #1A2466) center / cover no-repeat; box-shadow: 0 30px 80px rgba(0,0,0,.45); will-change: transform; }
.gv-frame img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.gv-frame img.ok { opacity: 1; }
/* while the photo flies in/out of its tile, the real frame waits underneath */
.gv.is-flying .gv-slide:nth-child(n) .gv-frame { visibility: hidden; }
.gv-fly { position: fixed; z-index: 1001; object-fit: cover; pointer-events: none; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.gv.is-closing .gv-track { transition: opacity .3s, transform .3s cubic-bezier(.22,1,.36,1); opacity: 0; transform: scale(.94) !important; }

.gv-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px;
  background: linear-gradient(rgba(8,12,40,.55), transparent); }
.gv-count { font-family: var(--font-display, sans-serif); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gv-count b { font-size: 1.6rem; color: var(--volt, #FFD400); }
.gv-count span { opacity: .6; font-size: 1rem; }
.gv-actions { display: flex; align-items: center; gap: 10px; }
.gv-drive { color: #fff; text-decoration: none; font-weight: 700; font-size: .85rem; padding: 9px 14px; border: 1.5px solid rgba(255,255,255,.35);
  transition: background .25s, color .25s, border-color .25s; }
.gv-drive:hover { background: var(--volt, #FFD400); color: var(--ink, #0A1036); border-color: var(--volt, #FFD400); }
.gv-close, .gv-nav { display: grid; place-items: center; border: 0; color: #fff; cursor: pointer; background: rgba(255,255,255,.1);
  transition: background .25s, transform .25s cubic-bezier(.22,1,.36,1); }
.gv-close { width: 42px; height: 42px; border-radius: 50%; }
.gv-close:hover { background: var(--signal, #E8262E); transform: rotate(90deg); }
.gv svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gv-nav { position: absolute; top: 50%; z-index: 2; width: 54px; height: 54px; margin-top: -27px; border-radius: 50%; }
.gv-prev { left: 22px; } .gv-next { right: 22px; }
.gv-nav:hover { background: var(--volt, #FFD400); color: var(--ink, #0A1036); }
.gv-prev:hover { transform: translateX(-3px); } .gv-next:hover { transform: translateX(3px); }
.gv :focus-visible { outline: 3px solid var(--volt, #FFD400); outline-offset: 3px; }
.gv-bar { position: absolute; left: 22px; right: 22px; bottom: 22px; z-index: 2; height: 2px; background: rgba(255,255,255,.18); }
.gv-bar i { display: block; height: 100%; background: var(--volt, #FFD400); transform-origin: left; transition: transform .52s cubic-bezier(.22,1,.36,1); }
.gv-hint { position: absolute; left: 0; right: 0; bottom: 44px; z-index: 2; text-align: center; font-size: .8rem; letter-spacing: .06em; opacity: 0;
  transform: translateY(8px); transition: opacity .5s, transform .5s cubic-bezier(.22,1,.36,1); pointer-events: none; }
.gv.show-hint .gv-hint { opacity: .75; transform: none; }
/* controls fade in after the photo lands; tap the photo to hide them */
.gv-top, .gv-nav, .gv-bar { opacity: 0; transition: opacity .4s ease .15s; }
.gv.is-open .gv-top, .gv.is-open .gv-nav, .gv.is-open .gv-bar { opacity: 1; }
.gv.is-open.chrome-off .gv-top, .gv.is-open.chrome-off .gv-nav, .gv.is-open.chrome-off .gv-bar { opacity: 0; pointer-events: none; transition-delay: 0s; }
@media (max-width: 699px), (hover: none) { .gv-nav { display: none; } .gv-top { padding: 14px 14px; } .gv-bar { left: 14px; right: 14px; } }
@media (prefers-reduced-motion: reduce) {
  .ig-tile, .ig-tile img, .gv-bg, .gv-bar i { transition: none !important; }
  .ig-tile img { clip-path: none; transform: none; }
  .ig-avatar, .ig-avatar span { animation: none; }
}
