/* FB Popup — colors and font choices come from the inline CSS printed by the plugin.
 * To customise on a single site, override with higher specificity, e.g. `#fb-popup .fbp__title { … }`. */

/* Inter (variable, SIL OFL 1.1) bundled locally: no request to Google Fonts. Downloaded only if used. */
@font-face {
	font-family: "FBP Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
	unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
	font-family: "FBP Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(fonts/inter-latin-wght-normal.woff2) format("woff2");
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

.fbp {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.fbp[hidden] { display: none; }
.fbp *, .fbp *::before, .fbp *::after { box-sizing: border-box; }

.fbp__overlay {
	position: absolute;
	inset: 0;
	background: var(--fbp-overlay);
	opacity: 0;
	transition: opacity .3s ease;
}

.fbp__dialog {
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	width: min(100%, 1120px);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--fbp-bg);
	color: var(--fbp-text);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transition: opacity .3s ease, transform .3s ease;
}
/* The dialog receives focus on open only to move keyboard focus inside: never show a ring on it,
   whatever the theme does with :focus / :focus-visible / [tabindex]. */
.fbp .fbp__dialog:focus,
.fbp .fbp__dialog:focus-visible { outline: none !important; }
.fbp--no-img .fbp__dialog { width: min(100%, 640px); }

.fbp.is-open .fbp__overlay,
.fbp.is-open .fbp__dialog { opacity: 1; transform: none; }

/* Image */
.fbp__media { position: relative; overflow: hidden; }
.fbp .fbp__img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	max-height: 45vh;
	margin: 0;
	object-fit: cover;
}
.fbp--fit-contain .fbp__img { max-height: 60vh; object-fit: contain; }

/* Body */
.fbp__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding: 32px 24px 40px;
}
.fbp .fbp__title {
	margin: 0 0 .7em;
	color: var(--fbp-title);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -.01em;
	text-wrap: pretty;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
}
/* No leftover space when a field is empty: first/last element never adds outer margin. */
.fbp .fbp__body > :first-child { margin-top: 0; }
.fbp .fbp__body > :last-child { margin-bottom: 0; }
.fbp .fbp__text {
	color: var(--fbp-text);
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: normal;
	text-wrap: pretty;
	-webkit-font-smoothing: antialiased;
}
.fbp .fbp__text p { margin: 0 0 1em; line-height: inherit; }
.fbp .fbp__text > :first-child { margin-top: 0; }
.fbp .fbp__text > :last-child { margin-bottom: 0; }
.fbp .fbp__text a { color: inherit; }

.fbp .fbp__cta {
	display: inline-block;
	margin-top: 1.75em;
	color: var(--fbp-cta);
	background: var(--fbp-cta-bg);
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.2;
	-webkit-font-smoothing: antialiased;
	transition: opacity .2s ease, text-decoration-color .2s ease;
}
.fbp--cta-link .fbp__cta {
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: .35em;
	text-decoration-thickness: 1px;
}
.fbp--cta-link .fbp__cta:hover,
.fbp--cta-link .fbp__cta:focus-visible { text-decoration-color: currentColor; }
.fbp--cta-button .fbp__cta { padding: .95em 1.8em; }
.fbp--cta-button .fbp__cta:hover { opacity: .85; }

/* Close button (theme button styles are reset with all: unset) */
.fbp .fbp__close {
	all: unset;
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	cursor: pointer;
	color: var(--fbp-close-icon);
}
.fbp .fbp__close::before {
	content: "";
	position: absolute;
	inset: 8px;
	background: var(--fbp-close-bg);
	transition: transform .25s ease;
}
.fbp--close-diamond .fbp__close::before { transform: rotate(45deg); }
.fbp--close-circle .fbp__close::before { inset: 4px; border-radius: 50%; }
.fbp--close-square .fbp__close::before { inset: 6px; }
.fbp--close-diamond .fbp__close:hover::before { transform: rotate(45deg) scale(1.08); }
.fbp--close-circle .fbp__close:hover::before,
.fbp--close-square .fbp__close:hover::before { transform: scale(1.08); }
.fbp .fbp__close svg { position: relative; width: 26px; height: 26px; }
.fbp .fbp__close:focus-visible { outline: 2px solid var(--fbp-close-bg); outline-offset: 2px; }

/* Desktop: image and text side by side */
@media (min-width: 782px) {
	.fbp { padding: 32px; }
	.fbp__dialog { max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); }
	.fbp--has-img .fbp__dialog { grid-template-columns: 1fr 1fr; }
	.fbp--img-right .fbp__media { order: 2; }
	.fbp__body { padding: clamp(40px, 5vw, 72px); }
	.fbp--has-img .fbp__body { min-height: 460px; }

	.fbp--fit-cover .fbp__media { min-height: 460px; }
	.fbp--fit-cover .fbp__img {
		position: absolute;
		inset: 0;
		height: 100%;
		max-height: none;
	}
	.fbp--fit-contain .fbp__media { display: flex; align-items: center; }
	.fbp--fit-contain .fbp__img { max-height: calc(100dvh - 64px); }
}

/* Image only (no title, text or button): the popup is just the image, at its own proportions. */
.fbp.fbp--no-body .fbp__dialog { grid-template-columns: 1fr; width: fit-content; max-width: min(100%, 960px); }
.fbp--no-body .fbp__media { min-height: 0; }
.fbp.fbp--no-body .fbp__img {
	position: static;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	object-fit: contain;
}
@media (min-width: 782px) {
	.fbp.fbp--no-body .fbp__img { max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); }
}

html.fbp-lock, html.fbp-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.fbp__overlay, .fbp__dialog, .fbp .fbp__close::before { transition: none; }
	.fbp__dialog { transform: none; }
}
