/* ==========================================================================
   TPS Fall Offer popup + corner tab
   Type comes from the theme: the h2 is the theme's Acta Display heading,
   text uses the theme's Gotham. Neutrals are the theme's charcoals; the gold
   and warm grey come from the fall campaign artwork.
   ========================================================================== */

.tps-offer {
	--tps-offer-ink: #404042;          /* theme heading charcoal */
	--tps-offer-ink-soft: #535355;     /* theme secondary charcoal */
	--tps-offer-ground: #ece8e3;       /* campaign backdrop */
	--tps-offer-ground-deep: #d9d1c9;  /* backdrop behind the model */
	--tps-offer-gold: #9c7647;         /* large gold text, disk, outlines (3:1+) */
	--tps-offer-gold-ink: #7a5a30;     /* small gold text (5:1) */
	--tps-offer-gold-deep: #6e5029;    /* gold text on the "on us" half (5.3:1) */
	--tps-offer-gift: #ead9c0;         /* "on us" half: warmer than the backdrop */
	--tps-offer-gold-line: #c8b494;    /* hairlines, perforation */
	--tps-offer-ease: cubic-bezier(0.16, 1, 0.3, 1);
	font-family: Gotham, sans-serif;
}

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

.tps-offer ::selection {
	background: var(--tps-offer-gold-line);
	color: var(--tps-offer-ink);
}

.tps-offer__icon {
	display: block;
	width: 1em;
	height: 1em;
	flex: none;
	stroke-width: 1.5;
}

.tps-offer__gold {
	color: var(--tps-offer-gold);
}

/* --------------------------------------------------------------------------
   Dialog
   ----------------------------------------------------------------------- */

.tps-offer__dialog {
	position: fixed;
	inset: 0;
	width: min(68rem, calc(100% - 3rem));
	max-width: none;
	height: fit-content;
	max-height: calc(100dvh - 3rem);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: linear-gradient(90deg, var(--tps-offer-ground) 50%, var(--tps-offer-ground-deep));
	color: var(--tps-offer-ink);
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.5;
	overflow: auto;
	overscroll-behavior: contain;
	box-shadow:
		0 40px 90px -30px rgba(24, 24, 26, 0.55),
		0 10px 30px -12px rgba(24, 24, 26, 0.25);
}

.tps-offer__dialog:not([open]) {
	display: none;
}

.tps-offer__dialog::backdrop {
	background: rgba(40, 40, 42, 0.62);
	transition: opacity 0.4s ease;
}

.tps-offer__dialog.is-closing::backdrop {
	opacity: 0;
}

html.tps-offer-locked {
	overflow: hidden;
}

.tps-offer__layout {
	position: relative;
	display: flex;
	align-items: center;
	min-height: min(40rem, calc(100dvh - 3rem));
}

/* The model stands at the right, full height, cropped by the dialog edge on
   narrower screens so her face stays clear of the copy. */
.tps-offer__media {
	display: block;
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.tps-offer .tps-offer__photo {
	position: absolute;
	bottom: 0;
	left: max(55%, calc(100% - 29rem));
	width: auto;
	max-width: none;
	height: 97%;
	transition: opacity 0.6s ease;
}

.tps-offer .tps-offer__photo.is-loading {
	opacity: 0;
}

/* Content sits on an opaque-to-clear fade, so it stays readable wherever
   it meets the photo. */
.tps-offer__content {
	position: relative;
	z-index: 2;
	width: min(41rem, 62%);
	padding: 2.5rem 2rem 2.5rem 3rem;
}

.tps-offer__content::before {
	content: "";
	position: absolute;
	inset: 0 -5rem 0 0;
	z-index: -1;
	background: linear-gradient(90deg, var(--tps-offer-ground) calc(100% - 7.5rem), rgba(236, 232, 227, 0));
	pointer-events: none;
}

.tps-offer--no-image .tps-offer__dialog {
	width: min(42rem, calc(100% - 3rem));
	background: var(--tps-offer-ground);
}

.tps-offer--no-image .tps-offer__content {
	width: 100%;
}

.tps-offer .tps-offer__logo {
	display: block;
	filter: brightness(0); /* the site's white logo, shown black */
	width: auto;
	max-width: 100%;
	height: 4rem;
	margin: 0 0 1.75rem;
}

/* "Face forward into fall" with a gold rule, as in the campaign artwork */
.tps-offer .tps-offer__eyebrow {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--tps-offer-gold-ink);
}

.tps-offer__eyebrow::after {
	content: "";
	flex: 0 0 6rem;
	height: 1px;
	background: var(--tps-offer-gold);
}

/* Headline: the theme's h2 face and colour, sized for the dialog */
.tps-offer .tps-offer__title {
	margin: 0 0 1.25rem;
	max-width: none;
	font-size: clamp(2.75rem, 1.5rem + 3vw, 4.25rem);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.005em;
	text-transform: uppercase;
}

.tps-offer__title-line {
	display: block;
}

.tps-offer .tps-offer__subhead {
	margin: 0;
	font-size: 1.5rem;
	line-height: 1.3;
	color: var(--tps-offer-ink);
	text-wrap: balance;
}

.tps-offer__subhead .tps-offer__gold {
	display: block;
	font-weight: 500;
}

.tps-offer .tps-offer__lead {
	margin: 0.75rem 0 0;
	max-width: 40ch;
	font-size: 1.0625rem;
	line-height: 1.55;
	color: var(--tps-offer-ink-soft);
}

/* --------------------------------------------------------------------------
   The voucher: two halves, a perforation, punched notches, a gold plus
   ----------------------------------------------------------------------- */

.tps-offer__voucher {
	--hole: 0.875rem;
	position: relative;
	margin: 1.625rem 0 1.25rem;
	box-shadow: inset 0 0 0 1px var(--tps-offer-gold-line);
	-webkit-mask:
		radial-gradient(circle at 50% 0, transparent var(--hole), #000 calc(var(--hole) + 0.5px)),
		radial-gradient(circle at 50% 100%, transparent var(--hole), #000 calc(var(--hole) + 0.5px));
	-webkit-mask-composite: source-in;
	mask:
		radial-gradient(circle at 50% 0, transparent var(--hole), #000 calc(var(--hole) + 0.5px)),
		radial-gradient(circle at 50% 100%, transparent var(--hole), #000 calc(var(--hole) + 0.5px));
	mask-composite: intersect;
}

/* perforation */
.tps-offer__voucher::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	z-index: 1;
	width: 1px;
	background: repeating-linear-gradient(to bottom, var(--tps-offer-gold) 0 5px, transparent 5px 10px);
}

.tps-offer .tps-offer__voucher-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tps-offer .tps-offer__half {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin: 0;
	padding: 1.125rem 1.875rem 1.25rem 1.375rem;
	background: rgba(255, 255, 255, 0.6);
}

.tps-offer .tps-offer__half--gift {
	padding: 1.125rem 1.375rem 1.25rem 1.875rem;
	background: var(--tps-offer-gift);
}

.tps-offer__plus {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--tps-offer-gold);
	color: #fff;
	font-size: 1.375rem;
	transform: translate(-50%, -50%);
}

.tps-offer__plus .tps-offer__icon {
	stroke-width: 2;
}

.tps-offer__half-head {
	display: flex;
	align-items: baseline;
	gap: 0.625rem;
}

.tps-offer__numeral,
.tps-offer__half-title,
.tps-offer__tab-label {
	font-family: "Acta Display Medium", serif; /* the theme's heading face */
	font-weight: 400;
}

.tps-offer__numeral {
	font-size: 2.75rem;
	line-height: 0.9;
}

.tps-offer__half-title {
	font-size: 1.5rem;
	line-height: 1.1;
}

.tps-offer__half--gift .tps-offer__numeral,
.tps-offer__half--gift .tps-offer__half-title {
	color: var(--tps-offer-gold-deep);
}

.tps-offer__half-text {
	font-size: 1rem;
	line-height: 1.45;
	color: var(--tps-offer-ink-soft);
	text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Deadline, buttons, phone
   ----------------------------------------------------------------------- */

.tps-offer .tps-offer__deadline,
.tps-offer .tps-offer__call {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0;
}

.tps-offer .tps-offer__deadline {
	font-size: 1.0625rem;
}

.tps-offer__deadline .tps-offer__icon {
	font-size: 1.5rem;
	color: var(--tps-offer-gold);
}

.tps-offer__deadline time {
	font-weight: 500;
	color: var(--tps-offer-gold-ink);
}

.tps-offer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.375rem;
}

.tps-offer .tps-offer__btn {
	flex: 1 1 auto; /* fill the row; when they wrap, each takes the full width */
	display: inline-flex;
	white-space: nowrap;
	align-items: center;
	justify-content: center;
	gap: 0.875rem;
	min-height: 3.25rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 0;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.07em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tps-offer .tps-offer__btn--primary {
	background: var(--tps-offer-ink);
	color: #fff;
}

.tps-offer .tps-offer__btn--primary:hover {
	background: #2b2b2c;
	color: #fff;
}

.tps-offer .tps-offer__btn--secondary {
	border-color: var(--tps-offer-gold);
	background: transparent;
	color: var(--tps-offer-ink);
}

.tps-offer .tps-offer__btn--secondary:hover {
	background: rgba(156, 118, 71, 0.1);
	color: var(--tps-offer-ink);
}

.tps-offer__btn .tps-offer__icon {
	font-size: 1.25rem;
	transition: transform 0.35s var(--tps-offer-ease);
}

.tps-offer__btn--secondary .tps-offer__icon {
	color: var(--tps-offer-gold);
}

.tps-offer__btn:hover .tps-offer__icon {
	transform: translateX(4px);
}

.tps-offer .tps-offer__call {
	margin-top: 1.125rem;
	font-size: 1rem;
	color: var(--tps-offer-ink-soft);
}

.tps-offer__call .tps-offer__icon {
	font-size: 1.25rem;
}

.tps-offer .tps-offer__call a {
	font-weight: 500;
	color: var(--tps-offer-ink);
	text-decoration: underline;
	text-decoration-color: var(--tps-offer-gold);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
	white-space: nowrap;
}

.tps-offer .tps-offer__call a:hover {
	color: var(--tps-offer-gold-ink);
	text-decoration-thickness: 2px;
}

/* Close */

.tps-offer .tps-offer__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid var(--tps-offer-gold-line);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--tps-offer-ink);
	font-size: 1.375rem;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tps-offer .tps-offer__close:hover {
	border-color: var(--tps-offer-ink);
	background: var(--tps-offer-ink);
	color: #fff;
}

/* Focus */

.tps-offer a:focus-visible,
.tps-offer button:focus-visible {
	outline: 2px solid var(--tps-offer-ink);
	outline-offset: 3px;
}

.tps-offer a:focus:not(:focus-visible),
.tps-offer button:focus:not(:focus-visible) {
	outline: none;
}

/* --------------------------------------------------------------------------
   Corner tab (minimized state)
   ----------------------------------------------------------------------- */

.tps-offer .tps-offer__tab {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 9990;
	display: flex;
	align-items: center;
	gap: 0.875rem;
	min-height: 3.5rem;
	max-width: calc(100% - 2rem);
	margin: 0;
	padding: 0.5rem 1rem 0.5rem 0.5rem;
	border: 0;
	border-radius: 0;
	background: var(--tps-offer-ink);
	color: #fff;
	text-align: left;
	cursor: pointer;
	box-shadow: 0 14px 34px -12px rgba(24, 24, 26, 0.55);
	transition: background-color 0.2s ease;
}

.tps-offer .tps-offer__tab[hidden] {
	display: none;
}

.tps-offer .tps-offer__tab:hover {
	background: #2b2b2c;
}

.tps-offer .tps-offer__tab:focus-visible {
	outline-color: var(--tps-offer-gold-line);
}

.tps-offer__tab-leaf {
	display: grid;
	place-items: center;
	flex: none;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--tps-offer-gold);
	color: #fff;
	font-size: 1.375rem;
	transition: transform 0.5s var(--tps-offer-ease);
}

.tps-offer__tab:hover .tps-offer__tab-leaf {
	transform: rotate(-14deg);
}

.tps-offer__tab-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.tps-offer__tab-label {
	font-size: 1.25rem;
	line-height: 1.15;
}

.tps-offer__tab-meta {
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.35;
	color: #e3e4e6;
}

.tps-offer__tab-open {
	font-size: 1.25rem;
	color: #d1b48a;
	transition: transform 0.35s var(--tps-offer-ease);
}

.tps-offer__tab:hover .tps-offer__tab-open {
	transform: translate(2px, -2px);
}

/* --------------------------------------------------------------------------
   Short desktop screens
   ----------------------------------------------------------------------- */

@media (min-width: 56rem) and (max-height: 56rem) {
	.tps-offer__content {
		padding-top: 1.75rem;
		padding-bottom: 1.75rem;
	}

	.tps-offer .tps-offer__logo {
		height: 2.75rem;
		margin-bottom: 1.25rem;
	}

	.tps-offer .tps-offer__title {
		font-size: min(3.5rem, 7.5vh);
		margin-bottom: 1rem;
	}

	.tps-offer__voucher {
		margin: 1.125rem 0 0.875rem;
	}

	.tps-offer__actions {
		margin-top: 1rem;
	}

	.tps-offer .tps-offer__call {
		margin-top: 0.75rem;
	}
}

/* --------------------------------------------------------------------------
   Tablets and phones: bottom sheet, portrait band on top, voucher stacks
   ----------------------------------------------------------------------- */

@media (max-width: 55.99rem) {
	/* centred vertically; on short screens it simply fills the height */
	.tps-offer__dialog,
	.tps-offer--no-image .tps-offer__dialog {
		inset: 0;
		width: 100%;
		max-height: calc(100dvh - 1rem);
		margin: auto 0;
		background: var(--tps-offer-ground);
	}

	.tps-offer__layout {
		display: block;
		min-height: 0;
	}

	/* The band fades out (a mask, not an overlay): in from the left and out
	   along the bottom, so her face stays clear and no hard edge shows. */
	.tps-offer__media {
		position: relative;
		z-index: 0;
		top: 0.9375rem;
		height: 13rem;
		background: transparent;
		-webkit-mask:
			linear-gradient(to right, transparent, #000 40%),
			linear-gradient(to top, transparent, #000 45%);
		-webkit-mask-composite: source-in;
		mask:
			linear-gradient(to right, transparent, #000 40%),
			linear-gradient(to top, transparent, #000 45%);
		mask-composite: intersect;
	}

	/* no phone photo: the desktop cut-out, cropped to her face on the right half */
	.tps-offer .tps-offer__photo {
		top: 0;
		bottom: auto;
		left: auto;
		right: 0;
		width: 50%;
		min-width: unset;
		height: 100%;
		object-fit: cover;
		object-position: 50% 20%;
	}

	/* a dedicated phone photo fills the band */
	.tps-offer--phone-photo .tps-offer__photo {
		top: 0;
		right: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: right center;
	}

	.tps-offer__content,
	.tps-offer--no-image .tps-offer__content {
		width: auto;
		margin-top: -1.25rem;
		padding: 0 1.125rem 1rem;
	}

	.tps-offer--no-image .tps-offer__content {
		margin-top: 0;
		padding-top: 3.75rem;
	}

	.tps-offer__content::before {
		display: none;
	}

	/* logo sits in the empty left of the photo band */
	.tps-offer__content {
		position: static;
	}

	.tps-offer__content > * {
		position: relative;
		z-index: 1;
	}

	.tps-offer .tps-offer__logo {
		position: absolute;
		top: 1.125rem;
		left: 1.125rem;
		z-index: 2;
		height: 3rem;
		max-width: 46%;
		margin: 0;
		object-fit: contain;
		object-position: left top;
	}

	.tps-offer .tps-offer__close {
		top: 0.625rem;
		right: 0.625rem;
	}

	.tps-offer .tps-offer__eyebrow {
		gap: 0.75rem;
		margin-bottom: 0.5rem;
		font-size: 0.6875rem; /* 11px */
	}

	.tps-offer__eyebrow::after {
		flex-basis: 2.5rem;
	}

	.tps-offer .tps-offer__title {
		margin-bottom: 0.625rem;
		font-size: clamp(2rem, 1.4rem + 3vw, 2.5rem);
	}

	.tps-offer .tps-offer__subhead {
		font-size: 1.125rem; /* 18px */
	}

	/* below 24px the gold needs the deeper shade to keep 4.5:1 */
	.tps-offer__subhead .tps-offer__gold {
		color: var(--tps-offer-gold-ink);
	}

	.tps-offer .tps-offer__lead {
		margin-top: 0.375rem;
		font-size: 0.875rem; /* 14px */
	}

	/* voucher: stacked halves, each one compact row */
	.tps-offer__voucher {
		--hole: 0.625rem;
		margin: 0.875rem 0 0.75rem;
		-webkit-mask:
			radial-gradient(circle at 0 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px)),
			radial-gradient(circle at 100% 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px));
		-webkit-mask-composite: source-in;
		mask:
			radial-gradient(circle at 0 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px)),
			radial-gradient(circle at 100% 50%, transparent var(--hole), #000 calc(var(--hole) + 0.5px));
		mask-composite: intersect;
	}

	.tps-offer__voucher::before {
		top: 50%;
		right: 0;
		bottom: auto;
		left: 0;
		width: auto;
		height: 1px;
		background: repeating-linear-gradient(to right, var(--tps-offer-gold) 0 5px, transparent 5px 10px);
	}

	/* equal rows keep the perforation, notches and plus at exactly 50% */
	.tps-offer .tps-offer__voucher-list {
		grid-template-columns: 1fr;
		grid-auto-rows: 1fr;
	}

	.tps-offer .tps-offer__half,
	.tps-offer .tps-offer__half--gift {
		display: grid;
		grid-template-columns: 6.25rem 1fr;
		align-items: center;
		column-gap: 0.75rem;
		padding: 0.625rem 1rem 0.875rem;
	}

	.tps-offer .tps-offer__half--gift {
		padding: 0.875rem 1rem 0.625rem;
	}

	.tps-offer__plus {
		width: 2rem;
		height: 2rem;
		font-size: 1.125rem;
	}

	.tps-offer__numeral {
		font-size: 1.75rem;
	}

	.tps-offer__half-title {
		font-size: 1.125rem;
	}

	.tps-offer__half-text {
		font-size: 0.875rem;
		line-height: 1.4;
	}

	.tps-offer .tps-offer__deadline {
		font-size: 0.9375rem;
	}

	.tps-offer__deadline .tps-offer__icon {
		font-size: 1.25rem;
	}

	.tps-offer__actions {
		flex-direction: column;
		gap: 0.5rem;
		margin-top: 0.875rem;
	}

	.tps-offer .tps-offer__btn {
		flex: none;
		width: 100%;
		min-height: 2.875rem;
		padding: 0.625rem 1rem;
		font-size: 0.9375rem;
		white-space: normal;
	}

	.tps-offer .tps-offer__call {
		margin-top: 0.625rem;
		font-size: 0.875rem;
	}

	.tps-offer .tps-offer__tab {
		left: 0.75rem;
		bottom: 0.75rem;
		max-width: calc(100% - 6rem); /* clear of the chat bubble */
		min-height: 3.25rem;
		gap: 0.75rem;
	}

	.tps-offer__tab-leaf {
		width: 2.25rem;
		height: 2.25rem;
		font-size: 1.25rem;
	}

	.tps-offer__tab-label {
		font-size: 1.125rem;
	}
}

@media (max-width: 55.99rem) and (max-height: 40rem) {
	.tps-offer__media {
		display: none;
	}

	.tps-offer__content {
		margin-top: 0;
		padding-top: 4rem;
	}
}

@media (max-width: 22rem) {
	.tps-offer__tab-meta {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Preferences
   ----------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.tps-offer *,
	.tps-offer__dialog::backdrop {
		transition-duration: 0.01ms !important;
	}
}

@media (forced-colors: active) {
	.tps-offer__dialog,
	.tps-offer .tps-offer__tab {
		outline: 1px solid CanvasText;
	}
}
