/* ==========================================================================
   Nártex — estilos globales (cabecera, pie y utilidades).
   Los estilos de cada bloque están en assets/css/blocks/ y los tokens en theme.json.
   ========================================================================== */

:root {
	--nartex-marca: var(--wp--preset--color--marca, #ff5e00);
	--nartex-topbar-h: 44px;
	--nartex-ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; }

/* Cabecera, contenido y pie van pegados: el espaciado lo da cada sección. */
.wp-site-blocks > * + * { margin-block-start: 0; }
.nartex-main .wp-block-post-content > .alignfull { margin-block: 0; }

/* ---------- Cabecera fija: la barra superior se va con el scroll, el menú se queda ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--nartex-topbar-h));
	z-index: 100;
}
@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part { top: calc(-1 * var(--nartex-topbar-h)); }
}

.nartex-topbar {
	box-sizing: border-box;
	min-height: var(--nartex-topbar-h);
	padding-block: 9px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
}
.nartex-topbar p { margin: 0; }
.nartex-topbar__email a { display: inline-flex; align-items: center; gap: 10px; color: var(--wp--preset--color--texto-suave); }
.nartex-topbar__email a:hover { color: var(--wp--preset--color--marca-oscuro); }
.nartex-topbar__email a::before {
	content: "";
	width: 15px; height: 15px;
	background: var(--nartex-marca);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='1.5'/%3E%3Cpath d='m3.5 6 8.5 7 8.5-7'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='1.5'/%3E%3Cpath d='m3.5 6 8.5 7 8.5-7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nartex-header { padding-block: 18px; }
.nartex-header .wp-block-site-logo img { width: 160px; height: auto; }

/* Sombra al desplazarse, sin JavaScript (animaciones ligadas al scroll). */
@supports (animation-timeline: scroll()) {
	.nartex-header {
		animation: nartex-sombra linear both;
		animation-timeline: scroll(root);
		animation-range: 0 90px;
	}
}
@keyframes nartex-sombra { to { box-shadow: 0 1px 6px rgba(0, 0, 0, .12); } }

/* ---------- Pie (footer_middle / footer_buttom) ---------- */
.nartex-footer { padding-block: 80px 70px; text-align: center; }
.nartex-footer__marca { margin: 0 0 18px; font-size: 26px; font-weight: 700; letter-spacing: 10px; text-transform: uppercase; }
.nartex-footer__marca span { color: var(--nartex-marca); }
.nartex-footer .wp-block-site-tagline { margin: 0 0 26px; color: #ddd; }
.nartex-footer-bottom { padding-block: 24px 20px; font-size: 14px; }
.nartex-copyright { margin: 0; color: #ccc; }
.nartex-copyright a { color: var(--nartex-marca); }
.nartex-copyright a:hover { color: #fff; }
.nartex-menu-pie { text-transform: none; font-size: 14px; }
.nartex-menu-pie a { color: #fff; }
.nartex-menu-pie a:hover { color: var(--nartex-marca); }
@media (min-width: 641px) { .nartex-footer-bottom > .alignwide { padding-right: 64px; } }

/* ---------- Botón «volver arriba» ---------- */
.nartex-arriba { position: fixed; right: 26px; bottom: 26px; z-index: 90; margin: 0; }
.nartex-arriba a {
	display: grid; place-items: center;
	width: 42px; height: 42px;
	background: var(--nartex-marca); color: #fff;
	font-size: 22px; line-height: 1;
	transition: background .3s ease;
}
.nartex-arriba a:hover { background: #111; color: #fff; }
@supports (animation-timeline: scroll()) {
	.nartex-arriba {
		animation: nartex-aparece linear both;
		animation-timeline: scroll(root);
		animation-range: 300px 500px;
	}
}
@keyframes nartex-aparece {
	from { opacity: 0; visibility: hidden; transform: translateY(10px); }
	to { opacity: 1; visibility: visible; transform: none; }
}

/* ---------- Datos de contacto ---------- */
.nartex-dato { position: relative; margin: 0; padding: 12px 0 12px 32px; border-bottom: 1px solid #eee; color: var(--wp--preset--color--texto-suave); }
.nartex-dato strong { color: #555; }
.nartex-dato::before {
	content: ""; position: absolute; left: 0; top: 15px;
	width: 20px; height: 20px; background: var(--nartex-marca);
	-webkit-mask: var(--nartex-icono) center / contain no-repeat;
	mask: var(--nartex-icono) center / contain no-repeat;
}
.nartex-dato--lugar { --nartex-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.nartex-dato--email { --nartex-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Crect x='3' y='5' width='18' height='14' rx='1.5'/%3E%3Cpath d='m3.5 6 8.5 7 8.5-7'/%3E%3C/svg%3E"); }
.nartex-dato--redes { --nartex-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E"); }
.nartex-dato + .is-style-nartex-tarjeta { margin-top: 30px; }

/* ---------- Páginas interiores ---------- */
.nartex-contenido { padding-block: var(--wp--preset--spacing--80); }
.nartex-cita { font-size: 22px; font-style: italic; font-weight: 300; color: var(--wp--preset--color--texto-suave); }

/* ---------- 404 ---------- */
.nartex-404 { padding-block: 110px; }
.nartex-404__codigo { margin: 0; font-size: 110px; font-weight: 300; line-height: 1; color: var(--nartex-marca); }

/* ---------- Aparición suave al entrar en pantalla (sin JavaScript) ---------- */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.is-style-nartex-actividad,
		.is-style-nartex-tarjeta,
		.is-style-nartex-guia,
		.is-style-nartex-crema,
		.is-style-nartex-logos {
			animation: nartex-entra linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 35%;
		}
	}
}
@keyframes nartex-entra {
	from { opacity: 0; transform: translateY(28px); }
	to { opacity: 1; transform: none; }
}

/* Separadores dentro del contenido de las páginas */
.nartex-contenido .wp-block-separator { margin-block: var(--wp--preset--spacing--70); border-color: #eee; }
