/* Narrow layout corrections for the restored version 34 composition. */

/* Slightly smaller metric headlines; supporting copy keeps its existing size. */
.production .metrics .metric-number {
  font-size: clamp(3rem, 4.25vw, 4.25rem);
}

@media (min-width: 48rem) and (max-width: 64rem) {
  .production .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 47.999rem) {
  .production .metrics li:nth-child(4) {
    padding-top: 1.25rem;
    border-top-color: var(--forest);
  }
}

@media (max-width: 40rem) and (orientation: portrait),
       (max-device-width: 45rem) and (any-pointer: coarse) and (orientation: portrait) {
  .opening {
    --phone-hero-gutter: 8vw;
    --phone-hero-logo-width: 44.4vw;
    --phone-hero-photo-height: calc(100vw * 2080 / 4624 * 4 / 3);
    --phone-hero-unit: 1rem;
  }

  .opening,
  html.cinematic .opening {
    min-height: 0;
  }

  .opening .opening-stage,
  html.cinematic .opening .opening-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "identity" "photo" "languages";
    min-height: 0;
  }

  .opening .hero-photo {
    grid-area: photo;
    height: var(--phone-hero-photo-height);
  }

  .opening .hero-photo img {
    inset: 0;
    height: 100%;
    object-fit: cover;
    object-position: right center;
  }

  .opening .title-composition,
  html.cinematic .opening .title-composition {
    grid-area: identity;
    position: static;
    width: max-content;
    max-width: 84vw;
    margin-inline-start: var(--phone-hero-gutter);
    padding-block: clamp(calc(1.75 * var(--phone-hero-unit)), 8vw, calc(3 * var(--phone-hero-unit)))
      calc(1.25 * var(--phone-hero-unit));
  }

  .opening .title-composition .brand-mark {
    align-self: flex-start;
    width: var(--phone-hero-logo-width);
    margin-block-start: calc(.875 * var(--phone-hero-unit) - var(--phone-hero-logo-width) * 242 / 1448);
    margin-inline: calc(var(--phone-hero-unit) / 16 - var(--phone-hero-logo-width) * 28 / 1448) 0;
  }

  .opening .report-language {
    position: relative;
    grid-area: languages;
    inset: auto;
    justify-self: start;
    align-self: end;
    margin: calc(.5 * var(--phone-hero-unit)) 0 calc(.75 * var(--phone-hero-unit)) var(--phone-hero-gutter);
  }
}

@media (min-width: 40.001rem) and (max-device-width: 45rem) and (any-pointer: coarse) and (orientation: portrait) {
  .opening .hero-photo::after {
    background: none;
  }

  .opening .title-composition .opening-note {
    font-size: calc(1.8 * var(--phone-hero-unit));
  }

  html[lang="es-MX"] .opening .title-composition .opening-note {
    font-size: calc(1.5 * var(--phone-hero-unit));
  }

  .opening .report-language {
    gap: calc(.5 * var(--phone-hero-unit));
  }

  .opening .report-language a {
    font-size: calc(.875 * var(--phone-hero-unit));
    min-width: calc(2.75 * var(--phone-hero-unit));
    min-height: calc(2.75 * var(--phone-hero-unit));
  }
}

@media (min-width: 48rem) and (max-device-width: 45rem) and (any-pointer: coarse) and (orientation: portrait) {
  /* Chrome's desktop site option can scale a 980px layout onto a phone screen. */
  .opening {
    --phone-hero-unit: 4.1vw;
  }
}

@media (max-width: 60rem) and (max-height: 31rem) and (orientation: landscape),
       (max-device-width: 64rem) and (max-device-height: 31rem) and (any-pointer: coarse) and (orientation: landscape) {
  .opening .title-composition .brand-mark {
    --phone-hero-logo-width: calc(52.84889% + var(--report-wide) * .562222%);
    width: var(--phone-hero-logo-width);
    margin-inline-start: calc(1px + var(--report-wide) * 1px - var(--phone-hero-logo-width) * 28 / 1448);
  }
}

@media (min-width: 64.001rem) {
  .reflection-stage-v8 {
    padding-left: calc(var(--edge) + 40px);
  }

  .impact > .reading {
    width: calc(100% - 2 * var(--edge) + 40px);
    max-width: min(calc(var(--measure) + 40px), calc(100vw - 2 * var(--edge)));
  }

  .impact > .reading .reading-inner {
    max-width: calc(var(--measure) + 40px);
  }
}

.testimony .photo-testimony {
  margin-top: calc(-3rem - 60px);
}

@media (max-width: 64rem) {
  .testimony .photo-testimony {
    margin-top: calc(clamp(-2rem, -3vw, -1.25rem) - 60px);
  }
}

@keyframes testimony-panel-rise {
  from { transform: translateY(60px); }
  to { transform: translateY(0); }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .testimony .photo-testimony {
      animation-name: testimony-panel-rise;
      animation-duration: 1s;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }
}

/* Keep each paper and its quotation together with a consistent reading rhythm. */
.reflection-stage-v8 .crew-reflection-caption {
  margin-bottom: 0;
}

.reflection-reading .reflection-stage-v8 {
  --reflection-quote-size: clamp(2rem, calc(1rem + 2.5vw), 3rem);
}

.reflection-reading .reflection-stage-v8 blockquote,
html.motion .reflection-reading .reflection-stage-v8 blockquote {
  font-size: var(--reflection-quote-size);
}

/* Hang the opening mark at full quotation size; dates align with the prose. */
.reflection-reading blockquote .reflection-day {
  position: relative;
}

.reflection-day .reflection-opening {
  position: absolute;
  inset-inline-end: 100%;
  bottom: 0;
  font: 600 var(--reflection-quote-size)/1.2 'Barlow Condensed', Barlow, sans-serif;
}

@media (min-width: 40rem) {
  .reflection-reading .reflection-stage-v8,
  html.motion .reflection-reading .reflection-stage-v8 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    column-gap: clamp(2rem, 4.5vw, 4rem);
    row-gap: clamp(1.5rem, 2.5vw, 1.75rem);
  }

  .testimony .reflection-reading .reflection-stage-v8,
  html.motion .testimony .reflection-reading .reflection-stage-v8 {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

@media (min-width: 64.001rem) {
  .reflection-reading .reflection-stage-v8,
  html.motion .reflection-reading .reflection-stage-v8 {
    padding-inline: calc(var(--edge) + 40px);
    grid-template-columns: minmax(0, 25rem) minmax(0, 32rem);
    justify-content: center;
  }

  .testimony .reflection-reading .reflection-stage-v8,
  html.motion .testimony .reflection-reading .reflection-stage-v8 {
    grid-template-columns: minmax(0, 32rem) minmax(0, 25rem);
  }
}

/* The first paper settles within its caption gap instead of crossing the text. */
@media (prefers-reduced-motion: no-preference) {
  .reflection-stage-v8.paper-arrived:has(.crew-reflection-caption) .reflection-paper {
    animation-name: paper-caption-arrival;
  }

  @keyframes paper-caption-arrival {
    from { transform: translateY(-16px); opacity: .72; }
    to { transform: translateY(0); opacity: 1; }
  }
}
