/* =================================================================
   Feature List Block
   Styles: split (default) | cards

   Split is the base style — no .is-style-split prefix needed.
   WordPress doesn't add the default style class on first insert,
   so base styles must work without it.
   ================================================================= */

/* --- Base --- */
.feature-list {
	position: relative;
	margin-block-start: 0 !important;
}

/* --- Padding --- */
.feature-list--py-sm {
	padding-block: 2rem;
}
.feature-list--py-md {
	padding-block: 3rem;
}
.feature-list--py-lg {
	padding-block: 4rem;
}

/* --- Background --- */
.feature-list--bg-default {
	background-color: var(--wp--preset--color--bg);
}
.feature-list--bg-light {
	background-color: var(--wp--preset--color--bg-secondary);
}

/* --- Shared item styles --- */
.feature-list__item-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--text);
	margin: 0 0 0.75rem;
}

.feature-list__item-content {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--wp--preset--color--text);
}

.feature-list__item-content p {
	margin: 0 0 0.5rem;
}

.feature-list__item-content p:last-child {
	margin-bottom: 0;
}

/* WYSIWYG: blockquote */
.header-section__description blockquote,
.feature-list__item-content blockquote {
	margin: 1rem 0;
	font-style: italic;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--wp--preset--color--black);
	font-family: var(--wp--preset--font-family--secondary);
}

.header-section__description blockquote p,
.feature-list__item-content blockquote p {
	margin: 0;
}

/* WYSIWYG: lists */
.feature-list__item-content ul,
.feature-list__item-content ol {
	margin: 0.5rem 0;
	padding-left: 1.25rem;
}

.feature-list__item-content li {
	margin-bottom: 0.25rem;
}

.feature-list__item-content li:last-child {
	margin-bottom: 0;
}

/* WYSIWYG: links */
.feature-list__item-content a {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: 0.15rem;
	transition: opacity 0.2s ease;
}

.feature-list__item-content a:hover {
	opacity: 0.7;
}

/* Item link: text link aligned right */
.feature-list__item-link-wrap {
	margin-top: 0.75rem;
	text-align: right;
}

.feature-list__item-link {
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: 0.2rem;
	transition: opacity 0.2s ease;
}

.feature-list__item-link:hover {
	opacity: 0.7;
}

/* --- CTA button --- */
.feature-list__cta {
	text-align: center;
	margin-top: 2.5rem;
}

/* =================================================================
   Style: Split (base / default)
   Header left + items right with left border accent
   ================================================================= */

.feature-list__split {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

.feature-list__header .header-section {
	margin-bottom: 0;
}

/* Mobile default: horizontal carousel (scroll-snap), one item per view
   with the next/previous item peeking at the edges. Reset back to a
   vertical list at 48rem — see Responsive section below. */
.feature-list__items {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 1rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 8%;
	padding-inline: 8%;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.feature-list__items::-webkit-scrollbar {
	display: none;
}

.feature-list__item {
	flex: 0 0 72%;
	scroll-snap-align: center;
	padding: 1.5rem 2rem;
	/* Semi-transparent so the peeking next item reads as "there's more"
	   instead of just its border line; solid bg-secondary again at 48rem. */
	background-color: rgba(255, 255, 255, 0.5);
	border-left: 2px solid var(--wp--preset--color--primary);
}

/* =================================================================
   Style: Cards
   Header on top, items in a grid as cards
   ================================================================= */

/* Mobile default: horizontal carousel (scroll-snap), one card per view
   with the next/previous card peeking at the edges. Reset back to a
   grid at 48rem — see Responsive section below. */
.is-style-cards .feature-list__grid {
	display: flex;
	flex-wrap: nowrap;
	gap: 1rem;
	margin-top: 3rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 8%;
	padding-inline: 8%;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.is-style-cards .feature-list__grid::-webkit-scrollbar {
	display: none;
}

.is-style-cards .feature-list__card {
	flex: 0 0 72%;
	scroll-snap-align: center;
	/* Same semi-transparent treatment as the items view, so the peeking
	   next card is clearly visible; back to transparent at 48rem. */
	background-color: var(--wp--preset--color--bg-secondary);
}

/* Column classes */
.is-style-cards.feature-list--cols-2 .feature-list__grid {
	--fl-cols: 2;
}
.is-style-cards.feature-list--cols-3 .feature-list__grid {
	--fl-cols: 3;
}
.is-style-cards.feature-list--cols-4 .feature-list__grid {
	--fl-cols: 4;
}

/* Card: bordered, padded */
.is-style-cards .feature-list__card {
	padding: 1.5rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

/* Hover only on cards that contain a link */
.is-style-cards .feature-list__item--has-link:hover {
	transform: translateY(-0.125rem);
	box-shadow: var(--wp--preset--shadow--200);
}

/* Card icon (image) — siempre centrado, sea cual sea la alineación del
   texto (el icono es un elemento decorativo suelto, no forma parte del
   flujo de texto que sí alterna izquierda/centro). */
.feature-list__card-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 1rem;
}

.feature-list__card-icon-img {
	display: block;
	width: 3rem;
	height: 3rem;
	object-fit: contain;
}

/* Card photo (full width, bleeds to the card's edges) */
.is-style-cards .feature-list__card--has-photo {
	padding-top: 0;
	overflow: hidden;
}

.feature-list__card-photo {
	margin: 0 -1.5rem 2rem;
}

.feature-list__card-photo-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* Cards center: center grid when items < columns. Only meaningful once
   it's a real grid (48rem+) — in the mobile carousel it would center the
   scrollable content as a group, hiding part of the first card. */
.is-style-cards.feature-list--cards-center .feature-list__grid {
	justify-content: flex-start;
}

/* Cards text alignment */
.is-style-cards.feature-list--cards-text-center .feature-list__card {
	text-align: left;
}

.is-style-cards.feature-list--cards-text-center .feature-list__item-link-wrap {
	text-align: center;
}

.is-style-cards.feature-list--cards-text-left .feature-list__card {
	text-align: left;
}

/* Cards cuadradas: variante sin bordes redondeados, con una línea de
   acento solo abajo y fondo blanco — todo el contenido centrado (no
   depende de "Alineación del texto en cards", la pisa a propósito). */
.is-style-cards.feature-list--cards-square .feature-list__card {
	border: none;
	border-bottom: 3px solid var(--wp--preset--color--accent);
	border-radius: 0;
	background-color: var(--wp--preset--color--bg);
	text-align: center;
}

.is-style-cards.feature-list--cards-square .feature-list__item-link-wrap {
	text-align: center;
}

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

/* Tablet (48rem / 768px) */
@media (min-width: 48rem) {
	.feature-list--py-sm {
		padding-block: 3rem;
	}
	.feature-list--py-md {
		padding-block: 4.5rem;
	}
	.feature-list--py-lg {
		padding-block: 6rem;
	}

	/* Split: 2-column layout */
	.feature-list__split {
		grid-template-columns: 1fr 1.5fr;
		gap: 3rem;
		align-items: start;
	}

	/* Header sticky within its column */
	.feature-list__header {
		position: sticky;
		top: 2rem;
	}

	/* Items: back to a vertical list (carousel was mobile-only) */
	.feature-list__items {
		flex-direction: column;
		flex-wrap: wrap;
		gap: 0.5rem;
		overflow-x: visible;
		scroll-snap-type: none;
		padding-inline: 0;
	}

	.feature-list__item {
		flex: initial;
		scroll-snap-align: none;
		background-color: var(--wp--preset--color--bg-secondary);
	}

	/* Cards: back to a grid (carousel was mobile-only), use column variable */
	.is-style-cards .feature-list__grid {
		display: grid;
		grid-template-columns: repeat(min(var(--fl-cols, 3), 2), 1fr);
		overflow-x: visible;
		scroll-snap-type: none;
		padding-inline: 0;
	}

	.is-style-cards .feature-list__card {
		flex: initial;
		scroll-snap-align: none;
		background-color: var(--wp--preset--color--bg-secondary);
	}

	.is-style-cards.feature-list--cards-center .feature-list__grid {
		justify-content: center;
	}
}

/* Desktop (64rem / 1024px) */
@media (min-width: 64rem) {
	/* Split: wider gap */
	.feature-list__split {
		gap: 4rem;
	}

	/* Cards: full columns */
	.is-style-cards .feature-list__grid {
		grid-template-columns: repeat(var(--fl-cols, 3), 1fr);
		gap: 2rem 5rem;
	}
}
