:root {
  /* These six are overridden at runtime from videos.json "theme" (and the admin page). */
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2e2a26;
  --muted: #8a7f74;
  --accent: #b08d6a;
  --line: #e7ded3;

  --shadow: 0 18px 40px -24px rgba(40, 30, 20, 0.45);
  --radius: 16px;
  --maxw: 1140px;
  --featuredw: 1280px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero (compact — keeps the video near the top) ---------- */
.hero {
  text-align: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem clamp(1.5rem, 4vw, 2.5rem);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.05rem, 4.4vw, 3.4rem);
  margin: 0 auto;
  color: var(--ink);
  white-space: nowrap;       /* keep the title on one line */
  line-height: 1.25;         /* room for descenders (g, p, j) */
  padding-bottom: 0.08em;
}

.hero__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  color: var(--muted);
  margin: 0.9rem auto 0;
  max-width: 40ch;
}

/* Watch (per-video) page header */
.hero--watch { padding-top: clamp(1.5rem, 4vw, 2.5rem); position: relative; }

.backlink {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1rem;
}
.backlink:hover { text-decoration: underline; }

/* ---------- Featured / main video ---------- */
.featured {
  max-width: var(--featuredw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.featured__player {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.featured__caption {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--muted);
  margin: 1rem auto 0;
  max-width: 60ch;
}

/* ---------- Gallery ---------- */
.gallery {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) 1.5rem;
}

.gallery__heading {
  text-align: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  color: var(--ink);
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
}

.gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 2.75rem);
}

@media (min-width: 640px) { .gallery__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .gallery__grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Reusable video facade ---------- */
.media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--ink));
}

/* Pre-loaded YouTube player sits at the bottom; thumbnail + play button cover it. */
.media__yt,
.media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 0;
}

.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
  transition: transform 0.5s ease;
}

.media__play { z-index: 2; }

/* Once playing, hide the thumbnail overlay so the player is visible/interactive. */
.media--playing img,
.media--playing .media__play { display: none; }

.media__play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.35));
  transition: background 0.3s ease;
}

.media:hover .media__play { background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.45)); }
.media:hover img { transform: scale(1.04); }

.media__play svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}

.media:hover .media__play svg { transform: scale(1.08); }

/* ---------- Gallery card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}

.card:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -22px rgba(40, 30, 20, 0.5); }

.card__body { padding: 1.3rem 1.4rem 1.6rem; }

.card__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 0.2rem;
  color: var(--ink);
}

.card__date {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

.card__desc { font-size: 0.92rem; color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 3rem 1.5rem 4rem; text-align: center; }

.footer__note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--muted);
  margin: 0;
}

/* Clickable links inside free-text fields (footer, subtitle, description) */
.footer__note a,
.featured__caption a,
.hero__tagline a,
.card__desc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}
.footer__note a:hover,
.featured__caption a:hover,
.hero__tagline a:hover,
.card__desc a:hover { opacity: 0.75; }

/* ---------- Focus & motion ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
