/* Shared interaction styles inherit the active training page's palette. */
.hero::before { background-image: url("assets/training-wall-1920.webp?v=20261201"); }
.section-menu { display: none; }
@media (max-width: 1000px) {
  .hero::before { background-image: url("assets/training-wall-1000.webp"); }
  .head-in { gap: clamp(4px, 1.5vw, 16px); }
  .head-in .brand { min-width: 0; }
  .site-head .section-menu {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    color: inherit;
    border: 0;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
  }
  .site-head .section-menu[hidden], .site-head .nav { display: none; }
  .section-menu svg { width: 22px; height: 22px; }
  .section-menu[aria-expanded="true"] + .nav {
    position: absolute;
    inset: 100% 0 auto;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 0;
    padding: 6px var(--gut);
    background: inherit;
    background-color: var(--nav-surface, var(--ink));
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 10px 20px rgb(0 0 0 / 12%);
  }
  .site-head .nav a { display: grid; place-items: center; min-height: 44px; }
  .float { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .float .btn { min-height: 44px; }
  .wwai-footer-directory a { min-height: 44px; }
  .wwai-video-controls button { width: 44px; height: 44px; }
  .wwai-video-seek { min-height: 44px; min-width: 0; }
}
@media (max-width: 360px) {
  .wm-head .wm-line { font-size: 17px; }
  .wm-head .wm-tag { font-size: 6px; }
}
@media (max-width: 1000px) and (min-width: 768px) {
  .wwai-video-stage[data-floating] { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* The gallery opens like a contact sheet as each row reaches the viewport. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .gallery .g img {
      animation: training-contact-sheet linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 95%;
    }
    .stat-list .num {
      animation: training-stat linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
    .moving-bg img {
      animation: training-photo-drift linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    .site-head::after {
      content: "";
      position: absolute;
      inset: auto 0 -1px;
      height: 2px;
      background: var(--caramel);
      pointer-events: none;
      transform-origin: left;
      animation: training-read-progress linear both;
      animation-timeline: scroll(root);
    }
  }
}
@keyframes training-contact-sheet {
  from { scale: 1.05; clip-path: inset(3% 3% 3% 3% round 12px); }
  to { scale: 1; clip-path: inset(0 round 0); }
}
@keyframes training-stat { from { translate: 0 .15em; } to { translate: 0 0; } }
@keyframes training-photo-drift { from { translate: 0 -2%; } to { translate: 0 2%; } }
@keyframes training-read-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Keep both story sections in reading order when there is room for one column. */
@media (max-width: 1000px) {
  .gift-grid, .host-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "photo" "copy";
    row-gap: clamp(18px, 3vw, 28px);
  }
  .gift-grid .gift-t, .host-grid .host-t { grid-area: heading; }
  .gift-grid .gift-photo, .host-grid .host-photo {
    grid-area: photo;
    position: static;
    width: 100%;
  }
  .gift-grid .gift-copy, .host-grid .host-copy { grid-area: copy; min-width: 0; }
  .site-head .btn-sm { flex: none; }
  .site-head .btn-sm .btn-main { white-space: nowrap; }
}

@media (max-width: 820px) {
  .float {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
  }
  .float .btn:not(.btn-sm):not(.btn-block) {
    width: auto;
    min-height: 44px;
    padding: 8px 16px;
    gap: 10px;
    font-size: 1rem;
    animation: none;
  }
}

/* Phones: a small center crop of the hero wall, kept at the same height so it scales the same. */
@media (max-width: 600px) {
  .hero::before { background-image: url("assets/training-wall-mobile.webp"); }
}

/* Phones: keep the floating button off the hero video. The header button stays visible. */
@media (max-width: 1000px) {
  .site-head .brand { display: inline-flex; align-items: center; min-height: 44px; }
  .float.is-clear-of-video { opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden; }
}
