/* =====================================================================
   base.css — reset, tipografía, layout y utilidades
   Depende de tokens.css. Mobile first.
   ===================================================================== */

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

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

body {
  margin: 0;
  background: var(--light);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-10) 0; }

/* Focus visible: tinta sobre fondos claros, oro sobre fondos oscuros */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.on-dark :focus-visible,
.site-footer :focus-visible,
.btn-ghost :focus-visible,
.hero :focus-visible { outline-color: var(--gold); }

::selection { background: var(--gold); color: var(--ink); }

/* ---- Tipografía ---- */
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); margin: 0; font-weight: 400; }

h1 {
  font-weight: 300;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.06;
  letter-spacing: -.005em;
}
h2 {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -.005em;
  margin-bottom: var(--s-5);
}
h3 { font-size: 26px; line-height: 1.15; margin-bottom: var(--s-3); }
h4 { font-size: 21px; line-height: 1.35; }

@media (min-width: 768px) { h2 { font-size: 48px; } }

/* Palabra destacada en itálica gris dentro de un título */
h1 em, h2 em, h3 em, .it {
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-3);
}
.eyebrow--sm { letter-spacing: .25em; }

.lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
}

.meta {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nav-link); /* muted-2 (#A39A8F) da 2,4:1 sobre --light y no pasa AA: para texto funcional se usa --nav-link (7:1) */
}

.tnum { font-variant-numeric: tabular-nums; }

/* Prosa de guía: columna de lectura, ink, 16 px */
.prose { max-width: var(--narrow); }
.prose p, .prose li { font-size: 16px; line-height: 1.75; }
.prose h2 { font-size: 30px; margin: var(--s-11) 0 var(--s-4); }
.prose h3 { margin: var(--s-8) 0 var(--s-2); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 18px; margin-bottom: .5em; }
.prose ul > li::before {
  content: ""; position: absolute; left: 2px; top: .8em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink);
}
.prose ol > li { margin-bottom: .6em; padding-left: .3em; }
.prose ol > li::marker { font-family: var(--serif); font-size: 1.15em; color: var(--muted); }
@media (min-width: 768px) { .prose h2 { font-size: 36px; } }
/* El eyebrow no hereda el tamaño de párrafo de la prosa */
.prose .eyebrow, .answer .eyebrow { font-size: 11px; line-height: 1.5; margin: 0 0 var(--s-2); }
/* Ritmo vertical entre bloques de la prosa */
.prose .photo, .prose .table-wrap, .prose .search-form, .prose .faq, .prose .steps { margin-block: var(--s-8); }
.prose .answer + .photo { margin-top: var(--s-10); }

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

.section { padding-block: var(--s-11); }
.section--alt { background: var(--sand); }
.section--soft { background: var(--light-2); }
@media (min-width: 1024px) { .section { padding-block: var(--s-15); } }

.grid { display: grid; gap: var(--s-7); }
@media (min-width: 640px)  { .grid--2, .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); gap: var(--s-8); } }

/* Artículo con barra lateral de reserva (≥1000 px) */
.article-layout { display: grid; gap: var(--s-10); grid-template-columns: minmax(0, 1fr); }
.article-layout > * { min-width: 0; }
@media (min-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, var(--narrow)) 340px; justify-content: space-between; align-items: start; }
  .article-layout > aside { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}

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

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 200;
  background: var(--ink); color: var(--cream);
  padding: var(--s-3) var(--s-5); border-radius: var(--r);
  font-size: 13px; text-decoration: none;
}
.skip-link:focus { top: var(--s-3); outline-color: var(--gold); }

/* Dato pendiente de confirmar: visible en revisión, se elimina antes de publicar */
.tbc {
  background: #F3E3B8;
  color: var(--ink);
  padding: 0 .35em;
  border-radius: var(--r);
  font-style: normal;
  font-weight: 500;
  font-size: .92em;
  white-space: normal;
}

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