/* Reset ligero, tipografía base y utilidades de layout. */

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

/* «hidden» siempre gana, aunque la clase tenga su propio display (.btn, .field…). */
[hidden] { display: none !important; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (min-width: 48em) {
  html { font-size: min(16px, max(14px, 100vw / 68.75)); }
}
/* En teléfono la letra es 15 px (tokens.css), pero lo que se escribe se queda en
   16 px: con menos, el iPhone hace zoom al tocar el campo. */
@media (max-width: 40rem) {
  input, select, textarea { font-size: max(16px, 1em); }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
  font-weight: var(--weight-bold);
  color: var(--color-brand);
  overflow-wrap: break-word;
}

/* Los subtítulos y rótulos de interfaz van en la sans, no en la serif. */
h3, h4 { font-family: var(--font-body); }

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-4); }

a { color: var(--color-copper); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-copper-dark); text-decoration: underline; }

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

ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }

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

/* Foco visible: accesibilidad, no adorno. */
:focus-visible {
  outline: 3px solid var(--color-copper);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow { max-width: var(--container-narrow); }

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

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--sidebar { grid-template-columns: 16.25rem 1fr; gap: var(--space-6); }

.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }

/* ---------- Utilidades ---------- */
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-display { font-family: var(--font-display); }
.bold { font-weight: var(--weight-bold); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.full-width { width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Una tabla no respeta height: 1px: sin esto, las tablas escondidas de las gráficas del
   panel (para lectores de pantalla) estiraban la página y dejaban un hueco abajo. */
table.visually-hidden { display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: var(--space-3) var(--space-4);
  background: var(--color-brand);
  color: var(--color-text-inverse);
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

input, select, textarea { font-size: 16px; }



