/*
Theme Name: Samay
Theme URI: https://samay.es
Author: Samay · Centro de Desarrollo Integral
Description: Tema de bloques a medida para Samay, Centro de Desarrollo Integral. Incluye las secciones del diseño como patrones insertables, fichas de Equipo y Talleres, y estilos para Contact Form 7. No depende de ningún constructor de páginas.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.2.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: samay
Tags: block-patterns, full-site-editing, custom-colors, editor-style, wide-blocks
*/

/* ---------- Tipografías (incluidas en el tema, sin Google Fonts) ---------- */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("assets/fonts/fraunces.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 700; font-display: swap; src: url("assets/fonts/fraunces-italic.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("assets/fonts/nunito-sans.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: italic; font-weight: 300 800; font-display: swap; src: url("assets/fonts/nunito-sans-italic.woff2") format("woff2"); }

/* ---------- Básicos ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { height: auto; max-width: 100%; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.wp-block-button__link { transition: background-color .2s, transform .2s, color .2s; }
.wp-block-button__link:hover { transform: translateY(-2px); }
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid #DCD4D0; color: var(--wp--preset--color--tinta); background: transparent;
	padding: calc(.85rem - 1.5px) calc(1.7rem - 1.5px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--coral); background: var(--wp--preset--color--coral-fondo);
}
:focus-visible { outline: 2px solid var(--wp--preset--color--morado); outline-offset: 3px; }

/* ---------- Cabecera ---------- */
.samay-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(253,251,248,.97);
	border-bottom: 1px solid rgba(142,118,179,.10);
}
.admin-bar .samay-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .samay-header { top: 46px; } }
.samay-header .wp-block-site-logo img { width: auto; max-height: 56px; }
.samay-header .wp-block-navigation .current-menu-item > a,
.samay-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--coral-intenso); }
.samay-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--crema); padding: 2rem;
}
.samay-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 1.1rem; font-size: 1.15rem; }
@media (max-width: 600px) { .samay-header .samay-header-cta { display: none; } }

/* ---------- Estilos de bloque del tema ---------- */
/* Tarjeta blanca con sombra */
.is-style-tarjeta {
	background: var(--wp--preset--color--blanco);
	border-radius: 26px;
	box-shadow: 0 18px 45px rgba(142,118,179,.12);
	transition: transform .25s;
}
.is-style-tarjeta:hover { transform: translateY(-4px); }
/* Panel de color redondeado (fondos suaves) */
.is-style-panel { border-radius: 26px; }

/* Imagen con forma orgánica */
.wp-block-image.is-style-organica img {
	border-radius: 38% 42% 44% 40% / 46% 42% 46% 42% !important;
	aspect-ratio: 1 / .8; object-fit: cover; width: 100%;
	box-shadow: 0 18px 45px rgba(142,118,179,.14);
}
/* Imagen redondeada con sombra */
.wp-block-image.is-style-sombra img { box-shadow: 0 18px 45px rgba(142,118,179,.14); }

/* Icono circular */
.samay-icono { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; }
.samay-icono.is-small { width: 60px; height: 60px; border-radius: 16px; margin: 0 0 1rem; }
.samay-icono svg { width: 40px; height: 40px; stroke: var(--wp--preset--color--tinta); fill: none; stroke-width: 1.4; }
.samay-icono.is-small svg { width: 28px; height: 28px; stroke-width: 1.5; }
.samay-icono.bg-coral { background: var(--wp--preset--color--coral-fondo); }
.samay-icono.bg-verde { background: var(--wp--preset--color--verde-fondo); }
.samay-icono.bg-morado { background: var(--wp--preset--color--morado-fondo); }
.samay-icono.bg-rosa { background: var(--wp--preset--color--rosa-fondo); }

/* Hoja decorativa */
.samay-hoja { width: 46px; height: auto; display: block; }
.samay-hoja.is-centered { margin-inline: auto; }

/* Puntos decorativos */
.samay-puntos { position: relative; }
.samay-puntos::after {
	content: ""; position: absolute; right: -6px; bottom: -14px; width: 130px; height: 86px; z-index: -1;
	background-image: radial-gradient(var(--wp--preset--color--coral-suave) 2px, transparent 2px);
	background-size: 16px 16px; opacity: .7;
}

/* Pasos con línea discontinua */
.samay-pasos { position: relative; }
.samay-pasos::before {
	content: ""; position: absolute; top: 44px; left: 12%; right: 12%;
	border-top: 2px dashed var(--wp--preset--color--coral-suave); z-index: 0;
}
.samay-pasos > .wp-block-column { position: relative; z-index: 1; }
@media (max-width: 781px) { .samay-pasos::before { display: none; } }

/* Comillas del testimonio */
.samay-comillas { font-family: var(--wp--preset--font-family--titulos); font-size: 4.5rem; line-height: .6; color: var(--wp--preset--color--morado-suave); margin: 0; }
.samay-estrellas { color: var(--wp--preset--color--coral-intenso); letter-spacing: 4px; }

/* Lista con puntos coral */
.is-style-puntos { list-style: none; padding-left: 0; }
.is-style-puntos li { position: relative; padding: .35rem 0 .35rem 1.9rem; }
.is-style-puntos li::before {
	content: ""; position: absolute; left: 0; top: .78rem; width: 14px; height: 14px; border-radius: 50%;
	background: var(--wp--preset--color--coral-suave);
}

/* Galería de espacios */
.samay-galeria .wp-block-image img { aspect-ratio: 1 / 1; object-fit: cover; }
.samay-galeria figcaption { font-weight: 600; color: var(--wp--preset--color--tinta); text-align: left; }

/* Fichas (equipo / talleres) */
.samay-fichas .wp-block-post-featured-image img { border-radius: 18px; aspect-ratio: 4/3; object-fit: cover; }
.samay-fichas .wp-block-post-title a { color: var(--wp--preset--color--tinta); text-decoration: none; }
.samay-fichas .wp-block-post-title a:hover { color: var(--wp--preset--color--coral-intenso); }
.samay-equipo .wp-block-post-featured-image img { aspect-ratio: 1/1; border-radius: 50%; }
.samay-fichas .wp-block-post-template > li, .samay-noticias .wp-block-post-template > li { display: flex; }
.samay-fichas .wp-block-post-template > li > .is-style-tarjeta,
.samay-noticias .wp-block-post-template > li > .is-style-tarjeta { width: 100%; }
.samay-dato { font-size: var(--wp--preset--font-size--pequeno); color: var(--wp--preset--color--coral-intenso); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* Mapa */
.samay-mapa { border-radius: 26px; overflow: hidden; box-shadow: 0 18px 45px rgba(142,118,179,.12); }
.samay-mapa iframe { display: block; width: 100%; height: 360px; border: 0; }

/* Datos de contacto con icono */
.samay-contacto-linea { display: flex; gap: .75rem; align-items: flex-start; }
.samay-contacto-linea svg { width: 22px; height: 22px; stroke: var(--wp--preset--color--coral-intenso); fill: none; stroke-width: 1.6; flex-shrink: 0; margin-top: .2rem; }

/* Etiqueta (píldora sobre los títulos) */
.samay-etiqueta {
	display: table; margin-inline: 0; padding: .35rem .95rem; border-radius: 40px;
	background: var(--wp--preset--color--coral-fondo); color: var(--wp--preset--color--coral-intenso);
	font-size: .76rem !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4;
}
.samay-etiqueta.has-text-align-center { margin-inline: auto !important; }
.has-coral-morado-gradient-background .samay-etiqueta { background: rgba(255,255,255,.65); }
.samay-subtitulo { max-width: 640px; margin-inline: auto !important; }
.samay-hoja-wrap { line-height: 0; }

/* Chips (botones pequeños) */
.samay-chips { gap: .5rem; }
.samay-chips .wp-block-button__link { padding: .45rem 1rem !important; font-size: .85rem; font-weight: 600; background: var(--wp--preset--color--blanco) !important; }
.samay-chips .wp-block-button__link:hover { transform: none; }

/* Inicial redonda (primer contacto) */
.samay-inicial {
	width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
	background: var(--wp--preset--color--blanco); color: var(--wp--preset--color--coral-intenso);
	font-family: var(--wp--preset--font-family--titulos); font-size: 1.8rem;
}

/* Lista numerada «Nuestro proceso» */
.samay-pasos-lista { list-style: none; counter-reset: paso; padding: 0; margin: 0; }
.samay-pasos-lista li { counter-increment: paso; position: relative; padding: .4rem 0 .4rem 2.4rem; color: var(--wp--preset--color--tinta-suave); }
.samay-pasos-lista li::before {
	content: counter(paso); position: absolute; left: 0; top: .35rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
	display: grid; place-items: center; font-size: .82rem; font-weight: 700;
	background: var(--wp--preset--color--morado-fondo); color: var(--wp--preset--color--morado);
}

/* Tarjetas de sala (foto arriba) */
.samay-sala { overflow: hidden; }
.samay-sala .wp-block-image { margin: 0; }
.samay-sala .wp-block-image img { border-radius: 0; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.samay-sala > :not(.wp-block-image) { padding-inline: var(--wp--preset--spacing--40); }

/* Bloque de datos de contacto */
.samay-contacto { display: grid; gap: .55rem; }
.samay-contacto a { color: inherit; text-decoration: none; }
.samay-contacto a:hover { color: var(--wp--preset--color--coral-intenso); }
.samay-contacto-grande { gap: 1.2rem; }
.samay-cta-derecha .samay-contacto { font-weight: 600; color: var(--wp--preset--color--tinta-suave); }
.samay-contacto-grande strong { color: var(--wp--preset--color--tinta); }
.samay-contacto-grande { color: var(--wp--preset--color--tinta-suave); }
.samay-mapa { margin-top: var(--wp--preset--spacing--40); }

/* ---------- Contact Form 7 ---------- */
.wpcf7 form p { margin: 0 0 1.1rem; }
.wpcf7 .wpcf7-form-control-wrap { display: block; }
.wpcf7 label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"],
.wpcf7 select, .wpcf7 textarea {
	width: 100%; box-sizing: border-box; max-width: 100%; padding: .8rem 1rem; border: 1.5px solid #E6DED9; border-radius: 12px;
	font: inherit; color: inherit; background: var(--wp--preset--color--crema); margin-top: .35rem;
}
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus { outline: none; border-color: var(--wp--preset--color--coral); }
.wpcf7 textarea { height: 130px; min-height: 130px; resize: vertical; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; font-size: .88rem; display: flex; gap: .5rem; align-items: flex-start; }
.wpcf7 input[type="submit"] {
	width: 100%; border: 0; cursor: pointer; border-radius: 40px; padding: .95rem 1.7rem;
	background: var(--wp--preset--color--coral); color: var(--wp--preset--color--tinta);
	font: 700 .98rem var(--wp--preset--font-family--texto); transition: background-color .2s;
}
.wpcf7 input[type="submit"]:hover { background: #F5B696; }
.wpcf7 .wpcf7-not-valid-tip { color: #A3341F; font-size: .85rem; }
.wpcf7 form .wpcf7-response-output { border-radius: 12px; margin: 1rem 0 0; padding: .8rem 1rem; }
.samay-aviso-formulario { padding: 1.25rem; border-radius: 16px; background: var(--wp--preset--color--coral-fondo); font-size: .92rem; }

/* ---------- Menú de Samay (Apariencia → Menús) ---------- */
.samay-menu { position: relative; }
.samay-menu ul { list-style: none; margin: 0; padding: 0; }
.samay-menu__lista { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.samay-menu__lista > li { position: relative; display: flex; align-items: center; gap: .15rem; }
.samay-menu a { color: var(--wp--preset--color--tinta-suave); text-decoration: none; font-weight: 600; font-size: .95rem; }
.samay-menu a:hover, .samay-menu .current-menu-item > a, .samay-menu .current-menu-ancestor > a, .samay-menu a[aria-current="page"] { color: var(--wp--preset--color--coral-intenso); }
.samay-menu button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--wp--preset--color--tinta); line-height: 0; }
.samay-menu svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.samay-menu__sub-toggle svg { width: 16px; height: 16px; }
.samay-menu__abrir, .samay-menu__cerrar { display: none; }
.samay-menu .sub-menu {
	position: absolute; top: 100%; left: -1rem; min-width: 230px; z-index: 60; padding: .6rem;
	background: var(--wp--preset--color--blanco); border-radius: 16px; box-shadow: 0 18px 45px rgba(142,118,179,.18);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s;
}
.samay-menu .sub-menu a { display: block; padding: .55rem .8rem; border-radius: 10px; font-weight: 600; }
.samay-menu .sub-menu a:hover { background: var(--wp--preset--color--coral-fondo); }
.samay-menu__lista > li:hover > .sub-menu, .samay-menu__lista > li:focus-within > .sub-menu, .samay-menu__lista > li.is-sub-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.samay-menu__lista > li.is-sub-open .samay-menu__sub-toggle svg { transform: rotate(180deg); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
@media (max-width: 900px) {
	.samay-menu__abrir { display: inline-flex; padding: .4rem; }
	.samay-menu__panel {
		position: fixed; inset: 0; z-index: 100000; background: var(--wp--preset--color--crema);
		padding: 5rem 2rem 2rem; overflow-y: auto; display: none;
	}
	.admin-bar .samay-menu__panel { top: 46px; }
	.samay-menu.is-open .samay-menu__panel { display: block; }
	.samay-menu__cerrar { display: inline-flex; position: absolute; top: 1.4rem; right: 1.4rem; padding: .4rem; }
	.samay-menu__lista { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
	.samay-menu__lista > li { flex-wrap: wrap; width: 100%; }
	.samay-menu a { font-size: 1.25rem; }
	.samay-menu .sub-menu { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: none; width: 100%; padding: .4rem 0 0 1rem; }
	.samay-menu .sub-menu a { font-size: 1.05rem; padding: .35rem 0; }
	.samay-menu__lista > li.is-sub-open > .sub-menu { display: block; }
	html.samay-menu-abierto { overflow: hidden; }
}
.samay-menu-pie__lista { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: var(--wp--preset--font-size--pequeno); }
.samay-menu-pie a { color: var(--wp--preset--color--coral-intenso); text-decoration: none; }
.samay-menu-pie a:hover { text-decoration: underline; }

/* ---------- Compatibilidad con WordPress 6.1 ---------- */
.wp-block-button__link.wp-element-button:hover { background-color: #F5B696; color: var(--wp--preset--color--tinta); }
.wp-block-button.is-style-outline > .wp-block-button__link.wp-element-button:hover { background-color: var(--wp--preset--color--coral-fondo); }
.samay-fichas ul.wp-block-post-template, .samay-noticias ul.wp-block-post-template {
	display: grid; gap: var(--wp--preset--spacing--40); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); list-style: none; padding: 0;
}
.samay-fichas ul.wp-block-post-template > li, .samay-noticias ul.wp-block-post-template > li { margin: 0; }
.samay-equipo ul.wp-block-post-template { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.samay-fichas .wp-block-post-featured-image img, .samay-noticias .wp-block-post-featured-image img { width: 100%; }
.samay-equipo .wp-block-post-featured-image { width: 160px; height: 160px; margin-inline: auto; }
.samay-equipo .wp-block-post-featured-image img { width: 160px; height: 160px; object-fit: cover; }
.samay-taller-imagen img, .samay-entrada-imagen img { aspect-ratio: 16/9; object-fit: cover; width: 100%; border-radius: 22px; }
.samay-retrato img { aspect-ratio: 1/1; object-fit: cover; width: 100%; border-radius: 50%; }

/* ---------- Pie ---------- */
.samay-footer .wp-block-site-logo img { width: auto; max-height: 48px; }
.samay-social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--wp--preset--color--coral-fondo); }
.samay-social svg { width: 18px; height: 18px; fill: var(--wp--preset--color--coral-intenso); }
.samay-footer a { text-decoration: none; }
.samay-footer a:hover { text-decoration: underline; }

/* ---------- Noticias ---------- */
.samay-noticias .wp-block-post-featured-image img { border-radius: 18px; aspect-ratio: 16/10; object-fit: cover; }
.wp-block-query-pagination { gap: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 781px) {
	.samay-apilar-movil.wp-block-columns { flex-direction: column; }
	.samay-cta-derecha { text-align: left !important; }
	.samay-cta-derecha .wp-block-buttons { justify-content: flex-start !important; }
	.samay-cta-derecha .samay-contacto-linea { justify-content: flex-start !important; }
}
