/* Base: reset corto, tipografía y elementos nativos. */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--alto-cabecera) + var(--espacio-sm));
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body {
	margin: 0;
	background: var(--color-fondo);
	color: var(--color-texto);
	font-family: var(--fuente-texto);
	font-size: var(--texto-base);
	line-height: var(--interlineado-texto);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--color-seleccion);
	color: var(--color-texto);
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--espacio-sm);
	color: var(--color-titulos);
	font-family: var(--fuente-titulos);
	font-weight: var(--peso-titulos);
	line-height: var(--interlineado-titulos);
	letter-spacing: var(--tracking-titulos);
	text-wrap: balance;
}

h1 { font-size: var(--texto-3xl); }
h2 { font-size: var(--texto-2xl); }
h3 { font-size: var(--texto-xl); }
h4 { font-size: var(--texto-lg); }
h5, h6 { font-size: var(--texto-base); }

p, ul, ol, dl, blockquote, figure, table { margin: 0 0 var(--espacio-sm); }
p { text-wrap: pretty; }

a {
	color: var(--color-enlace);
	text-decoration-thickness: var(--borde-fino);
	text-underline-offset: 0.18em;
	transition: color var(--duracion-rapida) var(--curva-estandar);
}
a:hover { color: var(--color-enlace-hover); text-decoration-thickness: var(--borde-medio); }

:focus-visible {
	outline: var(--borde-grueso) solid var(--color-foco);
	outline-offset: var(--borde-medio);
	border-radius: var(--radio-sm);
}

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

strong, b { font-weight: var(--peso-fuerte); }
small { font-size: var(--texto-sm); }

hr {
	border: 0;
	border-top: var(--borde-fino) solid var(--color-borde);
	margin: var(--espacio-lg) 0;
}

blockquote {
	padding-left: var(--espacio-md);
	border-left: var(--borde-grueso) solid var(--color-orquidea);
	color: var(--color-texto-suave);
	font-style: italic;
}

table { width: 100%; border-collapse: collapse; }
th, td {
	padding: var(--espacio-xs) var(--espacio-sm);
	border-bottom: var(--borde-fino) solid var(--color-borde);
	text-align: left;
}
th { font-weight: var(--peso-fuerte); color: var(--color-titulos); }

/* Formularios */
label { display: block; margin-bottom: var(--espacio-3xs); font-weight: var(--peso-fuerte); }

input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"]),
select,
textarea {
	width: 100%;
	min-height: var(--tamano-tactil);
	padding: var(--espacio-xs) var(--espacio-sm);
	border: var(--borde-medio) solid var(--color-borde-control);
	border-radius: var(--radio-md);
	background: var(--color-superficie);
	color: var(--color-texto);
	font: inherit;
	transition: border-color var(--duracion-rapida) var(--curva-estandar);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
	border-color: var(--color-foco);
	outline-offset: 0;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primario); }

button { font: inherit; }

/* Accesibilidad */
.screen-reader-text,
.sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.saltar-contenido {
	position: absolute;
	top: var(--espacio-2xs);
	left: var(--espacio-2xs);
	z-index: var(--capa-menu);
	padding: var(--espacio-xs) var(--espacio-sm);
	background: var(--color-marino);
	color: var(--color-sobre-oscuro);
	border-radius: var(--radio-md);
	transform: translateY(-200%);
}
.saltar-contenido:focus { transform: none; color: var(--color-sobre-oscuro); }
