/* ==========================================================================
   VR Celebrations — Base / Reset
   File: assets/css/base.css
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Offset in-page anchors below the sticky header */
:target {
  scroll-margin-top: calc(var(--header-height) + var(--space-sm));
}

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

img {
  height: auto;
}

figure {
  margin: 0;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

address {
  font-style: normal;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --------------------------------------------------------------------
   Focus visibility (WCAG 2.4.7)
   -------------------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

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

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: var(--z-toast);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-text);
  color: var(--color-text-invert);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
  color: var(--color-text-invert);
}

/* --------------------------------------------------------------------
   Media fallback — themed gradient shows while/if images are missing
   -------------------------------------------------------------------- */

.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--gradient-media-fallback);
}

.media-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent; /* keep alt text invisible over the gradient fallback */
}

/* app.js marks images that fail to load so only the gradient shows */
.media-frame > img.is-broken {
  visibility: hidden;
}

/* --------------------------------------------------------------------
   Reduced motion (WCAG 2.3.3)
   -------------------------------------------------------------------- */

@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;
  }
}
