/* ==========================================================================
   SCOTCH — Project (single film) pages
   Layout (from Scotch's wireframe):
     LEFT  — video, spot switcher, credits in 2 columns (sticky: stays in view)
     RIGHT — title, subtitle, writing, stacked images (scrolls)
   Pages live in /work/<film-key>.html and load base.css + this file.
   ========================================================================== */

body.project-page {
  /* Project-page type: Stack Sans Headline for headings and body copy */
  --project-heading-font: var(--font-text); /* Stack Sans Headline */
  --project-body-font: var(--font-text);
  background: #ffffff;
  color: #111111;
  font-family: var(--project-body-font);
}

/* The site's base <html> background is dark; make it white here so no black
   shows when the page bounces / overscrolls at the top or bottom. */
html:has(body.project-page),
html.project-html {
  background: #ffffff;
  color-scheme: light;
}

body.project-page ::selection { background: #111; color: #fff; }

/* ---------- Header ---------- */
.project-header {
  position: fixed; /* always visible while scrolling */
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 clamp(20px, 4vw, 48px);
  background: #ffffff; /* solid: no blurred text ghosting behind the logo */
}

.project-logo {
  font-family: var(--font-logo);
  font-weight: var(--logo-weight);
  font-size: 1.15rem;
  letter-spacing: var(--tracking-logo);
  color: #111;
  text-decoration: none;
  text-transform: uppercase;
}

.project-back {
  font-family: var(--project-body-font);
  font-size: 0.78rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
  transition: color 0.2s ease;
}
.project-back:hover { color: #000; }

/* ---------- Main: one centred column ----------
   The HTML still has two wrappers (aside.project-media + div.project-story);
   they're unwrapped with display:contents so the pieces can be re-ordered:
     title → video → spots → credits │ break │ BTS images → writing → prev/next */
.project-main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(68px + clamp(24px, 4vw, 56px)) clamp(20px, 4vw, 48px) 96px; /* 68px = fixed header */
}

.project-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  text-align: left; /* components are centred; text inside them stays left-aligned */
}
.project-media, .project-story { display: contents; }

.project-titleblock {          /* title left, date right (above the video) */
  order: 1;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.project-date {
  font-family: var(--project-body-font);
  font-size: 1rem;               /* same as the credit details */
  line-height: 1.5;
  color: #111;
  white-space: nowrap;
}
.project-date:empty { display: none; }
.project-video      { order: 2; width: 100%; margin-top: clamp(24px, 3vw, 40px); }
.project-spots      { order: 3; width: 100%; }
.project-credits    { order: 4; width: 100%; }
.project-story::before {        /* the break between credits and everything after */
  content: '';
  order: 5;
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.15);
  margin: clamp(56px, 7vw, 96px) 0 clamp(40px, 5vw, 64px);
}
.project-images     { order: 6; width: 100%; margin-top: 0; }
.project-body       { order: 7; width: 100%; }
.project-pager      { order: 8; width: 100%; }

/* ---------- Title (right, top) ---------- */
.project-title {
  font-family: var(--project-heading-font);
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: var(--tracking-title);
  text-transform: none; /* as typed (sentence case) */
  color: #000;
}
.project-subtitle {
  margin-top: 18px;
  font-family: var(--project-body-font);
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.6);
  max-width: 34em;
}

/* ---------- Writing (right) ---------- */
.project-body {
  margin-top: clamp(28px, 3vw, 40px);
  font-size: 1.12rem;
  line-height: 1.55;
  color: #1a1a1a;
  max-width: 36em;
}
.project-body > * + * { margin-top: 1.2em; }
.project-body:empty { display: none; } /* no gap until writing is added */
.project-body h2 {
  font-family: var(--project-heading-font);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  margin-top: 2.4em;
}
.project-body a { color: inherit; }

/* Images (right column): stacked, full column width */
.project-ph { width: 100%; aspect-ratio: 3 / 2; background: #d9d9d9; } /* gray placeholder box */
/* Row of portrait photos (e.g. phone BTS): three across, cropped to the same 3:4 shape */
.project-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-row img { aspect-ratio: 3 / 4; object-fit: cover; }
.project-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* two across */
.project-images { margin-top: clamp(24px, 2.5vw, 32px); display: grid; gap: 16px; }
.project-figure { margin: 0; }
.project-body .project-figure { margin: clamp(28px, 3vw, 40px) 0 0; }
.project-figure img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.project-figure figcaption,
.project-bts figcaption {
  margin-top: 8px;
  font-family: var(--project-body-font);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-label);
  color: rgba(0, 0, 0, 0.5);
}

/* BTS grid: 2 columns (1 on phones) */
.project-bts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 2.4em 0;
}
.project-bts figure { margin: 0; }
.project-bts img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.project-bts .is-wide { grid-column: 1 / -1; }
.project-bts .is-wide img { aspect-ratio: 16 / 9; }

/* ---------- Video (left, top) ---------- */
.project-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.project-video iframe,
.project-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}

/* Campaign spot switcher (only rendered for multi-spot films) */
.project-spots {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}
.project-spot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 130px;
  width: 130px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--project-body-font);
  font-size: 0.68rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
}
.project-spot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.project-spot.is-active { color: #000; }
/* selection drawn inside the thumbnail so both spots are exactly the same size */
.project-spot.is-active img { outline: 2px solid #000; outline-offset: -2px; }

/* ---------- Credits & details (right, under the video) ----------
   Stacked sections: rule on top, small uppercase label, details underneath.
   Use several <dd> under one <dt> for multi-line lists (e.g. team names). */
.project-credits {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}
.project-credits > div {
  padding: 14px 0 20px;
  border-top: 1px solid #111;
}
.project-credits dt {
  font-family: var(--project-body-font);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: #111;
  margin-bottom: 5px;
}
.project-credits dd {
  font-family: var(--project-body-font);
  font-size: 1rem;
  line-height: 1.5;
  color: #111;
}

/* ---------- Prev / next + footer ---------- */
.project-pager {
  margin-top: 96px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--project-body-font);
  font-size: 0.78rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.project-pager a { color: #111; text-decoration: none; text-align: left; }
.project-pager a:hover { text-decoration: underline; }
.project-pager span { display: block; color: rgba(0, 0, 0, 0.4); font-size: 0.66rem; margin-bottom: 4px; }
.project-pager .next { text-align: right; margin-left: auto; }

.project-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px clamp(20px, 4vw, 48px);
  font-family: var(--project-body-font);
  font-size: 0.75rem;
  letter-spacing: var(--tracking-label);
  color: rgba(0, 0, 0, 0.5);
}
.project-footer a { color: inherit; text-decoration: none; }
.project-footer a:hover { color: #000; }

/* ---------- Lightbox ---------- */
.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  background: rgba(255, 255, 255, 0.97);
  cursor: zoom-out;
}
.project-lightbox.is-open { display: flex; }
.project-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Smaller laptops ---------- */
@media (max-width: 1200px) {
  .project-body { font-size: 1.05rem; }
}

/* ---------- Tablet / phone ---------- */
@media (max-width: 760px) {
  .project-video { margin-top: 24px; }
  .project-story::before { margin: 48px 0 32px; }
}
@media (max-width: 640px) {
  .project-bts { grid-template-columns: 1fr; }
  .project-spot { width: calc(50% - 7px); }
}
