/**
 * Variavista Pillars
 *
 * Sección reutilizable de "valores / pilares / promesas" con glass cards
 * sobre gradient de marca, glifos decorativos y ornamentos gold.
 * Hereda paleta del Customizer del cliente vía CSS variables.
 *
 * BEM:
 *   .vv-pillars                -> contenedor full-bleed (variant default = 3 cards)
 *   .vv-pillars--duo           -> 2 cards centradas (programa / pareja)
 *   .vv-pillars__inner         -> wrapper centrado con max-width
 *   .vv-pillars__kicker        -> kicker uppercase gold sobre el título
 *   .vv-pillars__title         -> h2 principal (em -> gold italic)
 *   .vv-pillars__lede          -> párrafo intro centrado
 *   .vv-pillars__grid          -> grid de pilares
 *   .vv-pillar                 -> card glass individual
 *   .vv-pillar__title          -> h3 card
 *   .vv-pillar__body           -> párrafo card
 *   .vv-pillar__list           -> ul con bullets alquímicos
 *   .vv-pillars__cta           -> card full-width de cierre (CTA)
 *   .vv-pillars__cta-title
 *   .vv-pillars__cta-body
 *
 * Reveal animation se activa cuando <html> tiene la clase `vv-pillars-js`
 * (inyectada en wp_head antes del primer paint). El editor de WP nunca
 * tiene esa clase -> cards visibles en edición.
 *
 * @package Variavista
 * @since   3.52.0
 */

:root {
	--vvp-primary: var(--vv-primary, var(--primary, #7A003F));
	--vvp-primary-dark: var(--vv-primary-dark, #4a0026);
	--vvp-primary-light: var(--vv-primary-light, #922E62);
	--vvp-accent: var(--accent, var(--vv-accent, #C5006B));
	--vvp-gold: var(--vv-secondary, var(--secondary, #D2BF53));
	--vvp-gold-light: var(--vv-secondary-light, #DACB72);
	--vvp-gold-soft: color-mix(in srgb, var(--vvp-gold) 60%, white 40%);
	--vvp-on-dark: rgba(255, 255, 255, 0.92);
	--vvp-on-dark-muted: rgba(255, 255, 255, 0.72);
}

/* -------------------------------------------------------------------------- */
/*  Container — full-bleed con gradient + textura                              */
/* -------------------------------------------------------------------------- */

/*
 * IMPORTANTE: el `background` no debe contener `color-mix()` dentro de
 * un gradient — algunos navegadores invalidan toda la declaración cuando
 * encuentran ese patrón y la sección queda con fondo transparente
 * (texto blanco sobre body blanco -> sección "desaparecida"). Las capas
 * decorativas con tonos derivados van en pseudo-elementos.
 */
.vv-pillars {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	padding: clamp(4rem, 8vw, 7rem) clamp(1.25rem, 4vw, 3rem);
	background-color: var(--vvp-primary-dark);
	background-image: linear-gradient(135deg,
		var(--vvp-primary-dark) 0%,
		var(--vvp-primary) 45%,
		var(--vvp-accent) 100%);
	color: var(--vvp-on-dark);
	overflow: hidden;
	isolation: isolate;
}

/* Pegar la sección al hero / al footer cuando es el primer/último bloque
 * de la página. El wrapper de `.entry-content` aplica `py-12 md:py-20`
 * (3rem en mobile, 5rem en md+); igualamos exactamente con margin negativo
 * para que el gradient toque el bloque adyacente sin franja blanca. */
.vv-pillars:first-child { margin-top: -5rem; }
.vv-pillars:last-child  { margin-bottom: -5rem; }

/* Cuando la sección es el último bloque y debajo viene un footer
 * (location billboard, etc.), eliminamos el padding inferior para que
 * el CTA / la última card pegue contra el borde inferior de la sección
 * y la siguiente sección (mapa, etc.) no muestre franja de gradient
 * vacío entre ambos. */
.vv-pillars:last-child {
	padding-bottom: 0;
}

@media (max-width: 767.98px) {
	.vv-pillars:first-child { margin-top: -3rem; }
	.vv-pillars:last-child  { margin-bottom: -3rem; }
}

/* Glows superiores e inferiores — capa propia para no romper el gradient. */
.vv-pillars::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 55%),
		radial-gradient(80% 60% at 0% 100%, rgba(210, 191, 83, 0.14) 0%, transparent 60%);
	pointer-events: none;
	z-index: 0;
}

/* Textura sutil de puntitos con mask vertical para fade arriba/abajo. */
.vv-pillars::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
	background-size: 28px 28px;
	-webkit-mask-image: linear-gradient(180deg, transparent, black 25%, black 75%, transparent);
	mask-image: linear-gradient(180deg, transparent, black 25%, black 75%, transparent);
	pointer-events: none;
	z-index: 0;
}

.vv-pillars__inner {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	margin: 0 auto;
}

.vv-pillars__inner > .wp-block-group__inner-container,
.vv-pillars__inner:not(:has(> .wp-block-group__inner-container)) {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(1rem, 2.4vw, 1.75rem);
}

/* -------------------------------------------------------------------------- */
/*  Encabezado de la sección                                                   */
/* -------------------------------------------------------------------------- */

/*
 * `!important` necesario en los colores: el theme inyecta un sistema WCAG
 * inline (`<style id="variavista-adaptive-wcag">`) que aplica
 * `.bg-white h2 { color: #1a1a1a !important }` globalmente. Como esta
 * sección es full-bleed con fondo oscuro propio, sus textos blancos /
 * gold deben vencer al WCAG sin necesidad de tocar el generador global.
 */
.vv-pillars .vv-pillars__kicker,
.vv-pillars p.vv-pillars__kicker {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--vvp-gold) !important;
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
}

.vv-pillars__kicker::before,
.vv-pillars__kicker::after {
	content: "";
	width: 28px;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--vvp-gold), transparent);
}

.vv-pillars .vv-pillars__title,
.vv-pillars h2.vv-pillars__title {
	margin: 0;
	max-width: 22ch;
	text-align: center;
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: #ffffff !important;
}

.vv-pillars .vv-pillars__title em,
.vv-pillars h2.vv-pillars__title em {
	font-style: italic;
	font-weight: 500;
	background: linear-gradient(135deg, var(--vvp-gold) 0%, var(--vvp-gold-light) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	/* Italic slant overflows the glyph advance; compensate with right padding so
	   background-clip:text doesn't crop the rightmost letter (e.g. "Consciente"). */
	display: inline-block;
	padding-right: 0.12em;
}

.vv-pillars .vv-pillars__lede,
.vv-pillars p.vv-pillars__lede {
	margin: 0;
	max-width: 60ch;
	text-align: center;
	font-size: clamp(1rem, 1.4vw, 1.125rem);
	line-height: 1.65;
	color: var(--vvp-on-dark-muted) !important;
}

/* -------------------------------------------------------------------------- */
/*  Grid de cards                                                              */
/* -------------------------------------------------------------------------- */

/*
 * El grid vive en el inner-container que WordPress inyecta dentro del
 * wp:group con layout=default. La clase `.vv-pillars__grid` está en el
 * wrapper externo; sus hijos reales son `.wp-block-group__inner-container`
 * y dentro de ese están las cards.
 */
.vv-pillars__grid {
	width: 100%;
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.vv-pillars__grid > .wp-block-group__inner-container,
.vv-pillars__grid:not(:has(> .wp-block-group__inner-container)) {
	display: grid;
	gap: clamp(1rem, 2vw, 1.75rem);
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vv-pillars--duo .vv-pillars__grid > .wp-block-group__inner-container,
.vv-pillars--duo .vv-pillars__grid:not(:has(> .wp-block-group__inner-container)) {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 920px;
	margin-left: auto;
	margin-right: auto;
}

@media (max-width: 900px) {
	.vv-pillars__grid > .wp-block-group__inner-container,
	.vv-pillars--duo .vv-pillars__grid > .wp-block-group__inner-container,
	.vv-pillars__grid:not(:has(> .wp-block-group__inner-container)),
	.vv-pillars--duo .vv-pillars__grid:not(:has(> .wp-block-group__inner-container)) {
		grid-template-columns: 1fr;
		max-width: 560px;
	}
}

/* -------------------------------------------------------------------------- */
/*  Card glass                                                                 */
/* -------------------------------------------------------------------------- */

.vv-pillar {
	position: relative;
	padding: clamp(1.75rem, 2.6vw, 2.5rem);
	border-radius: 1.5rem;
	background:
		linear-gradient(180deg,
			rgba(255, 255, 255, 0.10) 0%,
			rgba(255, 255, 255, 0.04) 100%);
	border: 1px solid rgba(255, 255, 255, 0.18);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	backdrop-filter: blur(20px) saturate(140%);
	box-shadow:
		0 1px 0 0 rgba(255, 255, 255, 0.12) inset,
		0 24px 60px -32px rgba(0, 0, 0, 0.55);
	transition:
		transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
		box-shadow 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
		border-color 0.4s ease;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	overflow: hidden;
}

.vv-pillar > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.vv-pillar::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(135deg,
		color-mix(in srgb, var(--vvp-gold) 55%, transparent) 0%,
		transparent 40%,
		transparent 60%,
		color-mix(in srgb, var(--vvp-gold) 25%, transparent) 100%);
	-webkit-mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	opacity: 0.6;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.vv-pillar:hover {
	transform: translateY(-4px);
	border-color: rgba(255, 255, 255, 0.28);
	box-shadow:
		0 1px 0 0 rgba(255, 255, 255, 0.18) inset,
		0 32px 80px -28px rgba(0, 0, 0, 0.6);
}

.vv-pillar:hover::before {
	opacity: 1;
}

/* -------------------------------------------------------------------------- */
/*  Glifos alquímicos                                                          */
/* -------------------------------------------------------------------------- */

.vv-pillar::after {
	content: "";
	position: relative;
	z-index: 1;
	width: 56px;
	height: 56px;
	background-image: var(--vv-pillar-glyph, none);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.9;
	margin-bottom: 0.25rem;
	order: -1;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.vv-pillar:nth-child(1) {
	--vv-pillar-glyph: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23D2BF53' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M32 8 L56 52 L8 52 Z'/><circle cx='32' cy='40' r='5' opacity='0.85'/><line x1='8' y1='52' x2='56' y2='52' opacity='0.6'/></svg>");
}

.vv-pillar:nth-child(2) {
	--vv-pillar-glyph: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23D2BF53' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M32 32 m-2 0 a2 2 0 1 1 4 0 a4 4 0 1 1 -8 0 a6 6 0 1 1 12 0 a8 8 0 1 1 -16 0 a10 10 0 1 1 20 0 a12 12 0 1 1 -24 0 a14 14 0 1 1 28 0' /></svg>");
}

.vv-pillar:nth-child(3) {
	--vv-pillar-glyph: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23D2BF53' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='32' cy='32' r='20'/><path d='M32 12 c10 0 18 8 18 20 c0 10 -7 18 -16 18 c-7 0 -12 -5 -12 -10 c0 -3 2 -6 6 -6 c2 0 4 1 4 3' /><path d='M48 22 L52 12 L42 16 Z' fill='%23D2BF53' fill-opacity='0.6'/></svg>");
}

/* Pillar text */

.vv-pillars .vv-pillar__title,
.vv-pillars h3.vv-pillar__title {
	margin: 0;
	font-size: clamp(1.25rem, 1.8vw, 1.5rem);
	font-weight: 600;
	line-height: 1.25;
	color: #ffffff !important;
	letter-spacing: -0.005em;
}

.vv-pillars .vv-pillar__body,
.vv-pillars p.vv-pillar__body {
	margin: 0;
	font-size: 1rem;
	line-height: 1.7;
	color: var(--vvp-on-dark-muted) !important;
}

.vv-pillars .vv-pillar__body em,
.vv-pillars .vv-pillar__body strong em {
	font-style: italic;
	color: var(--vvp-gold-soft) !important;
	font-weight: 500;
}

.vv-pillars .vv-pillar__list,
.vv-pillars ul.vv-pillar__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	color: var(--vvp-on-dark-muted) !important;
	font-size: 1rem;
	line-height: 1.6;
}

.vv-pillars .vv-pillar__list li {
	position: relative;
	padding-left: 1.6rem;
	color: var(--vvp-on-dark-muted) !important;
}

.vv-pillars .vv-pillar__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--vvp-gold) 0%, var(--vvp-gold-light) 100%);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--vvp-gold) 18%, transparent);
}

.vv-pillars .vv-pillar__list li em {
	font-style: italic;
	color: var(--vvp-gold-soft) !important;
}

/* -------------------------------------------------------------------------- */
/*  CTA card (cierre — full grid width)                                        */
/* -------------------------------------------------------------------------- */

.vv-pillars__cta {
	width: 100%;
	max-width: 920px;
	margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
	padding: clamp(1.75rem, 3vw, 2.75rem);
	border-radius: 1.5rem;
	border: 1px solid color-mix(in srgb, var(--vvp-gold) 45%, transparent);
	background:
		linear-gradient(180deg,
			rgba(255, 255, 255, 0.08) 0%,
			rgba(255, 255, 255, 0.02) 100%);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	backdrop-filter: blur(20px) saturate(140%);
	text-align: center;
	box-shadow:
		0 1px 0 0 rgba(255, 255, 255, 0.10) inset,
		0 24px 60px -32px rgba(0, 0, 0, 0.55);
}

.vv-pillars__cta > .wp-block-group__inner-container,
.vv-pillars__cta:not(:has(> .wp-block-group__inner-container)) {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.vv-pillars .vv-pillars__cta-title,
.vv-pillars h3.vv-pillars__cta-title {
	margin: 0;
	font-size: clamp(1.4rem, 2.2vw, 1.75rem);
	font-weight: 600;
	color: #ffffff !important;
	letter-spacing: -0.005em;
}

.vv-pillars .vv-pillars__cta-body,
.vv-pillars p.vv-pillars__cta-body {
	margin: 0;
	max-width: 56ch;
	font-size: 1rem;
	line-height: 1.65;
	color: var(--vvp-on-dark-muted) !important;
}

/* Outline gold button — sólo dentro de .vv-pillars__cta */

.vv-pillars__cta .wp-block-button .wp-block-button__link,
.vv-pillars__cta .wp-block-button__link.wp-element-button {
	background: transparent;
	color: var(--vvp-gold);
	border: 1px solid var(--vvp-gold);
	padding: 0.85rem 1.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.vv-pillars__cta .wp-block-button .wp-block-button__link:hover,
.vv-pillars__cta .wp-block-button__link.wp-element-button:hover {
	background: var(--vvp-gold);
	color: var(--vvp-primary-dark);
	transform: translateY(-1px);
}

/* -------------------------------------------------------------------------- */
/*  Reveal animation                                                           */
/*  Sólo se aplica si <html> tiene `vv-pillars-js` (inyectado en wp_head).     */
/*  El editor nunca tiene esa clase -> cards visibles al editar.               */
/* -------------------------------------------------------------------------- */

html.vv-pillars-js .vv-pillars__kicker,
html.vv-pillars-js .vv-pillars__title,
html.vv-pillars-js .vv-pillars__lede,
html.vv-pillars-js .vv-pillar,
html.vv-pillars-js .vv-pillars__cta {
	opacity: 0;
	transform: translateY(28px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

html.vv-pillars-js .vv-pillars.is-revealed .vv-pillars__kicker,
html.vv-pillars-js .vv-pillars.is-revealed .vv-pillars__title,
html.vv-pillars-js .vv-pillars.is-revealed .vv-pillars__lede {
	opacity: 1;
	transform: translateY(0);
}

html.vv-pillars-js .vv-pillars.is-revealed .vv-pillars__title { transition-delay: 0.08s; }
html.vv-pillars-js .vv-pillars.is-revealed .vv-pillars__lede  { transition-delay: 0.16s; }

html.vv-pillars-js .vv-pillars.is-revealed .vv-pillar {
	opacity: 1;
	transform: translateY(0);
}

html.vv-pillars-js .vv-pillars.is-revealed .vv-pillar:nth-child(1) { transition-delay: 0.24s; }
html.vv-pillars-js .vv-pillars.is-revealed .vv-pillar:nth-child(2) { transition-delay: 0.34s; }
html.vv-pillars-js .vv-pillars.is-revealed .vv-pillar:nth-child(3) { transition-delay: 0.44s; }

html.vv-pillars-js .vv-pillars.is-revealed .vv-pillars__cta {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.5s;
}

@media (prefers-reduced-motion: reduce) {
	html.vv-pillars-js .vv-pillars__kicker,
	html.vv-pillars-js .vv-pillars__title,
	html.vv-pillars-js .vv-pillars__lede,
	html.vv-pillars-js .vv-pillar,
	html.vv-pillars-js .vv-pillars__cta {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* -------------------------------------------------------------------------- */
/*  Reset de colores heredados de wrappers como .entry-content.prose           */
/*  o .wp-block-post-content. Especificidad (0,2,0) para vencer a Tailwind     */
/*  Typography (`.prose :where(h2)` = (0,1,0)).                                */
/* -------------------------------------------------------------------------- */

.vv-pillars .wp-block-group,
.vv-pillars .wp-block-heading,
.vv-pillars h1,
.vv-pillars h2,
.vv-pillars h3,
.vv-pillars h4,
.vv-pillars h5,
.vv-pillars h6,
.vv-pillars p,
.vv-pillars ul,
.vv-pillars ol,
.vv-pillars li,
.vv-pillars strong,
.vv-pillars em {
	color: inherit;
}

.vv-pillars a:not(.wp-block-button__link) {
	color: var(--vvp-gold);
	text-decoration-color: color-mix(in srgb, var(--vvp-gold) 50%, transparent);
}

.vv-pillars a:not(.wp-block-button__link):hover {
	color: var(--vvp-gold-light);
}
