/* ==========================================================================
   base.css — reset, structural primitives, and shared components.
   Everything visual (type, colour, layout rhythm) lives in the concept
   stylesheets: cinematic.css, casting.css, reelfirst.css.

   Lifted from montemagnogetaways.com/new/css/base.css, which is already
   proven on this box, plus the actor-site primitives at the foot of the file.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus, currentColor);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* --- Utilities ----------------------------------------------------------- */

.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 0; top: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: #111;
  color: #fff;
  text-decoration: none;
  transform: translateY(-120%);
}
.skip:focus { transform: translateY(0); }

/* Images that fill their frame. Concepts set the frame's aspect-ratio. */
.fill picture, .fill img { width: 100%; height: 100%; }
.fill img { object-fit: cover; }

/* --- Scroll reveal ------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* No JS, or reduced motion: never leave content invisible. */
.no-js .reveal,
:where(html:not(.js)) .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* --- Lightbox ------------------------------------------------------------ */

.lb {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  /* minmax(0, 1fr), NOT 1fr. A bare `1fr` means `minmax(auto, 1fr)`, and that
     `auto` minimum refuses to shrink the track below the image's min-content
     height — so a 2400px-tall headshot forced this row past the viewport and
     the whole overlay overflowed. min-height on the stage cannot fix that;
     the binding constraint is the TRACK minimum, not the item's. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(12, 11, 10, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lb[open], .lb.is-open { opacity: 1; visibility: visible; }

.lb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  color: #f4f1ec;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lb__stage {
  /* Positioned so the prev/next buttons anchor to the image area rather than
     to the whole overlay (which would centre them against the caption too). */
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 clamp(0.5rem, 3vw, 3rem);
  min-height: 0;
}

/* Absolutely filling the stage, NOT width/height: 100% in flow.
   Measured: with the image in flow, `height: 100%` silently resolved to auto
   (grid item, align-self: center), so a 1600x2400 plate rendered 1354x2030
   inside a 670px-tall stage and overflowed the viewport — object-fit had a box
   as tall as the image and so nothing to contain. Absolute inset:0 against the
   positioned stage gives a definite box every time.

   The constant box also stops the viewer jumping: the cached thumbnail and the
   full-size plate occupy identical space, so the swap changes only sharpness.
   Nav buttons carry z-index: 2 and stay above this. */
.lb__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.3s ease;
}

/* While the low-res thumbnail is standing in, blur it so it reads as
   deliberately loading rather than as a bad image. site.js drops the class the
   moment the full plate has decoded. */
.lb__stage img.is-thumb { filter: blur(12px); }

@media (prefers-reduced-motion: reduce) {
  .lb__stage img { transition: none; }
}

.lb__cap {
  padding: 1rem clamp(1rem, 4vw, 2rem) 1.5rem;
  color: #cfc8bd;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  max-width: 70ch;
  margin-inline: auto;
}

.lb__btn {
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  color: #f4f1ec;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}
.lb__btn:hover { background: rgba(255, 255, 255, 0.18); }
.lb__btn svg { width: 1.25rem; height: 1.25rem; }

.lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.lb__nav--prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.lb__nav--next { right: clamp(0.5rem, 2vw, 1.5rem); }

body.lb-open { overflow: hidden; }

@media print {
  .skip { display: none; }
}

/* ==========================================================================
   Actor-site primitives. Structure only — concepts supply the colour.
   ========================================================================== */

/* --- Reel player --------------------------------------------------------- */

/* The poster carries the frame's aspect ratio so nothing shifts when the
   video element finally loads its metadata. */
.reel {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.reel video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Credits table ------------------------------------------------------- */

/* A three-column grid rather than a <table>: it collapses to two rows on
   narrow screens without the reflow tricks a real table would need. Concepts
   still mark it up as a <dl>-ish list so it reads correctly to a screen
   reader in either layout. */
.credits { display: grid; }

.credit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 1.5rem;
  padding: 0.95rem 0;
  align-items: baseline;
}
@media (min-width: 700px) {
  .credit {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0 1.5rem;
  }
}

.credit__title { font-weight: 600; }
.credit__note { display: block; font-size: 0.84em; opacity: 0.72; }

/* --- Stat rail ----------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 1rem 1.5rem;
}
.stat dt {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.2rem;
}
.stat dd { margin: 0; font-size: 1.02rem; }

/* --- Gallery ------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: clamp(0.5rem, 1.5vw, 1rem);
}
.gallery a {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.gallery a:hover img { transform: scale(1.04); }

/* --- Draft flag ---------------------------------------------------------- */

/* Marks copy that Yohana has not signed off on yet. Deliberately loud — it
   must not survive to the live site unnoticed. */
.draft {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: #fde68a;
  color: #4a3208;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
}

@media print {
  .reel, .gallery, .draft { display: none; }
}
