/*
 * Departures (data-section «Salidas 2027», pattern transpirenaica/departures). Ported from base.css and
 * mobile.css of 01-transpirenaica-en-moto with docs/class-map.md:
 * .salidas → .departures, .salidas__grid → .departures__grid (looper of the GB Query), .salida-card →
 * .departure-card (loop item), __fecha → __date, __precio → __price, __importe → __amount, __unidad → __unit,
 * .repeticion → .repeat-discount, .ruta-motif--salidas → the ::before of the section.
 *
 * Decorative pieces are masks painted with Global Colors (they cannot be deleted in the editor):
 * - route motif: .departures::before (route-motif.svg, 420×120; 220×64 on mobile);
 * - card calendar: .departure-card::before (calendar-card.svg, 28 px), a flex item, so it keeps the card gap
 *   as the <div class="salida-card__icon"> of the design;
 * - repeat icon: .repeat-discount::before (repeat.svg, 28 px; 24 px on mobile).
 *
 * Not in the approved design: .departure-card__single-room, the optional line «Suplemento habitación
 * individual: 180€», with the style of the «Precio:» label (it disappears while the field is empty).
 */

.departures {
	overflow-x: clip;
	background: var(--forest);
	color: var(--on-dark);
}

.departures::before {
	content: "";
	position: absolute;
	top: calc(var(--space-section) - 10px);
	right: var(--gutter);
	width: 420px;
	height: 120px;
	background-color: var(--mustard);
	opacity: .4;
	pointer-events: none;
	-webkit-mask: url("../../icons/route-motif.svg?v=1") center / 100% 100% no-repeat;
	mask: url("../../icons/route-motif.svg?v=1") center / 100% 100% no-repeat;
}

/* Cards: as many columns of at least 320 px as fit; one card per visible season. */
.departures__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: var(--space-5);
}

/* A single season would take the whole row: keep it at the width of a column, centred. */
.departures__grid > .departure-card:only-child {
	justify-self: center;
	width: 100%;
	max-width: calc((var(--container) - var(--space-5)) / 2);
}

.departure-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
	padding: var(--space-7);
	background: var(--forest-800);
	border: 1px solid var(--on-dark-line);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-none);
}

.departure-card::before {
	content: "";
	flex: none;
	align-self: flex-start;
	width: 28px;
	height: 28px;
	background-color: var(--mustard);
	-webkit-mask: url("../../icons/calendar-card.svg?v=1") center / contain no-repeat;
	mask: url("../../icons/calendar-card.svg?v=1") center / contain no-repeat;
}

.departure-card__date {
	min-height: 2.1em;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: var(--fs-date);
	line-height: 1.05;
	letter-spacing: var(--ls-heading);
	text-transform: uppercase;
	color: var(--white);
}

.departure-card__price {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	margin-top: auto;
	padding-top: var(--space-5);
	border-top: 1px solid var(--on-dark-line);
}

.departure-card__label,
.departure-card__single-room {
	font-size: var(--fs-xs);
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--on-dark-muted);
}

.departure-card__amount {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--space-3);
}

.departure-card__num {
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: var(--fs-price);
	line-height: 1;
	letter-spacing: .01em;
	color: var(--mustard);
	white-space: nowrap;
}

.departure-card__unit {
	font-size: var(--fs-body);
	font-weight: 500;
	color: var(--on-dark);
	white-space: nowrap;
}

/* Repetition policy */
.repeat-discount {
	display: flex;
	align-items: flex-start;
	gap: var(--space-4);
	margin-top: var(--space-5);
	padding: var(--space-5) var(--space-6);
	border: 1px dashed var(--mustard-line);
	border-radius: var(--radius-band);
}

.repeat-discount::before {
	content: "";
	flex: none;
	width: 28px;
	height: 28px;
	background-color: var(--mustard);
	-webkit-mask: url("../../icons/repeat.svg?v=1") center / contain no-repeat;
	mask: url("../../icons/repeat.svg?v=1") center / contain no-repeat;
}

.repeat-discount__text {
	font-size: var(--fs-body);
	color: var(--on-dark);
}

.repeat-discount__text strong {
	font-weight: 700;
	color: var(--mustard);
}

/* Mobile (≤767 px) */
@media (max-width: 767px) {
	.departures::before {
		top: calc(var(--space-section) - 2px);
		right: -40px;
		width: 220px;
		height: 64px;
		opacity: .32;
	}

	.departures__grid {
		grid-template-columns: 1fr;
		gap: var(--space-4);
	}

	.departure-card {
		gap: var(--space-4);
		padding: var(--space-6) var(--space-5);
	}

	.departure-card__date {
		min-height: 0;
	}

	.departure-card__price {
		padding-top: var(--space-4);
	}

	.departure-card .btn {
		--btn-height: 52px;
	}

	.repeat-discount {
		gap: var(--space-3);
		margin-top: var(--space-4);
		padding: var(--space-4);
	}

	.repeat-discount::before {
		width: 24px;
		height: 24px;
	}
}
