/* =================================================================
   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;
}

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

.text-section--py-sm {
	padding-block: 2rem;
}
.text-section--py-md {
	padding-block: 3rem;
}
.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: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--primary);
}

.text-section__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--primary);
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 900;
	line-height: 1.2;
	text-wrap: balance;
	color: var(--wp--preset--color--text-heading);
}

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

.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 link (inline, no chip)
   ================================================================= */

.text-section__link {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	align-self: flex-start;
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--primary);
	transition: opacity 0.2s ease;
}

.text-section__link-label {
	border-bottom: 1px solid currentColor;
	padding-bottom: 0.15em;
}

.text-section__link-arrow {
	display: inline-block;
	transition: transform 0.2s ease;
	font-size: 1.1em;
	line-height: 1;
}

.text-section__link:hover {
	text-decoration: none;
	opacity: 0.75;
}

.text-section__link:hover .text-section__link-arrow {
	transform: translateX(3px);
}

/* =================================================================
   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;
	}
}

.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;
}

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

.text-section--layout-list .text-section__list {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

.text-section--layout-list .text-section__list-item {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}

.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-content {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.text-section--layout-list .text-section__list-title {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--wp--preset--color--text-heading);
}

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

/* =================================================================
   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);
}

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

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

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

/* Small tablet (36rem+): list 2 cols */
@media (min-width: 36rem) {
	.text-section--layout-list .text-section__list {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 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+): list 3 cols */
@media (min-width: 64rem) {
	.text-section--layout-list .text-section__list {
		grid-template-columns: repeat(3, 1fr);
	}
}
