/**
 * One trip for the trip checkers (techrahal-tools 1.13.0): the card above the
 * passport checker, the EES helper, the ETIAS checker and (since 1.14.0) the
 * UK ETA checker's dates part, and the save row.
 * Colors, radii and the focus ring come from the theme presets and the tools'
 * custom properties, with the Route design system's light values as
 * fallbacks, so both follow the Night theme. The head flag
 * (assets/trip-flag.js) sets html.th-trip-on when a trip is kept, and one
 * class per checker for the card it will show, so the card's space is there
 * from the first paint. The space is reserved on the slot, not on the card;
 * trip.js gives it up when the card is in place before the first frame, and
 * otherwise once the visitor acts on the card.
 */

.th-trip-slot,
.th-trip-save {
	--th-trip-panel: var(--wp--preset--color--panel, #fff);
	--th-trip-ink: var(--wp--preset--color--ink, #0d1526);
	--th-trip-ink-soft: var(--wp--preset--color--ink-soft, #2c3a55);
	--th-trip-ink-muted: var(--wp--preset--color--ink-muted, #4b5873);
	--th-trip-accent: var(--wp--preset--color--accent, #1f4fd8);
	--th-trip-on-accent: var(--wp--preset--color--on-accent, #fff);
	--th-trip-tint: var(--wp--preset--color--accent-tint, #dce5fb);
	--th-trip-radius: var(--wp--custom--radius--control, 14px);
	--th-trip-ring: var(--wp--custom--tools--focus-ring, 0 0 0 2px var(--th-trip-panel), 0 0 0 5px var(--th-trip-accent));
	/* The tallest card in each state, measured with the longest names the
	   checkers save and dates across two years: the space reserved before the
	   card appears for an offer, a filled card, a filled card with the note
	   for the Schengen area, a filled card with one link (a trip to Ireland
	   or the UK in the passport and the ETIAS checkers), and a trip the
	   checker does not cover. These values hold from 340 to 479 px, the one
	   link card's from 320 to 389 px; the media queries below set the rest. */
	--th-trip-reserve: 150px;
	--th-trip-reserve-fill: 258px;
	--th-trip-reserve-note: 312px;
	--th-trip-reserve-one: 218px;
	--th-trip-reserve-na: 198px;
	box-sizing: border-box;
	min-width: 0;
	color: var(--th-trip-ink);
	font-size: 16px;
	line-height: 1.5;
}

@media (max-width: 339px) {
	.th-trip-slot,
	.th-trip-save {
		--th-trip-reserve: 174px;
		--th-trip-reserve-fill: 282px;
		--th-trip-reserve-note: 336px;
	}
}

@media (min-width: 390px) {
	.th-trip-slot,
	.th-trip-save {
		--th-trip-reserve-one: 150px;
	}
}

@media (min-width: 480px) {
	.th-trip-slot,
	.th-trip-save {
		--th-trip-reserve-fill: 194px;
		--th-trip-reserve-note: 248px;
		--th-trip-reserve-na: 174px;
	}
}

@media (min-width: 600px) {
	.th-trip-slot,
	.th-trip-save {
		--th-trip-reserve: 126px;
		--th-trip-reserve-fill: 150px;
		--th-trip-reserve-note: 180px;
		--th-trip-reserve-na: 150px;
	}
}

@media (min-width: 800px) {
	.th-trip-slot,
	.th-trip-save {
		--th-trip-reserve-fill: 126px;
		--th-trip-reserve-one: 126px;
	}
}

.th-trip-slot *,
.th-trip-save * {
	box-sizing: border-box;
}

.th-trip-slot:empty {
	display: none;
}

.th-trip-on .th-trip-slot {
	display: block;
	min-height: var(--th-trip-reserve);
}

.th-trip-on.th-trip-pass-fill .th-pass .th-trip-slot,
.th-trip-on.th-trip-ees-fill .th-ees .th-trip-slot,
.th-trip-on.th-trip-etias-fill .th-etias .th-trip-slot {
	min-height: var(--th-trip-reserve-fill);
}

.th-trip-on.th-trip-one-link.th-trip-pass-fill .th-pass .th-trip-slot,
.th-trip-on.th-trip-one-link.th-trip-etias-fill .th-etias .th-trip-slot {
	min-height: var(--th-trip-reserve-one);
}

.th-trip-on.th-trip-ees-note .th-ees .th-trip-slot {
	min-height: var(--th-trip-reserve-note);
}

.th-trip-on.th-trip-ees-na .th-ees .th-trip-slot,
.th-trip-on.th-trip-etias-na .th-etias .th-trip-slot {
	min-height: var(--th-trip-reserve-na);
}

/* The UK ETA checker's dates part: a trip to the UK gets the offer's space,
   any other trip the space of a card that does not apply. */
.th-trip-on .th-uketa .th-trip-slot {
	min-height: var(--th-trip-reserve-na);
}

.th-trip-on.th-trip-uk .th-uketa .th-trip-slot {
	min-height: var(--th-trip-reserve);
}

.th-trip-save[hidden],
.th-trip-slot [hidden],
.th-trip-save [hidden] {
	display: none !important;
}

.th-trip {
	display: grid;
	align-content: start;
	gap: 6px;
	padding: 14px 16px;
	border: 1.5px dashed var(--th-trip-accent);
	border-radius: var(--th-trip-radius);
	background: var(--th-trip-tint);
}

.th-trip p,
.th-trip ul,
.th-trip-save p,
.th-trip-save ul {
	margin: 0;
}

.th-trip__label {
	color: var(--th-trip-ink-soft);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.th-trip__text,
.th-trip-save__text {
	font-weight: 600;
}

.th-trip__note {
	color: var(--th-trip-ink-soft);
}

.th-trip__acts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 16px;
}

.th-trip__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 16px;
	padding: 0;
	list-style: none;
}

.th-trip__links a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	color: var(--th-trip-accent);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

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

.th-trip__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 6px 14px;
	border: 1.5px solid var(--th-trip-accent);
	border-radius: var(--th-trip-radius);
	background: var(--th-trip-accent);
	color: var(--th-trip-on-accent);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.th-trip__btn.is-ghost {
	background: transparent;
	color: var(--th-trip-accent);
}

.th-trip__btn.is-ghost:hover {
	background: var(--th-trip-tint);
}

.th-trip__btn.is-quiet {
	padding: 6px 0;
	border-width: 0;
	background: none;
	color: var(--th-trip-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.th-trip__text:focus,
.th-trip-save__text:focus {
	outline: none;
}

.th-trip-slot :is(a, button, .th-trip__text):focus-visible,
.th-trip-save :is(a, button, .th-trip-save__text):focus-visible {
	outline: 2px solid transparent;
	box-shadow: var(--th-trip-ring);
}

.th-trip-save__box {
	display: grid;
	justify-items: start;
	gap: 8px;
}

.th-trip-save__hint {
	color: var(--th-trip-ink-muted);
	font-size: 14px;
}

.th-trip__live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media print {
	.th-trip-slot,
	.th-trip-save {
		display: none !important;
	}
}
