/*
 * Safari Parks — homepage sections (https://safari-parks.co/fr, /en), loaded after site.css.
 * Owner: role D. Markup: tools/landing/sections/*.mjs. Only the tokens and shared components of
 * site.css (no new colour; the veils and text shadows use the shadow tint rgb(20 22 16) of the
 * --shadow-* tokens). Static, no JavaScript, no inline style (CSP style-src 'self').
 *
 * Breakpoints: < 600 phone (portrait photo, stacked hero), 600–1023 tablet (stacked hero on the
 * landscape photo, the title on the sky right of the leopard), ≥ 1024 desktop (W02 composition:
 * photo cover, text column right of the leopard, pill, quick actions on the photo, accents),
 * ≥ 1280 full type scale, the pledge link and the row of four modules, ≥ 1600 handwritten line.
 * Sections below the hero switch from phone to tablet at 768.
 */

/* Vertical rhythm between the homepage sections: the shared --section-gap (40–56 px), tightened to
   32 px on phones, where the page is a single long column. */
main {
  --home-gap: var(--section-gap);
}

@media (max-width: 767px) {
  main {
    --home-gap: var(--sp-8);
  }
}

/* ── Hero ─────────────────────────────────────────────────────────────────────────────────── */

.hero {
  /* Phones and tablets: a photo box on top, the exploration card straddling its bottom edge.
     --hero-reserve: the bottom of the photo kept clear of the text (see the heading below). */
  --hero-photo-h: clamp(520px, 144vw, 600px);
  --hero-overlap: 56px;
  --hero-reserve: max(49.5vw - 56px, 116px);
  position: relative;
  isolation: isolate;
  color: var(--c-charcoal);
}

.hero__media {
  position: relative;
  z-index: -1;
  overflow: hidden;
  background: var(--c-sky);
}

.hero__picture,
.hero__img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__img {
  object-fit: cover;
  /* Portrait photo (phones): keep the bottom, a shorter box only trims sky. */
  object-position: 50% 100%;
}

.hero__inner {
  position: relative;
}

.hero__heading {
  padding-top: calc(var(--header-h) + var(--sp-5));
  padding-bottom: var(--sp-6);
}

/* Phones and tablets: the text block is in the flow and sets the height of the photo (WCAG 1.4.12:
   with a larger line height or letter spacing it never runs down onto the leopard or the hills).
   The hero is a three-row grid (heading | exploration card | quick actions; the inner container
   is a subgrid of it): the photo box spans the heading's row and goes on under the top half of the
   card. The photo keeps its size (--hero-photo-h), anchored at the bottom of the box; when the
   heading grows the box grows upwards, filled with the photo's own sky colour (sampled from its
   top rows; no UI colour), and the top of the photo fades into it. The heading keeps the bottom
   of the photo (--hero-reserve, measured from the bottom of its row) free of text: the leopard
   from its ear down on the portrait photo (≈ 49.5 % of the width, at least 172 px), the hills
   on the landscape one (≈ 266 px). At the default spacing the heading ends above the reserve and
   the photo keeps its exact size and place. */
@media (max-width: 1023px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(calc(var(--hero-photo-h) - var(--hero-overlap)), auto) auto auto;
  }

  .hero__media {
    container: hero-media / size;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    grid-area: 1 / 1;
    margin-bottom: calc(-1 * var(--hero-overlap));
    background: rgb(229 174 121);
  }

  .hero__picture {
    flex: none;
    height: var(--hero-photo-h);
  }

  .hero__inner {
    display: grid;
    grid-row: 1 / -1;
    grid-column: 1;
    grid-template-rows: subgrid;
  }

  .hero__content {
    display: contents;
  }

  /* One column: the AI notice shares the heading's cell. */
  .hero__heading,
  .hero-explore,
  .hero-actions,
  .hero__ai {
    grid-column: 1;
  }

  .hero__heading {
    grid-row: 1;
    padding-bottom: max(var(--sp-6), var(--hero-reserve));
  }

  .hero-explore {
    grid-row: 2;
  }

  .hero-actions {
    grid-row: 3;
  }
}

/* The photo box is taller than the photo (the heading grew): the photo's top edge fades into the
   sky colour (no seam; on tablets the branches of the top-right tree melt into it). The box is
   taller than the photo when it is ≥ 604 px high (--hero-photo-h is at most 600 px), ≥ 524 px
   below 361 px (photo 520 px high), or narrower than 0.69 from 361 px (photo 1.44 × its width). */
@container hero-media (min-height: 604px) {
  .hero__picture {
    mask-image: linear-gradient(180deg, transparent, #000 96px);
  }
}

@container hero-media (max-width: 360px) and (min-height: 524px) {
  .hero__picture {
    mask-image: linear-gradient(180deg, transparent, #000 96px);
  }
}

@container hero-media (min-width: 361px) and (max-aspect-ratio: 69 / 100) {
  .hero__picture {
    mask-image: linear-gradient(180deg, transparent, #000 96px);
  }
}

.hero__title {
  max-width: 13em;
  font-size: var(--fs-h1);
  line-height: 1.04;
  hyphens: none;
}

/* One span per line: forced breaks from 1024 px; below, a long line balances on two. */
.hero__line {
  display: block;
}

.hero__lead {
  max-width: 34em;
  margin-top: var(--sp-3);
  font-size: var(--fs-body);
  font-weight: 450;
  line-height: 1.5;
}

/* Exploration: links laid out as the W02 pill (≥ 1024) or as a card (below). No form, no field,
   no dropdown chevron: one park, nothing to type. */
.hero-explore {
  align-self: start;
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--c-white);
  box-shadow: var(--shadow-float);
}

.hero-explore__list {
  display: grid;
}

.hero-explore__segment + .hero-explore__segment {
  border-top: 1px solid var(--c-line);
}

.hero-explore__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding-block: var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--c-charcoal);
  text-decoration: none;
}

.hero-explore__icon {
  width: 20px;
  height: 20px;
  color: var(--c-forest-900);
}

.hero-explore__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-explore__title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
}

.hero-explore__meta {
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
}

.hero-explore__link:hover .hero-explore__title {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.hero-explore__go {
  margin-top: var(--sp-2);
}

.hero-explore__button {
  width: 100%;
  min-height: 48px;
  white-space: nowrap;
}

/* Quick actions: 2 × 2 on ivory below the photo (phones), on the photo from 1024 px. */
.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-6);
}

.hero-action {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  border-radius: var(--r-sm);
  color: var(--c-charcoal);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.hero-action__icon {
  background: var(--c-forest-900);
  color: var(--c-ivory);
  transition: transform 200ms var(--ease);
}

.hero-action__line {
  display: block;
}

.hero-action:hover .hero-action__label {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-underline-offset: 3px;
}

/* Accents of the desktop composition (hidden below 1024 px: the pledge duplicates the fourth
   action, the eyebrow has no room, and the script font is never downloaded on phones). */
.hero__eyebrow,
.hero__script,
.hero__pledge {
  display: none;
}

/* "Image générée par IA": on the photo, its top 32 px above the exploration card (bottom margin:
   32 px minus the height of a one-line chip), at the bottom of the heading's row, that is inside
   the reserve (never over the text, whatever the text spacing). */
.hero__ai {
  grid-row: 1;
  align-self: end;
  justify-self: end;
  margin: 0 0 calc(var(--sp-8) - 1lh - 2 * var(--sp-1) - 2px);
}

/* Tablets, from 600 px (the portrait source stops at 599 px: images.mjs hero.mobile.media): the
   landscape photo in a 600 px box, the leopard on the left, the title on the sky to its right (the
   head is at ≈ 34 % of the box from 600 to 1023 px, the text column starts at 40 %). */
@media (min-width: 600px) {
  /* Reserve: the hills under the text column start 266–283 px above the bottom of the photo; 208
     px keeps the default layout as it is (French lead down to 334 px from the top at 780–830 px)
     and the 1.4.12 paragraph spacing adds 2em under the lead. */
  .hero {
    --hero-photo-h: 600px;
    --hero-reserve: 208px;
  }

  .hero__img {
    object-position: 18% 30%;
  }

  /* On the rock, clear of the elephants (bottom right on this framing). */
  .hero__ai {
    justify-self: start;
  }

  .hero__heading {
    margin-left: 40%;
  }

  .hero__title {
    font-size: clamp(2.125rem, 1rem + 3vw, 2.5rem);
  }

  .hero-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Desktop: W02 composition over the whole photo. The inner grid has three columns: the leopard's
   (≈ 36 % of the photo's width), the text column, and the right edge (script, pledge, notice);
   the last row stretches to the bottom of the hero (eyebrow, notice). */
@media (min-width: 1024px) {
  /* overflow-x: clip: the veils drawn around the text never widen the page. */
  .hero {
    display: grid;
    min-height: clamp(560px, 71vh, 680px);
    overflow-x: clip;
  }

  .hero__media {
    position: absolute;
    inset: 0;
  }

  /* Bottom veil: keeps the white labels legible over the bush, leaves the sky untouched. */
  .hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(20, 22, 16, 0.5), rgba(20, 22, 16, 0) 45%);
    pointer-events: none;
  }

  .hero__img {
    object-position: 50% 40%;
  }

  /* --photo-edge: the negative right margin that takes an item from the container's right edge to
     the photo's (0 up to 1440 px, the container stops at 1376 px beyond). */
  .hero__inner {
    --photo-edge: calc(-1 * max(0px, (100vw - var(--container)) / 2 - var(--gutter)));
    display: grid;
    grid-template-columns:
      [full-start] calc(36vw - (100vw - 100%) / 2)
      [text-start] minmax(0, 720px)
      [text-end] minmax(0, 1fr)
      [full-end];
    grid-template-rows: auto auto auto auto 1fr;
    padding-top: calc(var(--header-h) + clamp(24px, 4.5vh, 40px));
  }

  .hero__content {
    display: contents;
  }

  .hero__heading {
    grid-column: text;
    grid-row: 1;
    margin: 0;
    padding: 0;
  }

  /* 45 px at 1024 → 56 px from 1280: the longest line ends left of the top-right branches. A
     soft ivory halo (invisible on the sky) lifts the letters off a twig. */
  .hero__title {
    max-width: none;
    font-size: min(var(--fs-h1), 4.4vw);
    line-height: 1;
    text-shadow: 0 0 14px rgba(251, 248, 241, 0.55);
  }

  /* Same halo: where the second line meets the hilltops (1024–1279), it keeps 4.5:1. */
  .hero__lead {
    max-width: 620px;
    margin-top: var(--sp-4);
    font-size: var(--fs-lead);
    line-height: 1.45;
    text-shadow:
      0 0 3px rgba(251, 248, 241, 0.7),
      0 0 12px rgba(251, 248, 241, 0.6);
  }

  .hero-explore {
    grid-column: text-start / full-end;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
    margin-top: var(--sp-6);
    padding: 6px;
    border-radius: var(--r-pill);
  }

  /* Wraps rather than overflowing when the user enlarges letter and word spacing (WCAG 1.4.12):
     at the default spacing the three items always hold on one line. */
  .hero-explore__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .hero-explore__segment + .hero-explore__segment {
    position: relative;
    border-top: 0;
  }

  .hero-explore__segment + .hero-explore__segment::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 1px;
    height: 28px;
    background: var(--c-warm-gray);
    opacity: 0.45;
    transform: translateY(-50%);
  }

  .hero-explore__link {
    min-height: 44px;
    padding: var(--sp-1) var(--sp-5) var(--sp-1) var(--sp-4);
    border-radius: var(--r-pill);
    white-space: nowrap;
  }

  .hero-explore__link:hover {
    background: var(--c-sand);
  }

  .hero-explore__link:hover .hero-explore__title {
    text-decoration: none;
  }

  .hero-explore__go {
    margin: 0 0 0 var(--sp-2);
  }

  .hero-explore__button {
    width: auto;
    min-height: 44px;
  }

  .hero-actions {
    display: flex;
    grid-column: text;
    grid-row: 3;
    gap: var(--sp-8);
    margin-top: var(--sp-8);
  }

  .hero-action {
    min-height: 44px;
    color: var(--c-white);
    font-weight: 600;
    text-shadow:
      0 1px 2px rgba(20, 22, 16, 0.6),
      0 0 12px rgba(20, 22, 16, 0.45);
  }

  .hero-action__icon {
    background: var(--c-white);
    color: var(--c-forest-900);
    box-shadow: var(--shadow-card);
  }

  .hero-action:hover .hero-action__icon {
    transform: translateY(-2px);
  }

  .hero__eyebrow {
    display: block;
    grid-column: full-start / text-start;
    grid-row: 3 / 6;
    align-self: end;
    margin-bottom: var(--sp-10);
    color: var(--c-ivory);
    text-shadow: 0 1px 3px rgba(20, 22, 16, 0.6);
  }

  .hero__eyebrow-line {
    display: block;
  }

  /* From 1440 px: bottom right of the photo, right of the elephants (x 69–87 % of the photo): in
     the grid's last row (its height is reserved, so the text never runs under it, WCAG 1.4.12),
     pushed past the container to the photo's own edge on wide screens (beyond 1440 the container
     stops at 1376 px while the photo, and the herd, keep spreading). 1024–1439: see below. */
  .hero__ai {
    position: static;
    grid-column: text-end / full-end;
    grid-row: 5;
    align-self: end;
    justify-self: end;
    margin: 0 var(--photo-edge) var(--sp-3) 0;
  }
}

/* 1024–1439: the AI notice sits on the rock, under the stacked eyebrow (as on tablets). Right of
   the herd the strip is too narrow for it (13 % of the width, ≈ 150 px at 1160–1280, the notice's
   own width), and in a 560–600 px high hero the elephants reach the bottom edge, so it would touch
   the last one; above them it would sit beside the quick actions. The eyebrow moves up so that
   its rule ends 52 px from the bottom (was 40): the notice's 12 px margin and a 16 px gap as a
   padding, which the user's paragraph spacing (WCAG 1.4.12, a margin on every p) cannot shrink,
   and the notice's height as a relative offset, which leaves the grid as it was (with that
   spacing too, the hero keeps its height). */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero__eyebrow {
    position: relative;
    top: -24px;
    margin-bottom: 0;
    padding-bottom: calc(var(--sp-3) + var(--sp-4));
  }

  .hero__ai {
    grid-column: full-start / text-start;
    justify-self: start;
    margin: 0 0 var(--sp-3);
  }
}

/* 1024–1439: the quick actions cross the sunlit river. A deeper bottom veil (≥ 0.5 behind the
   labels, fading out under the pill) keeps the white labels at 4.5:1 on the photo itself, shadow
   aside; from 1440 they sit on the dark bush and the lighter veil is enough. */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero__media::after {
    background: linear-gradient(
      0deg,
      rgba(20, 22, 16, 0.68) 0,
      rgba(20, 22, 16, 0.52) 24%,
      rgba(20, 22, 16, 0) 47%
    );
  }
}

/* 1024–1439: the second line of the lead crosses the hilltops. A soft ivory haze behind the
   heading (a radial veil, invisible on the sky) keeps the charcoal text at 4.5:1 on the photo
   itself, halo aside. */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero__heading {
    position: relative;
  }

  .hero__heading::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 38% -48px -20px -40px;
    background: radial-gradient(
      closest-side,
      rgba(251, 248, 241, 0.62),
      rgba(251, 248, 241, 0.42) 62%,
      rgba(251, 248, 241, 0)
    );
    pointer-events: none;
  }
}

/* 1024–1439: slimmer segments, so that the pill holds on one line in its column (≥ 787 px at 1280,
   French and English). */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero-explore__link {
    padding-inline: var(--sp-3) var(--sp-4);
  }

  .hero-explore__go {
    margin-left: var(--sp-1);
  }
}

/* 1024–1279: the pill keeps one line per segment (the detail stays readable by screen readers;
   the same information is in the page). */
@media (min-width: 1024px) and (max-width: 1279px) {
  .hero-explore__meta {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Desktop, WCAG 1.4.12: with a larger line height or letter spacing the heading grows down onto
   the hills (and the handwritten line with it), and the pill and the quick actions move down
   onto the sunlit river. Two veils exist only when that happens; at the default spacing their
   height is 0 and the photo is untouched. --hero-heading-h is the heading's designed height
   (three title lines, the lead's margin and two lines of lead); 156 px is the pill and the actions
   rows (24 + 56 + 32 + 44).
   - An ivory haze behind the part of the heading's row beyond that height (lead, end of the
     title, handwritten line), up to the photo's right edge, both sides faded: over 40 px on the
     left, over the gutter on the right (the text column ends at the gutter, so the haze behind
     the text is as before; no hard edge left in the photo).
   - A dark band behind the quick actions once they have moved down: 96 px high at most, ending
     16 px under them, as high as their move (0 when they are in place). */
@media (min-width: 1024px) {
  .hero__inner {
    --hero-heading-h: calc(3 * min(var(--fs-h1), 4.4vw) + var(--sp-4) + 2.9 * var(--fs-lead));
  }

  .hero__inner::before,
  .hero__inner::after {
    content: '';
    position: absolute;
    z-index: -1;
    pointer-events: none;
  }

  /* Explicit end lines: an absolutely positioned grid child spans to the container's edge
     otherwise. */
  .hero__inner::before {
    grid-column: text-start / full-end;
    grid-row: 1 / 2;
    top: calc(var(--hero-heading-h) + 14px);
    right: calc(var(--photo-edge) - var(--gutter));
    bottom: -12px;
    left: -40px;
    background: linear-gradient(
      180deg,
      rgba(251, 248, 241, 0),
      rgba(251, 248, 241, 0.62) 32px,
      rgba(251, 248, 241, 0.62) calc(100% - 12px),
      rgba(251, 248, 241, 0)
    );
    mask-image: linear-gradient(
      90deg,
      transparent,
      #000 40px,
      #000 calc(100% - var(--gutter)),
      transparent
    );
  }

  .hero__inner::after {
    grid-column: text-start / text-end;
    grid-row: 1 / 4;
    right: -24px;
    bottom: -16px;
    left: -24px;
    height: max(0px, min(100% - var(--hero-heading-h) - 158px, 96px));
    background: linear-gradient(
      180deg,
      rgba(20, 22, 16, 0),
      rgba(20, 22, 16, 0.6) 28px,
      rgba(20, 22, 16, 0.6) calc(100% - 12px),
      rgba(20, 22, 16, 0)
    );
    mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  }
}

/* The handwritten line sits on the sky between the top-right branches and the hills, from 1600 px
   only: below, the title's longest line ends too close to it (14 px at 1440) and the right edge
   gets crowded (title, script, branches). Assumed gap with the brief (accent from 1024). */
@media (min-width: 1600px) {
  .hero__script {
    display: block;
    grid-column: text-end / full-end;
    grid-row: 1;
    align-self: end;
    justify-self: end;
    width: 176px;
    margin: 0 calc(-1 * var(--sp-2)) calc(-1 * var(--sp-3)) 0;
    color: var(--c-charcoal);
    font-family: var(--font-script);
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-wrap: balance;
    transform: rotate(-8deg);
  }

  .hero__swash {
    display: block;
    width: 96px;
    height: auto;
    margin: var(--sp-2) auto 0;
    color: var(--c-gold);
  }
}

/* « Notre engagement pour la faune »: a secondary link (outlined circle, smaller than the quick
   actions), at the right edge of the photo in its own grid row just under the row of actions,
   above the herd and the AI notice, so that it never reads as a fifth action (as « Voir notre
   vidéo » in W02, apart from the row). From 1440 px and an 880 px high viewport only: below 1440
   the herd reaches the bottom-right corner (the circle lands on an elephant at 1280 × 900), and a
   shorter hero leaves no room under the actions. Elsewhere the fourth action leads to the same
   place. */
@media (min-width: 1440px) and (min-height: 880px) {
  .hero__pledge {
    display: inline-flex;
    grid-column: text-end / full-end;
    grid-row: 4;
    align-self: start;
    justify-self: end;
    align-items: center;
    gap: var(--sp-2);
    width: max-content;
    max-width: 176px;
    min-height: 44px;
    margin: var(--sp-3) var(--photo-edge) 0 0;
    color: var(--c-white);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(20, 22, 16, 0.6);
  }

  .hero__pledge-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--c-white);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85);
  }

  .hero__pledge-icon .icon {
    width: 16px;
    height: 16px;
  }

  .hero__pledge-label {
    text-wrap: balance;
  }

  .hero__pledge:hover .hero__pledge-label {
    text-decoration: underline;
    text-decoration-color: var(--c-gold-300);
    text-underline-offset: 3px;
  }

  .hero__pledge:focus-visible .hero__pledge-icon {
    box-shadow: inset 0 0 0 1.5px var(--c-white);
  }
}

/* Wide heroes (ratio ≈ 2.5): a lower crop keeps the elephants by the river in the frame (with 40 %
   they fall below the hero edge). */
@media (min-width: 1600px) {
  .hero__img {
    object-position: 50% 55%;
  }

  .hero__script {
    margin-bottom: var(--sp-6);
  }
}

/* From 1800 px (1920 × 1080, the most common desktop): the hero follows 71vh up to 760 px and the
   crop moves down to the river, so the herd stays in the frame bottom right. */
@media (min-width: 1800px) {
  .hero {
    min-height: clamp(560px, 71vh, 760px);
  }

  .hero__img {
    object-position: 50% 68%;
  }

  /* The lower crop brings lighter bush behind the quick actions: the veil rises a little higher. */
  .hero__media::after {
    background: linear-gradient(
      0deg,
      rgba(20, 22, 16, 0.6) 0,
      rgba(20, 22, 16, 0.32) 36%,
      rgba(20, 22, 16, 0) 58%
    );
  }
}

/* ── « Le Kruger, notre premier parc » + Safari Pass ──────────────────────────────────────── */

.parks {
  padding-top: var(--sp-8);
}

.parks__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
}

.parks__head {
  align-items: baseline;
  margin-bottom: var(--sp-3);
}

/* Cards: a scroll-snap row on phones and tablets (the page itself never scrolls sideways). The
   next card peeks into the gutter only (16–25 px, the scroll-padding): Chromium does not scroll a
   focused element that already shows inside the scroll-padding box, so with a wider peek a card
   reached with Tab would stay cut off (F2-12); with this one it is brought fully into view. */
.parks__cards {
  display: flex;
  gap: var(--sp-3);
  margin-inline: calc(-1 * var(--gutter));
  padding: var(--sp-1) var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.parks__cards::-webkit-scrollbar {
  display: none;
}

.parks__item {
  flex: 0 0 calc(100vw - 2 * var(--gutter) - var(--sp-3) + 4px);
  scroll-snap-align: start;
}

/* At least 4:3 (the ::before spacer), taller when its text needs it (user text spacing): the
   photo covers the whole card, the text block sits at the bottom. */
.park-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--c-forest-700);
  color: var(--c-white);
  text-decoration: none;
  isolation: isolate;
}

.park-card::before {
  content: '';
  grid-area: 1 / 1;
  padding-top: 75%;
}

/* Phones: one wide card at a time, 16:10 (about as high as a 4:3 card three quarters as wide). */
@media (max-width: 599px) {
  .park-card::before {
    padding-top: 62.5%;
  }
}

/* Small tablets (600–767): two 4:3 cards per view, the third peeking into the gutter. */
@media (min-width: 600px) and (max-width: 767px) {
  .parks__item {
    flex-basis: calc((100vw - 2 * var(--gutter) - 2 * var(--sp-3) + 4px) / 2);
  }
}

.park-card__img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease);
}

/* Two dark veils: a light one over the lower half of the photo, and one carried by the text
   block itself, darkest behind the title and the place (4.5:1 on the brightest photo: sunlit
   water, pale sky). */
.park-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(20, 22, 16, 0) 35%, rgba(20, 22, 16, 0.6) 100%);
}

.park-card__body {
  position: relative;
  grid-area: 1 / 1;
  align-self: end;
  padding: var(--sp-8) var(--sp-3) var(--sp-3);
  background: linear-gradient(
    180deg,
    rgba(20, 22, 16, 0),
    rgba(20, 22, 16, 0.55) var(--sp-8),
    rgba(20, 22, 16, 0.72)
  );
}

.park-card__title {
  color: var(--c-white);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(20, 22, 16, 0.5);
}

/* The chevron sits at the end of the meta line: the title gets the full width of the card. */
.park-card__meta {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-1);
  margin-top: 2px;
  padding-right: var(--sp-6);
  color: var(--c-ivory);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
}

.park-card__meta .icon {
  width: 12px;
  height: 12px;
  margin-top: 0.2em;
}

.park-card__chevron {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  width: 18px;
  height: 18px;
  transition: transform 200ms var(--ease);
}

.park-card:hover .park-card__img {
  transform: scale(1.03);
}

.park-card:hover .park-card__chevron {
  transform: translateX(2px);
}

.park-card:hover .park-card__title {
  text-decoration: underline;
  text-decoration-color: var(--c-gold-300);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Safari Pass: Sand, gold crown and ticks, title in Forest 900 (gold on Sand is 2.2:1). The
   status chip straddles the top edge (W01 feature cards): it takes no line of its own and holds
   « Under consideration » as well as « Envisagé ». */
.pass {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-5) 18px 18px;
  border: 1px solid rgba(199, 154, 59, 0.3);
  border-radius: var(--r-md);
  background: var(--c-sand);
}

.pass__head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pass__crown {
  width: 22px;
  height: 22px;
  color: var(--c-gold);
}

.pass__title {
  color: var(--c-forest-900);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.pass__status {
  position: absolute;
  top: 0;
  right: var(--sp-4);
  padding-inline: 10px;
  border-color: rgba(199, 154, 59, 0.45);
  background: var(--c-ivory);
  transform: translateY(-50%);
}

.pass__tagline {
  margin-top: var(--sp-2);
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
}

.pass__features {
  display: grid;
  gap: 2px;
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.pass__features li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.pass__check {
  width: 16px;
  height: 16px;
  margin-top: 0.1em;
  color: var(--c-gold);
  stroke-width: 2.5;
}

.pass__free {
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-4);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.pass__button {
  margin-top: auto;
  padding-inline: var(--sp-4);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* Phones: a compact card (tagline on the title row's width, the three features on two lines,
   price note on one line). */
@media (max-width: 767px) {
  .pass {
    padding: var(--sp-4) var(--sp-4) var(--sp-4);
  }

  .pass__tagline {
    margin-top: 6px;
    font-size: var(--fs-sm);
    line-height: 1.3;
  }

  .pass__features {
    display: flex;
    flex-wrap: wrap;
    gap: 2px var(--sp-4);
    margin-top: var(--sp-2);
  }

  .pass__free {
    margin-top: var(--sp-2);
    margin-bottom: var(--sp-3);
  }
}

@media (min-width: 768px) {
  /* Three cards, the fourth peeking into the gutter. */
  .parks__item {
    flex-basis: calc((100vw - 2 * var(--gutter) - 3 * var(--sp-3) + 6px) / 3);
  }

  /* A thin visible scrollbar: the mouse has a handle on the row (768–1023). */
  .parks__cards {
    padding-bottom: var(--sp-3);
    scrollbar-color: rgba(31, 33, 29, 0.28) transparent;
    scrollbar-width: thin;
  }

  .parks__cards::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .parks__cards::-webkit-scrollbar-thumb {
    border-radius: var(--r-pill);
    background: rgba(31, 33, 29, 0.28);
  }
}

/* Tablets and small laptops: the pass card spans the width under the cards, on two columns
   (title, tagline and features | price note and button), as high as its content. */
@media (min-width: 768px) and (max-width: 1279px) {
  .pass {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: var(--sp-10);
    padding: var(--sp-5) var(--sp-6);
  }

  .pass__head,
  .pass__tagline,
  .pass__features {
    grid-column: 1;
  }

  .pass__features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-5);
  }

  .pass__free {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: start;
    margin: 0;
  }

  .pass__button {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    margin-top: var(--sp-3);
  }
}

@media (min-width: 1024px) {
  .parks {
    padding-top: 28px;
  }

  .parks__cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--sp-4);
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .parks__item {
    flex: none;
  }

  /* 203 px cards at 1440: 16 px titles hold « Parc national Kruger » on one line. */
  .park-card__body {
    padding-right: 10px;
  }

  .park-card__chevron {
    right: 10px;
  }

  .park-card__title {
    font-size: var(--fs-body);
  }
}

/* 1024–1439 (170–200 px cards): the place would take two or three lines. It stays for screen
   readers (part of the link's name); the titles end on the same baseline, the chevron beside.
   15 px titles (20 px clear of the chevron): the regions hold on one line at every width (« Les
   grandes rivières » from 1100 px); the park's full name needs two lines in the narrowest cards
   (171–190 px at 1024–1099 and 1280–1400) and is balanced there (« Kruger / National Park »). */
@media (min-width: 1024px) and (max-width: 1439px) {
  .park-card__title {
    padding-right: var(--sp-5);
    font-size: 0.9375rem;
    text-wrap: balance;
  }

  .park-card__meta {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .park-card__chevron {
    bottom: 14px;
  }
}

/* W02 row: the five cards and the Safari Pass card side by side, the pass card from the top of
   the title row (its chip straddling the edge just under the photo). */
@media (min-width: 1280px) {
  .parks__grid {
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: var(--sp-8);
  }

  .pass {
    align-self: start;
    padding: 14px 14px var(--sp-3);
  }

  .pass__tagline {
    margin-top: var(--sp-1);
    font-size: var(--fs-xs);
    line-height: 1.25;
  }

  .pass__features {
    gap: 0;
    margin-top: 6px;
    font-size: var(--fs-xs);
    line-height: 1.3;
  }

  .pass__check {
    width: 14px;
    height: 14px;
  }

  .pass__free {
    margin-top: var(--sp-1);
    margin-bottom: var(--sp-2);
    font-size: var(--fs-eyebrow);
    line-height: 1.3;
  }
}

/* ≥ 1440 (W02): the pass card runs from the top of the title to the bottom of the cards. The main
   column stretches to the card's height and the cards fill it (≈ 203 × 170 instead of 203 × 152:
   a little taller than 4:3, the gap under the title stays 12 px). */
@media (min-width: 1440px) {
  .pass {
    align-self: stretch;
  }

  .parks__main {
    display: flex;
    flex-direction: column;
  }

  .parks__cards {
    flex: 1 1 auto;
  }

  .parks__item {
    display: grid;
  }
}

/* ── Sideways rails (phones) ──────────────────────────────────────────────────────────────── */

/* Camps, app features, regions and the « Préparer » blocks scroll sideways on phones. The rail (a
   wrapper around the list) is the scroll container and a focusable group named by its section's
   title (role="group", tabindex="0"; a group, not a region, which would repeat the section's own
   landmark name): keyboard users reach it with Tab and scroll it with the arrow keys (axe
   scrollable-region-focusable, Safari included). From 768 px the lists are grids and the rail is a
   plain wrapper (still one Tab stop). */
.rail:focus-visible {
  border-radius: var(--r-sm);
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .rail {
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) var(--sp-1);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .rail::-webkit-scrollbar {
    display: none;
  }

  /* The rail touches the screen edges: the ring is drawn inside it. */
  .rail:focus-visible {
    border-radius: 0;
    outline-offset: -3px;
  }

  .rail > ul,
  .rail > .rail__track {
    display: flex;
    gap: var(--sp-3);
    width: max-content;
  }

  .rail > ul > li,
  .rail__track > * {
    scroll-snap-align: start;
  }
}

/* ── Row of four modules (W02 zone 12) ──────────────────────────────────────────────────────── */

/* Phones: stacked modules separated by a rule. 768–1279: 2 × 2. From 1280 (container ≥ 1216): the
   W02 row, where the four titles and the bars hold on one line each. */
.modules {
  display: grid;
  gap: var(--sp-6);
  padding-top: var(--home-gap);
}

.module {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.module + .module {
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-line);
}

.module__body {
  display: flex;
  flex-direction: column;
}

/* Under the H2: a status chip or a short note on the left, the « … → » link on the right (44 px
   high, so the four bars line up whatever they hold). */
.module__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--sp-2);
  min-height: 44px;
  margin-bottom: var(--sp-3);
}

.module__lead {
  flex: 1 1 10em;
  min-width: 0;
}

.module__link {
  flex: none;
  margin-left: auto;
}

.module__chip {
  padding-inline: var(--sp-2);
}

.module__note {
  margin-top: var(--sp-3);
}

.module__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-3);
}

.module__foot .module__note {
  margin: 0;
}

.module__ai .icon {
  color: var(--c-gold-700);
}

/* a) Sample sightings: 64 px square thumbnails, species in Fraunces, place · time, badges. */
.sighting {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--c-line);
}

.sighting:first-child {
  padding-top: var(--sp-1);
}

.sighting__media {
  display: block;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--c-sand);
}

.sighting__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The rhino row has no photo (the product never publishes one): the same 64 px tile (radius 8)
   as the photos, in Forest 900 with a light-gold shield. */
.sighting__media--hidden {
  display: grid;
  place-items: center;
  background: var(--c-forest-900);
  color: var(--c-gold-300);
}

.sighting__species {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.2;
}

.sighting__meta {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: var(--sp-1);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
}

.sighting__meta .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--c-olive);
}

.sighting__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--sp-2);
  margin-top: 6px;
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.sighting__badge {
  padding-inline: var(--sp-2) 10px;
}

.sighting__detail {
  font-weight: 500;
}

/* b) Gallery 3 × 2: square tiles, the species named on each tile. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.gallery__tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--c-forest-700);
}

.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark plate (as the hero's AI notice): readable on any part of the photo; one short name per
   tile (« Rollier » / « Roller »), two lines at most if the user enlarges the spacing. */
.gallery__label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  max-width: calc(100% - 12px);
  padding: 3px var(--sp-2);
  border-radius: var(--r-sm);
  background: rgba(20, 22, 16, 0.66);
  color: var(--c-ivory);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

/* c) Staying in the park: 21:9 banners, title, park, one or two lines of text (a rail on
   phones, see .rail). */
.stays {
  display: grid;
  gap: var(--sp-5);
}

@media (max-width: 767px) {
  .stays > .stay {
    flex: 0 0 min(82vw, 340px);
  }
}

/* Small tablets (600–767, modules stacked at full width): the two camps side by side (the rail no
   longer scrolls) and a lower 3 × 2 gallery (3:2 tiles). */
@media (min-width: 600px) and (max-width: 767px) {
  .stays > .stay {
    flex-basis: calc((100vw - 2 * var(--gutter) - var(--sp-3)) / 2);
  }

  .gallery__tile {
    aspect-ratio: 3 / 2;
  }
}

.stay__media {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--c-forest-700);
}

.stay__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stay__body {
  padding-top: var(--sp-2);
}

.stay__title {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.2;
}

.stay__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: 2px;
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
}

.stay__meta .icon {
  color: var(--c-olive);
}

.stay__text {
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.stays .stay + .stay {
  margin-top: 0;
}

/* d) Guides: 96 × 72 thumbnail, category, title (Fraunces), excerpt; the whole row is a link. */
.guide {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: start;
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--c-line);
  color: inherit;
  text-decoration: none;
}

.guides li:first-child .guide {
  padding-top: var(--sp-1);
}

.guide__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--c-sand);
}

.guide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease);
}

.guide__cat {
  letter-spacing: 0.1em;
}

.guide__title {
  margin-top: 2px;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.25;
}

.guide__excerpt {
  display: block;
  margin-top: var(--sp-1);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.guide__chevron {
  display: none;
  align-self: center;
  color: var(--c-forest-900);
  transition: transform 200ms var(--ease);
}

.guide:hover .guide__title {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.guide:hover .guide__img {
  transform: scale(1.04);
}

.guide:hover .guide__chevron {
  transform: translateX(2px);
}

/* Phones: the sightings note and the guides' excerpts go (the protection band and the « Préparer »
   blocks say the same), the guides' thumbnails shrink to 72 px: the stack stays short. */
@media (max-width: 767px) {
  .modules {
    gap: var(--sp-5);
  }

  .module + .module {
    padding-top: var(--sp-5);
  }

  .module--sightings .module__note,
  .guide__excerpt {
    display: none;
  }

  .guide {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
  }
}

/* 2 × 2: titles and bars aligned per row through a subgrid. */
@media (min-width: 768px) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* auto, not 1fr: in a grid of indefinite height every fr row would get the tallest's size. */
    grid-template-rows: repeat(2, auto auto auto);
    gap: 0 var(--sp-10);
  }

  .module {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
  }

  .module + .module {
    padding-top: 0;
    border-top: 0;
  }

  .module:nth-child(n + 3) {
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--c-line);
  }
}

/* Tablets and small laptops (2 × 2, columns ≥ 330 px): room for the guides' chevron. */
@media (min-width: 768px) and (max-width: 1279px) {
  .guide {
    grid-template-columns: 96px minmax(0, 1fr) 16px;
  }

  .guide__chevron {
    display: block;
  }
}

/* Tablets (768–1023): sightings and wildlife side by side, then « Dormir » and the guides each at
   full width (in a 330–480 px column the two stacked camps would leave ≈ 200 px of blank under the
   guides). */
@media (min-width: 768px) and (max-width: 1023px) {
  .module--stay,
  .module--guides {
    grid-column: 1 / -1;
  }
}

/* The two camp banners side by side (stacked, each would be 250 px high). */
@media (min-width: 768px) and (max-width: 1279px) {
  .stays {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-5);
  }
}

/* W02 row from 1280: 1.3fr 1.35fr 1fr 1fr with a hairline in the middle of each gap (24 px up to
   1439, 32 px from 1440); 40 px under the Safari Pass card (A §2.2: « bas des cartes → titres des
   modules »). */
@media (min-width: 1280px) {
  .modules {
    --modules-gap: var(--sp-6);
    padding-top: var(--sp-10);
    grid-template-columns: 1.3fr 1.35fr 1fr 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: var(--modules-gap);
  }

  .module {
    position: relative;
  }

  .module:nth-child(n + 3) {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .module + .module::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--modules-gap) / -2 - 0.5px);
    width: 1px;
    background: var(--c-line);
  }

  /* 245–275 px columns: the camp text in the module's small size keeps the column close to the
     height of the others. */
  .stays {
    gap: var(--sp-4);
  }

  .stay__text {
    font-size: var(--fs-xs);
    line-height: 1.4;
  }

  .sighting {
    padding-block: 14px;
  }
}

/* 1280–1439 (columns 245–335 px): 24 px titles hold on one line; the bars stack their note or
   chip over the link, left-aligned (side by side they would wrap unevenly); the guides' thumbnail
   shrinks to 72 px so that their titles keep ≈ 160 px. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .module__title {
    font-size: 1.5rem;
  }

  .module__bar {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .module__lead {
    flex: none;
  }

  .module__link {
    margin-left: 0;
  }

  .guide {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (min-width: 1440px) {
  .modules {
    --modules-gap: var(--sp-8);
  }
}

/* ── L'application (#application) ─────────────────────────────────────────────────────────── */

.app {
  padding-top: var(--home-gap);
}

.app__grid {
  display: grid;
  gap: var(--sp-8);
}

.app__title {
  margin-top: var(--sp-2);
}

/* One line wherever it fits (330 px in English, 310 in French); otherwise it breaks before the
   « · » only, its segments being unbreakable (keepSegments in sections/text.mjs). */
.app__status {
  margin-top: var(--sp-4);
  white-space: normal;
}

/* Narrowest phones: a segment may wrap rather than push the page sideways (WCAG 1.4.10 with
   1.4.12 text spacing, English at 320 px). */
@media (max-width: 359px) {
  .app__status .nowrap {
    white-space: normal;
  }
}

.app__text {
  max-width: 62ch;
  margin-top: var(--sp-4);
}

.app__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

/* The phone on a blurred savannah sunset (photo stage, 24 px radius), caption on a dark plate. */
.app__stage {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--sp-4);
  margin: 0;
  padding: var(--sp-8) var(--sp-4) var(--sp-6);
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--c-sky-warm);
  isolation: isolate;
}

.app__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.app__backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 12% 50%;
}

.app__phone {
  width: min(264px, 100%);
  height: auto;
  filter: drop-shadow(0 18px 36px rgba(20, 22, 16, 0.35));
}

.app__caption {
  max-width: 30em;
  padding: 6px var(--sp-3);
  border-radius: var(--r-sm);
  background: rgba(20, 22, 16, 0.66);
  color: var(--c-ivory);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

/* Feature cards (W01): white, hairline border, Forest icon disc straddling the top edge. Phones:
   a rail (see .rail; its top padding leaves room for the discs). */
.feature {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 34px var(--sp-5) var(--sp-5);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-white);
  box-shadow: var(--shadow-card);
}

.feature__icon {
  position: absolute;
  top: -22px;
  left: var(--sp-5);
  width: 44px;
  height: 44px;
  box-shadow: 0 0 0 4px var(--c-ivory);
}

.feature__title {
  font-size: var(--fs-h3);
  line-height: 1.25;
}

.feature__text {
  margin-top: 6px;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.feature__status {
  margin-top: auto;
}

/* The intro actions have a short label (« Notre protection », « FAQ »), shown below 480 px only;
   the hidden one is display: none, so each link is named by its visible text. */
.app__label--short {
  display: none;
}

@media (max-width: 479px) {
  .app__label--long {
    display: none;
  }

  .app__label--short {
    display: inline;
  }
}

/* Phones: the two actions side by side, one line each (short labels below 480 px; from 480 px,
   when the long labels do not fit side by side, the second button goes under the first), a 224 px
   phone, the features in a rail. */
@media (max-width: 767px) {
  .app__grid {
    gap: var(--sp-6);
  }

  .app__actions {
    gap: var(--sp-2);
  }

  .app__actions .btn {
    flex: 1 1 auto;
    min-height: 48px;
    padding-inline: var(--sp-4);
    font-size: var(--fs-sm);
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .app__actions .btn .icon {
    display: none;
  }

  .app__stage {
    gap: var(--sp-3);
    padding: var(--sp-6) var(--sp-4) var(--sp-4);
  }

  .app__phone {
    width: min(224px, 100%);
  }

  .app__rail {
    padding-top: 22px;
  }

  .app__features > .feature {
    flex: 0 0 min(78vw, 300px);
  }
}

/* Small tablets (600–767): the intro beside a narrower stage (200 px phone), its two actions on
   one or two rows; the features stay in their rail. */
@media (min-width: 600px) and (max-width: 767px) {
  .app__grid {
    grid-template-columns: minmax(0, 1fr) 232px;
    column-gap: var(--sp-6);
  }

  .app__intro {
    align-self: start;
  }

  .app__actions .btn {
    flex: 0 1 auto;
  }

  .app__phone {
    width: 200px;
  }

  .app__rail {
    grid-column: 1 / -1;
  }
}

/* Tablets: intro and phone side by side (the intro at the top, beside the phone), the features
   2 × 3 under them. */
@media (min-width: 768px) {
  .app__grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    column-gap: var(--sp-8);
    row-gap: var(--sp-10);
  }

  .app__intro {
    align-self: start;
  }

  .app__rail {
    grid-column: 1 / -1;
    padding-top: 22px;
  }

  .app__features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-10) var(--sp-5);
  }

  .app__phone {
    width: 260px;
  }
}

/* Desktop: intro and features on the left, the stage on the right, as high as its content (no
   empty photo above and below the phone) and sticky while the features scroll by. */
@media (min-width: 1024px) {
  .app__grid {
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-rows: auto 1fr;
    column-gap: var(--sp-12);
  }

  .app__intro {
    align-self: start;
    grid-column: 1;
    grid-row: 1;
  }

  .app__stage {
    position: sticky;
    top: var(--sp-6);
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: start;
    padding-top: var(--sp-10);
  }

  .app__phone {
    width: 320px;
  }

  .app__rail {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }
}

@media (min-width: 1280px) {
  .app__grid {
    grid-template-columns: minmax(0, 1fr) 440px;
  }

  .app__features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Protection (#protection): the dark band ──────────────────────────────────────────────── */

.protect {
  margin-top: var(--home-gap);
  padding-block: var(--home-gap);
  background: var(--c-forest-900);
}

.protect__grid {
  display: grid;
  gap: var(--sp-8);
}

.protect__title {
  max-width: 24em;
  margin-top: var(--sp-2);
}

.protect__intro {
  max-width: 64ch;
  margin-top: var(--sp-3);
}

.protect__points {
  display: grid;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

.protect-point {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.protect-point__title {
  font-size: var(--fs-h3);
  line-height: 1.3;
}

.protect-point__text {
  margin-top: var(--sp-1);
  color: rgba(251, 248, 241, 0.86);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.protect__note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
}

.protect__note .icon {
  margin-top: 1px;
  color: var(--c-gold-300);
}

/* Phones: the icon beside the title, the text under both at full width. */
@media (max-width: 767px) {
  .protect__points {
    gap: var(--sp-6);
  }

  .protect-point {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: var(--sp-2) var(--sp-3);
    align-items: center;
  }

  .protect-point__icon {
    width: 32px;
    height: 32px;
  }

  .protect-point__icon .icon {
    width: 16px;
    height: 16px;
  }

  .protect-point__body {
    display: contents;
  }

  .protect-point__text {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

/* The rhino portrait: a framed 4:5 card (the photo's background, ≈ #1C1D0F, is darker than
   Forest 900: a card, not a cut-out). Not displayed on phones (the band stays short; nothing is
   lost: the points say what it stands for), beside the title from 768 px, in the right column from
   1024 px. */
.protect__frame {
  display: none;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-charcoal);
  box-shadow: 0 0 0 1px rgba(218, 185, 110, 0.22);
}

.protect__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 600px) {
  .protect__points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-6) var(--sp-8);
  }
}

/* 600–767: two points per row with the phone layout. Each point is as high as its row: its own
   rows stay at the top (the space left goes under the text, not between icon, title and text),
   and the titles of a row start on the same line, the icon centred on their first line (17 px
   title at 1.3), so that two neighbours line up whatever their number of title lines. */
@media (min-width: 600px) and (max-width: 767px) {
  .protect-point {
    align-content: start;
    align-items: start;
  }

  .protect-point__icon {
    margin-top: calc((var(--fs-h3) * 1.3 - 32px) / 2);
  }
}

@media (min-width: 768px) {
  .protect__frame {
    display: block;
  }
}

/* Tablets: the portrait (176 px) right of the eyebrow, title and intro; the points and the note
   under them, full width. */
@media (min-width: 768px) and (max-width: 1023px) {
  .protect__grid {
    grid-template-columns: minmax(0, 1fr) 176px;
    gap: 0 var(--sp-8);
  }

  .protect__main {
    display: contents;
  }

  .protect__main > * {
    grid-column: 1;
  }

  .protect__frame {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: start;
  }

  .protect__main > .protect__points,
  .protect__main > .protect__note {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .protect__grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    column-gap: var(--sp-16);
    align-items: center;
  }
}

/* ── Le parc national Kruger (#kruger) ────────────────────────────────────────────────────── */

.kruger {
  padding-top: var(--home-gap);
}

.kruger__top {
  display: grid;
  gap: var(--sp-6);
}

.kruger__media {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-sand);
}

.kruger__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kruger__eyebrow {
  color: var(--c-forest-700);
}

.kruger__title {
  margin-top: var(--sp-3);
}

.kruger__lead {
  max-width: 62ch;
  margin-top: var(--sp-3);
}

/* Facts: 2 × 2, one row of four from 1280 px. A column is never narrower than its value (no
   overlap with the next fact); below 400 px the value shrinks with the width and may break before
   its unit (<wbr> in the markup). */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5) var(--sp-4);
  margin-top: var(--sp-6);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: var(--sp-3);
  border-left: 2px solid var(--c-gold);
}

.fact__value {
  color: var(--c-forest-900);
  font-family: var(--font-serif);
  font-size: min(1.5rem, 6vw);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

@media (min-width: 400px) {
  .fact__value {
    white-space: nowrap;
  }
}

/* English « ≈ 20,000 km² » is a little wider than the French « ≈ 20 000 km² »: 7 % smaller, it
   keeps one line from 320 px (the break before the unit stays for a larger text spacing). */
@media (max-width: 399px) {
  .fact__value:lang(en) {
    font-size: min(1.5rem, 5.6vw);
  }
}

.fact__label {
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
}

/* Phones: the four regions in a rail (see .rail; each one is a link target of the park cards). */
.region {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-white);
  box-shadow: var(--shadow-card);
}

.regions-rail {
  margin-top: var(--sp-6);
}

@media (max-width: 767px) {
  .regions > .region {
    flex: 0 0 min(78vw, 300px);
  }
}

.region__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-h3);
}

.region__icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-sand);
  color: var(--c-gold-700);
}

.region__icon .icon {
  width: 18px;
  height: 18px;
}

.region__text {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* « Préparer son safari »: a Sand panel, three columns from 1024 px with hairlines between. */
.prepare {
  margin-top: var(--sp-6);
  padding: var(--sp-5) var(--sp-4) var(--sp-6);
  border-radius: var(--r-md);
  background: var(--c-sand);
}

.prepare__title {
  font-size: 1.375rem;
  font-weight: 700;
}

.prepare__grid {
  display: grid;
  gap: var(--sp-6);
  margin-top: var(--sp-5);
}

.prepare__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-h3);
  line-height: 1.25;
}

.prepare__text {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.checklist {
  display: grid;
  gap: 6px;
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.checklist__tick {
  margin-top: 0.15em;
  color: var(--c-gold-700);
  stroke-width: 2.5;
}

/* Phones: the three blocks as white cards of equal height in a rail inside the Sand panel
   (bleeding to the panel's edges, not the screen's). */
@media (max-width: 767px) {
  .prepare {
    padding: var(--sp-5) var(--sp-4);
  }

  .prepare__grid {
    align-items: stretch;
    gap: var(--sp-3);
    margin-top: 0;
  }

  .prepare-rail {
    margin: var(--sp-4) calc(-1 * var(--sp-4)) 0;
    padding: 0 var(--sp-4) 2px;
    scroll-padding-inline: var(--sp-4);
  }

  .prepare__block {
    flex: 0 0 min(80vw, 300px);
    padding: var(--sp-4);
    border-radius: var(--r-sm);
    background: var(--c-ivory);
    box-shadow: var(--shadow-card);
  }

  .prepare__text {
    margin-top: var(--sp-2);
  }
}

@media (min-width: 768px) {
  .kruger__top {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--sp-8);
    align-items: center;
  }

  .kruger__media {
    aspect-ratio: 3 / 2;
  }

  .regions-rail {
    margin-top: var(--sp-8);
  }

  .regions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4);
  }

  .prepare {
    margin-top: var(--sp-8);
    padding: var(--sp-6) var(--sp-8) var(--sp-8);
  }
}

@media (min-width: 1024px) {
  .kruger__top {
    column-gap: var(--sp-12);
  }

  .facts {
    grid-template-columns: repeat(2, auto);
    justify-content: start;
    column-gap: var(--sp-10);
  }

  .regions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .prepare__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--sp-12);
  }

  .prepare__block {
    position: relative;
  }

  .prepare__block + .prepare__block::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--sp-6) - 0.5px);
    width: 1px;
    background: rgba(31, 33, 29, 0.12);
  }
}

/* Auto columns: at least as wide as the value (nowrap), the labels wrap when the row is tight. */
@media (min-width: 1280px) {
  .facts {
    grid-template-columns: repeat(4, auto);
    column-gap: var(--sp-8);
  }
}

/* ── Panoramic banner (W01 bottom band) ───────────────────────────────────────────────────── */

.banner {
  position: relative;
  margin-top: var(--home-gap);
  overflow: hidden;
  background: var(--c-charcoal);
  color: var(--c-ivory);
  isolation: isolate;
}

/* The photo covers the whole band. Phones: the herd across the top, the text laid over the bottom
   (the reflections on the water) on a dark veil that rises from the bottom edge, so the band is
   no taller than its text plus a strip of elephants. */
.banner__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

.banner__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(20, 22, 16, 0.9) 0,
    rgba(20, 22, 16, 0.82) 50%,
    rgba(20, 22, 16, 0.3) 76%,
    rgba(20, 22, 16, 0) 90%
  );
}

.banner__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--sp-5);
  padding-block: 104px var(--sp-6);
}

.banner__eyebrow {
  color: var(--c-ivory);
  text-shadow: 0 1px 3px rgba(20, 22, 16, 0.6);
}

.banner__eyebrow-line {
  display: block;
}

.banner__title {
  max-width: 14em;
  margin-top: var(--sp-4);
  color: var(--c-ivory);
  font-size: clamp(1.625rem, 1.2rem + 1.2vw, 2.125rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 3px rgba(20, 22, 16, 0.5);
}

.banner__cta {
  flex: none;
}

/* Wide screens: the 6:1 photo at its own ratio, the text on the calm left third over a dark veil
   from the left (the herd starts at x ≈ 34 %). */
@media (min-width: 768px) {
  .banner__media::after {
    background: linear-gradient(
      90deg,
      rgba(20, 22, 16, 0.68) 0,
      rgba(20, 22, 16, 0.45) 30%,
      rgba(20, 22, 16, 0) 58%
    );
  }

  /* Anchored on the calm left part: from 768 to 1440 the box is 3:1 to 5.5:1, narrower than the
     6:1 photo, and a centred crop would bring the first elephants under the text. */
  .banner__img {
    object-position: 0% 50%;
  }

  .banner__inner {
    justify-content: center;
    min-height: 240px;
    padding-block: var(--sp-6);
  }
}

/* ── FAQ ──────────────────────────────────────────────────────────────────────────────────── */

.faq {
  padding-block: var(--home-gap);
}

.faq__title {
  margin-bottom: var(--sp-4);
}

.faq__columns {
  display: grid;
  column-gap: var(--sp-8);
}

.faq__item {
  border-bottom: 1px solid var(--c-line);
}

/* Reached from « Gratuit ou Safari Pass ? » or « Comment ça marche » (the link targets the
   answer's paragraph, which opens the question): a gold rule marks the question. */
.faq__item:has(:target) .faq__summary {
  box-shadow: inset 3px 0 0 var(--c-gold);
  padding-left: var(--sp-3);
}

.faq__column:first-child .faq__item:first-child {
  border-top: 1px solid var(--c-line);
}

.faq__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 56px;
  padding-block: var(--sp-3);
  list-style: none;
}

.faq__summary::-webkit-details-marker {
  display: none;
}

.faq__summary::marker {
  content: '';
}

.faq__q {
  font-size: var(--fs-h3);
}

.faq__summary:hover .faq__q {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.faq__toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-sand);
  color: var(--c-forest-900);
  transition: transform 200ms var(--ease);
}

.faq__toggle .icon {
  width: 18px;
  height: 18px;
}

.faq__item[open] .faq__toggle {
  transform: rotate(180deg);
}

.faq__a {
  max-width: 62ch;
  padding-bottom: var(--sp-5);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.faq__a a {
  color: var(--c-forest-900);
  font-weight: 600;
}

/* Link target: the question above the answer stays in view (a question takes up to ≈ 100 px,
   three lines with a larger text spacing). */
.faq__a p {
  scroll-margin-top: 128px;
}

@media (min-width: 1024px) {
  .faq__columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .faq__column .faq__item:first-child {
    border-top: 1px solid var(--c-line);
  }
}

/* ── Motion and forced colours ────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .park-card:hover .park-card__img,
  .park-card:hover .park-card__chevron,
  .hero-action:hover .hero-action__icon,
  .guide:hover .guide__img,
  .guide:hover .guide__chevron {
    transform: none;
  }

  .park-card__img,
  .guide__img {
    transition: none;
  }
}

/* Forced colours: surfaces drawn by a background (Sand, white plates) get a real border; veils
   over photos go (the system backplate keeps the text readable). */
@media (forced-colors: active) {
  .hero-explore,
  .pass,
  .park-card,
  .prepare,
  .gallery__label,
  .app__caption,
  .sighting__media--hidden {
    border: 1px solid CanvasText;
  }

  .hero__media::after,
  .hero__inner::before,
  .hero__inner::after,
  .park-card::after,
  .banner__media::after {
    display: none;
  }
}
