/**
 * Alquimia — editor de bloques.
 * Se carga en el sitio y dentro del editor, para que se vean igual.
 */

/* ---------- Editor: tipografía y colores del sitio ---------- */
.editor-styles-wrapper {
	background: var(--alq-bg);
	color: var(--alq-text);
	font-family: var(--alq-font-body);
	font-size: var(--alq-font-size);
	line-height: 1.65;
}
.editor-styles-wrapper :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--alq-font-heading);
	color: var(--alq-heading);
	line-height: 1.25;
}
.editor-styles-wrapper a { color: var(--alq-link-text, var(--alq-accent)); }
.editor-styles-wrapper .wp-block-post-title { font-family: var(--alq-font-heading); }

/* ---------- Páginas hechas con bloques ---------- */
.alq-blocks .site-main { overflow-x: clip; }

/* «Lienzo a ancho completo»: el texto suelto se queda en el ancho del sitio;
   lo «ancho completo» llega a los bordes. */
.alq-blocks .is-canvas .entry-content > :where(:not(.alignfull):not(.alignwide)) {
	max-width: var(--alq-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
	box-sizing: content-box;
}
.alq-blocks .is-canvas .entry-content > .alignwide {
	max-width: calc(var(--alq-width) + 240px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
}
.alq-blocks .is-canvas .entry-content > .alignfull {
	width: auto;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}
.alq-blocks .is-canvas .entry-content > :first-child { margin-top: 0; }

/* Secciones a ancho completo una tras otra: sin franja blanca entre ellas. */
.alq-blocks .entry-content > .alignfull { margin-top: 0; margin-bottom: 0; }
.alq-blocks .entry-content > .alignfull + :not(.alignfull) { margin-top: 56px; }
.alq-blocks .entry-content > :not(.alignfull) + .alignfull { margin-top: 56px; }

/* Anclas: que la cabecera fija no tape el inicio de la sección. */
.alq-blocks .site-main [id] { scroll-margin-top: var(--alq-anchor-offset, 0px); }
@media (prefers-reduced-motion: no-preference) {
	html:has(body.alq-blocks) { scroll-behavior: smooth; }
}

/* ---------- Portada (Cover) ---------- */
/* «Pantalla completa» sin el brinco de la barra del navegador en móvil. */
.wp-block-cover[style*="min-height:100vh"] { min-height: 100svh !important; }

/* Paralaje: la imagen es más alta que la sección y el script la desplaza. */
.wp-block-cover.alq-parallax { overflow: hidden; }
.alq-js .wp-block-cover.alq-parallax > .wp-block-cover__image-background,
.alq-js .wp-block-cover.alq-parallax > .wp-block-cover__video-background {
	top: calc(var(--alq-px-extra, 30%) * -1);
	height: calc(100% + var(--alq-px-extra, 30%) * 2);
	will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
	.alq-js .wp-block-cover.alq-parallax > .wp-block-cover__image-background,
	.alq-js .wp-block-cover.alq-parallax > .wp-block-cover__video-background {
		top: 0;
		height: 100%;
		transform: none !important;
	}
}

/* ---------- Aparecer al hacer scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
	.alq-js .alq-reveal {
		opacity: 0;
		transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
	}
	.alq-js .alq-reveal-up { transform: translateY(40px); }
	.alq-js .alq-reveal-left { transform: translateX(-48px); }
	.alq-js .alq-reveal-right { transform: translateX(48px); }
	.alq-js .alq-reveal-zoom { transform: scale(.94); }
	.alq-js .alq-reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Estilos de bloque ---------- */

/* Galería: mosaico sin márgenes */
.wp-block-gallery.is-style-alq-mosaico { gap: 0 !important; }
.wp-block-gallery.is-style-alq-mosaico.has-nested-images figure.wp-block-image {
	margin: 0 !important;
	width: calc(100% / var(--alq-gal-cols, 3)) !important;
	flex-grow: 0 !important;
	aspect-ratio: 4 / 3;
}
.wp-block-gallery.is-style-alq-mosaico.columns-1 { --alq-gal-cols: 1; }
.wp-block-gallery.is-style-alq-mosaico.columns-2 { --alq-gal-cols: 2; }
.wp-block-gallery.is-style-alq-mosaico.columns-4 { --alq-gal-cols: 4; }
.wp-block-gallery.is-style-alq-mosaico.columns-5 { --alq-gal-cols: 5; }
.wp-block-gallery.is-style-alq-mosaico.columns-6 { --alq-gal-cols: 6; }
.wp-block-gallery.is-style-alq-mosaico.columns-7 { --alq-gal-cols: 7; }
.wp-block-gallery.is-style-alq-mosaico.columns-8 { --alq-gal-cols: 8; }
.wp-block-gallery.is-style-alq-mosaico.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease, filter .3s ease;
}
.wp-block-gallery.is-style-alq-mosaico.has-nested-images figure.wp-block-image:hover img { transform: scale(1.04); }

/* Galería: nombres sobre la imagen (personas, secciones) */
.wp-block-gallery.is-style-alq-nombres.has-nested-images figure.wp-block-image { aspect-ratio: 4 / 3; overflow: hidden; }
.wp-block-gallery.is-style-alq-nombres.has-nested-images figure.wp-block-image img { height: 100%; object-fit: cover; filter: brightness(.62); transition: filter .3s ease; }
.wp-block-gallery.is-style-alq-nombres.has-nested-images figure.wp-block-image:hover img { filter: brightness(.45); }
.wp-block-gallery.is-style-alq-nombres.has-nested-images figure.wp-block-image figcaption {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	max-height: none;
	padding: 12px;
	background: none;
	color: #fff;
	font-size: 1rem;
	text-align: center;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
	overflow: visible;
}

/* Columnas sin espacios (tablero de fotos y textos) */
.wp-block-columns.is-style-alq-pegadas { gap: 0 !important; margin-bottom: 0; }
.wp-block-columns.is-style-alq-pegadas + .wp-block-columns.is-style-alq-pegadas { margin-top: 0 !important; }
.wp-block-columns.is-style-alq-pegadas > .wp-block-column {
	margin: 0;
	align-self: stretch !important;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.wp-block-columns.is-style-alq-pegadas > .wp-block-column > .wp-block-image:only-child,
.wp-block-columns.is-style-alq-pegadas > .wp-block-column > .wp-block-cover:only-child { height: 100%; margin: 0; }
.wp-block-columns.is-style-alq-pegadas > .wp-block-column > .wp-block-image:only-child img {
	width: 100%;
	height: 100%;
	min-height: 260px;
	object-fit: cover;
	display: block;
}

/* Título en banda */
.wp-block-heading.is-style-alq-banda {
	padding: .7em 1em;
	background: var(--alq-surface, #f1f1f1);
	text-align: center;
	text-transform: uppercase;
	letter-spacing: .04em;
	font-size: clamp(1.1rem, 1.6vw, 1.45rem);
}

/* Cajas */
.wp-block-group.is-style-alq-caja {
	padding: clamp(24px, 4vw, 44px);
	background: var(--alq-surface, #f4f4f4);
}
.wp-block-group.is-style-alq-caja-oscura {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
	padding: clamp(24px, 4vw, 48px);
	background: rgba(36, 33, 44, .86);
	color: #fff;
}
.wp-block-group.is-style-alq-caja-oscura :where(h1, h2, h3, h4, h5, h6, a) { color: #fff; }

/* Imagen con sombra */
.wp-block-image.is-style-alq-sombra img { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45); }

/* ---------- Detalles de bloques de WordPress con el tema ---------- */
/* Un bloque con color de texto propio (caja oscura, Portada) manda sobre el
   color de títulos y enlaces del tema. */
.has-text-color :where(h1, h2, h3, h4, h5, h6),
.wp-block-cover:not(.is-light) :where(h1, h2, h3, h4, h5, h6) { color: inherit; }
.has-text-color :where(a:not(.wp-block-button__link)),
.wp-block-cover:not(.is-light) :where(a:not(.wp-block-button__link)) { color: inherit; text-decoration: underline; text-underline-offset: .15em; }
.wp-block-media-text.alignfull .wp-block-media-text__content { padding-top: clamp(32px, 5vw, 72px); padding-bottom: clamp(32px, 5vw, 72px); }
.wp-block-cover .wp-block-cover__inner-container > :last-child { margin-bottom: 0; }
.wp-block-alquimia-portafolio { margin-bottom: 1.5em; }

/* Patrones: lista de videos */
.alq-video-row .wp-block-embed { margin: 0; }
