/* =================================================================
   Sección de Texto

   Modifiers:
     .text-section--layout-{centered|split|large|list}
     .text-section--bg-{default|light|primary}
     .text-section--py-{sm|md|lg}
     .text-section--width-{narrow|normal|wide}  (only affects centered)
   ================================================================= */

/* =================================================================
   Base
   ================================================================= */

.text-section {
	position: relative;
	margin-block-start: 0 !important;
	padding-block: 100px !important;
}

.text-section__inner {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.text-section--py-sm {
	padding-block: 2rem;
}
.text-section--py-md {
	padding: 50px 0 0;
}
.text-section--py-lg {
	padding-block: 4rem;
}

.text-section--bg-default {
	background-color: var(--wp--preset--color--bg);
}
.text-section--bg-light {
	background-color: var(--wp--preset--color--bg-secondary);
}
.text-section--bg-primary {
	background-color: var(--wp--preset--color--primary);
}

/* =================================================================
   Shared typography
   ================================================================= */

.text-section__tagline {
	margin: 0;
	font-size: var(--wp--preset--font-size--22);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--text-muted);
}

.text-section__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--30);
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
	color: var(--wp--preset--color--primary);
}

.text-section .text-section__heading {
	margin-bottom: 20px;
	text-transform: initial;
}

.text-section__body {
	margin: 0;
	color: var(--wp--preset--color--text);
	line-height: var(--lh-relaxed);
}

.text-section__body p {
	margin: 0 0 0.75em;
}

.text-section__body p:last-child {
	margin-bottom: 0;
}

.text-section__body--lead {
	font-size: 1.125rem;
}

/* =================================================================
   CTA button
   ================================================================= */

.text-section__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	/* align-self: flex-start; */
	margin-top: 0.5rem;
}

/* =================================================================
   Layout: centered (default)
   ================================================================= */

.text-section--layout-centered .text-section__inner {
	max-width: 45rem;
	margin-inline: auto;
}

@media (min-width: 48rem) {
	.text-section--layout-centered .text-section__inner {
		align-items: center;
		text-align: center;
	}

	/* El contenedor sigue centrado en la página (margin-inline:auto, sin
	   tocar) — esto solo alinea el texto DENTRO de él a la izquierda. */
	.text-section--layout-centered.text-section--content-align-left .text-section__inner {
		align-items: flex-start;
		text-align: left;
	}
}

.text-section--layout-centered .text-section__body {
	max-width: 60ch;
}

/* =================================================================
   Layout: split (editorial)
   Mobile: stacked. Tablet+: tagline/heading left, body right.
   ================================================================= */

.text-section--layout-split .text-section__inner {
	gap: 1.5rem;
}

.text-section--layout-split .text-section__split-header {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.text-section--layout-split .text-section__body {
	max-width: 100%;
}

/* =================================================================
   Layout: large (heading as graphic element)
   ================================================================= */

.text-section--layout-large .text-section__inner {
	gap: 1.5rem;
}

.text-section--layout-large .text-section__heading {
	font-size: clamp(2.5rem, 7vw, 5rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	font-weight: 600;
	max-width: 18ch;
	text-transform: none;
}

/* =================================================================
   Layout: list (features)
   ================================================================= */

.text-section--layout-list .text-section__inner {
	max-width: 56rem;
	margin-inline: auto;
	gap: 1.5rem;
}

/* El navegador (scroll anchoring) intenta compensar el scroll solo cuando
   el contenido de arriba cambia de alto, para evitar saltos — pero aquí
   el alto SÍ cambia a propósito (al abrir/cerrar un ítem del acordeón) y
   esa compensación automática pelea con el control propio de script.js,
   provocando que la página derive a un punto impredecible según cuánto
   texto tenga el ítem. Se desactiva en todo el bloque. */
.text-section--layout-list {
	overflow-anchor: none;
}

.text-section--layout-list .text-section__heading {
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
	text-transform: none;
}

.text-section--layout-list .text-section__list {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
}


.text-section--layout-list .text-section__list-heading {
	margin: 0;
}

.text-section--layout-list .text-section__list-trigger {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	padding: 1.125rem 0;
	border: 0;
	background: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
}

.text-section--layout-list .text-section__list-icon {
	flex-shrink: 0;
	width: 2.25rem;
	height: 2.25rem;
	display: grid;
	place-items: center;
	border-radius: var(--wp--custom--radius--2, 0.25rem);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-size: 1rem;
	line-height: 1;
}

.text-section--layout-list .text-section__list-title {
	position: relative;
	flex: 1;
	padding-left: 2.5rem;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--text-heading);
}
/* Viñeta — los ítems de esta migración no traen icono propio (el
   contenido real no tenía descripción por ítem, solo el título). */
.text-section--layout-list .text-section__list-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1px;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary);
}

/* Ítem cerrado: viñeta y texto atenuados, para que el abierto destaque. */
.text-section--layout-list .text-section__list-item:not(.is-open) .text-section__list-title {
	color: rgba(41, 40, 45, 0.25);
}

.text-section--layout-list .text-section__list-item:not(.is-open) .text-section__list-title::before {
	background-color: rgba(41, 40, 45, 0.25);
}

.text-section--layout-list .text-section__list-chevron {
	flex-shrink: 0;
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2px solid var(--wp--preset--color--text-muted);
	border-bottom: 2px solid var(--wp--preset--color--text-muted);
	transform: rotate(45deg);
	transition: transform var(--wp--custom--motion--duration--base, 200ms) var(--wp--custom--motion--easing--standard, ease);
}

/* Con navegación por scroll, el avance es automático — el chevron (pensado
   para el acordeón de click) sobra y confunde. */
.text-section--layout-list .text-section__list[data-wheel-nav="1"] .text-section__list-chevron {
	display: none;
}

.text-section--layout-list .text-section__list-item.is-open .text-section__list-chevron {
	transform: rotate(-135deg);
}

/* Panel colapsable — grid-template-rows 0fr→1fr anima hacia una altura
   desconocida sin medir en JS; el contenido real puede llegar más tarde
   (hoy la mayoría de los ítems migrados no trae texto propio, solo título). */
.text-section--layout-list .text-section__list-panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--wp--custom--motion--duration--base, 200ms) var(--wp--custom--motion--easing--standard, ease);
	border-left: solid 1px black;
	margin-left: 10px;
}

.text-section--layout-list .text-section__list-item.is-open .text-section__list-panel {
	grid-template-rows: 1fr;
}

.text-section--layout-list .text-section__list-panel-inner {
	overflow: hidden;
}

.text-section--layout-list .text-section__list-body {
	margin: 0 0 1.125rem;
	padding-left: 2rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--wp--preset--color--text);
}

@media (prefers-reduced-motion: reduce) {
	.text-section--layout-list .text-section__list-chevron,
	.text-section--layout-list .text-section__list-panel {
		transition: none;
	}
}

/* =================================================================
   Content width overrides (centered layout only)
   Normal = layout default (45rem / 60ch body).
   ================================================================= */

.text-section--width-narrow.text-section--layout-centered .text-section__inner {
	max-width: 34rem;
}

.text-section--width-narrow.text-section--layout-centered .text-section__body {
	max-width: 48ch;
}

.text-section--width-wide.text-section--layout-centered .text-section__inner {
	max-width: 60rem;
}

.text-section--width-wide.text-section--layout-centered .text-section__body {
	max-width: 80ch;
}

/* =================================================================
   BG primary overrides — white text on primary background
   ================================================================= */

.text-section--bg-primary .text-section__tagline {
	color: rgba(255, 255, 255, 0.75);
}

.text-section--bg-primary .text-section__heading {
	color: var(--wp--preset--color--white);
}

.text-section--bg-primary .text-section__body,
.text-section--bg-primary .text-section__list-title,
.text-section--bg-primary .text-section__list-body {
	color: rgba(255, 255, 255, 0.9);
}

/* main.css pone "strong { color: negro }" a nivel global (para que
   resalte sobre fondos claros) — un <strong>/<b> suelto dentro del texto
   enriquecido de este bloque (el campo "body", WYSIWYG) no tiene clase
   propia, así que esa regla global le gana a la herencia del blanco de
   arriba y las negritas se veían negras sobre el fondo del color
   principal. Aquí se le devuelve el blanco explícitamente. */
.text-section--bg-primary .text-section__body strong,
.text-section--bg-primary .text-section__body b {
	color: inherit;
}

.text-section--bg-primary .text-section__list-icon {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
}

/* =================================================================
   Responsive
   ================================================================= */

/* Tablet (48rem+): section padding scales up, split becomes side-by-side */
@media (min-width: 48rem) {
	.text-section--py-sm {
		padding-block: 3rem;
	}
	.text-section--py-md {
		padding-block: 4.5rem;
	}
	.text-section--py-lg {
		padding-block: 6rem;
	}

	.text-section--layout-split .text-section__inner {
		flex-direction: row;
		align-items: flex-start;
		gap: 3rem;
	}

	.text-section--layout-split .text-section__split-left {
		flex: 0 0 38%;
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
		position: sticky;
		top: 3rem;
	}

	.text-section--layout-split .text-section__split-right {
		flex: 1;
	}

	.text-section--layout-split .text-section__heading {
		font-size: clamp(1.75rem, 2.5vw, 2.75rem);
	}
}

/* Desktop (64rem+): algo más de aire por ítem */
@media (min-width: 64rem) {
	.text-section--layout-list .text-section__list-trigger {
		padding-block: 1.375rem;
	}
}
