/* Reusable components (Figma Design System › 02 Controls, 05 Features, 08/09
   Chapters, Lens, slideshows). Section-specific layout lives in sections.css. */

@layer components {
  /* Logo — supplied "GNOF Logo Horizontal Reversed" lockup (644 × 70). ---- */
  .logo {
    display: block;
    inline-size: min(25rem, 70vw);
    flex-shrink: 0;

    & img {
      inline-size: 100%;
      block-size: auto;
    }
  }

  /* Buttons (V2/Buttons): yellow or royal; hover/pressed surfaces are white
     with an inset outline so the size never changes. ---------------------- */
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    --cap-shift: 0px;
    min-block-size: 3.25rem;
    padding: calc(0.875rem + var(--cap-shift)) var(--v2-space-24) calc(0.875rem - var(--cap-shift));
    font-size: var(--v2-button-size);
    font-weight: var(--v2-weight-medium);
    line-height: var(--lh-body);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--v2-radius);
    transition:
      background-color var(--dur-fast) ease,
      color var(--dur-fast) ease,
      box-shadow var(--dur-fast) ease;
  }

  /* Centre the capitals, not the font's line box: the label is trimmed to
     cap height so align-items: center is exact at every size. Browsers
     without text-box fall back to shifting the label by Neusa's measured
     offset (capitals sit ~0.153em above the middle of the line box). */
  .button__label {
    display: block;
    text-box: trim-both cap alphabetic;
  }

  @supports not (text-box: trim-both cap alphabetic) {
    .button {
      --cap-shift: 0.153em;
    }
  }

  .button--small {
    min-block-size: var(--v2-button-small-min-height);
    padding: calc(0.6875rem + var(--cap-shift)) var(--v2-space-20) calc(0.6875rem - var(--cap-shift));
  }

  .button--yellow {
    background: var(--v2-yellow);
    color: var(--v2-navy);
  }

  .button--royal {
    background: var(--v2-royal);
    color: var(--v2-white);
  }

  .button:hover,
  .button:focus-visible {
    background: var(--v2-white);
    color: var(--v2-navy);
    box-shadow: inset 0 0 0 2px var(--v2-yellow);
  }

  .button--royal:hover,
  .button--royal:focus-visible {
    box-shadow: inset 0 0 0 2px var(--v2-royal);
  }

  .button:active {
    box-shadow: inset 0 0 0 4px var(--v2-yellow);
  }

  /* Report buttons: no outline in any state — hover/press just turns white. */
  .button--yellow:is(:hover, :focus-visible, :active) {
    box-shadow: none;
  }

  /* 44px transparent icon target (V2/Icons/Arrow left/right). */
  /* Count-up stats (motion.js): final text for screen readers. */
  .count__sr {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .icon-button {
    display: inline-grid;
    place-items: center;
    inline-size: var(--v2-control-target);
    block-size: var(--v2-control-target);
    flex-shrink: 0;
    transition: opacity var(--dur-fast) ease;

    &:disabled {
      opacity: 0.28;
      cursor: default;
    }

    & img {
      inline-size: 1.5rem;
      block-size: 1.5rem;
    }
  }

  .text-link {
    font-size: var(--v2-link-size);
    line-height: var(--lh-link);
    text-decoration: underline;
    text-underline-position: from-font;
    text-underline-offset: 2px;

    &:hover {
      text-decoration-thickness: 2px;
    }
  }

  /* Arrow centred on the label's capitals in every browser (no reliance on
     text-box or the font's line metrics): items align on the text baseline,
     then the arrow drops so its middle sits half a cap-height above it. */
  .back-link {
    display: inline-flex;
    flex-wrap: wrap; /* lets align-content centre the row in min-block-size */
    align-content: center;
    align-items: baseline;
    gap: var(--v2-space-16);
    min-block-size: 3rem;
    color: inherit;
    font-size: var(--v2-button-size);
    font-weight: var(--v2-weight-medium);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    text-decoration: none;
    transition: color var(--dur-fast) ease;

    &:hover,
    &:focus-visible {
      color: var(--back-hover, var(--v2-cyan));
    }
  }

  .back-link__label {
    display: block;
  }

  .back-link__icon {
    inline-size: 1.5rem;
    block-size: 1.5rem;
    flex-shrink: 0;
    /* Its baseline is its bottom edge: move it down by (half its height −
       half a cap) so its centre meets the capitals' centre. */
    translate: 0 calc(0.75rem - 0.5cap);
    background: currentColor; /* the arrow follows the link colour on hover */
    mask: url("../svg/arrow-left.svg") center / contain no-repeat;
  }

  /* Key Findings + By the Numbers (navy): back link turns yellow. */
  .chapters.bg-navy {
    --back-hover: var(--v2-yellow);
  }

  /* Image + text carousels (Lens): links turn yellow. */
  .lens a:hover {
    color: var(--v2-yellow);
  }

  /* READ MORE / READ LESS (V2/READ MORE — linked content) ----------------- */
  .read-more {
    display: flex;
    flex-direction: column;
  }

  /* Content is visible until read-more.js enhances it, so nothing is lost
     without JS. Once enhanced, hidden="until-found" keeps it searchable
     (it keeps a zero-height box, so spacing lives on the open state only). */
  .read-more__content {
    overflow: clip;

    &:not([hidden]) {
      margin-block-end: var(--v2-space-24);
    }
  }

  .read-more__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--v2-space-8);
    align-self: flex-start;
    min-block-size: var(--v2-control-target);
    font-size: var(--v2-link-size);
    line-height: var(--lh-link);
    text-transform: uppercase;
    transition: color var(--dur-fast) ease;

    &:hover {
      color: var(--v2-cyan);
    }

    & .read-more__label {
      text-decoration: underline;
      text-underline-position: from-font;
      text-underline-offset: 2px;
    }

    & img {
      inline-size: 1rem;
      block-size: 1rem;
      transition: rotate 0.3s var(--ease-standard);
    }

    &[aria-expanded="true"] img {
      rotate: 180deg;
    }
  }

  .signature strong {
    font-weight: var(--v2-weight-medium);
  }

  .signature p + p {
    margin-block-start: 0;
  }

  .bullets {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-16);
    padding-inline-start: 1.25rem;
  }

  /* Brand split — 35% cyan chevron panel / 65% royal text ------------------ */
  .brand-split {
    display: grid;
    grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
    background: var(--v2-royal);
  }

  .brand-split__art {
    position: relative;
    display: grid;
    place-items: center;
    min-block-size: 30rem;
    overflow: clip;
    background: var(--v2-cyan);
  }

  /* GNOF chevron, vertically centred and bleeding off the panel. Figma pins
     it to the left of a "Replaceable brand graphic" box that is centred in
     the panel, so its left edge sits half that box's width left of centre.
     Desktop: 428.4 × 826 in a 593.169-wide box (tablet/mobile values in
     sections.css). */
  .brand-split__chevron {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: calc(50% - 18.5366rem); /* 593.169 / 2 */
    inline-size: 26.775rem; /* 428.4 */
    max-inline-size: none;
    block-size: auto;
    translate: 0 -50%;
    opacity: 0.25;
  }

  .brand-split__text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--v2-space-96);
  }

  .brand-split__reading {
    inline-size: 100%;
    max-inline-size: var(--v2-feature-reading-width);

    & p {
      margin: 0;
    }
  }

  /* Feature split — 65% text / 35% photo (Key terms, Our commitments) ------ */
  .feature-split {
    display: grid;
    grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
  }

  .feature-split__text {
    display: flex;
    justify-content: center;
    padding: var(--v2-space-144) var(--v2-space-96);
  }

  .feature-split__reading {
    inline-size: 100%;
    max-inline-size: var(--v2-feature-reading-width);
  }

  .feature-split__media {
    position: relative;
    overflow: clip;
    min-block-size: 20rem;

    & img {
      position: absolute;
      inset: 0;
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
  }

  .prose strong {
    font-weight: var(--v2-weight-medium);
  }

  /* Statistic card (V2/Statistics/Card) ---------------------------------- */
  .stat {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-20);
    text-align: center;
  }

  .detail-stat {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-20);
  }

  .detail-stat__value {
    color: var(--v2-yellow);
  }

  /* Panels are swapped by chapters.js; without JS every panel is shown.
     The overview stays visible until a detail panel is active, so there is
     no flash or layout shift while the module loads. */
  .js .chapter-detail:not(.is-active),
  .js [data-component="chapters"]:has(.chapter-detail.is-active) [data-chapter="overview"] {
    display: none;
  }

  .chapter-detail {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-40);

    & > h3:focus {
      outline: none;
    }
  }

  .chapter-detail__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--v2-space-32) var(--v2-space-48);
    align-items: flex-start;

    & > :first-child {
      flex: 1 1 20rem;
    }

    & > :last-child {
      flex: 1 1 30rem;
    }
  }

  .chapter-detail__grid--even > :last-child {
    flex-basis: 20rem;
  }

  /* Lens — synchronized photo + copy reel with expanding thumbnail tabs
     (V02e / Lens C). 700 ms cubic-bezier(.4,0,.2,1). ----------------------- */
  .lens {
    --lens-height: 29.5rem; /* 472 */
    --lens-viewport: 15.4375rem; /* 247 */
    --active-grow: 2.6667; /* 456 / 171 */
    --index: 0;
    --count: 5;
    position: relative;
    container-type: inline-size;
  }

  .lens--compact {
    --lens-height: 23.25rem; /* 372 */
    --lens-viewport: 12rem; /* 192 */
  }

  .lens__story {
    display: grid;
    grid-template-columns: 35fr 65fr;
    block-size: var(--lens-height);
  }

  .lens__photo {
    overflow: clip;
    background: var(--v2-navy);
  }

  .lens__photo-reel,
  .lens__copy-reel {
    display: flex;
    block-size: 100%;
    translate: calc(var(--index) * -100%) 0;
    transition: translate var(--dur-lens) var(--ease-standard);
  }

  .lens__photo-reel img {
    flex: 0 0 100%;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }

  .lens__reading {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-24);
    min-inline-size: 0;
    padding: 3.5rem;
    overflow: clip;
  }

  .lens__reading {
    position: relative;
  }

  /* Sits in the reading area's bottom padding so it never shifts the layout. */
  .lens__scroll-hint {
    position: absolute;
    inset-block-end: var(--v2-space-24);
    inset-inline-start: 3.5rem;

    &[hidden] {
      display: none;
    }
  }

  .lens__controls {
    display: flex;
    align-items: center;
    gap: var(--v2-space-16);

    & .lens__count {
      flex: 1;
    }
  }

  .lens__viewport {
    block-size: var(--lens-viewport);
    overflow: clip;
  }

  .lens__panel {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-24);
    block-size: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
        /* padding-inline-end: var(--v2-space-8); */

    padding-inline-end: 0.7rem;

    /* Thin, rounded scrollbar in the palette blues. The gutter is always
       reserved (no layout shift) but stays invisible until the panel is
       hovered or being scrolled (.is-scrolling, set by lens.js). */
    --lens-scroll-thumb: transparent;
    --lens-scroll-track: transparent;

    &:hover,
    &.is-scrolling {
      --lens-scroll-thumb: var(--v2-sky);
      --lens-scroll-track: color-mix(in srgb, var(--v2-navy) 35%, transparent);
    }

    /* Chromium + Safari: pseudo-elements allow the rounded ends. */
    &::-webkit-scrollbar {
      inline-size: 6px;
    }

    &::-webkit-scrollbar-track {
      background: var(--lens-scroll-track);
      border-radius: 999px;
    }

    &::-webkit-scrollbar-thumb {
      background: var(--lens-scroll-thumb);
      border-radius: 999px;
    }

    &::-webkit-scrollbar-thumb:hover {
      background: var(--v2-cyan);
    }

    /* Firefox: standard properties (setting these in Chromium would
       override the pseudo-elements above, hence the @supports gate). */
    @supports not selector(::-webkit-scrollbar) {
      scrollbar-width: thin;
      scrollbar-color: var(--lens-scroll-thumb) var(--lens-scroll-track);
    }

    &:focus-visible {
      outline-offset: -2px;
    }
  }

  .lens__tabs {
    position: relative;
    display: flex;
    /* Tabs resize while the selection animates; never let them spill past
       the strip (x only, so the yellow line below the strip still shows). */
    overflow-x: clip;
    block-size: 5.5rem; /* 88 */
  }

  .lens__tab {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-inline-size: 0;
    overflow: clip;
    background: var(--v2-navy);
    color: var(--v2-white);
    transition: flex-grow var(--dur-lens) var(--ease-standard);

    & img {
      flex: 1;
      inline-size: 100%;
      min-block-size: 0;
      object-fit: cover;
      transition: opacity var(--dur-fast) ease;
    }

    &:hover img {
      opacity: 0.85;
    }

    &[aria-selected="true"] {
      flex-grow: var(--active-grow);
      cursor: default;
    }

    &:focus-visible {
      outline-offset: -3px;
    }
  }

  .lens__tab-num {
    display: grid;
    place-items: center;
    block-size: 2rem;
    background: var(--v2-royal);
    transition: background-color var(--dur-lens) var(--ease-standard);

    [aria-selected="true"] > & {
      background: var(--v2-navy);
    }
  }

  /* Yellow position line follows the active (expanded) tab. */
  .lens__indicator {
    position: absolute;
    inset-block-end: 0;
    inset-inline-start: 0;
    block-size: 4px;
    inline-size: calc(100% * var(--active-grow) / (var(--count) - 1 + var(--active-grow)));
    background: var(--v2-yellow);
    translate: calc(100% / var(--active-grow) * var(--index)) 0;
    transition: translate var(--dur-lens) var(--ease-standard);
    pointer-events: none;
  }

  .lens--line-below .lens__tabs {
    margin-block-end: 4px;
  }

  .lens--line-below .lens__indicator {
    inset-block-end: -4px;
  }

  /* Without JS the reels become scroll-snap lists so every topic is reachable. */
  html:not(.js) .lens__copy-reel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  html:not(.js) .lens__panel {
    scroll-snap-align: start;
  }

  /* Peek carousel — 800px reading window, neighbours peek at 25% opacity and
     are offset ±128px (Reflections + Commitments). ------------------------ */
  .peek-carousel {
    --theme-bg: var(--v2-pale);
    --theme-fg: var(--v2-navy);
    --peek-offset: 8rem; /* 128 */
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-32);
    padding-block: var(--v2-section-padding);
    overflow: clip;
    background: var(--v2-pale);
    color: var(--theme-fg);
    transition: color 0.3s var(--ease-standard);

    &[data-theme="royal"] {
      --theme-fg: var(--v2-white);
    }
  }

  .peek-carousel__heading,
  .peek-carousel__viewport,
  .peek-carousel__nav {
    position: relative;
    z-index: 1;
    inline-size: 100%;
    max-inline-size: calc(var(--v2-reading-width) + 2 * var(--v2-page-gutter));
    margin-inline: auto;
    padding-inline: var(--v2-page-gutter);
  }

  .peek-carousel__heading {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--v2-space-24);
    min-block-size: 7rem; /* 112 */
  }

  .peek-carousel__viewport {
    overflow: visible;
  }

  .peek-carousel__track {
    display: grid;
    /* Every slide occupies the same cell, so the track is as tall as the
       longest slide (Figma: "one height measured from the longest"). */
    grid-template-areas: "slide";
    align-items: center;
  }

  .peek-slide {
    grid-area: slide;
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-32);
    inline-size: 100%;
    /* Set by JS: -1 previous, 0 current, 1 next, ±2… hidden */
    --pos: 0;
    translate: calc(var(--pos) * (100% + var(--peek-offset))) 0;
    opacity: 0;
    visibility: hidden;
    transition:
      translate var(--dur-lens) var(--ease-standard),
      opacity var(--dur-lens) var(--ease-standard),
      visibility 0s linear var(--dur-lens);

    &.is-current,
    &.is-prev,
    &.is-next {
      visibility: visible;
      transition:
        translate var(--dur-lens) var(--ease-standard),
        opacity var(--dur-lens) var(--ease-standard),
        visibility 0s;
    }

    &.is-current {
      opacity: 1;
    }

    &.is-prev,
    &.is-next {
      opacity: 0.25;
    }

    /* Loop wrap: jump without animating (Figma resets loop states in 1 ms). */
    &.no-transition {
      transition: none !important;
    }
  }

  html:not(.js) .peek-carousel__track {
    grid-template-areas: none;
    gap: var(--v2-space-64);
  }

  html:not(.js) .peek-slide {
    grid-area: auto;
    opacity: 1;
    visibility: visible;
    translate: none;
  }

  html:not(.js) .peek-carousel__nav {
    display: none;
  }

  .peek-carousel__nav {
    display: flex;
    align-items: center;
    gap: var(--v2-space-24);

    & p {
      flex: 1;
      text-align: center;
    }

    & .icon-light {
      display: none;
    }
  }

  .peek-carousel[data-theme="royal"] .peek-carousel__nav {
    & .icon-dark {
      display: none;
    }

    & .icon-light {
      display: block;
    }
  }

  /* Colour wash (driven by peek-carousel.js): the wash shows the colour
     underneath, the circle is the one growing or shrinking over it. */
  .color-wash {
    position: absolute;
    inset: 0;
    overflow: clip;
    pointer-events: none;
    background: var(--v2-pale);
  }

  .color-wash__circle {
    position: absolute;
    inset: 0;
    clip-path: circle(0 at 50% 50%);
  }

  /* Simple slides (findings report panels) ------------------------------- */
  .slides-nav {
    display: flex;
    align-items: center;
    gap: var(--v2-space-24);

    /* One-off soft yellow glow behind the arrows when a chapter opens, to
       draw attention to them, ending on a faint resting glimmer (slides.js
       adds .is-attention after the panel has faded in). Not a hover state. */
    & .icon-button {
      --arrow-glow: radial-gradient(
        circle,
        color-mix(in srgb, var(--v2-yellow) 30%, transparent) 0%,
        color-mix(in srgb, var(--v2-yellow) 10%, transparent) 45%,
        transparent 70%
      );
      position: relative;
      isolation: isolate;

      /* ::before — the one-off attention pulse and its resting glimmer.
         ::after — the full glow on hover/focus. Separate layers because a
         finished animation (fill-mode: both) overrides any hover styles. */
      &::before,
      &::after {
        content: "";
        position: absolute;
        inset: -0.25rem;
        z-index: -1;
        border-radius: 50%;
        background: var(--arrow-glow);
        opacity: 0;
        pointer-events: none;
      }

      &::after {
        scale: 0.6;
        transition:
          opacity 300ms ease,
          scale 300ms var(--ease-standard, ease);
      }

      &:is(:hover, :focus-visible):not(:disabled)::after {
        opacity: 1;
        scale: 1;
      }
    }

    /* Left arrow 1s after the chapter appears, right arrow 1s after that;
       each ends on a faint glimmer (fill-mode: both). */
    /* Then the glimmer breathes: fades to nothing and back, continuously,
       starting the moment each arrow's pulse ends (delay + 1.6s). */
    &.is-attention .icon-button:not(:disabled)::before {
      animation:
        arrow-glow 1.6s var(--ease-standard, ease) 1s both,
        arrow-glimmer 3s ease-in-out 2.6s infinite;
    }

    &.is-attention .icon-button + * + .icon-button::before {
      animation-delay: 2s, 3.6s;
    }

    & .slides-nav__count {
      flex: 1;
      text-align: center;
    }
  }

  /* Counters between arrows ("Slide 3 of 3", "01 / 05"): trim the line box
     to the capitals so they centre on the arrows, not on the font's
     ascender/descender box. */
  .slides-nav__count,
  .peek-carousel__nav p,
  .lens__count {
    text-box: trim-both cap alphabetic;
  }

  .finding-slides {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-32);
  }

  .finding-slides__track {
    display: grid;
    grid-template-areas: "slide";
  }

  .finding-slide {
    grid-area: slide;
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-32);
    inline-size: 100%;
    max-inline-size: var(--v2-reading-width);
    margin-inline: auto;
  }

  /* A slide whose charts sit side by side (.chart-pair) uses the full frame;
     its copy keeps the usual reading width. */
  .finding-slide--wide {
    max-inline-size: var(--v2-frame-width);

    & > .finding-slide__col:not(.finding-slide__col--wide) {
      inline-size: 100%;
      max-inline-size: var(--v2-reading-width);
      margin-inline: auto;
    }
  }

  /* Copy in a left column, chart in a right column on desktop (Spotlight
     slides), both top-aligned; stacked, chart first, below 64rem. */
  .finding-slide--split {
    max-inline-size: var(--v2-frame-width);

    @media (width > 64rem) {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: var(--v2-space-64);
      align-items: start;

      & > .finding-slide__col--wide {
        order: 0; /* chart on the right */
      }
    }
  }

  /* Two charts side by side on desktop, stacked below 64rem. */
  .chart-pair {
    display: grid;
    gap: var(--v2-space-48);
    align-items: start;

    @media (width > 64rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Charts are size-contained (container queries), so with the centring
       auto margins they would shrink to nothing: fill the cell instead. */
    & > [data-chart] {
      inline-size: 100%;
      max-inline-size: var(--report-figure-width); /* when stacked */
    }
  }

  .finding-slide__kicker {
    order: -2;
  }

  /* The track takes the height of the slide on screen, not the tallest one:
     inactive slides leave the flow (slides.js animates the height change). */
  .js .finding-slides__track {
    position: relative;
  }

  .js .finding-slide:not(.is-current) {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    visibility: hidden;
    pointer-events: none;
  }

  html:not(.js) .finding-slides__track {
    grid-template-areas: none;
    gap: var(--v2-space-64);
  }

  html:not(.js) .slides-nav {
    display: none;
  }

  .finding-slide__col {
    min-inline-size: 0;
    --stack-gap: var(--v2-space-24);
  }

  .finding-slide__col--wide {
    order: -1;
    --stack-gap: var(--v2-space-48);

    & > [data-chart] {
      inline-size: 100%;
      max-inline-size: var(--report-figure-width);
      margin-inline: auto;
    }
  }

  /* Legends + swatches shared by every chart ----------------------------- */
  .chart-legend {
    /* Extra room above the plot (on top of the chart's 16px gap). */
    margin-block-end: var(--v2-space-16);
    display: flex;
    flex-wrap: wrap;
    gap: var(--v2-space-8) var(--v2-space-20);
    font-size: var(--v2-body-text-small-size);
    line-height: var(--lh-small);

    /* Centre each swatch on its label's capitals (not the font's line box,
       whose middle sits on the baseline at this line-height): the swatch is
       exactly cap-height tall and rests on the text baseline. */
    & li {
      display: inline-flex;
      align-items: baseline;
      gap: var(--v2-space-8);
    }

    & .swatch {
      inline-size: 1cap;
      block-size: 1cap;
    }
  }

  .swatch {
    inline-size: 0.75rem;
    block-size: 0.75rem;
    flex-shrink: 0;
    background: var(--swatch, currentColor);
  }

  .swatch--primary,
  .swatch--increase,
  .swatch--y2021 {
    --swatch: var(--chart-primary);
  }

  .swatch--comparison {
    --swatch: var(--chart-comparison);
  }

  .swatch--decrease,
  .swatch--y2020 {
    --swatch: var(--v2-white);
  }

  .swatch--y2026 {
    --swatch: var(--v2-yellow);
  }
}

/* R3 additions ------------------------------------------------------------ */
@layer components {
  /* "presented by" partner credit (hero, footer) */
  .presented-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--v2-space-16);
    margin: 0;

    & img {
      inline-size: 7rem; /* 112 */
      block-size: auto;
    }
  }

  /* Letter heading row: H1 + H2 beside a 216px square portrait */
  .letter-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--v2-space-32);

    & > .stack {
      --stack-gap: var(--v2-space-24);
      flex: 1 1 20rem;
    }
  }

  .letter-head__portrait {
    flex: 0 0 13.5rem; /* 216 */
    aspect-ratio: 1;
    margin: 0;
    overflow: clip;

    & img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
    }
  }

  .letter-head__portrait--devon img {
    object-position: 50% 30%;
  }

  /* Topic tiles (V03/Chapters — By the Numbers, Key Findings, Commitments) */
  .topic-tiles {
    --tile-cols: 2;
    --tile-h: 16.5rem; /* 264 */
    display: grid;
    grid-template-columns: repeat(var(--tile-cols), minmax(0, 1fr));
    gap: var(--v2-space-24);
  }

  .topic-tiles--three {
    --tile-cols: 3;
    --tile-h: 17.5rem; /* 280 */
  }

  .topic-tiles--four {
    --tile-cols: 4;
    --tile-h: 17.5rem;
  }

  .topic-tile {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-16);
    block-size: 100%;
    min-block-size: var(--tile-h);
    padding: var(--v2-space-24);
    border: 1px solid var(--tile-line, var(--v2-cyan));
    background: var(--tile-bg, var(--v2-navy));
    color: var(--tile-text, var(--v2-white));
    text-decoration: none;
    transition: background-color 120ms ease;

    &:hover,
    &:focus-visible {
      background: var(--tile-hover, var(--v2-royal));
    }
  }

  .topic-tile__stat,
  .topic-tile__cta {
    color: var(--tile-accent, var(--v2-yellow));
  }

  .topic-tile__cta {
    margin-block-start: auto;
    font-size: var(--v2-button-size);
    font-weight: var(--v2-weight-medium);
    line-height: var(--lh-body);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
  }

  .chapters--sky {
    --tile-bg: var(--v2-sky);
    --tile-line: var(--v2-navy);
    --tile-text: var(--v2-navy);
    --tile-accent: var(--v2-navy);
    --tile-hover: var(--v2-white);

    & .topic-tile {
      gap: var(--v2-space-12);
    }
  }

  @media (width <= 64rem) {
    .topic-tiles--three,
    .topic-tiles--four {
      --tile-cols: 2;
    }
  }

  @media (width <= 40rem) {
    .topic-tiles {
      --tile-cols: 1;
      --tile-h: 13rem;
    }
  }

  /* Chapter detail header aligned to the reading column (findings) */
  .chapter-detail__title {
    inline-size: 100%;
    max-inline-size: var(--v2-reading-width);
    margin-inline: auto;
  }

  .chapter-detail {
    gap: var(--v2-space-24);
  }

  .commitment-detail {
    --stack-gap: var(--v2-space-24);
    margin-inline: auto;
  }

  .bullets {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-24);
    /* padding-inline-start: 1.6875rem;  */
    list-style: disc;

    /* Slightly smaller dots than the text's default marker. */
    & li::marker {
      font-size: 0.75em;
    }
  }

  /* Notes under a chart: plain lines, no bullets or indent. */
  .chart-notes {
    display: flex;
    flex-direction: column;
    gap: var(--v2-space-8);
    padding-inline-start: 0;
    list-style: none;
    /* Left-aligned even inside a chart's (centred) figcaption. */
    text-align: start;
  }
}

/* Resting glimmer, looping: from the pulse's end state down to 0 and back. */
@keyframes arrow-glimmer {
  0%,
  100% {
    opacity: 0.55;
    scale: 0.9;
  }
  50% {
    opacity: 0;
    scale: 0.9;
  }
}

@keyframes arrow-glow {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  35% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0.55; /* glimmer left behind */
    scale: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lens__photo-reel,
  .lens__copy-reel,
  .lens__tab,
  .lens__tab-num,
  .lens__indicator,
  .peek-slide,
  .read-more__toggle img,
  .topic-tile {
    transition: none !important;
  }

  /* No pulse; just the resting glimmer. */
  .slides-nav.is-attention .icon-button:not(:disabled)::before {
    animation: none;
    opacity: 0.55;
    scale: 0.9;
  }
}
.text-lead {
  font-size: var(--v2-body-text-lead-size);


}

/** Fixes **/

#findings {
  .t-h4 {
    margin-bottom: 0px;
    margin-top: 0px;

  }
   .spotlight {

      .t-h4 {

      color: var(--v2-yellow);
      }

    }


  .quote {
  color: var(--v2-white);

  /* V03/Body Text/Lead */
  font-family: var(--v2-family);
  font-size: var(--v2-body-text-lead-size);
  font-style: normal;
  font-weight: 400;
  line-height: 133.333%; /* 32px */
  }

  .finding-slide__col--wide {
    --stack-gap: 1rem;

  }
}
#parish-map-title {
  padding-bottom: 20px;
}
/* .signature__name {
  padding-bottom: 20px;
}  */

/* Smaller type on mobile for the Reflections carousel and the brand split
   banners (quotes, stats and their headings). */
@media (width < 768px) { 
:is(.peek-carousel__track, .brand-split) {
.t-h4 {
  font-size: 1.2rem;

}
.t-large {
  font-size: 1rem;
}
}
}
.brand-split__text.double-quote {
  flex-direction: column;
  gap: 24px;

}