/* =========================================================
   TEMPORARY: alternative hero / header styles, picked with the
   floating switcher (partials/hero-switcher.njk, on every page). Once a style is
   chosen, its rules move into style.css and this file is deleted.
   Every style builds on the text-left / photo-right hero in style.css.
   ========================================================= */

/* ---------- Switcher panel ---------- */
.hero-switcher {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 95;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  padding: 6px;
  border-radius: 20px;
  background: rgba(33, 56, 60, 0.92);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.hero-switcher-body {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  row-gap: 6px;
}

.hero-switcher-body[hidden] {
  display: none;
}

.hero-switcher-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-switcher-group + .hero-switcher-group,
.hero-switcher-toggle + .hero-switcher-body {
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-switcher-title {
  padding: 0 8px 0 10px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.hero-switcher button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-white);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.hero-switcher button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-switcher button[aria-pressed="true"] {
  background: var(--color-white);
  color: var(--color-text);
}

.hero-switcher .hero-switcher-toggle {
  align-self: flex-start;
  color: rgba(255, 255, 255, 0.85);
}

.hero-switcher .hero-switcher-toggle::after {
  content: " ◂";
}

.hero-switcher.is-collapsed .hero-switcher-toggle::after {
  content: " ▸";
}

/* On phones a floating bar covers the page and the swing button, so it
   becomes a strip at the top of the page instead (scrolls away with it). */
@media (max-width: 700px) {
  .hero-switcher {
    position: static;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
  }

  .hero-switcher-body {
    flex-wrap: nowrap;
  }
}

/* ---------- 1 · Blob: photo cut into the site's organic shape ----------
   Also used by 5 for the intro section's photo (body[data-intro="blob"]). */
.hero[data-variant="blob"] .hero-media,
body[data-intro="blob"] .hero + .section .split-media {
  position: relative;
  z-index: 0; /* keeps the shape behind the photo but above the section background */
}

.hero[data-variant="blob"] .hero-media::before,
body[data-intro="blob"] .hero + .section .split-media::before {
  content: "";
  position: absolute;
  inset: 8% -5% -5% 8%;
  z-index: -1;
  background: var(--color-sky);
  opacity: 0.45;
  border-radius: 40% 60% 45% 55% / 55% 45% 60% 40%;
}

.hero[data-variant="blob"] .hero-photo,
body[data-intro="blob"] .hero + .section .split-photo {
  aspect-ratio: 1;
  border-radius: 62% 38% 55% 45% / 45% 55% 45% 55%;
  box-shadow: none;
}

@media (max-width: 860px) {
  .hero[data-variant="blob"] .hero-media,
  body[data-intro="blob"] .hero + .section .split-media {
    width: min(100%, 420px);
    margin: 0 auto;
  }
}

/* ---------- 2 · Banner: centered text, wide photo underneath ---------- */
.hero[data-variant="banner"] .hero-grid {
  grid-template-columns: 1fr;
  gap: 48px;
  text-align: center;
}

.hero[data-variant="banner"] .hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero[data-variant="banner"] .hero-actions {
  justify-content: center;
}

.hero[data-variant="banner"] .hero-photo {
  aspect-ratio: 21 / 9;
}

@media (max-width: 700px) {
  .hero[data-variant="banner"] .hero-photo {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- 3 · Background: full-bleed photo under a teal tint ---------- */
.hero[data-variant="background"] {
  padding: 150px 0 140px;
}

.hero[data-variant="background"] .hero-blob {
  display: none;
}

.hero[data-variant="background"] .hero-grid {
  position: static;
  grid-template-columns: 1fr;
  text-align: center;
}

.hero[data-variant="background"] .hero-inner {
  max-width: 720px;
  margin: 0 auto;
  color: var(--color-white);
}

.hero[data-variant="background"] .hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero[data-variant="background"] .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Lighter at the edges so the room shows; a little deeper in the middle,
     behind the text, so the white type stays readable. */
  background:
    radial-gradient(ellipse 55% 60% at 50% 50%, rgba(10, 60, 66, 0.3), transparent 70%),
    linear-gradient(180deg, rgba(10, 60, 66, 0.12), rgba(10, 60, 66, 0.28));
}

.hero[data-variant="background"] .hero-inner {
  /* a tight shadow for crisp edges plus a wide soft one, since the tint is light */
  text-shadow: 0 1px 3px rgba(10, 40, 44, 0.55), 0 2px 18px rgba(10, 40, 44, 0.5);
}

.hero[data-variant="background"] .hero-photo {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.hero[data-variant="background"] h1 {
  color: var(--color-white);
}

.hero[data-variant="background"] .eyebrow,
.hero[data-variant="background"] .hero-subtitle {
  color: var(--color-secondary);
}

.hero[data-variant="background"] p.lead {
  color: rgba(255, 255, 255, 0.9);
}

.hero[data-variant="background"] .hero-actions {
  justify-content: center;
}

.hero[data-variant="background"] .btn-outline {
  border-color: var(--color-white);
  color: var(--color-white);
}

.hero[data-variant="background"] .btn-outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* ---------- 4 · No photo: the original centered hero ---------- */
.hero[data-variant="none"] .hero-media {
  display: none;
}

.hero[data-variant="none"] .hero-grid {
  grid-template-columns: 1fr;
  text-align: center;
}

.hero[data-variant="none"] .hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero[data-variant="none"] .hero-actions {
  justify-content: center;
}

/* ---------- 6 · Arch: tall photo with a rounded top, an outline arch behind ---------- */
.hero[data-variant="arch"] .hero-media {
  position: relative;
  z-index: 0;
  width: min(100%, 420px);
  justify-self: center;
}

.hero[data-variant="arch"] .hero-media::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  z-index: -1;
  border: 2px solid var(--color-coral);
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  opacity: 0.7;
}

.hero[data-variant="arch"] .hero-photo {
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  box-shadow: none;
}

@media (max-width: 860px) {
  .hero[data-variant="arch"] .hero-media {
    width: min(100%, 340px);
  }
}

/* ---------- 7 · Frame: photo with a pastel panel and a dot pattern offset behind ---------- */
.hero[data-variant="frame"] .hero-media {
  position: relative;
  z-index: 0;
}

.hero[data-variant="frame"] .hero-media::before {
  content: "";
  position: absolute;
  inset: 28px -22px -22px 28px;
  z-index: -1;
  border-radius: var(--radius-lg);
  background: var(--color-sky);
  opacity: 0.4;
}

.hero[data-variant="frame"] .hero-media::after {
  content: "";
  position: absolute;
  top: -22px;
  left: -22px;
  width: 120px;
  height: 90px;
  z-index: -1;
  background-image: radial-gradient(var(--color-coral) 2px, transparent 2.5px);
  background-size: 16px 16px;
  opacity: 0.7;
}

.hero[data-variant="frame"] .hero-photo {
  box-shadow: none;
}

/* ---------- 8 · Fade: photo fills the right side and fades into the page ---------- */
.hero[data-variant="fade"] .hero-blob--peach {
  display: none;
}

.hero[data-variant="fade"] .hero-grid {
  position: static;
}

.hero[data-variant="fade"] .hero-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56%;
  z-index: 1;
}

.hero[data-variant="fade"] .hero-photo {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%);
  mask-image: linear-gradient(to right, transparent, #000 45%);
}

@media (max-width: 860px) {
  .hero[data-variant="fade"] .hero-media {
    position: relative;
    width: auto;
    margin: 0 -24px -96px;
  }

  .hero[data-variant="fade"] .hero-photo {
    aspect-ratio: 4 / 3;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%);
    mask-image: linear-gradient(to bottom, transparent, #000 30%);
  }
}

/* ---------- 9 · Polaroid: photo in a white print, slightly tilted, with tape ---------- */
.hero[data-variant="polaroid"] .hero-media {
  position: relative;
  width: min(100%, 480px);
  justify-self: center;
  padding: 14px 14px 56px;
  border-radius: 6px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
  transform: rotate(2.5deg);
}

.hero[data-variant="polaroid"] .hero-media::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 120px;
  height: 30px;
  margin-left: -60px;
  background: var(--color-secondary);
  opacity: 0.9;
  transform: rotate(-4deg);
}

.hero[data-variant="polaroid"] .hero-photo {
  border-radius: 2px;
  box-shadow: none;
}

@media (max-width: 860px) {
  .hero[data-variant="polaroid"] .hero-media {
    width: min(100%, 380px);
  }
}

/* ---------- 10 · Cutout / 11 · Cutout rope: a child on a swing, no background ----------
   Use their own images (.hero-scene), so the Image option doesn't apply.
   Layers of the same size: the room's equipment (static) and the child on the
   swing, which sways gently: the nest swing (10) or the rope swing (11). The
   straps / rope start at the top edge of the hero, and the photo runs off the
   right edge of the screen, where its furniture is cut. */
.hero:is([data-variant="cutout"], [data-variant="cutout-rope"]) .hero-photo {
  display: none;
}

.hero:is([data-variant="cutout"], [data-variant="cutout-rope"]) .hero-media {
  /* the space between the container's content and the right edge of the screen */
  --gutter-right: max(24px, (100vw - var(--container-width)) / 2 + 24px);
  position: relative;
  z-index: 0;
  align-self: start;
  margin-top: -100px; /* the hero's top padding, so the swing hangs from the top edge */
  margin-right: calc(-1 * var(--gutter-right));
  margin-left: -40px;
}

.hero:is([data-variant="cutout"], [data-variant="cutout-rope"]) .hero-scene--ramp {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1600 / 1027;
  opacity: 0.8;
}

.hero-scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* softer colours, to sit with the site's pastel palette (the files stay untouched) */
  filter: saturate(0.72) contrast(0.92) brightness(1.05);
}

/* the dartboard: drawn over the photos' area, behind the child on the rope */
.hero-scene-dart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* the same softening as the photos */
  filter: saturate(0.72) contrast(0.92) brightness(1.05);
}

.hero-dart {
  transform-box: view-box;
  transform-origin: 505px 0;
  animation: hero-swing-dart 5s ease-in-out infinite alternate;
}

.hero-dart-cord {
  fill: none;
  stroke: #d8d2c4;
  stroke-width: 4;
}

.hero-dart-numbers {
  fill: #fff;
  font: 700 13px var(--font-body);
  text-anchor: middle;
  dominant-baseline: central;
}

.hero-dart-ball {
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 2;
}

@keyframes hero-swing-dart {
  from { transform: rotate(-1.5deg); }
  to { transform: rotate(1.5deg); }
}

/* Dart group: on the right, above the soft blocks (the cord still starts at the
   top edge; the outer group moves, the inner one sways) */
.hero[data-dart="right"] .hero-dart-pos {
  transform: translate(835px, 0);
}

/* only with the rope swing: the nest swing (10) hangs where the board would be */
.hero[data-variant="cutout"] .hero-scene-dart,
.hero[data-dart="none"] .hero-scene-dart {
  display: none;
}

/* each style shows only its own swing */
.hero[data-variant="cutout"] .hero-scene-rope,
.hero[data-variant="cutout-rope"] .hero-scene-swing {
  display: none;
}

/* the mats run off the bottom of the photo, so they fade out instead */
.hero-scene-room {
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent 98%);
}

.hero-scene-swing {
  /* swings from where the straps meet, just above the image */
  transform-origin: 28.4% -4.4%;
  animation: hero-swing 4.5s ease-in-out infinite alternate;
}

.hero-scene-rope {
  /* swings from the top of the rope */
  transform-origin: 23.4% 0;
  animation: hero-swing-rope 4.5s ease-in-out infinite alternate;
}

@keyframes hero-swing {
  from { transform: rotate(-2.5deg); }
  to { transform: rotate(2.5deg); }
}

@keyframes hero-swing-rope {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}

/* ---------- 12 · Cutout play: the child on the rope swing among other equipment ----------
   Same idea as 10 / 11 with another photo (tyre swing, roll swing, soft blocks).
   Nothing is cut at its edges, so it stays inside the column. */
.hero[data-variant="cutout-play"] .hero-photo {
  display: none;
}

.hero[data-variant="cutout-play"] .hero-media {
  position: relative;
  z-index: 0;
  align-self: start;
  margin-top: -100px; /* the hero's top padding, so the ropes hang from the top edge */
}

.hero[data-variant="cutout-play"] .hero-scene--play {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1600 / 1292;
}

.hero-play-swing {
  /* swings from the top of the rope */
  transform-origin: 52.6% 0;
  animation: hero-swing-play 4.5s ease-in-out infinite alternate;
}

@keyframes hero-swing-play {
  from { transform: rotate(-3deg); }
  to { transform: rotate(3deg); }
}

/* Small screens: the scene moves above the text, edge to edge, and hangs from
   the top edge on the plain page background (no peach shape behind it). */
@media (max-width: 860px) {
  .hero:is([data-variant="cutout"], [data-variant="cutout-rope"], [data-variant="cutout-play"]) .hero-blob--peach {
    display: none;
  }

  .hero:is([data-variant="cutout"], [data-variant="cutout-rope"], [data-variant="cutout-play"]) .hero-media {
    order: -1;
    margin: -100px -24px 0;
  }
}

@media (max-width: 700px) {
  .hero:is([data-variant="cutout"], [data-variant="cutout-rope"], [data-variant="cutout-play"]) .hero-media {
    margin-top: -64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scene-swing,
  .hero-scene-rope,
  .hero-play-swing,
  .hero-dart {
    animation: none;
  }
}

/* ---------- Background: the hero's colour (Background group) ----------
   Works with every hero style above; the photo of 3 / 5 covers it. The hero's
   bottom wave stays page-coloured, so the colour ends in a wave like .section--alt. */

/* Tint: the inner pages' hero colour, with the logo dots */
.hero[data-bg="tint"] {
  background-color: var(--color-bg-alt);
  background-image:
    radial-gradient(circle at 4% 22%, var(--dot-sky) 0 22px, transparent 23px),
    radial-gradient(circle at 46% 86%, var(--dot-coral) 0 9px, transparent 10px),
    radial-gradient(circle at 10% 80%, var(--dot-sage) 0 14px, transparent 15px);
}

/* Wash: sky in the top left, fading through white to peach in the bottom right
   (the sky and peach --accent-soft of the topic pages) */
.hero[data-bg="wash"] {
  background-image:
    radial-gradient(circle at 5% 24%, var(--dot-coral) 0 9px, transparent 10px),
    radial-gradient(circle at 44% 88%, var(--dot-sage) 0 14px, transparent 15px),
    linear-gradient(135deg, #e3f2fc 0%, var(--color-bg) 48%, #fff1de 100%);
}

.hero[data-bg="wash"] .hero-blob--peach {
  opacity: 0.7;
}

/* Mesh: large soft patches of the palette; they take the place of the blobs */
.hero[data-bg="mesh"] {
  background-color: #f6fbfc;
  background-image:
    radial-gradient(ellipse 45% 55% at 92% 8%, rgba(253, 213, 162, 0.75), transparent 70%),
    radial-gradient(ellipse 40% 50% at 4% 18%, rgba(162, 213, 244, 0.55), transparent 70%),
    radial-gradient(ellipse 40% 45% at 30% 100%, rgba(165, 198, 171, 0.45), transparent 70%),
    radial-gradient(ellipse 30% 35% at 70% 75%, rgba(250, 150, 135, 0.22), transparent 70%);
}

.hero[data-bg="mesh"] .hero-blob {
  display: none;
}

/* Phones: the hero is tall and narrow here, so the colour is a little deeper
   (less white in between) and the dots are fewer and smaller */
@media (max-width: 700px) {
  .hero[data-bg="tint"] {
    background-image:
      radial-gradient(circle at 92% 62%, var(--dot-sky) 0 14px, transparent 15px),
      radial-gradient(circle at 6% 94%, var(--dot-coral) 0 7px, transparent 8px),
      linear-gradient(180deg, #e0f1f2 0%, var(--color-bg-alt) 55%, #e3f2fc 100%);
  }

  .hero[data-bg="wash"] {
    background-image:
      radial-gradient(circle at 92% 62%, var(--dot-coral) 0 8px, transparent 9px),
      linear-gradient(170deg, #d6ecfa 0%, #eef6f6 45%, #fde6c8 100%);
  }
}
