/* =====================
   Shapes of Us — page overrides.
   Shares the case-study layout with evanescent.css (loaded first).
   Everything here is prefixed su- and only places things: grid column,
   max width, aspect ratio and margins. The three patterns borrowed from
   the other case studies (heading row, 2-up / grid, source line) are
   copied in with their original values, since reminiscence.css and
   climate-quest.css are not loaded on this page.

   Vertical rhythm follows Evanescent:
     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-shapes .col-grid {
  z-index: 0;
  position: fixed;
}

/* Every image on this page 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-shapes .ev-image,
.page-shapes .ev-pair__img,
.su-2up__item,
.su-grid__item,
.su-proto__img {
  height: auto;
}

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

/* Live site — sits beside the title: label level with the year, the two
   links level with the title, in the Tools column (cols 5-6) on desktop,
   so it reads as part of the title block.
   Year and title give up those columns on this page so the three share
   two rows.
   Hidden unless the screen can actually run the piece. The live site draws
   a 1512 x 982 stage and refuses to start below 58% scale, which works out
   to 877 x 570 in landscape (or the same turned on its side, where it asks
   the visitor to rotate). Phones never reach that in either orientation,
   so they don't get links that lead to a "needs a larger screen" message. */
.ev-section--overview .ev-year  { grid-row: 1; }
.ev-section--overview .ev-title { grid-row: 2; }

.su-live {
  display: none;
  grid-column: 5 / 7;
  grid-row: 1 / 3;
  align-self: start;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

@media (min-width: 901px) {
  .ev-section--overview .ev-year,
  .ev-section--overview .ev-title { grid-column: 3 / 5; }
}

@media (orientation: landscape) and (min-width: 877px) and (min-height: 570px),
       (orientation: portrait) and (min-width: 570px) and (min-height: 877px) {
  .su-live {
    display: flex;
  }
}

/* Same type as the meta row beneath (.ev-meta dt / dd) */
.su-live dt,
.su-live dd {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

.su-live dt { color: #727272; }
:root.dark-mode .su-live dt { color: #909090; }

.su-live dd {
  color: var(--color-text);
  display: flex;
  flex-direction: column;
}

.su-live .line { display: inline-block; }

/* Same hover as .ev-next a */
.su-live a {
  transition: opacity 0.2s ease;
}

.su-live a:hover {
  opacity: 0.6;
}

/* =====================
   Problem
===================== */

/* Why — right column, between the brief and the childhood montage.
   Same placement as .rm-block--why in reminiscence.css. */
.su-block--why {
  grid-column: 7 / 11;
  max-width: 552px;
  margin-top: 60px;
}

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

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

/* Section heading + subtitle row (Experiment 1-5).
   Copied from .rm-h2-row / .rm-h2-sub in reminiscence.css. */
.su-h2-row {
  grid-column: 3 / 11;
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin: 0;
}

.su-h2-row .ev-h2 {
  margin: 0;
}

.su-h2-sub {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #717171;
  margin: 0;
}

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

/* Sources narrower than the content column (1188px and 1232px wide) sit
   on the left half so they are never scaled up. */
.su-image--half {
  grid-column: 3 / 7;
  max-width: 552px;
}

/* Inline video — .ev-video sized to each clip's real ratio, so nothing
   is cropped. */
.su-video {
  max-width: 1124px;
  height: auto;
}

.su-video--16x9 { aspect-ratio: 16 / 9; }
.su-video--wide { aspect-ratio: 1600 / 814; }
.su-video--pull { aspect-ratio: 1600 / 1040; }

/* Text under media. 882px is the text width Evanescent's process section
   uses; at this size no paragraph on the page ends on a stranded word. */
.su-text {
  grid-column: 3 / 11;
  max-width: 882px;
  margin-top: 24px;
}

/* Source line under a reference image.
   Copied from .cq-source in climate-quest.css. */
.su-source {
  grid-column: 7 / 11;
  font-size: 10px;
  font-weight: 400;
  color: #717171;
  line-height: 1.5;
  margin-top: 16px;
}

/* Two images side by side. Copied from .rm-2up in reminiscence.css. */
.su-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;
}

.su-2up__item {
  width: 100%;
  display: block;
}

/* 2 by 2 grid. Copied from .rm-grid in reminiscence.css. */
.su-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;
}

.su-grid__item {
  width: 100%;
  display: block;
}

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

/* =====================
   Approach — Rapid prototyping
   Portrait diagram capped at 3 columns, caption under it, text right.
===================== */
.su-proto {
  margin-top: 24px;
}

.su-proto__figure {
  grid-column: 4 / 7;
  max-width: 553px;
  margin: 0;
}

.su-proto__img {
  display: block;
  width: 100%;
  aspect-ratio: 1500 / 2289;
}

.su-proto__caption {
  margin-top: 16px;
}

/* =====================
   Process — User testing
   Photo left, text right (same columns as the Evanescent feedback row).
===================== */
.su-pair--testing {
  margin-top: 24px;
}

.su-pair__img--testing {
  grid-column: 3 / 7;
  max-width: 695px;
  aspect-ratio: 1400 / 1050;
}

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

/* =====================
   Dark mode (the two copied colours)
===================== */
:root.dark-mode .su-h2-sub,
:root.dark-mode .su-source {
  color: #6a6a6a;
}

/* =====================
   Responsive — narrow viewports (6 columns)
===================== */
@media (max-width: 900px) {
  .su-block--why,
  .su-h2-row,
  .su-image,
  .su-image--half,
  .su-text,
  .su-source,
  .su-2up,
  .su-grid,
  .su-pair__img--testing,
  .su-block--testing {
    grid-column: 1 / 7;
    max-width: none;
  }

  .su-video {
    max-width: none;
  }

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

  /* Live site keeps its place beside the title (middle two of six columns) */
  .ev-section--overview .ev-year,
  .ev-section--overview .ev-title { grid-column: 1 / 3; }
  .su-live { grid-column: 3 / 5; }

  /* Portrait diagram keeps its 3-column cap; the text stacks under it */
  .su-proto__figure {
    grid-column: 1 / 4;
    max-width: none;
  }

  .su-block--testing {
    margin-top: 40px;
  }
}

/* =====================
   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-shapes {
    --col-margin: 12px;
    --col-gutter: 10px;
  }

  .su-block--why,
  .su-h2-row,
  .su-image,
  .su-image--half,
  .su-text,
  .su-source,
  .su-2up,
  .su-grid,
  .su-proto__figure,
  .su-pair__img--testing,
  .su-block--testing {
    grid-column: 1 / 5;
    max-width: none;
  }

  /* Live site beside the title (only on tall, wide-enough portrait screens) */
  .ev-section--overview .ev-year,
  .ev-section--overview .ev-title { grid-column: 1 / 3; }
  .su-live { grid-column: 3 / 5; }

  .su-block--testing {
    margin-top: 32px;
  }
}
