/*
 * Glacial Promotions — offers and the promotions pages.
 *
 * Fonts are inherited from the theme. Colors come from Promotions → Settings as
 * custom properties (contrast-checked on save); the fallbacks below are only
 * used before the settings have been saved.
 *
 * Self-contained, so the same look holds on older and newer site builds:
 * everything the plugin prints sits inside an element with the .gp-ui class,
 * and every rule is scoped to it. That puts these rules above a theme's
 * content rules (".entry-content p", ".w-richtext ul"), and the reset below
 * clears what themes add to bare elements. Nothing here relies on theme CSS.
 *
 * Accessibility rules this file keeps:
 * - Text never sits directly on a photo: panels or a dark scrim guarantee
 *   contrast, "text over photo" stacks under the photo on small screens, and
 *   the poster fades its photo out beside the text rather than under it.
 * - Designer graphics are never cropped (they're validated as 4:5 on upload),
 *   so no words in them are cut off.
 * - Sizes are rem-based and nothing has a fixed height, so text can be
 *   enlarged to 200% and re-spaced (WCAG 1.4.4, 1.4.10, 1.4.12).
 * - Fine print stays at least 0.875rem and full-contrast.
 * - Every control has a visible :focus-visible outline and a 44px target.
 */

:root {
	--gp-dark: #321b2d;
	--gp-accent: #7a5c86;
	--gp-light: #f4efe8;
	--gp-ink: #25071f;
	--gp-white: #fff;
	--gp-line: rgb(0 0 0 / 14%);
	--gp-radius: 4px;
	--gp-gap: clamp(1rem, 0.6rem + 1.6vw, 2rem);
	--gp-band: clamp(2.5rem, 1.5rem + 4vw, 5rem);
	--gp-wrap: 103.75rem; /* 1660px */
	/* Inside the offer's box and the form panel beside it */
	--gp-panel-pad: clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
	--gp-heading-font: inherit;
	/* Accent words on dark panels: the accent lifted toward white (≥ 7:1 on dark). */
	--gp-accent-on-dark: color-mix(in srgb, var(--gp-accent) 40%, #fff);
}

/* ---------- reset: theme styles on bare elements ---------- */

/* Specificity 0,1,1: above a theme's element rules, below every rule after it. */
.gp-ui,
.gp-ui *,
.gp-ui ::before,
.gp-ui ::after {
	box-sizing: border-box;
}

.gp-ui :is(h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, figure) {
	float: none;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	letter-spacing: normal;
	text-align: inherit;
	text-transform: none;
}

.gp-ui :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
	font-family: var(--gp-heading-font);
}

.gp-ui :is(h1, h2, h3, h4, h5, h6, li)::before,
.gp-ui :is(h1, h2, h3, h4, h5, h6, li)::after {
	content: none;
}

.gp-ui :is(ul, ol) {
	list-style: none;
}

.gp-ui a {
	border: 0;
	background-image: none;
	box-shadow: none;
	text-shadow: none;
}

.gp-ui img {
	max-width: 100%;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* The promotions pages' background (Promotions → Settings → Colors), else the site's own */
.gp-ui.gp-page {
	background: var(--gp-page-bg, transparent);
}

/* ---------- utilities ---------- */

.gp-ui .gp-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.gp-ui .gp-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--gp-wrap);
	margin-inline: auto;
	padding-inline: 16px;
}

@media (min-width: 768px) {
	.gp-ui .gp-wrap {
		padding-inline: 24px;
	}
}

.gp-ui.gp-band,
.gp-ui .gp-band {
	padding-block: var(--gp-band);
	color: var(--gp-ink);
}

.gp-ui.gp-band--light,
.gp-ui .gp-band--light {
	background: var(--gp-light);
}

.gp-ui .gp-band--offer {
	padding-block: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.gp-ui .gp-title {
	font-family: var(--gp-heading-font);
	color: inherit;
	line-height: 1.15;
	margin: 0 0 0.5em;
	text-wrap: balance;
}

.gp-ui .gp-title em,
.gp-ui .gp-accent {
	color: var(--gp-accent);
	font-style: italic;
}

.gp-ui .gp-eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: inherit;
}

.gp-ui .gp-section-title {
	font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
}

.gp-ui .gp-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	margin: 1.25rem 0 0;
}

/* ---------- buttons & links ---------- */

.gp-ui .gp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.7rem 1.5rem;
	border: 2px solid var(--gp-dark);
	border-radius: var(--gp-radius);
	background: var(--gp-dark);
	color: var(--gp-white) !important;
	font-weight: 600;
	font-size: 0.9375rem;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	text-transform: uppercase;
	cursor: pointer;
}

.gp-ui .gp-btn:hover {
	background: var(--gp-ink);
	border-color: var(--gp-ink);
}

.gp-ui .gp-link {
	color: inherit !important;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
	min-height: 24px;
	display: inline-block;
}

.gp-ui .gp-link:hover {
	text-decoration-thickness: 2px;
}

.gp-ui .gp-btn:focus-visible,
.gp-ui .gp-link:focus-visible,
.gp-ui .gp-card__title a:focus-visible,
.gp-ui .gp-graphic-link:focus-visible,
.gp-ui .gp-filter a:focus-visible,
.gp-ui.gp-bar a:focus-visible,
.gp-ui .gp-bar__close:focus-visible {
	outline: 3px solid var(--gp-accent);
	outline-offset: 3px;
}

/* On dark backgrounds the focus ring and buttons flip. */
.gp-ui .gp-style-dark .gp-btn,
.gp-ui .gp-style-photo .gp-feature__body .gp-btn {
	background: var(--gp-white);
	border-color: var(--gp-white);
	color: var(--gp-dark) !important;
}

.gp-ui .gp-style-dark .gp-btn:hover,
.gp-ui .gp-style-photo .gp-feature__body .gp-btn:hover {
	background: var(--gp-light);
	border-color: var(--gp-light);
}

.gp-ui .gp-style-dark :focus-visible,
.gp-ui .gp-style-photo .gp-feature__body :focus-visible,
.gp-ui.gp-bar :focus-visible {
	outline-color: var(--gp-white) !important;
}

/* ---------- price, dates, terms ---------- */

.gp-ui .gp-price {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15rem 0.6rem;
	margin: 0.25rem 0 1rem;
	padding: 0.75rem 1.1rem;
	border: 2px solid currentColor;
	border-radius: var(--gp-radius);
	line-height: 1.2;
}

.gp-ui .gp-price__amount {
	font-family: var(--gp-heading-font);
	font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
	font-weight: 700;
}

.gp-ui .gp-price__label {
	font-size: 1rem;
	font-weight: 600;
}

.gp-ui .gp-price__regular,
.gp-ui .gp-price__savings {
	flex-basis: 100%;
	font-size: 0.9375rem;
}

.gp-ui .gp-price__savings {
	font-weight: 700;
}

.gp-ui .gp-dates {
	margin: 0 0 1rem;
	font-weight: 600;
	font-size: 0.9375rem;
}

.gp-ui .gp-provider {
	margin: 1rem 0 0;
	font-weight: 600;
	font-size: 0.9375rem;
}

.gp-ui .gp-terms {
	margin: 1.25rem 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
	max-width: 40rem;
}

/* ---------- offer: large ("the graphic") ---------- */

.gp-ui .gp-feature {
	display: grid;
	grid-template-columns: 1fr;
	border-radius: var(--gp-radius);
	overflow: hidden;
	background: var(--gp-white);
	color: var(--gp-ink);
}

.gp-ui .gp-feature__media {
	order: -1;
	min-height: 16rem;
	position: relative;
}

.gp-ui .gp-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gp-ui .gp-focus-left {
	object-position: 20% center;
}
.gp-ui .gp-focus-center {
	object-position: center;
}
.gp-ui .gp-focus-right {
	object-position: 80% center;
}
.gp-ui .gp-focus-top {
	object-position: center 15%;
}

.gp-ui .gp-feature__media .gp-photo {
	position: absolute;
	inset: 0;
}

.gp-ui .gp-feature__body {
	padding: var(--gp-panel-pad);
}

.gp-ui .gp-feature__title {
	font-size: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
}

.gp-ui .gp-feature__summary {
	font-size: 1.0625rem;
	line-height: 1.6;
	margin: 0;
	max-width: 36rem;
}

/* Additional info, under the dates on the offer's own page */
.gp-ui .gp-feature__details {
	margin: 0 0 1rem;
	line-height: 1.6;
	max-width: 40rem;
}

.gp-ui .gp-feature__details > * + * {
	margin-top: 0.75em;
}

.gp-ui .gp-feature__details :is(ul, ol) {
	padding-left: 1.25em;
	list-style: revert;
}

@media (min-width: 768px) {
	.gp-ui .gp-feature.has-photo:not(.gp-feature--stacked) {
		grid-template-columns: 1fr 1fr;
	}

	.gp-ui .gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__media {
		order: 0;
		min-height: 100%;
	}

	/* Photo left, offer right. */
	.gp-ui .gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__media {
		grid-column: 1;
		grid-row: 1;
	}

	.gp-ui .gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__body {
		grid-column: 2;
		grid-row: 1;
	}

	.gp-ui .gp-feature__body {
		align-self: center;
	}
}

.gp-ui .gp-style-dark.gp-feature,
.gp-ui .gp-style-dark .gp-feature__body {
	background: var(--gp-dark);
	color: var(--gp-white);
}

.gp-ui .gp-style-dark .gp-title em,
.gp-ui .gp-style-dark .gp-accent,
.gp-ui .gp-style-photo .gp-feature__body .gp-title em,
.gp-ui .gp-style-photo .gp-feature__body .gp-accent {
	color: var(--gp-accent-on-dark);
}

.gp-ui .gp-style-light.gp-feature {
	background: var(--gp-light);
}

/* Text over photo: a dark scrim under the text half keeps contrast ≥ 4.5:1 on
   any photo; below 768px it behaves like the dark style (photo above text). */
.gp-ui .gp-style-photo.gp-feature {
	background: var(--gp-dark);
	color: var(--gp-white);
}

@media (min-width: 768px) {
	.gp-ui .gp-style-photo.gp-feature.has-photo:not(.gp-feature--stacked) {
		grid-template-columns: minmax(0, 1fr);
		position: relative;
		isolation: isolate;
		min-height: 34rem;
	}

	.gp-ui .gp-style-photo.gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__media {
		position: absolute;
		inset: 0;
		z-index: -1;
	}

	.gp-ui .gp-style-photo.gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__media::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(
			90deg,
			rgb(20 10 18 / 92%) 0%,
			rgb(20 10 18 / 88%) 48%,
			rgb(20 10 18 / 0%) 78%
		);
	}

	.gp-ui .gp-style-photo.gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__body {
		grid-column: 1;
		max-width: 52%;
		background: none;
	}
}

/* ---------- offer: poster ---------- */

/*
 * Laid out like the practice's social promo graphics — big headline, boxed
 * price, dates, photo on the right, button and fine print in a band along the
 * bottom — in real text. Phones get a portrait poster (photo above, fading
 * into the background); wider screens put the photo beside the text, fading
 * in from its left edge, so the text never sits on the photo.
 */

.gp-ui .gp-style-poster.gp-feature {
	grid-template-areas: "media" "main" "foot";
	background: var(--gp-light);
	color: var(--gp-ink);
	box-shadow: inset 0 0 0 1px var(--gp-line);
}

.gp-ui .gp-style-poster .gp-feature__body {
	display: contents;
}

.gp-ui .gp-style-poster .gp-feature__media {
	grid-area: media;
	aspect-ratio: 4 / 3;
	min-height: 0;
	-webkit-mask-image: linear-gradient(#000 70%, transparent);
	mask-image: linear-gradient(#000 70%, transparent);
}

.gp-ui .gp-style-poster .gp-feature__main {
	grid-area: main;
	padding: clamp(1.5rem, 1rem + 2vw, 3rem) clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
}

.gp-ui .gp-style-poster.has-photo .gp-feature__main {
	padding-top: 0.25rem;
}

.gp-ui .gp-style-poster .gp-feature__title {
	font-size: clamp(2.25rem, 1.4rem + 3.2vw, 4rem);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.01em;
	margin-bottom: 0.45em;
}

.gp-ui .gp-style-poster .gp-price {
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0 1.25rem;
	padding: 1rem 1.75rem 1.1rem;
	border: 0;
	border-radius: 0.75rem;
	background: var(--gp-dark);
	color: var(--gp-white);
	text-align: center;
}

.gp-ui .gp-style-poster .gp-price__amount {
	font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1.05;
	text-transform: uppercase;
}

/* "— CO2 Laser Treatment —": the rules are borders, so nothing extra is read. */
.gp-ui .gp-style-poster .gp-price__label {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 500;
}

.gp-ui .gp-style-poster .gp-price__label::before,
.gp-ui .gp-style-poster .gp-price__label::after {
	content: "";
	flex: none;
	width: 1.5rem;
	border-top: 1px solid currentColor;
}

.gp-ui .gp-style-poster .gp-price__regular,
.gp-ui .gp-style-poster .gp-price__savings {
	flex-basis: auto;
	font-size: 0.875rem;
}

.gp-ui .gp-style-poster .gp-dates {
	font-weight: 500;
	letter-spacing: 0.02em;
	margin-bottom: 1.25rem;
}

.gp-ui .gp-style-poster .gp-feature__summary {
	font-size: 1rem;
	max-width: 32rem;
}

.gp-ui .gp-style-poster .gp-feature__foot {
	grid-area: foot;
	display: grid;
	align-items: center;
	gap: 1rem 2rem;
	padding: clamp(1.25rem, 1rem + 1vw, 2rem) clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
	background: var(--gp-dark);
	color: var(--gp-white);
}

.gp-ui .gp-style-poster .gp-feature__foot .gp-actions,
.gp-ui .gp-style-poster .gp-feature__foot .gp-terms {
	margin: 0;
}

.gp-ui .gp-style-poster .gp-feature__foot .gp-terms {
	max-width: none;
}

.gp-ui .gp-style-poster .gp-feature__foot .gp-btn {
	gap: 0.6em;
	padding-inline: 1.75rem;
	border-color: var(--gp-white);
	border-radius: 999px;
	background: var(--gp-white);
	color: var(--gp-dark) !important;
	font-size: 1.0625rem;
	letter-spacing: 0;
	text-transform: none;
}

/* Arrow drawn with a mask, so screen readers have nothing to announce. */
.gp-ui .gp-style-poster .gp-feature__foot .gp-btn::after {
	content: "";
	width: 1.1em;
	height: 0.8em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Cpath d='M0 8h19M13 1.5 19.5 8 13 14.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Cpath d='M0 8h19M13 1.5 19.5 8 13 14.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
}

.gp-ui .gp-style-poster .gp-feature__foot .gp-btn:hover {
	border-color: var(--gp-light);
	background: var(--gp-light);
}

.gp-ui .gp-style-poster .gp-feature__foot :focus-visible {
	outline-color: var(--gp-white) !important;
}

@media (min-width: 768px) {
	.gp-ui .gp-style-poster.gp-feature.has-photo:not(.gp-feature--stacked) {
		grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
		grid-template-rows: minmax(26rem, auto) auto;
		grid-template-areas: "main media" "foot foot";
	}

	.gp-ui .gp-style-poster.gp-feature.has-photo:not(.gp-feature--stacked) .gp-feature__media {
		grid-area: media;
		aspect-ratio: auto;
		min-height: 100%;
		-webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
		mask-image: linear-gradient(to right, transparent, #000 30%);
	}

	.gp-ui .gp-style-poster .gp-feature__main,
	.gp-ui .gp-style-poster.has-photo .gp-feature__main {
		align-self: center;
		padding: clamp(2rem, 1rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
	}

	.gp-ui .gp-style-poster .gp-feature__foot {
		grid-template-columns: auto minmax(0, 1fr);
	}
}

/* ---------- offer: designer graphic ---------- */

.gp-ui .gp-graphic {
	display: block;
	width: 100%;
	height: auto;
}

.gp-ui .gp-card__graphic,
.gp-ui .gp-feature__graphic {
	margin: 0;
	padding: 0;
}

.gp-ui .gp-graphic-link {
	display: block;
}

/* Not clipped, so the focus ring can sit outside the artwork. */
.gp-ui .gp-card.is-graphic {
	overflow: visible;
}

.gp-ui .gp-card.is-graphic .gp-graphic {
	border-radius: calc(var(--gp-radius) - 1px) calc(var(--gp-radius) - 1px) 0 0;
}

/* Not clipped either: the artwork is a link here too. */
.gp-ui .gp-feature.is-graphic {
	overflow: visible;
	border: 1px solid var(--gp-line);
	background: var(--gp-light);
}

.gp-ui .gp-feature.is-graphic .gp-graphic {
	border-radius: calc(var(--gp-radius) - 1px);
}

.gp-ui .gp-feature.is-graphic .gp-dates {
	font-size: 1rem;
}

@media (min-width: 768px) {
	.gp-ui .gp-feature.is-graphic:not(.gp-feature--stacked) {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.gp-ui .gp-feature.is-graphic:not(.gp-feature--stacked) .gp-feature__body {
		align-self: center;
	}
}

/* ---------- offer: card ---------- */

.gp-ui .gp-grid {
	display: grid;
	gap: var(--gp-gap);
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
	.gp-ui .gp-grid--2,
	.gp-ui .gp-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 992px) {
	.gp-ui .gp-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.gp-ui .gp-card {
	display: flex;
	flex-direction: column;
	background: var(--gp-white);
	color: var(--gp-ink);
	border: 1px solid var(--gp-line);
	border-radius: var(--gp-radius);
	overflow: hidden;
}

.gp-ui .gp-card__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.gp-ui .gp-card__media-link {
	position: relative;
	display: block;
	height: 100%;
}

/* The site logo on the photo, bottom left */
.gp-ui .gp-card__logo {
	position: absolute;
	bottom: 0.75rem;
	left: 0.75rem;
	display: flex;
	align-items: center;
	max-width: calc(100% - 1.5rem);
}

.gp-ui .gp-card__logo img {
	display: block;
	width: auto;
	max-width: 11rem;
	height: 1.75rem;
	object-fit: contain;
}

.gp-ui .gp-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.25rem 1.25rem 1.5rem;
}

.gp-ui .gp-card__title {
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}

.gp-ui .gp-card__title a {
	color: inherit !important;
	text-decoration: none;
}

.gp-ui .gp-card__title a:hover {
	text-decoration: underline;
}

.gp-ui .gp-card .gp-price {
	align-self: flex-start;
	background: var(--gp-dark);
	border-color: var(--gp-dark);
	color: var(--gp-white);
}

.gp-ui .gp-card__summary {
	margin: 0 0 0.75rem;
	line-height: 1.55;
}

.gp-ui .gp-card .gp-terms {
	margin: 0 0 0.75rem;
}

.gp-ui .gp-card .gp-actions {
	margin-top: auto;
	padding-top: 0.5rem;
}

/*
 * Cards side by side (.gp-grid--aligned, gpromo_grid_classes()): each card
 * takes eight rows of the grid and shares them with the cards beside it
 * (subgrid): photo, eyebrow, headline, price, description, dates, terms and
 * button. So a card without an eyebrow, or with a one-line headline, keeps its
 * price box, dates and button level with its neighbours. A designer-graphic
 * card's artwork spans the first five rows; its dates, terms and button use
 * the same rows as everyone else's. Browsers without subgrid keep the column
 * layout above.
 */
@supports (grid-template-rows: subgrid) {
	.gp-ui .gp-grid--aligned {
		row-gap: 0;
		margin-bottom: calc(-1 * var(--gp-gap));
	}

	.gp-ui .gp-grid--aligned > .gp-card,
	.gp-ui .gp-grid--aligned > .gp-card:not(.is-graphic) > .gp-card__body {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: subgrid;
		row-gap: 0;
	}

	.gp-ui .gp-grid--aligned > .gp-card {
		grid-row: span 8;
		margin-bottom: var(--gp-gap);
	}

	/* Text card: photo, then seven rows of text */
	.gp-ui .gp-grid--aligned > .gp-card > .gp-card__media { grid-row: 1; }
	.gp-ui .gp-grid--aligned > .gp-card:not(.is-graphic) > .gp-card__body { grid-row: 2 / span 7; }
	.gp-ui .gp-grid--aligned .gp-card__body > .gp-eyebrow { grid-row: 1; }
	.gp-ui .gp-grid--aligned .gp-card__body > .gp-card__title { grid-row: 2; }
	.gp-ui .gp-grid--aligned .gp-card__body > .gp-price { grid-row: 3; justify-self: start; align-self: start; }
	.gp-ui .gp-grid--aligned .gp-card__body > .gp-card__summary { grid-row: 4; }
	.gp-ui .gp-grid--aligned > .gp-card:not(.is-graphic) > .gp-card__body > .gp-dates { grid-row: 5; }
	.gp-ui .gp-grid--aligned > .gp-card:not(.is-graphic) > .gp-card__body > .gp-terms { grid-row: 6; }
	.gp-ui .gp-grid--aligned > .gp-card:not(.is-graphic) > .gp-card__body > .gp-actions { grid-row: 7; }

	.gp-ui .gp-grid--aligned > .gp-card:not(.is-graphic) > .gp-card__body > .gp-actions {
		align-self: end;
		margin-top: 0;
	}

	/* Designer-graphic card: spans the same rows as one column, its dates and terms right under the artwork and
	   its button at the bottom, level with the others */
	.gp-ui .gp-grid--aligned > .gp-card.is-graphic,
	.gp-ui .gp-grid--aligned > .gp-card.is-graphic > .gp-card__body {
		display: flex;
		flex-direction: column;
	}
}

/*
 * Phones: two or more offers sit side by side in a row you swipe through
 * (.gp-grid--swipe), snapping card by card. Each card is a little narrower
 * than the screen so the next one peeks in, and the row runs to the screen's
 * edges. Cards still share rows, so they line up as above. Tabbing to a card
 * scrolls it into view.
 */
@media (max-width: 639px) {
	.gp-ui .gp-grid--swipe {
		grid-auto-columns: min(85%, 22rem);
		grid-auto-flow: column;
		grid-template-columns: none;
		margin-inline: -16px;
		padding: 0 16px 0.75rem;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-padding-inline: 16px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}

	.gp-ui .gp-grid--swipe > .gp-card {
		scroll-snap-align: start;
	}
}

/* ---------- offer page: back link ---------- */

.gp-ui .gp-back {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
}

.gp-ui .gp-back a::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 0.75em;
	margin-right: 0.4em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Cpath d='M22 8H3M9 1.5 2.5 8 9 14.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Cpath d='M22 8H3M9 1.5 2.5 8 9 14.5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- promotions page ---------- */

.gp-ui .gp-page-title-wrap {
	padding-top: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.gp-ui .gp-page-title {
	margin: 0;
	font-size: clamp(2rem, 1.5rem + 2.5vw, 3.25rem);
}

.gp-ui .gp-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 var(--gp-gap);
	padding: 0;
	list-style: none;
}

.gp-ui .gp-filter a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.4rem 1.1rem;
	border: 2px solid var(--gp-dark);
	border-radius: 999px;
	color: var(--gp-dark) !important;
	font-weight: 600;
	text-decoration: none !important;
}

.gp-ui .gp-filter a:hover,
.gp-ui .gp-filter a[aria-current="page"] {
	background: var(--gp-dark);
	color: var(--gp-white) !important;
}

.gp-ui .gp-empty {
	max-width: 40rem;
	font-size: 1.0625rem;
	line-height: 1.6;
}

.gp-ui .gp-more-link {
	margin: var(--gp-gap) 0 0;
}

.gp-ui .gp-preview-notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 4px solid #996800;
	background: #fff8e5;
	color: #1d2327;
	font-size: 0.9375rem;
}

/* ---------- top bar ---------- */

.gp-ui.gp-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.5rem 3.5rem 0.5rem 1rem;
	background: var(--gp-dark);
	color: var(--gp-white);
	font-size: 0.9375rem;
	line-height: 1.4;
	text-align: center;
}

.gp-ui .gp-bar__text {
	margin: 0;
}

.gp-ui .gp-bar__link {
	margin-left: 0.5rem;
	color: inherit !important;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	white-space: nowrap;
}

.gp-ui .gp-bar__close {
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.gp-ui .gp-bar__close[hidden] {
	display: none;
}

/* ---------- related offers on procedure pages ---------- */

.gp-ui.gp-related .gp-section-title {
	margin-bottom: 1.5rem;
}

/* ---------- an offer's own page: the offer beside the form ---------- */
/*
 * Outside .gp-ui (single-promotions.php): Cognito's seamless embed draws its
 * own fields into the page, and the reset above would strip them. The offer
 * column is .gp-ui; the form's heading sits in a .gp-ui wrapper.
 */
.gp-offer-layout {
	padding-block: clamp(1.5rem, 1rem + 2vw, 3rem) var(--gp-band);
	background: var(--gp-page-bg, transparent);
}

.gp-offer-layout__grid {
	box-sizing: border-box;
	display: grid;
	gap: var(--gp-gap);
	width: 100%;
	max-width: var(--gp-wrap);
	margin-inline: auto;
	padding-inline: 16px;
}

/* A stacked offer (beside the form) gets a taller photo than the phone layout's */
.gp-ui .gp-feature--stacked .gp-feature__media {
	min-height: clamp(16rem, 12rem + 20vw, 24rem);
}

/*
 * Side by side, the offer and the form are the same height. The offer's photo
 * takes up the difference (it's cropped to fit, never stretched); a designer
 * graphic is never cropped, so the text under it grows instead, as does the
 * middle of a Poster.
 */
@media (min-width: 992px) {
	.gp-offer-layout.has-form .gp-offer-layout__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: stretch;
	}

	.gp-offer-layout.has-form .gp-offer-layout__offer {
		display: flex;
		flex-direction: column;
	}

	.gp-offer-layout.has-form .gp-offer-layout__offer > .gp-feature {
		flex: 1;
	}

	.gp-ui .gp-feature--stacked:not(.is-graphic):not(.gp-style-poster) {
		grid-template-rows: minmax(24rem, 1fr) auto;
	}

	.gp-ui .gp-feature--stacked.is-graphic {
		grid-template-rows: auto 1fr;
	}

	.gp-ui .gp-feature--stacked.gp-style-poster {
		grid-template-rows: auto 1fr auto;
	}

	.gp-ui .gp-feature--stacked .gp-feature__body {
		align-self: stretch;
	}
}

.gp-offer-form {
	box-sizing: border-box;
	padding: var(--gp-panel-pad);
	border: 1px solid var(--gp-line);
	border-radius: var(--gp-radius);
	background: var(--gp-white);
	color: var(--gp-ink);
	scroll-margin-top: 6rem;
}

.gp-ui .gp-offer-form__title {
	margin: 0 0 1.25rem;
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
}

/*
 * Cognito's form, in the site's type and colors: the theme variables Cognito
 * reads, as the landing pages set them for their form (cognito-frame.css in
 * the landing pages repo), with this site's colors on a light panel. Input
 * borders are mixed from the text color to keep 3:1 against the panel.
 * Cognito's own rules are very specific, hence !important.
 */
.gp-offer-form .cog-cognito:not(.el-popper) {
	--font-family: inherit !important;
	--font-size: 1rem !important;
	--font-weight: 400 !important;
	--line-height: 1.45 !important;
	--color: var(--gp-ink) !important;
	--gutter: 1.25rem !important;
	--border-radius: var(--gp-radius) !important;
	--border-width: 1px !important;
	--small-text: 0.9375em !important;
	--form__background-color: transparent !important;
	--form__margins: 0px !important;
	--form__margins--responsive: 0px !important;
	--form__width: 100% !important;
	--primary: var(--gp-dark) !important;
	--primary-reverse: #fff !important;
	--highlight: var(--gp-accent) !important;
	--highlight-reverse: #fff !important;
	--a__color: var(--gp-ink) !important;
	--label__color: var(--gp-ink) !important;
	--label__font-family: inherit !important;
	--label__font-weight: 600 !important;
	--input__background-color: #fff !important;
	--input__border-color: color-mix(in srgb, var(--gp-ink) 55%, #fff) !important;
	--input__border-radius: var(--gp-radius) !important;
	--input__color: var(--gp-ink) !important;
	--input__font-size: 1rem !important;
	--input__line-height: 1.4 !important;
	--input__padding-h: 0.9rem !important;
	--input__padding-v: 0.75rem !important;
	--placeholder__color: color-mix(in srgb, var(--gp-ink) 55%, #fff) !important;
	--checkable__border-color: color-mix(in srgb, var(--gp-ink) 55%, #fff) !important;
	--checkbox__border-radius: var(--gp-radius) !important;
	--button-primary__background-color: var(--gp-dark) !important;
	--button-primary__border-color: var(--gp-dark) !important;
	--button-primary__border-radius: var(--gp-radius) !important;
	--button-primary__color: #fff !important;
	--button-primary__font-family: inherit !important;
	--button-primary__font-weight: 600 !important;
	caret-color: var(--gp-accent);
}

/* This panel's heading names the form */
.gp-offer-form .cog-header {
	display: none !important;
}

.gp-offer-form .cog-body {
	margin-top: 0 !important;
}

/* The submit button matches the plugin's buttons; full width on phones */
.gp-offer-form .cog-cognito .cog-button--primary {
	min-height: 44px !important;
	padding: 0 1.75rem !important;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.gp-offer-form .cog-cognito .cog-button--primary:hover {
	border-color: var(--gp-ink) !important;
	background: var(--gp-ink) !important;
}

@media (max-width: 600px) {
	.gp-offer-form .cog-cognito .cog-button--primary {
		width: 100% !important;
	}
}

/* ---------- an offer's own colors (its Photo & style tab) ---------- */
/*
 * Set per offer and contrast-checked on save (gpromo_offer_colors_problem()),
 * so they win over the hero styles' panel colors. The card, or the offer's
 * panel on its own page, takes --gp-card-bg / --gp-card-ink; its button takes
 * them swapped, so it always stands out; accent words take the text color.
 * The price box takes --gp-price-bg / --gp-price-ink.
 */
.gp-ui .gp-card.has-card-colors,
.gp-ui .gp-feature.has-card-colors,
.gp-ui .gp-feature.has-card-colors .gp-feature__body {
	background: var(--gp-card-bg) !important;
	color: var(--gp-card-ink) !important;
}

.gp-ui .gp-card.has-card-colors,
.gp-ui .gp-feature.has-card-colors {
	border-color: color-mix(in srgb, var(--gp-card-ink) 18%, transparent);
}

.gp-ui .has-card-colors :is(.gp-accent, .gp-title em, .gp-card__title a, .gp-link, .gp-eyebrow, .gp-dates, .gp-terms, .gp-provider) {
	color: var(--gp-card-ink) !important;
}

.gp-ui .has-card-colors .gp-btn {
	border-color: var(--gp-card-ink) !important;
	background: var(--gp-card-ink) !important;
	color: var(--gp-card-bg) !important;
}

.gp-ui .has-card-colors .gp-btn:hover {
	text-decoration: underline !important;
	text-underline-offset: 0.2em;
}

.gp-ui .has-card-colors :focus-visible {
	outline-color: var(--gp-card-ink) !important;
}

.gp-ui .has-price-colors .gp-price {
	border-color: var(--gp-price-bg) !important;
	background: var(--gp-price-bg) !important;
	color: var(--gp-price-ink) !important;
}
