/*--------------------------------------------------------------
# Book a Call — Call Options Dialog
# The four call cards brought to the reader from the closing CTA,
# rather than scrolling them back up past the whole page.
--------------------------------------------------------------*/

.bac-modal {
	position: fixed;
	inset: 0;
	/* The theme's modal level — .ic-vault-modal and .m-archive-modal both sit
	   here, above the site header's 1000. */
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;

	/* Nothing in here is interactive until the dialog is open. Belt and braces
	   next to the [hidden] guard below: during the 300ms close fade the
	   element is displayed again, and without this it would go on swallowing
	   clicks meant for the page behind it. */
	pointer-events: none;
}

/* The hidden attribute is nothing but [hidden]{display:none} in the UA
   stylesheet, and an author display declaration beats a UA one whatever the
   specificity — so the display:flex above silently cancelled it.

   The dialog was therefore laid out the entire time: a fixed, full-viewport
   layer over the page. Invisible, because .bac-modal__dialog sits at
   opacity 0, but opacity does not stop hit-testing, so every click aimed at
   the closing CTA landed on the dialog instead and the button appeared dead.
   This is why .m-archive-modal carries the same rule. */
.bac-modal[hidden] {
	display: none;
}

.bac-modal.is-active {
	pointer-events: auto;
}

.bac-modal__backdrop {
	position: absolute;
	inset: 0;
	/* Light enough that the page still reads through it. At 0.62 the backdrop
	   was doing the darkening on its own and the dialog had nothing left to
	   frost, which is what made the panel look like a flat grey slab. */
	background: rgba(26, 26, 26, 0.35);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bac-modal.is-active .bac-modal__backdrop {
	opacity: 1;
}


/* ── Dialog ── */

.bac-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 1080px;

	/* vh first, then dvh for browsers that have it. On a phone vh is the
	   *largest* viewport height, so the dialog's bottom can end up behind the
	   URL bar; dvh is the honest number. Safe to use here in a way it was not
	   for the About hero: body scroll is locked while this is open, so the bar
	   cannot collapse mid-view and reflow it. */
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;

	/* Solid fallback for browsers without backdrop-filter: dark, matching the
	   glass's own tint rather than the white it replaced. */
	background: #16161A;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 24px;
	padding: 44px 40px 40px;

	opacity: 0;
	transform: translateY(16px);
	transition:
		opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.bac-modal.is-active .bac-modal__dialog {
	opacity: 1;
	transform: translateY(0);
}

/* Dark glass. The header's recipe is white-tinted because it sits over a pale
   page; here the panel sits over its own dimmed backdrop, and tinting white
   there only ever produced grey. Tinting dark instead keeps the frost reading
   as glass and lets the copy go light.

   Through the whole stack — backdrop 0.35, then this at 0.66 — a white
   section behind lands at sRGB 70 and a dark one at 26. 70 is the worst case
   for light copy, and white holds 9.44:1 on it. */
@supports ( ( backdrop-filter: blur(1px) ) or ( -webkit-backdrop-filter: blur(1px) ) ) {
	.bac-modal__dialog {
		background: rgba(16, 16, 18, 0.66);
		backdrop-filter: blur(24px) saturate(150%);
		-webkit-backdrop-filter: blur(24px) saturate(150%);
	}
}


/* ── Close ── */

.bac-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--tpp-white);
	cursor: pointer;
	transition:
		background var(--tpp-transition),
		color var(--tpp-transition);
}

.bac-modal__close:hover {
	background: rgba(255, 255, 255, 0.14);
}

.bac-modal__close:focus-visible {
	outline: 2px solid var(--tpp-white);
	outline-offset: 2px;
}


/* ── Heading ── */

.bac-modal__heading {
	text-align: center;
	font-family: var(--tpp-font-heading);
	font-size: clamp(1.9rem, 4vw + 0.5rem, 3rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-white);
	margin: 0 0 32px;
}


/* ──────────────────────────────────────────────
   The cards inside the dialog

   The wrapper carries .bac-options so the card tokens and the .is-visible
   reveal state resolve from book-a-call-options.css rather than being copied
   here. These two rules take back what comes with that class and does not
   belong in a dialog.

   Doubled selector on purpose: .bac-options--modal alone matches the same
   specificity as .bac-options, which would leave this depending on stylesheet
   order — and order here is hand-managed through wp_enqueue_style $deps.
   ────────────────────────────────────────────── */

.bac-options.bac-options--modal {
	background: transparent;
	padding: 0;
}

.bac-options.bac-options--modal .bac-options__panel {
	padding: 0;
}

/* 70px between cards is right on a full-width page section; inside a dialog
   it just pushes the fourth card off the bottom. */
.bac-options.bac-options--modal .bac-options__grid {
	gap: 20px;
}

/* No stagger — the cards are already on screen when the dialog opens, so a
   delay would only make them arrive late. */
.bac-options.bac-options--modal .bac-options__card {
	transition-delay: 0s;
}


/* ──────────────────────────────────────────────
   Cards as glass

   The page cards are solid white with dark copy, which on a dark glass panel
   reads as four cut-out holes rather than as part of it. Every colour they
   set therefore has to be restated here, on a translucent fill.

   No backdrop-filter of their own: they sit on a panel that has already
   frosted everything behind it, so a translucent fill over that reads as
   glass for free. Blurring again would be four more filter passes inside a
   scrolling container, for no visible difference.

   Ratios below are against the lightest the card can get — sRGB 89, which is
   with a white page section behind the modal.
   ────────────────────────────────────────────── */

.bac-options.bac-options--modal .bac-options__card {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
}

.bac-options.bac-options--modal .bac-options__card:hover {
	border-color: rgba(255, 255, 255, 0.38);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

/* Featured: a brighter edge instead of the black one, which would vanish. */
.bac-options.bac-options--modal .bac-options__card--featured,
.bac-options.bac-options--modal .bac-options__card--featured:hover {
	border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.bac-options.bac-options--modal .bac-options__badge {
	background: var(--tpp-white);
	color: var(--tpp-black);
}

/* 7.06:1 */
.bac-options.bac-options--modal .bac-options__price {
	color: var(--tpp-white);
}

/* 4.59:1 */
.bac-options.bac-options--modal .bac-options__desc {
	color: rgba(255, 255, 255, 0.72);
}

/* The page's duration colours are a darkened blue and green chosen to be
   legible on white; on this ground they are all but invisible. #BED0F9 is the
   same hue as --bac-duration taken light enough to clear 4.5:1 here (4.56:1),
   and the featured card can finally use the theme's actual orange, which
   reads clearly on the dark glass where it could not on the white card. */
.bac-options.bac-options--modal .bac-options__duration {
	color: #BED0F9;
}

.bac-options.bac-options--modal .bac-options__card--featured .bac-options__duration {
	color: var(--tpp-accent);
}

/* Four-part selector so it outranks .bac-options__cta:hover:visited, which is
   what actually decides the colour of the hover-stagger spans — they take
   `color: inherit` from the anchor. Three parts would only tie and leave this
   depending on stylesheet order. */
.bac-options.bac-options--modal .bac-options__cta,
.bac-options.bac-options--modal .bac-options__cta:hover,
.bac-options.bac-options--modal .bac-options__cta:visited,
.bac-options.bac-options--modal .bac-options__cta:hover:visited {
	border-color: rgba(255, 255, 255, 0.35);
	color: var(--tpp-white);
}

.bac-options.bac-options--modal .bac-options__cta:hover {
	border-color: var(--tpp-white);
	background: rgba(255, 255, 255, 0.14);
}

.bac-options.bac-options--modal .bac-options__cta:focus-visible {
	outline-color: var(--tpp-white);
}

/* Featured button stays the solid one, inverted: white fill, dark label. */
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta,
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta:hover,
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta:visited,
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta:hover:visited {
	background: var(--tpp-accent); /* orange key button, white until 29 Nov 2026 */
	border-color: var(--tpp-accent);
	color: var(--tpp-black);
}

.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta:hover {
	background: var(--tpp-accent-dark);
	border-color: var(--tpp-accent-dark);
	box-shadow: 0 10px 30px rgba(255, 153, 0, 0.25);
}

/* ...and its label has to be set on the spans, not just on the anchor.
   js/hover-text-animate.js splits this button's text into .text-reveal spans,
   and style.css colours those white directly:

       .bac-options__card--featured .bac-options__cta .text-reveal-primary

   That is for the page's featured card, where the button is black. Here the
   button is white, so the rule left white text on a white pill — the label
   vanished entirely. The spans carry their own explicit colour, so setting
   `color` on the anchor above cannot reach them; this has to name them too,
   at five parts to outrank that three-part selector. */
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta .text-reveal,
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta .text-reveal-primary,
.bac-options.bac-options--modal .bac-options__card--featured .bac-options__cta .text-reveal-secondary {
	color: var(--tpp-black);
}

/* Unconfigured link. Dashed and quiet, as on the page, but light enough to
   still be readable as a message rather than looking broken. */
.bac-options.bac-options--modal .bac-options__cta--pending,
.bac-options.bac-options--modal .bac-options__cta--pending:hover {
	border-color: rgba(255, 255, 255, 0.28);
	background: transparent;
	color: rgba(255, 255, 255, 0.62);
}


/* ──────────────────────────────────────────────
   Reduced motion
   ────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.bac-modal__backdrop,
	.bac-modal__dialog,
	.bac-modal__close {
		transition: none;
	}
}


/* ──────────────────────────────────────────────
   Tablet (≤991px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 991px) {
	.bac-modal__dialog {
		padding: 40px 28px 32px;
	}

	.bac-modal__heading {
		margin-bottom: 26px;
	}
}


/* ──────────────────────────────────────────────
   Mobile (≤767px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 767px) {
	.bac-modal {
		padding: 16px;
	}

	.bac-modal__dialog {
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
		border-radius: 20px;
		padding: 36px 18px 28px;
	}

	.bac-modal__heading {
		font-size: clamp(1.65rem, 7vw, 2.4rem);
		margin-bottom: 22px;
	}

	.bac-modal__close {
		top: 10px;
		right: 10px;
	}

	/* The page section drops to two columns here and one at 480px, which the
	   dialog inherits. Four cards in one column is a long scroll, but it is
	   the same list the page shows and cutting it down would make the dialog
	   disagree with the section. */
	.bac-options.bac-options--modal .bac-options__grid {
		gap: 14px;
	}
}
