/* =====================
   Tukutuku — page overrides.
   Shares the case-study layout with evanescent.css (loaded first).
   Everything here is prefixed tk- and only places things: grid column,
   max width, aspect ratio and margins. The shared pieces are copied from
   their su- originals in shapes-of-us.css, which is not loaded here.

   Vertical rhythm (same as Shapes of Us):
     140px above a new heading
      24px between a heading, its media and its text
      60px between two pieces of media in the same block
     100px above a second image + text pair under one heading
===================== */

/* Grid lines span the full page height, lowest z-index (evanescent.css
   scopes the same rule to .page-evanescent). */
.page-tukutuku .col-grid {
  z-index: 0;
  position: fixed;
}

/* Every image and video carries width / height attributes, so the browser
   reserves the right space before the lazy-loaded file arrives.
   height:auto lets that ratio drive the height instead of the attribute. */
.page-tukutuku .ev-image,
.page-tukutuku .ev-pair__img,
.tk-row__item,
.tk-2up__item,
.tk-3up__item,
.tk-grid__item {
  height: auto;
}

/* =====================
   Overview
===================== */

/* Hero — image in the .ev-hero slot (the pattern from reminiscence.html),
   at the flags mockup's own 4:3 ratio so no flag is cropped. */
.page-tukutuku .ev-hero > img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2240 / 1672;
}

/* =====================
   Shared pieces
===================== */

/* Heading that starts a new block inside a section */
.tk-h2 {
  margin-top: 140px;
}

/* Full-width image */
.tk-image {
  grid-column: 3 / 11;
  max-width: 1124px;
  margin-top: 24px;
}

/* A source narrower than the content column sits on the left half so it
   is never scaled up. */
.tk-image--half {
  grid-column: 3 / 7;
  max-width: 552px;
}

/* Text under media */
.tk-text {
  grid-column: 3 / 11;
  max-width: 882px;
  margin-top: 24px;
}

/* Credit line under a teammate's work.
   Copied from .su-source in shapes-of-us.css. */
.tk-source {
  grid-column: 7 / 11;
  font-size: 10px;
  font-weight: 400;
  color: #717171;
  line-height: 1.5;
  margin-top: 16px;
}

/* Right-column block inside Approach ("Our question:"), placed like the
   Problem blocks. */
.tk-block--question {
  grid-column: 7 / 11;
  max-width: 489px;
  margin-top: 60px;
}

/* Two equal columns. Copied from .su-2up. */
.tk-2up {
  grid-column: 3 / 11;
  max-width: 1124px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--col-gutter);
  align-items: start;
  margin-top: 24px;
}

/* 2 by 2 grid. Copied from .su-grid. */
.tk-grid {
  grid-column: 3 / 11;
  max-width: 1124px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--col-gutter);
  row-gap: 16px;
  margin-top: 24px;
}

/* Three equal columns — the 9:16 silo projections. Stays three across at
   every width; stacked, they would be three screens tall on a phone. */
.tk-3up {
  grid-column: 3 / 11;
  max-width: 1124px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--col-gutter);
  align-items: start;
  margin-top: 24px;
}

/* Row of images with different proportions. Each column's share of the
   width is its image's width / height, so every image in the row comes
   out the same height and nothing is cropped. */
.tk-row {
  grid-column: 3 / 11;
  max-width: 1124px;
  display: grid;
  column-gap: var(--col-gutter);
  align-items: start;
  margin-top: 24px;
}

.tk-row--site      { grid-template-columns: 0.75fr 1.3333fr 0.75fr; }   /* portrait, landscape, portrait */
.tk-row--designer  { grid-template-columns: 0.5346fr 0.5133fr 0.5346fr; }
.tk-row--cardboard { grid-template-columns: 1.3333fr 0.75fr; }
.tk-row--laser     { grid-template-columns: 1.1657fr 0.75fr; }
.tk-row--materials { grid-template-columns: 0.5626fr 0.75fr; }
.tk-row--spatial   { grid-template-columns: 1.3133fr 1.4141fr; }

/* Two narrow portrait phone photos: six columns wide, so they stay sharp
   and the row is not overly tall. */
.tk-row--materials {
  grid-column: 3 / 9;
  max-width: 836px;
}

.tk-row__item,
.tk-2up__item,
.tk-3up__item,
.tk-grid__item {
  display: block;
  width: 100%;
  min-width: 0;
}

/* Videos inside a row or grid, sized to each clip's real ratio */
.tk-video--16x9 { aspect-ratio: 16 / 9; }
.tk-video--9x16 { aspect-ratio: 9 / 16; }

/* Spacing between media in the same block. Declared after the pieces
   above so they win at equal specificity. */
.tk-media--stacked { margin-top: 60px; }
.tk-media--sub     { margin-top: 100px; }

/* =====================
   Process — Workshop
   Poster left, text right (same columns as the Evanescent feedback row).
   Copied from .su-pair--testing.
===================== */
.tk-pair--workshop {
  margin-top: 24px;
}

.tk-pair__img--poster {
  grid-column: 3 / 7;
  max-width: 552px;
  aspect-ratio: 1400 / 1979;
}

.tk-block--workshop {
  grid-column: 7 / 11;
  max-width: 552px;
}

/* =====================
   Dark mode (the copied credit colour)
===================== */
:root.dark-mode .tk-source {
  color: #6a6a6a;
}

/* =====================
   Responsive — narrow viewports (6 columns)
   Side-by-side media stays side by side here: stacking at this width would
   stretch the 768px phone photos past their real size.
===================== */
@media (max-width: 900px) {
  .tk-image,
  .tk-image--half,
  .tk-text,
  .tk-source,
  .tk-block--question,
  .tk-2up,
  .tk-3up,
  .tk-grid,
  .tk-row,
  .tk-row--materials {
    grid-column: 1 / 7;
    max-width: none;
  }

  /* Poster and text share the row, three columns each */
  .tk-pair__img--poster {
    grid-column: 1 / 4;
    max-width: none;
  }

  .tk-block--workshop {
    grid-column: 4 / 7;
    max-width: none;
  }
}

/* =====================
   Responsive — mobile (4 columns, 12px margin, 10px gutter)
   Matches Evanescent's phone grid, which evanescent.css scopes to
   .page-evanescent.
===================== */
@media (max-width: 640px) {
  .page-tukutuku {
    --col-margin: 12px;
    --col-gutter: 10px;
  }

  .tk-image,
  .tk-image--half,
  .tk-text,
  .tk-source,
  .tk-block--question,
  .tk-2up,
  .tk-3up,
  .tk-grid,
  .tk-row,
  .tk-row--materials,
  .tk-pair__img--poster,
  .tk-block--workshop {
    grid-column: 1 / 5;
    max-width: none;
  }

  /* Side-by-side media stacks on a phone... */
  .tk-2up,
  .tk-grid,
  .tk-row {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  /* ...except the prototype screens, which read as one strip */
  .tk-row--keep.tk-row--designer {
    grid-template-columns: 0.5346fr 0.5133fr 0.5346fr;
  }

  .tk-block--workshop {
    margin-top: 32px;
  }
}
