/**
 * Burbank Popups — front end.
 *
 * Typography and colour follow the Visit Burbank system: Instrument Serif for
 * display, Lexend for body, Courier Prime for eyebrows, #EF4343 accent,
 * #F4F2EB cream, #231F20 near-black, square corners.
 *
 * Two things that look odd but are deliberate, both to survive this site:
 *  - Selectors carry an extra .bb-popup to outrank Elementor's kit rules.
 *  - Reveal delays sit only on the .is-open rule so closing does not stagger.
 */

.bb-popup {
	--bb-popup-accent: #EF4343;
	--bb-popup-max-width: 880px;
	--bb-popup-overlay: 0.7;
	--bb-popup-image-focal: center;

	--bb-popup-panel: #F4F2EB;
	--bb-popup-ink: #231F20;
	--bb-popup-ink-soft: #55504f;
	--bb-popup-rule: rgba(35, 31, 32, 0.14);
	--bb-popup-cta-ink: #F4F2EB;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-font-smoothing: antialiased;
}

.bb-popup[hidden] {
	display: none;
}

/* Everything inside the popup sizes predictably regardless of the host theme. */
.bb-popup,
.bb-popup *,
.bb-popup *::before,
.bb-popup *::after {
	box-sizing: border-box;
}

/* Palettes ---------------------------------------------------------------- */

.bb-popup--white {
	--bb-popup-panel: #ffffff;
}

.bb-popup--dark {
	--bb-popup-panel: #231F20;
	--bb-popup-ink: #F4F2EB;
	--bb-popup-ink-soft: rgba(244, 242, 235, 0.72);
	--bb-popup-rule: rgba(244, 242, 235, 0.2);
}

/* Overlay ----------------------------------------------------------------- */

.bb-popup__overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 17, 18, var(--bb-popup-overlay));
	opacity: 0;
	transition: opacity 320ms ease;
	cursor: pointer;
}

.bb-popup.is-open .bb-popup__overlay {
	opacity: 1;
}

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

.bb-popup .bb-popup__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--bb-popup-max-width);
	margin: auto;
	background: var(--bb-popup-panel);
	color: var(--bb-popup-ink);
	box-shadow: 0 24px 70px rgba(20, 17, 18, 0.34);
	opacity: 0;
	transform: translateY(18px) scale(0.985);
	transition: opacity 340ms ease, transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
	font-family: Lexend, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.bb-popup.is-open .bb-popup__dialog {
	opacity: 1;
	transform: none;
}

/* Split layout ------------------------------------------------------------ */

.bb-popup--split.bb-popup--has-image .bb-popup__dialog {
	display: grid;
	grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
	align-items: stretch;
}

.bb-popup--split.bb-popup--image-right .bb-popup__media {
	order: 2;
}

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

.bb-popup .bb-popup__media {
	position: relative;
	overflow: hidden;
	background: #ded9d0;
	min-height: 100%;
}

.bb-popup .bb-popup__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--bb-popup-image-focal);
}

/* The card layout gives the image a fixed band rather than a full column. */
.bb-popup--card.bb-popup--has-image .bb-popup__media {
	min-height: 0;
	aspect-ratio: 16 / 9;
}

/* Copy panel -------------------------------------------------------------- */

.bb-popup .bb-popup__body {
	padding: 48px 48px 52px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	text-align: left;
}

.bb-popup--card .bb-popup__body {
	align-items: center;
	text-align: center;
	padding: 40px 44px 46px;
}

.bb-popup .bb-popup__logo {
	margin: 0 0 22px;
	width: 100%;
}

.bb-popup .bb-popup__logo img {
	display: block;
	width: 100%;
	height: auto;
}

.bb-popup--card .bb-popup__logo img {
	margin: 0 auto;
}

.bb-popup .bb-popup__eyebrow {
	margin: 0 0 14px;
	font-family: "Courier Prime", "Courier New", monospace;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bb-popup-accent);
}

.bb-popup .bb-popup__heading {
	margin: 0;
	font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
	font-size: clamp(32px, 3.4vw, 46px);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--bb-popup-ink);
	text-transform: none;
	text-wrap: pretty;
}

/* Accent rule under the heading. */
.bb-popup .bb-popup__heading::after {
	content: "";
	display: block;
	width: 54px;
	height: 2px;
	margin: 20px 0 0;
	background: var(--bb-popup-accent);
}

.bb-popup--card .bb-popup__heading::after {
	margin-left: auto;
	margin-right: auto;
}

.bb-popup .bb-popup__text {
	margin: 20px 0 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.62;
	color: var(--bb-popup-ink-soft);
}

.bb-popup .bb-popup__text p {
	margin: 0 0 0.85em;
}

.bb-popup .bb-popup__text p:last-child {
	margin-bottom: 0;
}

.bb-popup .bb-popup__text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Detail lines ------------------------------------------------------------ */

.bb-popup .bb-popup__details {
	list-style: none;
	margin: 22px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--bb-popup-rule);
	width: 100%;
	font-size: 13px;
	line-height: 1.55;
	color: var(--bb-popup-ink);
}

.bb-popup .bb-popup__details li {
	margin: 0 0 7px;
	padding: 0;
}

.bb-popup .bb-popup__details li:last-child {
	margin-bottom: 0;
}

.bb-popup .bb-popup__details strong {
	font-weight: 600;
}

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

.bb-popup .bb-popup__actions {
	margin: 30px 0 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
}

.bb-popup--card .bb-popup__actions {
	align-items: center;
}

.bb-popup .bb-popup__cta {
	display: inline-block;
	padding: 15px 34px;
	background: var(--bb-popup-accent);
	color: var(--bb-popup-cta-ink);
	font-family: Lexend, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	text-decoration: none;
	border: 0;
	border-radius: 0;
	transition: background-color 200ms ease, transform 200ms ease;
}

.bb-popup .bb-popup__cta:hover,
.bb-popup .bb-popup__cta:focus {
	background: #231F20;
	color: #F4F2EB;
	text-decoration: none;
}

.bb-popup--dark .bb-popup__cta:hover,
.bb-popup--dark .bb-popup__cta:focus {
	background: #F4F2EB;
	color: #231F20;
}

.bb-popup .bb-popup__cta-secondary {
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.02em;
	color: var(--bb-popup-ink-soft);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 200ms ease;
}

.bb-popup .bb-popup__cta-secondary:hover,
.bb-popup .bb-popup__cta-secondary:focus {
	color: var(--bb-popup-accent);
}

/* Content reveal ---------------------------------------------------------- */

/* The panel's children rise into place in sequence, and the photo settles out
   of a slight over-scale.

   These are keyframe animations rather than transitions, deliberately. The
   resting state is fully visible, and only the .is-open rule animates — so if
   an animation is throttled, interrupted or never runs at all (background tab,
   older browser), the content is simply there. A transition-based version of
   this stranded everything below the first element at opacity 0. Content must
   fail visible. */

@keyframes bb-popup-rise {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

@keyframes bb-popup-settle {
	from { transform: scale(1.06); }
	to   { transform: none; }
}

@keyframes bb-popup-rule {
	from { transform: scaleX(0); }
	to   { transform: none; }
}

.bb-popup.is-open .bb-popup__body > * {
	animation: bb-popup-rise 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bb-popup.is-open .bb-popup__body > *:nth-child(1) { animation-delay: 100ms; }
.bb-popup.is-open .bb-popup__body > *:nth-child(2) { animation-delay: 130ms; }
.bb-popup.is-open .bb-popup__body > *:nth-child(3) { animation-delay: 160ms; }
.bb-popup.is-open .bb-popup__body > *:nth-child(4) { animation-delay: 190ms; }
.bb-popup.is-open .bb-popup__body > *:nth-child(5) { animation-delay: 220ms; }
.bb-popup.is-open .bb-popup__body > *:nth-child(6) { animation-delay: 250ms; }

.bb-popup.is-open .bb-popup__media img {
	animation: bb-popup-settle 1100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* The accent rule draws itself in under the heading. */
.bb-popup .bb-popup__heading::after {
	transform-origin: left center;
}

.bb-popup--card .bb-popup__heading::after {
	transform-origin: center;
}

.bb-popup.is-open .bb-popup__heading::after {
	animation: bb-popup-rule 420ms cubic-bezier(0.22, 1, 0.36, 1) 200ms both;
}

/* Close ------------------------------------------------------------------- */

.bb-popup .bb-popup__close {
	position: absolute;
	appearance: none;
	-webkit-appearance: none;
	min-width: 0;
	flex: none;
	top: 14px;
	right: 14px;
	z-index: 3;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: rgba(244, 242, 235, 0.92);
	color: #231F20;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(20, 17, 18, 0.18);
	transition: background-color 200ms ease, transform 200ms ease;
}

.bb-popup .bb-popup__close:hover,
.bb-popup .bb-popup__close:focus-visible {
	background: var(--bb-popup-accent);
	color: #F4F2EB;
	transform: rotate(90deg);
}

.bb-popup .bb-popup__close svg {
	flex: 0 0 auto;
	width: 17px;
	min-width: 17px;
	height: 17px;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	fill: none;
}

/* Bar layout -------------------------------------------------------------- */

.bb-popup--bar {
	align-items: flex-end;
	padding: 0;
	pointer-events: none;
}

.bb-popup--bar .bb-popup__overlay {
	display: none;
}

.bb-popup--bar .bb-popup__dialog {
	pointer-events: auto;
	max-width: none;
	margin: 0;
	transform: translateY(100%);
	box-shadow: 0 -8px 34px rgba(20, 17, 18, 0.22);
}

.bb-popup--bar.is-open .bb-popup__dialog {
	transform: none;
}

.bb-popup--bar .bb-popup__body {
	flex-direction: row;
	align-items: center;
	gap: 26px;
	padding: 20px 78px 20px 32px;
	max-width: 1400px;
	margin: 0 auto;
	width: 100%;
}

.bb-popup--bar .bb-popup__logo {
	margin: 0;
	flex: 0 0 auto;
}

.bb-popup--bar .bb-popup__eyebrow,
.bb-popup--bar .bb-popup__heading {
	margin: 0;
}

.bb-popup--bar .bb-popup__heading {
	font-size: 26px;
}

.bb-popup--bar .bb-popup__heading::after {
	display: none;
}

.bb-popup--bar .bb-popup__text {
	margin: 0;
}

.bb-popup--bar .bb-popup__details {
	display: none;
}

.bb-popup--bar .bb-popup__actions {
	margin: 0;
	flex: 0 0 auto;
	margin-left: auto;
	width: auto;
}

.bb-popup--bar .bb-popup__close {
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
}

.bb-popup--bar .bb-popup__close:hover,
.bb-popup--bar .bb-popup__close:focus-visible {
	transform: translateY(-50%) rotate(90deg);
}

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

.bb-popup :focus-visible {
	outline: 2px solid var(--bb-popup-accent);
	outline-offset: 3px;
}

.bb-popup--dark :focus-visible {
	outline-color: #F4F2EB;
}

/* Scroll lock helper applied to <html> while a popup is open. */
html.bb-popup-open {
	overflow: hidden;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 860px) {
	.bb-popup {
		padding: 16px;
		align-items: flex-start;
	}

	.bb-popup--split.bb-popup--has-image .bb-popup__dialog {
		grid-template-columns: 1fr;
	}

	.bb-popup--split .bb-popup__media {
		order: 0;
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.bb-popup .bb-popup__body {
		padding: 32px 26px 36px;
	}

	/* The logo is stacked below the image band on small screens, where it
	   costs a lot of height for branding the copy already carries. */
	.bb-popup .bb-popup__logo {
		display: none;
	}

	.bb-popup .bb-popup__heading {
		font-size: 30px;
	}

	.bb-popup .bb-popup__heading::after {
		margin-top: 16px;
	}

	.bb-popup .bb-popup__text {
		margin-top: 16px;
		font-size: 14px;
		line-height: 1.55;
	}

	.bb-popup .bb-popup__actions {
		margin-top: 24px;
	}

	.bb-popup .bb-popup__cta {
		width: 100%;
		text-align: center;
	}

	/* The bar collapses into a stacked card on small screens. */
	.bb-popup--bar .bb-popup__body {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding: 26px 24px 28px;
	}

	.bb-popup--bar .bb-popup__actions {
		margin-left: 0;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.bb-popup {
		padding: 0;
	}

	.bb-popup .bb-popup__dialog {
		min-height: 100%;
	}

	.bb-popup--split .bb-popup__media {
		aspect-ratio: 4 / 3;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.bb-popup__overlay,
	.bb-popup .bb-popup__dialog,
	.bb-popup .bb-popup__close,
	.bb-popup .bb-popup__cta {
		transition-duration: 1ms;
	}

	.bb-popup .bb-popup__dialog {
		transform: none;
	}

	.bb-popup.is-open .bb-popup__body > *,
	.bb-popup.is-open .bb-popup__media img,
	.bb-popup.is-open .bb-popup__heading::after {
		animation: none;
	}

	.bb-popup .bb-popup__close:hover,
	.bb-popup .bb-popup__close:focus-visible {
		transform: none;
	}

	.bb-popup--bar .bb-popup__close:hover,
	.bb-popup--bar .bb-popup__close:focus-visible {
		transform: translateY(-50%);
	}
}

/* Fallback for themes that do not already ship .screen-reader-text. */
.bb-popup .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
