/**
 * Announcement promo popup.
 *
 * A sales-ad style card, not a system notice: full-bleed image on
 * top, logo-gold-to-slate accent bar, condensed display title, slate
 * pill CTA (client 2026-09-18: same slate as every other blue button on
 * the site) and a quiet "No, thanks" text button. Every colour / font / radius /
 * shadow reads the host theme's tokens first (spartan-traxx
 * tokens.css) and falls back to the same values, so the card picks up
 * a rebrand automatically and still looks right on a theme without
 * those custom properties. Gold appears as the top bar and the eyebrow
 * chip — the client's "subtle touch".
 *
 * assets/pr-popup.js handles the focus trap + ESC close + initial-
 * focus routing. WCAG 2.1 AA:
 *   - 1.4.3  Contrast: title/body ink on white >= 10:1; eyebrow gold-ink
 *            (#4A3A00) on gold tint >= 7:1; white on slate CTA 7.67:1
 *            (hover slate-2 10.09:1);
 *            dismiss text #464646 on white 9.7:1
 *   - 1.4.11 Non-text contrast: close button stroke slate-2 on white
 *   - 2.1.1  Keyboard: every control is a real button/link
 *   - 2.3.3  Motion: entrance animation only when motion is allowed
 *   - 2.4.7  Focus visible: 3px outline via :focus-visible
 *   - 4.1.2  Name/Role/Value: role="dialog" + aria-modal + labelledby
 */

.traxx-pr-popup-root {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
}

.traxx-pr-popup-root[hidden] {
	display: none;
}

.traxx-pr-popup-root,
.traxx-pr-popup-root * {
	box-sizing: border-box;
}

.traxx-pr-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(43, 43, 46, 0.72);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* ---- Card ---------------------------------------------------------- */

.traxx-pr-popup__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-x: hidden;
	overflow-y: auto;
	background: var(--surface-elevated, #FFFFFF);
	color: var(--text, #14161A);
	border-radius: var(--r-lg, 16px);
	box-shadow:
		var(--shadow-popup, 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 8px 16px -8px rgba(0, 0, 0, 0.15)),
		0 0 0 1px rgba(207, 163, 38, 0.35);
	font-family: var(--font-body, "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: 1rem;
	line-height: var(--lh-body, 1.55);
	outline: none;
	text-align: center;
}

/* Accent bar across the top edge. Sits above the media so the card
   always opens on a stripe of brand colour (logo gold into slate). */
.traxx-pr-popup__dialog::before {
	content: "";
	position: sticky;
	top: 0;
	display: block;
	height: 6px;
	background: linear-gradient(90deg, var(--logo-gold, #D2A348), var(--slate-blue, #49555C));
	z-index: 2;
}

/* ---- Close (X) ----------------------------------------------------- */

.traxx-pr-popup__close {
	position: absolute;
	top: 16px;
	right: 14px;
	z-index: 3;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--surface-elevated, #FFFFFF);
	color: var(--slate-blue-2, #3A434A);
	border: 1.5px solid var(--slate-blue-2, #3A434A);
	border-radius: 50%;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--elev-2, 0 4px 8px -2px rgba(0, 0, 0, 0.10), 0 2px 4px -2px rgba(0, 0, 0, 0.06));
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.traxx-pr-popup__close:hover {
	background: var(--slate-blue-2, #3A434A);
	color: var(--cream, #F3E9D8);
	transform: scale(1.05);
}

/* ---- Media --------------------------------------------------------- */

.traxx-pr-popup__media {
	margin: -6px 0 0; /* tuck under the accent bar */
	aspect-ratio: 16 / 8;
	overflow: hidden;
	background: var(--bone, #F3F1EC);
}

.traxx-pr-popup__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- Body ---------------------------------------------------------- */

.traxx-pr-popup__body {
	padding: clamp(28px, 5vw, 40px) clamp(24px, 5vw, 44px) clamp(28px, 5vw, 36px);
}

.traxx-pr-popup__dialog:not(.has-media) .traxx-pr-popup__body {
	padding-top: clamp(60px, 8vw, 68px); /* clear the X (16px + 40px) */
}

.traxx-pr-popup__eyebrow {
	display: inline-block;
	margin: 0 0 14px;
	padding: 5px 14px;
	background: var(--gold-tint, rgba(207, 163, 38, 0.15));
	color: var(--gold-ink, #4A3A00);
	border-radius: var(--r-pill, 50px);
	font-family: var(--font-display, "Oswald", Impact, sans-serif);
	font-size: var(--fs-eyebrow, 0.78rem);
	font-weight: 500;
	letter-spacing: var(--tracking-eyebrow, 0.22em);
	text-transform: uppercase;
	line-height: 1.4;
}

.traxx-pr-popup__title {
	margin: 0 0 14px;
	font-family: var(--font-display, "Oswald", Impact, sans-serif);
	font-weight: 500; /* the theme loads Oswald 400 / 500 only */
	font-size: clamp(1.85rem, 3.4vw, 2.6rem);
	line-height: var(--lh-tight, 1.1);
	letter-spacing: var(--tracking-display, 0.005em);
	text-transform: uppercase;
	color: var(--slate-blue-2, #3A434A);
	text-wrap: balance;
}

.traxx-pr-popup__summary {
	margin: 0 auto 8px;
	max-width: 42ch;
	font-size: 1.0625rem;
	color: var(--text-muted, #464646);
}

.traxx-pr-popup__summary p {
	margin: 0 0 0.75em;
}

.traxx-pr-popup__summary p:last-child {
	margin-bottom: 0;
}

/* ---- Actions ------------------------------------------------------- */

.traxx-pr-popup__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: 24px 0 0;
}

.traxx-pr-popup__cta {
	display: inline-block;
	min-width: min(260px, 100%);
	padding: 15px 38px;
	background: var(--slate-blue, #49555C);
	color: #FFFFFF;
	border-radius: var(--r-pill, 50px);
	font-family: var(--font-body, "Titillium Web", sans-serif);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: 0 10px 22px -10px rgba(73, 85, 92, 0.9);
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.traxx-pr-popup__cta:hover {
	background: var(--slate-blue-2, #3A434A);
	color: #FFFFFF;
	transform: translateY(-1px);
	box-shadow: 0 14px 26px -10px rgba(58, 67, 74, 0.9);
	text-decoration: none;
}

.traxx-pr-popup__dismiss {
	background: none;
	border: 0;
	padding: 6px 10px;
	font-family: inherit;
	font-size: var(--fs-small, 0.875rem);
	color: var(--text-muted, #464646);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.traxx-pr-popup__dismiss:hover {
	color: var(--slate-blue-2, #3A434A);
}

/* ---- Focus --------------------------------------------------------- */

.traxx-pr-popup__close:focus-visible,
.traxx-pr-popup__dismiss:focus-visible,
.traxx-pr-popup__cta:focus-visible {
	outline: 3px solid var(--slate-blue-2, #3A434A);
	outline-offset: 3px;
}

/* ---- Motion -------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.traxx-pr-popup-root:not([hidden]) .traxx-pr-popup__backdrop {
		animation: traxx-pr-popup-fade 0.25s ease-out;
	}
	.traxx-pr-popup-root:not([hidden]) .traxx-pr-popup__dialog {
		animation: traxx-pr-popup-in 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.15);
	}
}

@keyframes traxx-pr-popup-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes traxx-pr-popup-in {
	from { opacity: 0; transform: translateY(18px) scale(0.94); }
	to   { opacity: 1; transform: none; }
}

/* ---- Small screens ------------------------------------------------- */

@media (max-width: 480px) {
	.traxx-pr-popup-root {
		align-items: flex-end;
		padding: 0;
	}
	.traxx-pr-popup__dialog {
		max-height: 92dvh;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
	}
	.traxx-pr-popup__media {
		aspect-ratio: 16 / 9;
		max-height: 34dvh; /* keep the CTA above the fold on short phones */
	}
	.traxx-pr-popup__cta {
		width: 100%;
	}
}
