/*
 * HOME GLOBAL SHELL
 * Geometry only. No section-specific design belongs here.
 */

html[data-home-foundation-ready="true"] {
  --home-visible-viewport: var(--home-viewport-height);
}

body[data-home-architecture="v1"] {
  min-width: 280px;
}

[data-home-section] {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  scroll-margin-top: var(--home-content-top);
}

/*
 * Hero visible area:
 * from the bottom of the fixed header to the bottom of the viewport.
 */
[data-home-section="hero"] {
  min-height: var(--home-hero-height);
  height: var(--home-hero-height);
}

/*
 * Events, Guide, Reports and Footer visible area:
 * from the bottom of the fixed primary actions to the viewport bottom.
 * The current legacy design can still provide its own internal layout.
 */
[data-home-section="events"],
[data-home-section="guide"],
[data-home-section="reports"],
[data-home-section="footer"] {
  min-height: var(--home-section-height);
  height: var(--home-section-height);
}

/* A section may scroll internally later, but must never expand the page geometry. */
[data-home-section] > .container,
[data-home-section] > .footer-shell,
[data-home-section] > .footer-inner {
  min-height: 0;
  box-sizing: border-box;
}

/* Foundation state exposed for later button styling and snap behavior. */
body[data-current-home-section="hero"] [data-home-section="hero"],
body[data-current-home-section="events"] [data-home-section="events"],
body[data-current-home-section="guide"] [data-home-section="guide"],
body[data-current-home-section="reports"] [data-home-section="reports"],
body[data-current-home-section="footer"] [data-home-section="footer"] {
  --home-section-is-current: 1;
}



/* ==========================================================================
   HOME SNAP & TRANSITIONS V1
   One visible section after every released page scroll.
   ========================================================================== */

html[data-home-snap-ready="true"] {
  scroll-behavior: auto !important;
  overscroll-behavior-y: none;
}

body[data-home-architecture="v1"] {
  overscroll-behavior-y: none;
}

/* Section alignment is controlled by the single JS engine. */
[data-home-section] {
  scroll-snap-align: none !important;
  scroll-snap-stop: normal !important;
}

/* Temporary state while the engine finishes alignment. */
html.is-home-snapping,
html.is-home-snapping body {
  scroll-behavior: auto !important;
}

html.is-home-snapping [data-home-section] {
  pointer-events: none;
}

/* Keep interactive controls usable during the short snap animation. */
html.is-home-snapping [data-site-header],
html.is-home-snapping [data-primary-actions],
html.is-home-snapping .media-detail-modal,
html.is-home-snapping .gallery-lightbox {
  pointer-events: auto;
}

/* Respect users who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --home-motion-section: 1ms;
  }
}


/* Mobile homepage: native vertical page scrolling stays available from
   every section. Horizontal rails may still be dragged naturally. */
@media (max-width: 1023px) {
  html[data-home-snap-ready="true"],
  body[data-home-architecture="v1"] {
    overscroll-behavior-y: auto;
  }

  body[data-home-architecture="v1"] [data-home-section] {
    touch-action: pan-y pinch-zoom;
  }

  body[data-home-architecture="v1"] .home-event-single-carousel,
  body[data-home-architecture="v1"] [data-home-guide-grid],
  body[data-home-architecture="v1"] .home-editorial-carousel {
    touch-action: pan-x pan-y pinch-zoom;
  }

  html.is-home-snapping,
  html.is-home-snapping body {
    overflow-anchor: none;
  }
}
