/* ============================================================
   02 · BASE — Fundamentos y accesibilidad global.
   ============================================================ */

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

html {
	-webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background-color: var(--cm-color-bg);
	color: var(--cm-color-text);
	font-family: var(--cm-font-text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

/* --- Foco visible (WCAG 2.4.7 / 2.4.11) --- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--cm-color-focus);
	outline-offset: 2px;
}

.cm-on-dark :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--cm-color-focus-dark);
}

/* --- Skip link --- */
.cm-skip-link {
	position: absolute;
	top: -100%;
	left: var(--cm-space-16);
	z-index: var(--cm-z-toast);
	padding: var(--cm-space-12) var(--cm-space-16);
	background: var(--wp--preset--color--white);
	color: var(--cm-color-link-hover);
	border-radius: var(--cm-radius-sm);
	box-shadow: var(--cm-shadow-e2);
	font-weight: 600;
	text-decoration: none;
}

.cm-skip-link:focus-visible {
	top: var(--cm-space-16);
}

/* --- Selección --- */
::selection {
	background: var(--wp--preset--color--primary-100);
	color: var(--wp--preset--color--ink-900);
}

/* --- Tablas de datos (fichas/precios futuros) --- */
:where(table) {
	border-collapse: collapse;
	width: 100%;
}

/* --- Reduced motion (doc 03 §5, congelado) --- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
