/* =========================================================
   Tema Taboga — estilos que solo se aplican al sitio público
   (en el editor el carrusel se muestra como galería editable).
   ========================================================= */

html { scroll-behavior: smooth; scroll-padding-top: 100px; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.taboga-principal { margin-block: 0; }
.taboga-portada > * + * { margin-block-start: 0; }

/* Encabezado fijo al desplazarse */
.taboga-parte-cabecera {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
}
@media (max-width: 600px) {
	.admin-bar .taboga-parte-cabecera { top: 0; }
}

/* El menú pasa al botón «Menú» por debajo de 1060 px de ancho */
@media (min-width: 600px) and (max-width: 1059px) {
	.taboga-menu .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.taboga-menu .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* ---------- Carrusel ---------- */
.taboga-carrusel {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: clamp(420px, 62vh, 620px);
	overflow: hidden;
	padding-top: 3rem;
	padding-bottom: 0;
}
.taboga-carrusel::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 45% 40% at 100% 0%, rgba(8, 30, 20, .5), rgba(8, 30, 20, 0)),
		linear-gradient(90deg, rgba(8, 30, 20, .55) 0%, rgba(8, 30, 20, 0) 65%),
		linear-gradient(180deg, rgba(8, 30, 20, 0) 25%, rgba(8, 30, 20, .8) 100%);
}
.taboga-carrusel.sin-fotos::after { background: radial-gradient(circle at 85% 20%, rgba(127, 168, 74, .35), transparent 55%); }

.taboga-carrusel .wp-block-gallery {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0 !important;
	gap: 0 !important;
	flex-wrap: nowrap !important;
	transition: transform .9s ease;
}
.taboga-carrusel .wp-block-gallery.has-nested-images figure.wp-block-image:not(#taboga) {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 0;
}
.taboga-carrusel .wp-block-gallery.has-nested-images figure.wp-block-image:not(#taboga) img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
.taboga-carrusel .wp-block-gallery figcaption { display: none; }
.taboga-carrusel.sin-fotos .wp-block-gallery { display: none; }

.taboga-carrusel__texto {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1180px);
	margin-inline: auto !important;
	padding-bottom: 5.5rem;
}

.taboga-carrusel__controles {
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	bottom: 1.25rem;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	/* alineados con el borde derecho del contenido */
	max-width: var(--wp--style--global--wide-size, 1180px);
	margin-inline: auto !important;
	padding-inline: var(--wp--style--root--padding-right, 1.5rem);
	gap: .5rem;
	margin: 0 !important;
}
.taboga-carrusel__boton {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .5);
	background: rgba(0, 0, 0, .25);
	color: #fff;
	cursor: pointer;
	padding: 0;
}
.taboga-carrusel__boton:hover { background: rgba(0, 0, 0, .5); }
.taboga-carrusel__boton svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.taboga-carrusel__boton .lleno { fill: currentColor; stroke: none; }
.taboga-carrusel__boton .ico-reanudar { display: none; }
.taboga-carrusel__boton[aria-pressed="true"] .ico-reanudar { display: block; }
.taboga-carrusel__boton[aria-pressed="true"] .ico-pausa { display: none; }

@media (prefers-reduced-motion: reduce) {
	.taboga-carrusel .wp-block-gallery { transition: none; }
}

/* Un carrusel dentro de otro (bloque duplicado o movido en el editor):
   el de adentro se vuelve transparente y el de afuera ocupa todo el ancho. */
.taboga-carrusel .taboga-carrusel {
	position: static;
	display: contents;
	padding: 0;
	margin: 0;
	background: none;
	min-height: 0;
}
.taboga-carrusel .taboga-carrusel::after { content: none; }

/* ---------- Buscador en el carrusel: esquina superior derecha ---------- */
.taboga-carrusel .taboga-buscador {
	position: absolute;
	z-index: 3;
	top: 1.5rem;
	right: max(var(--wp--style--root--padding-right, 1.5rem), calc((100% - var(--wp--style--global--wide-size, 1180px)) / 2 + var(--wp--style--root--padding-right, 1.5rem)));
	width: min(300px, calc(100% - 2 * var(--wp--style--root--padding-right, 1rem)));
	margin: 0 !important;
}

/* ---------- Celulares (hasta 781 px) ---------- */
@media (max-width: 781px) {
	/* El carrusel deja lugar arriba para el buscador */
	.taboga-carrusel { padding-top: 5.25rem; }
	.taboga-carrusel__texto { padding-bottom: 4.25rem; }

	/* Buscador: todo el ancho, arriba */
	.taboga-carrusel .taboga-buscador {
		top: 1rem;
		left: var(--wp--style--root--padding-left, 1rem);
		right: var(--wp--style--root--padding-right, 1rem);
		width: auto;
	}

	/* Controles más chicos, abajo a la derecha */
	.taboga-carrusel__controles { bottom: .9rem; gap: .4rem; }
	.taboga-carrusel__boton { width: 36px; height: 36px; }
	.taboga-carrusel__boton svg { width: 16px; height: 16px; }
}

/* Las fotos del carrusel no responden al clic (el deslizamiento sigue activo) */
.taboga-carrusel .wp-block-gallery figure.wp-block-image { pointer-events: none; cursor: default; }
.taboga-carrusel .wp-block-gallery .lightbox-trigger { display: none; }
