/*
 * SeaPod — estilos base del front-end.
 * Solo lo que theme.json no puede expresar: accesibilidad y comportamiento.
 * No definir colores nuevos aquí: usar los tokens de theme.json.
 */

.seapod-skip-link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background-color: var(--wp--preset--color--abyss);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.seapod-skip-link:focus {
	clip: auto !important;
	clip-path: none;
	height: auto;
	width: auto;
	overflow: visible;
	outline: 2px solid var(--wp--preset--color--coral);
	outline-offset: 2px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--coral);
	outline-offset: 2px;
}

/*
 * Cabecera limpia por defecto: sin border-bottom ni box-shadow.
 * La línea divisoria era una decoración automática no solicitada (0.4.x bugfix).
 * focus-visible NO se toca aquí: se mantiene en los elementos interactivos.
 *
 * 0.4.1 — Sticky:
 * el sticky ya NO es incondicional. Se activa con la clase `seapod-has-sticky-header`
 * que añade core/header-settings.php cuando el toggle está ON, y se aplica al
 * contenedor del template part (`.seapod-header-wrap`), que es hijo directo de
 * `.wp-site-blocks`. Fijar solo el <header> interior no funcionaba porque su
 * contenedor se desplazaba con el scroll.
 */
.seapod-header {
	position: relative;
}

body.seapod-has-sticky-header .seapod-header-wrap,
body.seapod-has-sticky-header > .wp-site-blocks > .seapod-header-wrap {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--background);
	backdrop-filter: saturate(1.2) blur(8px);
}

/* La barra de administración no debe tapar la cabecera fija. */
body.admin-bar.seapod-has-sticky-header .seapod-header-wrap {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar.seapod-has-sticky-header .seapod-header-wrap {
		top: 46px;
	}
}

/*
 * position: sticky deja de funcionar si algún ancestro crea un contexto de
 * scroll o de transformación. Estos ancestros deben permanecer neutros.
 */
body.seapod-has-sticky-header .wp-site-blocks,
body.seapod-has-sticky-header .wp-site-blocks > * {
	overflow: visible;
	transform: none;
	filter: none;
	contain: none;
}


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

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
