/*
 * Todosaviajar: airport signage. The price is the departures board (yellow condensed digits on slate);
 * everything else stays quiet: white paper, mist grey and one hairline.
 */

@font-face {
	font-family: "Barlow Condensed";
	src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Barlow Condensed";
	src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--ink: #1b2a3a;
	--ink-soft: #46586b;
	--signal: #ffc72c;
	--gate: #0a5fa8;
	--paper: #fff;
	--mist: #edf1f4;
	--rule: #c9d3dc;
	--deal: #b3261e;

	--font-board: "Barlow Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
	--font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--step--1: 0.875rem;
	--step-0: 1rem;
	--step-1: 1.25rem;
	--step-2: 1.563rem;
	--step-3: 1.953rem;
	--step-4: 2.441rem;

	--space: 1rem;
	--width: 72rem;
	--radius: 4px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--mist);
	color: var(--ink);
	font: var(--step-0) / 1.55 var(--font-text);
	overflow-wrap: anywhere;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--gate);
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--signal);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--ink);
}

h1,
h2,
h3 {
	font-family: var(--font-board);
	font-weight: 700;
	line-height: 1.1;
	margin: 0;
}

h1 {
	font-size: var(--step-4);
}

h2 {
	font-size: var(--step-3);
}

h3 {
	font-size: var(--step-1);
	font-weight: 600;
}

.wrap {
	width: min(100% - 2 * var(--space), var(--width));
	margin-inline: auto;
}

.skip-link {
	position: absolute;
	left: var(--space);
	top: -4rem;
	padding: 0.5rem 1rem;
	background: var(--signal);
	color: var(--ink);
	font-weight: 600;
	z-index: 10;
}

.skip-link:focus {
	top: var(--space);
}

/* --- Header: the slate bar with the three categories as gates */

.site-header {
	background: var(--ink);
	color: var(--paper);
}

.site-header .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem var(--space);
	padding-block: 0.75rem;
}

.site-search {
	display: flex;
	flex: 1 1 100%;
	gap: 0.5rem;
}

.site-search .field {
	flex: 1 1 auto;
}

.site-search input {
	min-height: 2.5rem;
}

.site-search button {
	padding: 0.5rem 1rem;
	background: var(--signal);
	color: var(--ink);
	border: 0;
	border-radius: var(--radius);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.site-search button:hover {
	background: var(--paper);
}

@media (min-width: 48rem) {
	.site-search {
		flex: 0 1 22rem;
	}
}

.brand {
	color: var(--paper);
	font-family: var(--font-board);
	font-size: var(--step-3);
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.brand:hover {
	color: var(--signal);
}

.nav-menu > summary {
	cursor: pointer;
	list-style: none;
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--ink-soft);
	border-radius: var(--radius);
	font-weight: 600;
}

.nav-menu > summary::-webkit-details-marker {
	display: none;
}

.nav-menu[open] > summary {
	border-color: var(--signal);
}

.nav-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.nav-list a {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0.75rem;
	border-bottom: 3px solid transparent;
	color: var(--paper);
	text-decoration: none;
	font-weight: 600;
}

.nav-list a:hover,
.nav-list a[aria-current] {
	border-bottom-color: var(--signal);
}

.count {
	color: var(--signal);
	font-family: var(--font-board);
	font-variant-numeric: tabular-nums;
}

/*
 * Wide screens: the menu is always open. A closed <details> hides its content whatever its display, so the
 * content box is shown with ::details-content; browsers without it keep the "Menú" button.
 */
@supports selector(::details-content) {
	@media (min-width: 48rem) {
		.nav-menu > summary {
			display: none;
		}

		.nav-menu::details-content {
			content-visibility: visible;
			display: contents;
		}

		.nav-list {
			flex-direction: row;
			margin: 0;
		}
	}
}

/* --- Page */

main {
	padding-block: calc(2 * var(--space)) calc(3 * var(--space));
}

.page-head {
	margin-bottom: calc(2 * var(--space));
	max-width: 48rem;
}

.page-head p {
	margin: 0.5rem 0 0;
	color: var(--ink-soft);
}

.block {
	margin-top: calc(2.5 * var(--space));
}

.block-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem var(--space);
	margin-bottom: var(--space);
	border-bottom: 1px solid var(--rule);
	padding-bottom: 0.5rem;
}

.block-head a {
	font-weight: 600;
}

.empty {
	padding: var(--space);
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}

/* --- Price: the departures board */

.price {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	background: var(--ink);
	color: var(--signal);
	border-radius: 2px;
	font-family: var(--font-board);
	font-size: var(--step-2);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
	white-space: nowrap;
}

.price-from {
	display: block;
	color: var(--ink-soft);
	font-size: var(--step--1);
}

/* --- Ad cards */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: var(--space);
	margin: 0;
	padding: 0;
	list-style: none;
}

.card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	overflow: hidden;
}

.card-img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--mist);
}

.card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.5rem;
	padding: var(--space);
}

.card-title a {
	color: var(--ink);
	text-decoration: none;
}

.card-title a:hover {
	color: var(--gate);
	text-decoration: underline;
}

.card-meta {
	margin: 0;
	color: var(--ink-soft);
	font-size: var(--step--1);
}

.card-program {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	color: var(--ink-soft);
	font-size: var(--step--1);
}

.card-program img {
	width: 60px;
	height: 30px;
	object-fit: contain;
}

.card-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: auto;
}

.book {
	font-weight: 600;
}

.discount {
	color: var(--deal);
	font-weight: 700;
}

/* --- Home grid: compact modules of offers by category, as the previous home page */

:root {
	--cat-FLIGHTS: #0a5fa8;
	--cat-HOTELS: #1d7a4f;
	--cat-HOLIDAYS: #b3261e;
}

.modules {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: calc(1.5 * var(--space));
	align-items: start;
}

@media (min-width: 45rem) {
	.modules {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.span-2 {
		grid-column: span 2;
	}

	.span-3 {
		grid-column: 1 / -1;
	}
}

.modules > .span-3 .block {
	margin-top: var(--space);
}

.module {
	display: flex;
	flex-direction: column;
	padding: var(--space);
	background: var(--paper);
	border: 1px solid var(--rule);
	border-top: 4px solid var(--module-color, var(--ink));
	border-radius: var(--radius);
}

.module-FLIGHTS {
	--module-color: var(--cat-FLIGHTS);
}

.module-HOTELS {
	--module-color: var(--cat-HOTELS);
}

.module-HOLIDAYS {
	--module-color: var(--cat-HOLIDAYS);
}

.module-title {
	margin: 0 0 0.5rem;
	color: var(--module-color, var(--ink));
	font-size: var(--step-1);
}

.module-lines {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Long modules spread their lines in columns, as the previous "twoCol" and "threeCol" lists */
@media (min-width: 45rem) {
	.span-2 .module-lines {
		columns: 2;
		column-gap: calc(2 * var(--space));
	}

	.span-3 .module-lines {
		columns: 3;
		column-gap: calc(2 * var(--space));
	}
}

.module-lines li {
	break-inside: avoid;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: baseline;
	column-gap: 0.75rem;
	padding-block: 0.45rem;
	border-bottom: 1px solid var(--rule);
}

.line-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.module-lines .price {
	grid-row: span 2;
	align-self: center;
	font-size: var(--step-1);
}

.line-program {
	color: var(--ink-soft);
	font-size: var(--step--1);
}

.line-discount {
	justify-self: start;
	grid-column: 1;
	padding: 0 0.35rem;
	background: var(--deal);
	color: var(--paper);
	border-radius: 2px;
	font-size: var(--step--1);
	font-weight: 700;
}

.module-more {
	align-self: flex-end;
	margin-top: 0.75rem;
	font-weight: 600;
}

/* --- Links to the SEO search pages */

.seo-links ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.seo-links a {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	font-weight: 600;
}

/* --- Groups: origins, destinations, cities */

.groups {
	columns: 14rem auto;
	column-gap: calc(2 * var(--space));
	margin: 0;
	padding: 0;
	list-style: none;
}

.groups li {
	break-inside: avoid;
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	padding-block: 0.35rem;
	border-bottom: 1px solid var(--rule);
}

.group-meta {
	color: var(--ink-soft);
	font-size: var(--step--1);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* --- Pagination */

.pagination {
	margin-top: calc(2 * var(--space));
}

.pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pagination a,
.pagination [aria-current="page"] {
	display: inline-block;
	min-width: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--paper);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.pagination [aria-current="page"] {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--signal);
	font-weight: 700;
}

.listing-total {
	margin-top: var(--space);
	color: var(--ink-soft);
}

/* --- Search panel: the check-in desk */

.search-panel {
	display: grid;
	gap: var(--space);
	padding: calc(1.25 * var(--space));
	background: var(--ink);
	color: var(--paper);
	border-radius: var(--radius);
}

.search-panel h2 {
	color: var(--signal);
	font-size: var(--step-2);
}

.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
}

.search-form .field {
	flex: 1 1 12rem;
}

.search-form button {
	flex: 1 0 auto;
}

@media (min-width: 40rem) {
	.search-form button {
		flex-grow: 0;
	}
}

.search-tab {
	display: grid;
	gap: 0.5rem;
}

.search-tab[hidden] {
	display: none;
}

.search-tab h3 {
	margin: 0;
	color: var(--signal);
	font-size: var(--step-0);
}

.search-tab + .search-tab {
	padding-top: var(--space);
	border-top: 1px solid var(--ink-soft);
}

.search-tablist + .search-tab,
.search-tab[role="tabpanel"] {
	padding-top: 0;
	border-top: 0;
}

.search-tablist {
	display: flex;
	gap: 0.25rem;
	border-bottom: 1px solid var(--ink-soft);
}

.search-tablist [role="tab"] {
	flex: 1 1 0;
	padding: 0.5rem 0.25rem;
	background: transparent;
	color: var(--paper);
	border: 0;
	border-bottom: 3px solid transparent;
	border-radius: 0;
	font-weight: 600;
	cursor: pointer;
}

.search-tablist [role="tab"][aria-selected="true"] {
	color: var(--signal);
	border-bottom-color: var(--signal);
}

.field {
	position: relative;
	display: grid;
	gap: 0.25rem;
}

.field label {
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.field input {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 2px solid var(--paper);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--ink);
	font: inherit;
}

.search-form button {
	min-height: 2.75rem;
	padding: 0.5rem 1.25rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--signal);
	color: var(--ink);
	font-family: var(--font-board);
	font-size: var(--step-1);
	font-weight: 700;
	cursor: pointer;
}

.search-form button:hover {
	background: var(--paper);
}

.suggestions {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 10;
	max-height: 18rem;
	margin: 0.25rem 0 0;
	padding: 0.25rem 0;
	overflow-y: auto;
	list-style: none;
	background: var(--paper);
	color: var(--ink);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	box-shadow: 0 8px 24px rgb(27 42 58 / 0.25);
}

.suggestions[hidden] {
	display: none;
}

.suggestions li {
	padding: 0.5rem 0.75rem;
	cursor: pointer;
}

.suggestions li[aria-selected="true"],
.suggestions li:hover {
	background: var(--ink);
	color: var(--signal);
}

/* --- Ad pages: the image, and beside it the facts and the boarding pass to book */

.ad-top {
	display: grid;
	gap: calc(1.5 * var(--space));
}

@media (min-width: 48rem) {
	.ad-top {
		grid-template-columns: 3fr 2fr;
		align-items: start;
	}
}

.ad-img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}

.ad-aside {
	display: grid;
	gap: var(--space);
}

.ad-discount {
	margin: 0;
	font-size: var(--step-1);
}

.facts {
	display: grid;
	gap: 0;
	margin: 0;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}

.facts div {
	display: grid;
	grid-template-columns: minmax(7rem, 2fr) 3fr;
	gap: var(--space);
	padding: 0.6rem var(--space);
}

.facts div + div {
	border-top: 1px solid var(--rule);
}

.facts dt {
	color: var(--ink-soft);
	font-size: var(--step--1);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	align-self: center;
}

.facts dd {
	margin: 0;
	font-weight: 600;
}

.booking {
	display: grid;
	gap: 0.75rem;
	padding: var(--space);
	background: var(--paper);
	border: 1px solid var(--rule);
	border-left: 6px solid var(--signal);
	border-radius: var(--radius);
}

.booking p {
	margin: 0;
}

.booking .price {
	font-size: var(--step-3);
}

.button-book {
	display: block;
	padding: 0.85rem var(--space);
	background: var(--ink);
	color: var(--signal);
	border-radius: var(--radius);
	font-family: var(--font-board);
	font-size: var(--step-1);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	letter-spacing: 0.02em;
}

.button-book:hover {
	background: var(--gate);
	color: var(--paper);
}

.booking-note {
	color: var(--ink-soft);
	font-size: var(--step--1);
}

.ad-section {
	margin-top: calc(2 * var(--space));
	max-width: 48rem;
}

.ad-section h2 {
	margin-bottom: 0.75rem;
	font-size: var(--step-2);
}

.ad-text {
	margin: 0;
	white-space: pre-line;
}

.periods {
	width: 100%;
	border-collapse: collapse;
	background: var(--ink);
	color: var(--paper);
	border-radius: var(--radius);
	overflow: hidden;
}

.periods th,
.periods td {
	padding: 0.6rem var(--space);
	text-align: left;
}

.periods th {
	color: var(--signal);
	font-family: var(--font-board);
	font-size: var(--step--1);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.periods td:last-child,
.periods th:last-child {
	text-align: right;
	white-space: nowrap;
	overflow-wrap: normal;
}

.periods tbody tr {
	border-top: 1px solid var(--ink-soft);
}

.periods .price {
	padding: 0;
	font-size: var(--step-1);
}

.ad-more,
.next-steps {
	margin-top: calc(2 * var(--space));
	font-weight: 600;
}

.next-steps {
	display: grid;
	gap: 0.5rem;
	padding: 0;
	list-style: none;
}

/* --- Third-party embeds and the consent notice */

.ads {
	display: flex;
	justify-content: center;
	margin-top: calc(2.5 * var(--space));
}

.ads-row {
	flex-wrap: wrap;
	justify-content: space-around;
	gap: var(--space);
	margin-top: 0;
}

.embed {
	display: grid;
	place-items: center;
	max-width: 100%;
	padding: var(--space);
	background: var(--paper);
	border: 1px dashed var(--rule);
	border-radius: var(--radius);
	color: var(--ink-soft);
	font-size: var(--step--1);
	text-align: center;
}

.embed p {
	margin: 0;
	max-width: 32rem;
}

.embed-ads {
	width: 250px;
	min-height: 250px;
}

.embed-map {
	aspect-ratio: 3 / 2;
}

.embed iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.embed-loaded {
	padding: 0;
	border: 0;
	background: none;
}

.share {
	margin-top: calc(2 * var(--space));
	font-weight: 600;
}

.link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--gate);
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
}

.consent {
	position: sticky;
	bottom: 0;
	z-index: 20;
	background: var(--ink);
	color: var(--paper);
	border-top: 4px solid var(--signal);
	box-shadow: 0 -8px 24px rgb(27 42 58 / 0.25);
}

.consent[hidden] {
	display: none;
}

.consent .wrap {
	padding-block: var(--space);
}

.consent h2 {
	color: var(--signal);
	font-size: var(--step-2);
}

.consent p {
	margin: 0.5rem 0 0;
	max-width: 48rem;
}

@media (max-width: 40rem) {
	.consent p {
		font-size: var(--step--1);
	}

	.consent h2 {
		font-size: var(--step-1);
	}
}

.consent-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: var(--space);
}

/* Accept and reject weigh the same */
.consent-actions button {
	flex: 1 1 8rem;
	max-width: 16rem;
	min-height: 2.75rem;
	padding: 0.5rem 1.25rem;
	border: 2px solid var(--signal);
	border-radius: var(--radius);
	background: var(--signal);
	color: var(--ink);
	font-family: var(--font-board);
	font-size: var(--step-1);
	font-weight: 700;
	cursor: pointer;
}

.consent-actions button:hover {
	background: var(--paper);
	border-color: var(--paper);
}

.advertisers {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: var(--space);
	margin: var(--space) 0 0;
	padding: 0;
	list-style: none;
}

.advertisers li {
	display: grid;
	justify-items: center;
	gap: 0.5rem;
	padding: var(--space);
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	font-weight: 600;
	text-align: center;
}

.advertisers img {
	width: 120px;
	height: 60px;
	object-fit: contain;
}

/* --- Footer */

.site-footer {
	border-top: 1px solid var(--rule);
	background: var(--paper);
	color: var(--ink-soft);
	font-size: var(--step--1);
}

.site-footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space);
	padding-block: calc(1.5 * var(--space));
}

.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
