/* ==========================================================================
   base.css — Reset, tipografía y utilidades globales
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-cream);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* Foco visible para quien navega con teclado */
:focus-visible {
  outline: 3px solid var(--c-rose-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
.theme-deep :focus-visible,
.site-footer :focus-visible { outline-color: var(--c-rose); }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-section); }

/* Temas de sección: cambian fondo y color de texto */
.theme-cream { background: var(--c-cream); }
.theme-paper { background: var(--c-paper); }
.theme-rose  { background: var(--c-rose); }
.theme-deep  { background: var(--c-olive-deep); color: var(--c-cream); }

/* Encabezado de sección */
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head p { margin-top: 1rem; font-size: var(--fs-lead); color: var(--c-ink-soft); }
.theme-deep .section-head p { color: rgba(240, 231, 224, .82); }

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

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 200;
  background: var(--c-ink);
  color: var(--c-cream);
  padding: .8rem 1.2rem;
  border-radius: var(--r-s);
  transition: top 160ms var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* Cuando hay un diálogo abierto, la página de fondo no scrollea */
body.is-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
}
