/*--------------------------------------------------------------
# Newsletter pop-up — the boarding pass
# Concept 06 of ref-doc/homepage-section-concepts.html as a dialog:
# a black pass with notches and a perforation, the email field on the
# main part and a torn-off stub on the right (below on phones).
# Markup: template-parts/global/newsletter-popup.php.
--------------------------------------------------------------*/

/* The dialog itself is only a frame: transparent, no padding, so a click
   that lands on it (not on the pass) is a click on the backdrop. The
   drop shadow sits here because the pass's notch mask would cut a shadow
   on the pass off. */
.tpp-nl {
	/* Wide and low, like a real boarding pass (was 820px; widened 26 Nov 2026
	   because it looked boxy). */
	width: min(1000px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	overflow: visible;
	background: transparent;
	color: var(--tpp-white);
	filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}

.tpp-nl::backdrop {
	background: rgba(12, 14, 18, 0.6);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.tpp-nl[open] {
	animation: tpp-nl-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.tpp-nl[open]::backdrop {
	animation: tpp-nl-fade 0.4s ease;
}

@keyframes tpp-nl-in {
	from {
		opacity: 0;
		transform: translateY(28px) scale(0.98);
	}
}

@keyframes tpp-nl-fade {
	from {
		opacity: 0;
	}
}

/* No page scrolling behind the open pop-up */
html:has(.tpp-nl[open]) {
	overflow: hidden;
}


/* ──────────────────────────────────────────────
   The pass: main part + stub, with two notches at the tear line
   ────────────────────────────────────────────── */

.tpp-nl__pass {
	--stub: 250px;
	--notch: 14px;

	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--stub);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	border-radius: 24px;
	background: var(--tpp-black);
	-webkit-mask:
		radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, transparent 98%, #000 100%) top / 100% 51% no-repeat,
		radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, transparent 98%, #000 100%) bottom / 100% 51% no-repeat;
	mask:
		radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, transparent 98%, #000 100%) top / 100% 51% no-repeat,
		radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, transparent 98%, #000 100%) bottom / 100% 51% no-repeat;
}

/* The pass takes focus when the pop-up opens (autofocus), so it opens
   without a focus ring on the X; Tab goes on to the X and the field. */
.tpp-nl__pass:focus {
	outline: none;
}

/* The perforation between the main part and the stub */
.tpp-nl__pass::after {
	content: '';
	position: absolute;
	top: 22px;
	bottom: 22px;
	right: calc(var(--stub) - 1px);
	border-left: 2px dashed rgba(255, 255, 255, 0.2);
	pointer-events: none;
}

.tpp-nl__close {
	position: absolute;
	z-index: 1;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: var(--tpp-white);
	cursor: pointer;
	transition: background var(--tpp-transition-fast);
}

.tpp-nl__close:hover {
	background: rgba(255, 255, 255, 0.2);
}

.tpp-nl__close:focus-visible {
	outline: 2px solid var(--tpp-accent);
	outline-offset: 2px;
}

.tpp-nl__close svg {
	width: 16px;
	height: 16px;
}


/* ──────────────────────────────────────────────
   Main part
   ────────────────────────────────────────────── */

.tpp-nl__main {
	padding: 34px 48px 30px;
}

/* Small uppercase label in the body font, like every other label on the site */
.tpp-nl__kicker {
	display: block;
	font-family: var(--tpp-font-body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--tpp-accent);
}

.tpp-nl__title {
	margin: 10px 0 8px;
	font-family: var(--tpp-font-heading);
	font-size: clamp(1.6rem, 1.6vw + 1rem, 2.25rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.03em;
	color: var(--tpp-white);
}

.tpp-nl__desc {
	max-width: 660px;
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.7);
}

/* CSH ---✈--- PTS */
.tpp-nl__route {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-top: 26px;
}

.tpp-nl__to {
	text-align: right;
}

.tpp-nl__code {
	display: block;
	font-family: var(--tpp-font-heading);
	font-size: clamp(1.9rem, 2.4vw + 1rem, 2.6rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
}

.tpp-nl__city {
	display: block;
	margin-top: 6px;
	font-size: 0.6875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
}

.tpp-nl__line {
	position: relative;
	flex: 1;
	height: 2px;
	border-top: 2px dashed rgba(255, 255, 255, 0.3);
}

.tpp-nl__line svg {
	position: absolute;
	top: 50%;
	left: 50%;
	box-sizing: content-box;
	width: 26px;
	height: 26px;
	padding: 0 4px;
	background: var(--tpp-black);
	color: var(--tpp-accent);
	transform: translate(-50%, -55%) rotate(90deg);
}

.tpp-nl__fields {
	display: grid;
	grid-template-columns: repeat(3, auto);
	justify-content: start;
	gap: 32px;
	margin: 24px 0;
}

.tpp-nl__fields dt,
.tpp-nl__field small {
	display: block;
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
}

.tpp-nl__fields dd {
	margin: 2px 0 0;
	font-weight: 600;
}

/* Email + button */
.tpp-nl__form {
	display: flex;
	gap: 10px;
}

/* Doubled class: style.css styles input[type="email"] (grey, 3px corners)
   with more weight than a single class. */
.tpp-nl .tpp-nl__input {
	flex: 1;
	min-width: 0;
	padding: 15px 20px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: var(--tpp-radius-pill);
	background: rgba(255, 255, 255, 0.06);
	color: var(--tpp-white);
	font: inherit;
	font-size: 0.9375rem;
}

.tpp-nl .tpp-nl__input::placeholder {
	color: rgba(255, 255, 255, 0.45);
}

.tpp-nl .tpp-nl__input:focus {
	border-color: rgba(255, 255, 255, 0.35);
	color: var(--tpp-white);
	outline: 2px solid var(--tpp-accent);
	outline-offset: 2px;
}

.tpp-nl__btn {
	flex: none;
	padding: 15px 24px;
	border: 0;
	border-radius: var(--tpp-radius-pill);
	background: var(--tpp-accent);
	color: var(--tpp-black);
	font-family: var(--tpp-font-body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background var(--tpp-transition-fast);
}

.tpp-nl__btn:hover {
	background: var(--tpp-accent-dark);
}

.tpp-nl__btn:focus-visible {
	outline: 2px solid var(--tpp-white);
	outline-offset: 2px;
}

.tpp-nl__btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

.tpp-nl__msg {
	margin: 12px 0 0;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--tpp-accent);
}

.tpp-nl__msg.is-error {
	color: #FFB4B4;
}

/* Once subscribed, the field gives way to the thank-you line */
.tpp-nl.is-subscribed .tpp-nl__form {
	display: none;
}

.tpp-nl.is-subscribed .tpp-nl__msg {
	margin-top: 0;
	font-size: 1.0625rem;
}

.tpp-nl__consent {
	margin: 12px 0 0;
	font-size: 0.75rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.5);
}

.tpp-nl__consent a,
.tpp-nl__consent a:visited {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tpp-nl__consent a:hover {
	color: var(--tpp-white);
}


/* ──────────────────────────────────────────────
   Stub
   ────────────────────────────────────────────── */

.tpp-nl__stub {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 22px;
	padding: 64px 32px 30px;
}

.tpp-nl__field b {
	display: block;
	margin-top: 2px;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
}

.tpp-nl__barcode {
	height: 52px;
	border-radius: 2px;
	background: repeating-linear-gradient(90deg, #FFF 0 2px, transparent 2px 4px, #FFF 4px 5px, transparent 5px 9px, #FFF 9px 12px, transparent 12px 14px);
	opacity: 0.85;
}


/* ──────────────────────────────────────────────
   Phones — the stub moves under the pass, torn along the top
   ────────────────────────────────────────────── */

@media screen and (max-width: 640px) {
	.tpp-nl__pass {
		--stub: 0px;
		grid-template-columns: 1fr;
		border-radius: 22px;
		-webkit-mask: none;
		mask: none;
	}

	.tpp-nl__pass::after {
		display: none;
	}

	.tpp-nl__main {
		padding: 30px 22px 6px;
	}

	.tpp-nl__title {
		padding-right: 28px;
	}

	.tpp-nl__route {
		margin-top: 20px;
	}

	.tpp-nl__fields {
		gap: 22px;
		margin: 20px 0;
	}

	.tpp-nl__form {
		flex-direction: column;
	}

	.tpp-nl__btn {
		padding: 15px 20px;
	}

	.tpp-nl__stub {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-items: flex-end;
		gap: 16px 28px;
		margin-top: 18px;
		padding: 22px 22px 26px;
		border-top: 2px dashed rgba(255, 255, 255, 0.2);
	}

	.tpp-nl__barcode {
		flex: 1 1 100%;
		height: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tpp-nl[open],
	.tpp-nl[open]::backdrop {
		animation: none;
	}
}
