/* TuMampara — ajustes de WordPress sobre el CSS del front (front.css). */

/* WordPress no debe añadir márgenes ni anchos propios: el diseño lo marcan las clases del front. */
/* Con :where() la especificidad es 0: las clases del diseño (mt-3, mb-4…) siempre ganan. */
:where(.wp-site-blocks) > * + * { margin-block-start: 0; }
:where(.wp-block-post-content) > * { margin-block: 0; }
:where(.is-layout-flow, .is-layout-constrained) > * + * { margin-block-start: 0; }
:where(.wp-block-group) { box-sizing: border-box; }

/* Enlaces del front */
.topbar-links a:hover, .footer-list a:hover, .legal-links a:hover { color: var(--wp--preset--color--accent); }
.footer-list a, .legal-links a { opacity: .8; }
.footer-list a:hover, .legal-links a:hover { opacity: 1; }
.site-logo a { color: inherit; }

/* Navegación (bloque core/navigation) con el aspecto del front */
.site-nav { display: none; }
@media (min-width: 64rem) { .site-nav { display: flex; } }
.site-nav .wp-block-navigation__container { gap: 1.75rem; }
.site-nav .wp-block-navigation-item__content { font-size: .875rem; font-weight: 500; color: rgb(16 28 40 / .8); transition: color .15s; }
.site-nav .wp-block-navigation-item__content:hover,
.site-nav .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--accent); }
@media (max-width: 63.99rem) {
	.site-nav { display: flex; }
	.site-nav .wp-block-navigation__responsive-container-open { width: 2.5rem; height: 2.5rem; border: 1px solid var(--wp--preset--color--border); border-radius: .125rem; display: inline-flex; align-items: center; justify-content: center; }
	.site-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem 1.25rem; }
	.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.125rem; padding: .5rem 0; }
}
.header-cta { margin: 0; }

/* Aparición al hacer scroll (equivale al componente Reveal del front) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.reveal-in { opacity: 1; transform: none; }
.editor-styles-wrapper .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Imágenes de bloque sin márgenes de WordPress */
.wp-block-image { margin: 0; }
.wp-block-image img { display: block; }

/* Botón de llamada de la cabecera: color e icono de teléfono (equivale al icono lucide del front) */
.header-cta a { color: var(--wp--preset--color--accent-foreground); }
.header-cta a::before {
	content: ""; width: 1rem; height: 1rem; flex: none; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384'/%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='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Imágenes importadas del front: las clases de tamaño/proporción quedan en <figure>; la imagen la rellena. */
.wp-block-image.img-front { overflow: hidden; }
.wp-block-image.img-front img { width: 100%; height: 100%; object-fit: cover; }
.wp-block-image.img-front.object-contain img { object-fit: contain; }

/* Tarjetas-enlace: toda la tarjeta es clicable a través del enlace del título (patrón «stretched link»). */
.card-link { position: relative; }
.card-link .card-link__a { color: inherit; }
.card-link .card-link__a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-within { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* Preguntas frecuentes (bloque Detalles) con el estilo del front: summary «text-lg font-semibold», sin marcador. */
.wp-block-details > summary { cursor: pointer; list-style: none; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; color: var(--wp--preset--color--foreground); }
.wp-block-details > summary::-webkit-details-marker { display: none; }
.wp-block-details > summary::marker { content: none; }
.wp-block-details[open] > summary .group-open\:rotate-45 { transform: rotate(45deg); }

/* Mkt360 Cookies: su paleta usa los nombres base/contrast/muted(texto)/on-primary; aquí «muted» es un fondo claro. */
:root:root {
	--m360c-bg: var(--wp--preset--color--background);
	--m360c-fg: var(--wp--preset--color--foreground);
	--m360c-muted: var(--wp--preset--color--muted-foreground);
	--m360c-on-accent: var(--wp--preset--color--primary-foreground);
	--m360c-font: var(--wp--preset--font-family--sans);
}
