/**
 * Eventos Index V2 — page-specific styles.
 *
 * Additive only. Reuses discovery.css tokens/.ch-section/.ch-container and
 * home.css .ch-home-rail carousel styles. No new library, no !important.
 */

.ch-events-index {
	--ch-home-accent-start: #ff7a59;
	--ch-home-accent-end: #ffb347;
}

/* ---------------------------------------------------------------------
 * 01 · HERO — approved Visual Language V2 Index Hero
 * ------------------------------------------------------------------- */
.ch-events-index .ch-events-hero {
	margin-bottom: 0;
}

.ch-events-index .ch-events-hero .ch-destination-hero__overlay {
	background: var(--ch-vl-hero-overlay-event);
}

/* Event Detail still uses Home hero language; hide the Home paper fade. */
.ch-home-hero.ch-events-hero::before {
	display: none;
}

/* ---------------------------------------------------------------------
 * 02 · EVENTOS DESTACADOS — 1 lead + up to 2 supporting
 * ------------------------------------------------------------------- */
.ch-events-featured__stage {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	gap: 14px;
	height: 520px;
}

.ch-events-featured--count-1 .ch-events-featured__stage {
	grid-template-columns: minmax(0, 1fr);
	height: 420px;
}

.ch-events-featured__lead,
.ch-events-featured__stack {
	min-width: 0;
	min-height: 0;
}

.ch-events-featured__stack {
	display: grid;
	grid-template-rows: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.ch-events-featured--count-2 .ch-events-featured__stack,
.ch-events-featured--count-3 .ch-events-featured__stack {
	grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
}

.ch-events-featured__card {
	position: relative;
	display: block;
	height: 100%;
	min-height: 0;
	overflow: hidden;
	border-radius: var(--ch-radius-medium);
	background-color: var(--ch-color-forest-deep);
	color: var(--ch-color-text-on-dark);
	text-decoration: none;
}

a.ch-events-featured__card:hover,
a.ch-events-featured__card:focus-visible {
	color: var(--ch-color-text-on-dark);
}

a.ch-events-featured__card:focus-visible {
	outline: 2px solid var(--ch-color-forest);
	outline-offset: 3px;
}

.ch-events-featured__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--ch-focal, center center);
	filter: var(--ch-media-grade);
}

.ch-events-featured__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: var(--ch-overlay-card);
}

.ch-events-featured__copy {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 14px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.ch-events-featured__card--lead .ch-events-featured__copy {
	left: 24px;
	right: 24px;
	bottom: 20px;
}

.ch-events-featured__name {
	margin: 0;
	max-width: 100%;
	font-family: var(--ch-font-display);
	font-size: var(--ch-type-entity);
	font-weight: 500;
	line-height: var(--ch-type-entity-lh);
	letter-spacing: var(--ch-type-section-tracking);
	color: var(--ch-color-text-on-dark);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.ch-events-featured__card--lead .ch-events-featured__name {
	font-size: var(--ch-type-entity-lg);
	line-height: var(--ch-type-entity-lg-lh);
}

.ch-events-featured__meta,
.ch-events-featured__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 0;
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-small);
	font-weight: 400;
	line-height: var(--ch-type-small-lh);
	color: color-mix(in srgb, var(--ch-color-text-on-dark) 90%, transparent);
}

.ch-events-featured__date-icon {
	display: inline-flex;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------------
 * 03 · LO QUE ESTÁ POR SUCEDER — chronological photographic rail
 * ------------------------------------------------------------------- */
.ch-events-happening {
	margin-bottom: var(--ch-space-48);
}

.ch-events-happening .ch-home-rail__title {
	font-family: var(--ch-font-display);
	font-size: var(--ch-type-section);
	line-height: var(--ch-type-section-lh);
	font-weight: var(--ch-type-section-weight);
	letter-spacing: var(--ch-type-section-tracking);
	color: var(--ch-color-title);
}

.ch-events-happening .ch-home-card--event {
	flex-basis: clamp(220px, 23%, 260px);
}

.ch-events-happening__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

a.ch-events-happening__card,
a.ch-events-happening__card:hover,
a.ch-events-happening__card:focus-visible,
a.ch-events-happening__card:visited {
	color: inherit;
	text-decoration: none;
}

a.ch-events-happening__card:focus-visible {
	outline: 2px solid var(--ch-color-forest);
	outline-offset: 3px;
}

.ch-events-happening__chip {
	margin: 0 0 10px;
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-kicker);
	font-weight: 700;
	letter-spacing: var(--ch-type-kicker-tracking);
	text-transform: uppercase;
	color: var(--ch-color-forest);
}

.ch-events-happening__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--ch-radius-medium);
	background: var(--ch-color-forest-deep);
}

.ch-events-happening__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: var(--ch-media-grade);
	transition: transform var(--ch-motion-base) var(--ch-motion-ease);
}

a.ch-events-happening__card:hover .ch-events-happening__photo {
	transform: scale(1.02);
}

.ch-events-happening__name {
	margin: 12px 0 0;
	font-family: var(--ch-font-display);
	font-size: var(--ch-type-entity);
	font-weight: 500;
	line-height: var(--ch-type-entity-lh);
	color: var(--ch-color-title);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.ch-events-happening__meta,
.ch-events-happening__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 0;
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-small);
	line-height: var(--ch-type-small-lh);
	color: var(--ch-color-text-muted);
}

.ch-events-happening__date-icon {
	display: inline-flex;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------------
 * Weekend feature (kept for the single-event rail helper)
 * ------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
 * 03 · WEEKEND / UPCOMING RAILS
 * ------------------------------------------------------------------- */
.ch-events-rail-section .ch-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--ch-space-16);
	flex-wrap: wrap;
}

.ch-events-carousel {
	margin-bottom: var(--ch-space-48);
}

.ch-events-carousel .ch-home-card--event {
	flex-basis: clamp(260px, 31%, 360px);
}

.ch-events-rail__cta {
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-small);
	font-weight: 600;
	color: var(--ch-color-forest);
	text-decoration: none;
	white-space: nowrap;
}

.ch-events-rail__cta:hover,
.ch-events-rail__cta:focus-visible {
	text-decoration: underline;
}

.ch-events-rail__empty {
	color: var(--ch-color-text-muted);
	font-size: var(--ch-type-body);
	margin: 0;
	padding-top: var(--ch-space-8);
}

.ch-events-rail__track {
	list-style: none;
	margin: 0;
	padding-inline: var(--ch-gutter);
}

.ch-events-rail__item {
	flex: 0 0 auto;
	width: min(300px, 78vw);
	scroll-snap-align: start;
}

/* One real weekend event becomes an editorial feature, not a sparse rail. */
.ch-events-weekend-feature {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
	min-height: 360px;
	background: var(--ch-color-surface);
	border-radius: var(--ch-radius-panel);
	overflow: hidden;
}

a.ch-events-weekend-feature {
	color: inherit;
	text-decoration: none;
}

a.ch-events-weekend-feature:focus-visible {
	outline: 2px solid var(--ch-color-forest);
	outline-offset: 3px;
}

.ch-events-weekend-feature--without-media {
	grid-template-columns: 1fr;
}

.ch-events-weekend-feature__media {
	position: relative;
	min-height: 360px;
	background: var(--ch-color-forest-deep);
	overflow: hidden;
}

.ch-events-weekend-feature--without-media .ch-events-weekend-feature__media {
	display: none;
}

.ch-events-weekend-feature__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: var(--ch-media-grade);
}

.ch-events-weekend-feature__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(var(--ch-space-24), 4vw, var(--ch-space-48));
}

.ch-events-weekend-feature--without-media .ch-events-weekend-feature__body {
	max-width: var(--ch-content-editorial);
}

.ch-events-weekend-feature__tag {
	margin: 0 0 var(--ch-space-8);
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-kicker);
	font-weight: 600;
	letter-spacing: var(--ch-type-kicker-tracking);
	text-transform: uppercase;
	color: var(--ch-color-forest);
}

.ch-events-weekend-feature__title {
	margin: 0;
	font-family: var(--ch-font-display);
	font-size: clamp(30px, 3vw, 44px);
	line-height: 1.08;
	font-weight: var(--ch-type-section-weight);
	color: var(--ch-color-title);
	overflow-wrap: break-word;
}

.ch-events-weekend-feature__schedule,
.ch-events-weekend-feature__location,
.ch-events-weekend-feature__summary {
	font-family: var(--ch-font-sans);
}

.ch-events-weekend-feature__schedule {
	margin: var(--ch-space-16) 0 0;
	font-size: var(--ch-type-small);
	line-height: var(--ch-type-small-lh);
	font-weight: 600;
	color: var(--ch-color-forest);
}

.ch-events-weekend-feature__schedule--estimated {
	color: var(--ch-color-warning-bg);
}

.ch-events-weekend-feature__location {
	margin: var(--ch-space-8) 0 0;
	font-size: var(--ch-type-small);
	line-height: var(--ch-type-small-lh);
	color: var(--ch-color-text-muted);
}

.ch-events-weekend-feature__summary {
	margin: var(--ch-space-16) 0 0;
	font-size: var(--ch-type-body);
	line-height: var(--ch-type-body-lh);
	color: var(--ch-color-text);
}

/* ---------------------------------------------------------------------
 * Mosaic event card — photo-on-top layout for rails/traditions grid.
 * Scoped to this page; base .ch-event-card box/typography from
 * discovery.css is reused, only the mosaic layout is added here.
 * ------------------------------------------------------------------- */
.ch-events-index .ch-event-card--mosaic {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	padding: 0;
	height: 100%;
	overflow: hidden;
}

.ch-events-index .ch-event-card--mosaic .ch-event-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: var(--ch-color-forest-deep);
	overflow: hidden;
}

.ch-events-index .ch-event-card--mosaic .ch-event-card__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: var(--ch-media-grade);
}

.ch-events-index .ch-event-card--mosaic .ch-event-card__body {
	padding: var(--ch-space-16);
}

.ch-events-index .ch-event-card--mosaic .ch-event-card__tag {
	margin: 0 0 6px;
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-chip);
	font-weight: 600;
	letter-spacing: var(--ch-type-chip-tracking);
	text-transform: uppercase;
	color: var(--ch-color-forest);
}

.ch-events-index .ch-event-card--mosaic .ch-event-card__title {
	font-size: var(--ch-type-entity);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.ch-events-index .ch-event-card--mosaic .ch-event-card__meta {
	margin: 6px 0 0;
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-small);
	color: var(--ch-color-text-muted);
}

.ch-events-index .ch-event-card--mosaic.ch-event-card--without-media .ch-event-card__media {
	background: linear-gradient(135deg, var(--ch-color-forest-deep), var(--ch-color-forest));
}

/* ---------------------------------------------------------------------
 * 04 · EXPLORAR POR DESTINO — Home rail carousel
 * ------------------------------------------------------------------- */
.ch-events-index .ch-events-destinations {
	margin-bottom: var(--ch-space-48);
}

.ch-events-destinations .ch-home-rail__eyebrow {
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-kicker);
	line-height: var(--ch-type-kicker-lh);
	font-weight: 600;
	letter-spacing: var(--ch-type-kicker-tracking);
	text-transform: uppercase;
	color: var(--ch-color-forest);
}

.ch-events-destinations .ch-home-rail__title {
	font-family: var(--ch-font-display);
	font-size: var(--ch-type-section);
	line-height: var(--ch-type-section-lh);
	font-weight: var(--ch-type-section-weight);
	letter-spacing: var(--ch-type-section-tracking);
	color: var(--ch-color-title);
}

.ch-events-destinations .ch-home-card--destination {
	flex-basis: clamp(240px, 32%, 340px);
}

/* ---------------------------------------------------------------------
 * 05 · PROGRAMA HOTEL FUNDADORES
 * ------------------------------------------------------------------- */
.ch-events-phf {
	background: var(--ch-color-sand);
}

.ch-events-phf__inner {
	padding-block: var(--ch-space-16);
}

.ch-events-phf__copy {
	max-width: var(--ch-content-editorial);
}

.ch-events-phf__traveler,
.ch-events-phf__partner {
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-body);
	line-height: var(--ch-type-body-lh);
	color: var(--ch-color-text);
	margin: 0 0 var(--ch-space-12);
}

.ch-events-phf__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: var(--ch-space-8);
	padding: 12px 22px;
	border-radius: var(--ch-radius-pill);
	background: color-mix(in srgb, var(--ch-color-forest) 14%, transparent);
	color: var(--ch-color-forest);
	font-family: var(--ch-font-sans);
	font-size: var(--ch-type-small);
	font-weight: 600;
	cursor: default;
}

.ch-events-phf__cta-note {
	font-weight: 500;
	font-size: var(--ch-type-chip);
	opacity: 0.75;
}

/* ---------------------------------------------------------------------
 * 06 · TRADICIONES QUE REGRESAN
 * ------------------------------------------------------------------- */
.ch-events-traditions__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--ch-space-24);
	padding-top: var(--ch-space-16);
	margin-top: 0;
	margin-bottom: 0;
	list-style: none;
}

.ch-events-traditions__grid .ch-home-card {
	width: auto;
	max-width: none;
	min-width: 0;
}

.ch-events-index .ch-home-founder__cta {
	color: #2a1608;
	text-decoration: none;
}

.ch-events-traditions__empty {
	color: var(--ch-color-text-muted);
	margin: 0;
	padding-top: var(--ch-space-8);
}

/* ---------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 1023px) {
	.ch-events-featured__stage,
	.ch-events-featured--count-1 .ch-events-featured__stage {
		grid-template-columns: minmax(0, 1fr);
		height: auto;
	}

	.ch-events-featured__lead {
		min-height: 280px;
		aspect-ratio: 16 / 9;
	}

	.ch-events-featured__stack {
		grid-template-rows: none;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		min-height: 168px;
	}

	.ch-events-featured--count-2 .ch-events-featured__stack,
	.ch-events-featured--count-3 .ch-events-featured__stack {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ch-events-featured__lead {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.ch-events-featured__stack {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
	}

	.ch-events-featured__card--support {
		aspect-ratio: 16 / 10;
	}

	.ch-events-weekend-feature {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.ch-events-weekend-feature__media {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.ch-events-weekend-feature__body {
		padding: var(--ch-space-24);
	}

	.ch-events-traditions__grid {
		grid-template-columns: 1fr;
	}

	.ch-events-phf__inner {
		display: flex;
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ch-events-hero__cta,
	.ch-events-rail__cta,
	a.ch-events-happening__card:hover .ch-events-happening__photo {
		transition: none;
		transform: none;
	}
}
