/**
 * Atlas Vertical – Base styles
 * Reset, root defaults, global utilities.
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light dark;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

::selection {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
}

/* Skip-to-content link: visible only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  color: var(--color-text);
  border: 2px solid var(--color-accent);
  border-radius: 4px;
  font-size: var(--font-size-sm);
  text-decoration: none;
}

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

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------
   Theme setting: phone_frame = false
   Removes rounded borders and shadow from portrait video frames.
--------------------------------------------------------------- */
.no-phone-frame .post-hero__media,
.no-phone-frame .hero-frame,
.no-phone-frame .story-panel__frame {
  border-radius: 0;
  box-shadow: none;
}

/* ---------------------------------------------------------------
   Theme setting: hero_layout = feature-image
   Converts the homepage hero from portrait 9:16 to landscape 16:9.
--------------------------------------------------------------- */
body[data-hero-layout="feature-image"] .hero-frame {
  border-radius: 12px;
  overflow: hidden;
}

body[data-hero-layout="feature-image"] .hero-frame__media {
  aspect-ratio: 16 / 9;
  max-height: 480px;
}
