/* ===========================================================================
   premium-videographer.css — the Showreel layer
   ---------------------------------------------------------------------------
   Loaded after premium.css by templates/template-premium-videographer.html and
   scoped to .pm--film on <body>, so nothing here reaches any other template.

   Two jobs. The first is to give the page a cutting-room register: wide-gauge
   type, a sprocket rule above every section heading, and a dark surface that
   reads as a grading suite rather than a card wall. The second is to style the
   four blocks this template adds and premium.css has never heard of — the
   showreel of ten films, the previous-works grid, the stills mosaic with its
   full-screen viewer, and the highlighted channel cards.

   Only tokens from tokens.css are used, so light and dark both come free.
   =========================================================================== */


/* ---------------------------------------------------------------------------
   1 — THE CINEMA REGISTER
   --------------------------------------------------------------------------- */

/* A film frame has corners, not pillows. Everything Premium draws — cards,
   panels, photographs — tightens at once from this one place. */
.pm--film {
  --pm-radius: var(--radius-sm);
  --pm-radius-lg: var(--radius-md);

  /* The layer's own measurements, named once so the blocks below agree. */
  --film-gap: var(--space-4);
  --film-slate: color-mix(in srgb, var(--slate-950) 92%, var(--color-accent));
  --film-sheen: linear-gradient(135deg,
                  color-mix(in srgb, var(--white) 10%, transparent) 0%,
                  transparent 42%);
  --film-tool: color-mix(in srgb, var(--slate-950) 62%, transparent);
}

/* The eyebrow becomes a slate marker: a short accent bar, then the word. It
   sits above every section heading, so this one rule sets the page's voice. */
.pm--film .eyebrow {
  position: relative;
  padding-left: var(--space-5);
  border-color: transparent;
  background: none;
  color: var(--color-text);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}
.pm--film .eyebrow::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 0;
  width: var(--space-4);
  height: 2px;
  background: var(--color-accent);
  transform: translateY(-50%);
}

/* Headlines in the wide gauge — cinema titling is tight and heavy. */
.pm--film .hero__title,
.pm--film .shead__title { letter-spacing: -0.035em; }

.pm--film .hero__title em.ink { font-style: normal; }

/* Two sunken bands meeting with nothing between them lose the join. */
.pm--film #contact { border-top: 1px solid var(--color-border); }

/* Eight menu items, not five: the row is allowed to breathe less. */
.pm--film .topnav { gap: var(--space-1); }
.pm--film .topnav__link { padding-inline: var(--space-2); }


/* ---------------------------------------------------------------------------
   2 — THE SHOWREEL
   Ten films. One lead frame at full width, the rest in a responsive bed. Each
   card holds a slate placeholder until premium-videographer.js swaps in the
   YouTube iframe, so nothing is fetched from another host on page load.
   --------------------------------------------------------------------------- */

.reel {
  display: grid;
  gap: var(--film-gap);
}

@container frame (min-width: 44rem) {
  .reel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reel__card--lead { grid-column: 1 / -1; }
}

@container frame (min-width: 70rem) {
  .reel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.reel__card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--color-border);
  border-radius: var(--pm-radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: clip;
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.reel__card:hover,
.reel__card:focus-within {
  border-color: var(--color-border-accent);
  box-shadow: var(--shadow-lg);
}

/* --- the frame --- */

.reel__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--film-slate);
  overflow: clip;
}

/* The iframe the script builds, and nothing else, fills the frame. */
.reel__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Sprocket holes down both edges — two gradients, no images. The slate is
   what a visitor sees before the film is built, and what stays if the card
   has no address at all. */
.reel__slate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--white) 34%, transparent);
  background-image:
    repeating-linear-gradient(to bottom,
      color-mix(in srgb, var(--white) 14%, transparent) 0 0.5rem,
      transparent 0.5rem 1.1rem),
    repeating-linear-gradient(to bottom,
      color-mix(in srgb, var(--white) 14%, transparent) 0 0.5rem,
      transparent 0.5rem 1.1rem),
    var(--film-sheen);
  background-size: 0.3rem 100%, 0.3rem 100%, 100% 100%;
  background-position: left center, right center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

/* Once a film is playing the slate is in the way. */
.reel__frame.is-playing .reel__slate { display: none; }

/* --- play button --- */

.reel__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
}
.reel__play .icon {
  width: 3.25rem;
  height: 3.25rem;
  padding: 0.85rem;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  box-shadow: var(--shadow-accent-lg);
  transition: transform var(--duration-base) var(--ease-spring);
}
.reel__play:hover .icon { transform: scale(1.08); }
.reel__play:focus-visible { outline: var(--focus-ring); outline-offset: -4px; }

.reel__frame.is-playing .reel__play { display: none; }

/* A card whose address is not a YouTube link has no film to start, so the
   script takes the button away and the slate is all that is left. */
.reel__play[hidden] { display: none; }

/* --- sound and full screen --- */

.reel__tools {
  position: absolute;
  inset: auto var(--space-2) var(--space-2) auto;
  display: flex;
  gap: var(--space-2);
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.reel__frame.is-playing .reel__tools,
.reel__card:hover .reel__frame.is-playing .reel__tools { opacity: 1; transform: none; }

/* With the script off, or before a film is built, the two tools do nothing —
   so they are not offered. */
.reel__frame:not(.is-playing) .reel__tools { display: none; }

.reel__tool {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--social-ring);
  border-radius: var(--radius-full);
  background: var(--film-tool);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background-color var(--duration-fast) var(--ease-out);
}
.reel__tool:hover { background: var(--color-accent); color: var(--color-text-on-accent); }
.reel__tool:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* --- the caption below --- */

.reel__body {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-4);
}

.reel__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.reel__card--lead .reel__title { font-size: var(--text-lg); }

.reel__cap {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.reel__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  text-transform: uppercase;
}
.reel__link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.reel__link .icon { transition: transform var(--duration-fast) var(--ease-out); }
.reel__link:hover .icon { transform: translate(2px, -2px); }


/* ---------------------------------------------------------------------------
   3 — PREVIOUS WORKS
   Past productions, each with its own still. A photograph with a tag over it
   reads as a job rather than a gallery picture, which is the difference
   between this section and the stills below.
   --------------------------------------------------------------------------- */

.pworks {
  display: grid;
  gap: var(--film-gap);
}

@container frame (min-width: 40rem) { .pworks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container frame (min-width: 66rem) { .pworks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pwork {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--color-border);
  border-radius: var(--pm-radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: clip;
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-out);
}
.pwork:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }

.pwork__shot {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 2;
  background: var(--color-bg-sunken);
  overflow: clip;
}

.pwork__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-slower) var(--ease-out);
}
.pwork:hover .pwork__img { transform: scale(1.04); }

.pwork__body {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-4);
}

.pwork__tag {
  margin: 0;
  color: var(--color-accent-text);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.pwork__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.pwork__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.pwork__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.pwork__link:hover { color: var(--color-accent-text); }
.pwork__link .icon { transition: transform var(--duration-fast) var(--ease-out); }
.pwork__link:hover .icon { transform: translate(2px, -2px); }


/* ---------------------------------------------------------------------------
   4 — STILLS MOSAIC
   premium.css already draws .mcard for its masonry gallery; the lift, the
   photograph's slow scale and the caption that rises on hover all come from
   there. What is added here is the mosaic bed — tall and wide cells, so ten
   stills read as a contact sheet — and the button reset, because every card
   on this page opens the viewer.
   --------------------------------------------------------------------------- */

.mgrid {
  display: grid;
  grid-auto-rows: 9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

@container frame (min-width: 40rem) {
  .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 11rem; }
}
@container frame (min-width: 66rem) {
  .mgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 12rem; }
}

/* The mosaic cell. Everything here either undoes the masonry margin or undoes
   a browser's button styling; the look itself is premium.css's. */
.mgrid .mcard {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
  appearance: none;
}
.mgrid .mcard:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }

.mcard--tall { grid-row: span 2; }
.mcard--wide { grid-column: span 2; }

/* premium.css draws the masonry photograph as `.mcard img { height: auto }`,
   which is one point heavier than a lone class and would win here — leaving a
   tall or wide cell with a band of empty bed under the photograph. The mosaic
   bed sizes its own cells, so the photograph is told to fill one. */
.mgrid .mcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The caption sits on one line in a cell this size. */
.mgrid .mcard__cap {
  display: block;
  padding: var(--space-6) var(--space-3) var(--space-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcard__zoom {
  position: absolute;
  inset: var(--space-2) var(--space-2) auto auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: var(--film-tool);
  color: var(--white);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}
.mcard:hover .mcard__zoom,
.mcard:focus-visible .mcard__zoom { opacity: 1; }


/* ---------------------------------------------------------------------------
   5 — THE FULL-SCREEN VIEWER
   One overlay for the whole section. It is hidden markup until the script
   opens it, so a visitor without JavaScript simply never sees it — and the
   stills are still on the page, at full width, which is the point of them.
   --------------------------------------------------------------------------- */

.lbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--slate-950) 92%, transparent);
  backdrop-filter: blur(8px);
}
.lbox[hidden] { display: none; }

.lbox__inner {
  position: relative;
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  max-width: min(72rem, 100%);
}

.lbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  background: var(--slate-900);
}

.lbox__cap {
  margin: 0;
  color: color-mix(in srgb, var(--white) 82%, transparent);
  font-size: var(--text-sm);
  text-align: center;
}
.lbox__cap[hidden] { display: none; }

.lbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--social-ring);
  border-radius: var(--radius-full);
  background: var(--film-tool);
  color: var(--white);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.lbox__btn:hover { background: var(--color-accent); color: var(--color-text-on-accent); }
.lbox__btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.lbox__btn--prev  { inset: 50% auto auto calc(-1 * var(--space-3)); transform: translateY(-50%); }
.lbox__btn--next  { inset: 50% calc(-1 * var(--space-3)) auto auto; transform: translateY(-50%); }
.lbox__btn--close { inset: calc(-1 * var(--space-5)) calc(-1 * var(--space-3)) auto auto; }

/* On a narrow screen there is no room beside the photograph, so the two
   arrows come inside it and the close button sits above. */
@media (max-width: 40rem) {
  .lbox__btn--prev  { inset: 50% auto auto var(--space-2); }
  .lbox__btn--next  { inset: 50% var(--space-2) auto auto; }
  .lbox__btn--close { inset: calc(-1 * var(--space-10)) var(--space-2) auto auto; }
}

/* The page behind must not scroll while the viewer is open. */
.pm--film.lbox-open { overflow: hidden; }


/* ---------------------------------------------------------------------------
   6 — HIGHLIGHTED CHANNELS
   The spec asks for prominence, so these are not icons in a row: each network
   gets a card carrying its own colour as a wash and a glow, with the handle
   and the follower count beside it. The colour comes from the icon in the
   card, exactly as the footer dock does it in premium.css, so a card and its
   tint can never disagree.
   --------------------------------------------------------------------------- */

.chans {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.chan {
  --social-tint: var(--color-accent);

  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--pm-radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  overflow: clip;
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

/* The wash: the network's colour at a tenth, poured from the icon corner. */
.chan::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--social-tint);
  opacity: 0.08;
  transition: opacity var(--duration-base) var(--ease-out);
}

.chan:hover,
.chan:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--social-tint) 45%, var(--color-border));
  box-shadow: 0 12px 28px -14px var(--social-tint), var(--shadow-md);
}
.chan:hover::before { opacity: 0.16; }

.chan__icon,
.chan__body,
.chan__go { position: relative; }

.chan__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--social-ring);
  background: var(--social-tint);
  color: var(--social-on);
  box-shadow: 0 6px 18px -10px var(--social-tint);
}

.chan__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.chan__name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.chan__handle,
.chan__count {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chan__handle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.chan__count {
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.chan__go { color: var(--color-text-subtle); }
.chan:hover .chan__go { color: var(--color-text); }

/* One line per network, read off the icon the card carries. */
.chan:has(use[href="#i-youtube"])   { --social-tint: var(--social-youtube); }
.chan:has(use[href="#i-instagram"]) { --social-tint: var(--social-instagram); }
.chan:has(use[href="#i-tiktok"])    { --social-tint: var(--social-tiktok); }
.chan:has(use[href="#i-facebook"])  { --social-tint: var(--social-facebook); }
.chan:has(use[href="#i-vimeo"])     { --social-tint: var(--social-vimeo); }
.chan:has(use[href="#i-behance"])   { --social-tint: var(--social-behance); }
.chan:has(use[href="#i-whatsapp"])  { --social-tint: var(--social-whatsapp); }
.chan:has(use[href="#i-linkedin"])  { --social-tint: var(--social-linkedin); }
.chan:has(use[href="#i-x-social"])  { --social-tint: var(--social-x); }
.chan:has(use[href="#i-github"])    { --social-tint: var(--social-github); }
.chan:has(use[href="#i-pinterest"]) { --social-tint: var(--social-pinterest); }

/* Instagram's brand mark is a gradient, which a shadow cannot take. The wash
   and the tile keep it; the glow falls back to the card's own accent. */
.chan:has(use[href="#i-instagram"]) {
  --social-glow: var(--violet-500);
}
.chan:has(use[href="#i-instagram"]):hover {
  border-color: color-mix(in srgb, var(--violet-500) 45%, var(--color-border));
  box-shadow: 0 12px 28px -14px var(--violet-500), var(--shadow-md);
}
.chan:has(use[href="#i-instagram"]) .chan__icon { box-shadow: 0 6px 18px -10px var(--violet-500); }

/* TikTok, X and GitHub are near-black: on a dark page the tile would be a
   hole, so those three borrow the ink the theme is using for text. */
[data-theme="dark"] .chan:has(use[href="#i-tiktok"]),
[data-theme="dark"] .chan:has(use[href="#i-x-social"]),
[data-theme="dark"] .chan:has(use[href="#i-github"]) {
  --social-tint: var(--slate-700);
}


/* ---------------------------------------------------------------------------
   7 — SMALL SCREENS
   The editor's phone and tablet previews drive the same container, so these
   are container queries rather than media queries wherever the layout is
   what changes.
   --------------------------------------------------------------------------- */

@container frame (max-width: 30rem) {
  .reel__body { padding: var(--space-3); }
  .reel__play .icon { width: 2.75rem; height: 2.75rem; padding: 0.7rem; }
  .mgrid { grid-auto-rows: 7.5rem; gap: var(--space-2); }
  .chan { padding: var(--space-3); }
  .chan__icon { width: 2.5rem; height: 2.5rem; }
}


/* ---------------------------------------------------------------------------
   8 — MOTION
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .pwork,
  .pwork__img,
  .chan,
  .reel__play .icon,
  .reel__link .icon,
  .pwork__link .icon {
    transition: none;
  }
  .pwork:hover,
  .chan:hover { transform: none; }
  .pwork:hover .pwork__img { transform: none; }
}
