/* ==========================================================================
   base.css — reset ligero, tipografía, layout y utilidades.
   Solo usa tokens de tokens.css.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-offset, 0px) + var(--space-6)); }

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

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-heading);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); line-height: var(--leading-snug); }
h4 { font-size: var(--text-base); }
p { margin: 0 0 var(--space-4); max-width: 68ch; }
ul, ol { margin: 0 0 var(--space-4); }

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

a { color: var(--color-link); text-underline-offset: 0.18em; }
a:hover { color: var(--color-link-hover); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

/* Foco visible en cualquier fondo: anillo oscuro + halo amarillo */
:focus-visible {
  outline: 3px solid var(--color-focus-inner);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--color-focus-outer);
  border-radius: var(--radius-sm);
}

/* --- Layout --- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container-max));
  margin-inline: auto;
}
.container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); }

.section { padding-block: var(--space-section); }
.section--surface { background: var(--color-surface); }
.section--soft { background: var(--color-primary-soft); }
.section--tight { padding-block: var(--space-10); }
.section__header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.section__intro { max-width: var(--container-narrow); }
.section__eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-accent);
}
.section__title { margin: 0; }
.section__lead { margin: var(--space-3) 0 0; color: var(--color-text-muted); }
.section__more {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  min-height: var(--touch-target);
  font-weight: var(--weight-semibold);
}

.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--space-10); font-size: var(--text-xl); }
.prose h3 { margin-top: var(--space-8); }

.stack > * + * { margin-top: var(--space-6); }
/* Secciones de contenido apiladas (municipalidad, contacto): más aire entre bloques */
.stack--sections > * + * { margin-top: var(--space-12); }
@media (min-width: 64em) { .stack--sections > * + * { margin-top: var(--space-16); } }

/* --- Accesibilidad --- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-16));
  padding: var(--space-3) var(--space-4);
  background: var(--color-cta);
  color: var(--color-on-cta);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
}
.skip-link:focus { top: var(--space-4); }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
