/*
 * Event pages (/<slug>, built by the servePage function from the `pages`
 * collection) — shared styles. Loaded by every event page AND by the admin
 * editor's live preview, so the two can never drift apart. Per-page values
 * (background image + opacity) arrive as inline styles on .page-bg.
 */
:root { --purple: #490d60; --pink: #b92f8b; --soft: #da7ab5; }
* { box-sizing: border-box; }
/* Background colour on html only: a body background would paint over the
   z-index:-1 image layer below. */
html { background: #faf8fb; }
html, body { margin: 0; color: var(--purple); }
body { font-family: "DM Sans", system-ui, sans-serif; padding: 24px 16px 48px; }

/* Full-page background image, fixed so it stays put while the page scrolls. */
.page-bg {
  position: fixed; inset: 0; z-index: -1;
  background-position: center; background-size: cover; background-repeat: no-repeat;
}

/* Background art is often busy, so the heading block sits on a solid light
   panel to stay legible: eyebrow, title, then the credit line. */
header { text-align: center; margin: 0 0 32px; }
.heading {
  display: inline-block; max-width: 100%; padding: 12px 24px 14px; border-radius: 12px;
  background: #faf8fb;
}
.eyebrow {
  margin: 0 0 4px; color: var(--pink);
  font: 600 clamp(12px, 1.6vw, 15px)/1.3 "DM Sans", sans-serif; text-transform: uppercase; letter-spacing: .14em;
}
h1 {
  margin: 0;
  font: 700 clamp(26px, 5vw, 48px)/1.1 "Oswald", sans-serif; text-transform: uppercase;
  letter-spacing: .02em;
}
.credit { margin: 8px 0 0; font: 400 clamp(13px, 1.6vw, 15px)/1.5 "DM Sans", sans-serif; }
.credit span { white-space: nowrap; }
main { display: grid; gap: 40px; justify-items: center; }

.player {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  container-type: inline-size;
  /* Haze + depth, innermost first: a thin light rim, a soft white glow that
     separates the player from busy background art, then two purple-tinted drop
     shadows (tight and wide) so it reads as lifted off the page. */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .6),
    0 0 40px 12px rgba(255, 255, 255, .75),
    0 12px 24px rgba(73, 13, 96, .35),
    0 30px 70px rgba(73, 13, 96, .35);
}
.player.wide { width: min(100%, 1280px); aspect-ratio: 16 / 9; }
.player.tall { height: min(85vh, 960px); aspect-ratio: 9 / 16; max-width: 100%; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* YouTube-style controls: a scrub bar across the bottom, then a row of
   icon-only buttons (play, mute, time on the left; loop, full screen on the
   right) on a soft gradient. Built by event-player.js, once per player. */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 32px 12px 4px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  transition: opacity .4s; color: #fff;
}
.bar { position: relative; height: 16px; cursor: pointer; touch-action: none; }
.track { position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: rgba(255,255,255,.3); transition: transform .1s; }
.bar:hover .track, .bar.drag .track { transform: scaleY(1.5); }
.buffered, .played { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.buffered { background: rgba(255,255,255,.45); }
.played { background: var(--pink); }
.thumb {
  position: absolute; top: 8px; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; background: var(--pink); transform: scale(0); transition: transform .1s;
}
.bar:hover .thumb, .bar.drag .thumb, .bar:focus-visible .thumb { transform: scale(1); }
.bar:focus-visible { outline: none; }
.bar:focus-visible .track { outline: 2px solid #fff; outline-offset: 2px; }

.row { display: flex; align-items: center; gap: 2px; }
.spacer { flex: 1; }
.time { font: 500 13px/1 "DM Sans", sans-serif; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 0 2px rgba(0,0,0,.5); }
.controls button {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; background: none; color: #fff; cursor: pointer; opacity: .9;
}
.controls button:hover { opacity: 1; }
.controls button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; border-radius: 4px; }
.controls svg { width: 26px; height: 26px; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
/* Loop on = pink underline, the way YouTube marks an active toggle. */
.loop[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 5px; height: 2px;
  border-radius: 1px; background: var(--pink);
}
/* The vertical player is narrow on phones; drop the time readout below 360px wide. */
@container (max-width: 360px) { .time { display: none; } }

/* Full screen: the whole player (video + controls) fills the screen. Controls
   and cursor fade after a few seconds idle so a TV/projector shows only video. */
.player:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; max-width: none; border-radius: 0; }
.player:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; max-width: none; border-radius: 0; }
.player.idle { cursor: none; }
.player.idle .controls { opacity: 0; pointer-events: none; }

.missing {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 16px;
  background: var(--purple); color: var(--soft); font-weight: 500;
}
.player.no-video .missing { display: grid; }
.player.no-video .controls { display: none; }
