/* ==========================================================================
   Shared base — reset, accessibility helpers and the hooks used by
   shared/js/core.js. Contains NO visual identity: every template defines its
   own tokens, typography and components on top of this file.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-offset, 88px);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

/* :where() keeps specificity at zero so any template class can override. */
:where(ul[role="list"], ol[role="list"]) {
  list-style: none;
  padding: 0;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus-ring, currentColor);
  outline-offset: 3px;
}

/* ---- Accessibility helpers ---------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Scroll reveal (driven by core.js) ---------------------------------- */
/* Content is only hidden once JS has confirmed it can reveal it again. */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="left"] { transform: translate3d(-36px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(36px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(0.94); }

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Accordion (driven by core.js) -------------------------------------- */

[data-accordion-panel] {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-accordion-panel] > * {
  overflow: hidden;
}

[data-accordion-item].is-open [data-accordion-panel] {
  grid-template-rows: 1fr;
}

/* ---- Forms (driven by core.js) ------------------------------------------ */

[data-form-status]:empty {
  display: none;
}

/* ---- Scroll lock while a mobile menu is open ---------------------------- */

html.nav-locked,
html.nav-locked body {
  overflow: hidden;
}

/* ---- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
