/*
 * The live banner on the site (static layout).
 *
 * The look comes from custom properties (--fmc-live-*) that the Style tab
 * generates (includes/class-style.php) and prints inline after this file,
 * for desktop and, where they differ, tablet and phone. The fallbacks here
 * are the Style tab's defaults, so the banner looks the same without them.
 *
 * Default contrast: white on #245a8b is 7.22:1; white on the label's
 * #c1542d is 4.59:1; the inverse site button is #245a8b on white, 7.22:1.
 */

.fmc-live-banner {
	position: relative;
	box-sizing: border-box;
	min-height: var(--fmc-live-min-h, 0px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	border-width: var(--fmc-live-border-width, 0);
	border-style: var(--fmc-live-border-style, solid);
	border-color: var(--fmc-live-border-color, transparent);
	border-radius: var(--fmc-live-radius, 0px);
	background: var(--fmc-live-bg, #245a8b);
	box-shadow: var(--fmc-live-shadow, none);
	color: var(--fmc-live-text-color, #fff);
	text-align: var(--fmc-live-text-align, start);
}

.fmc-live-banner[hidden],
.fmc-live-banner__inner[hidden] {
	display: none;
}

.fmc-live-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: var(--fmc-live-justify, space-between);
	gap: var(--fmc-live-gap, 24px);
	box-sizing: border-box;
	width: 100%;
	max-width: var(--fmc-live-max, calc(1160px + 2 * var(--fmc-live-pad-x, 32px)));
	margin: 0 auto;
	padding: var(--fmc-live-pad-y, 16px) var(--fmc-live-pad-x, 32px);
}

.fmc-live-banner__body {
	display: flex;
	flex: var(--fmc-live-body-grow, 1) 1 var(--fmc-live-body-basis, 24rem);
	flex-direction: var(--fmc-live-body-dir, row);
	align-items: var(--fmc-live-body-align, center);
	justify-content: var(--fmc-live-body-justify, flex-start);
	gap: var(--fmc-live-body-gap, 16px);
	min-width: 0;
}

.fmc-live-banner__label {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 6px;
	padding: var(--fmc-live-label-pad, 4px 10px);
	border-radius: var(--fmc-live-label-radius, 999px);
	background: var(--fmc-live-label-bg, #c1542d);
	color: var(--fmc-live-label-color, #fff);
	font-family: var(--fmc-live-label-font, inherit);
	font-size: var(--fmc-live-label-size, 13px);
	font-weight: var(--fmc-live-label-weight, 700);
	line-height: var(--fmc-live-label-lh, 1.2);
	letter-spacing: var(--fmc-live-label-ls, 0.8px);
	text-transform: var(--fmc-live-label-case, uppercase);
}

.fmc-live-banner__dot {
	display: var(--fmc-live-dot, inline-block);
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	animation: fmc-live-pulse 1.6s ease-in-out infinite;
}

@keyframes fmc-live-pulse {
	50% {
		opacity: 0.35;
	}
}

/* Title and text: on one line (wrapping when long) or stacked. */
.fmc-live-banner__text {
	display: flex;
	flex-wrap: wrap;
	flex-direction: var(--fmc-live-text-dir, row);
	align-items: var(--fmc-live-text-align-items, baseline);
	justify-content: var(--fmc-live-body-justify, flex-start);
	gap: var(--fmc-live-text-gap, 0 12px);
	min-width: 0;
}

.fmc-live-banner .fmc-live-banner__title {
	margin: 0;
	padding: 0;
	color: var(--fmc-live-title-color, #fff);
	font-family: var(--fmc-live-title-font, inherit);
	font-size: var(--fmc-live-title-size, 18px);
	font-weight: var(--fmc-live-title-weight, 700);
	line-height: var(--fmc-live-title-lh, 1.3);
	letter-spacing: var(--fmc-live-title-ls, 0px);
	text-transform: var(--fmc-live-title-case, none);
}

.fmc-live-banner__content {
	color: var(--fmc-live-text-color, #fff);
	font-family: var(--fmc-live-text-font, inherit);
	font-size: var(--fmc-live-text-size, 16px);
	font-weight: var(--fmc-live-text-weight, 400);
	line-height: var(--fmc-live-text-lh, 1.45);
	letter-spacing: var(--fmc-live-text-ls, 0px);
	text-transform: var(--fmc-live-text-case, none);
}

.fmc-live-banner__content p {
	margin: 0;
}

.fmc-live-banner .fmc-live-banner__content a {
	color: var(--fmc-live-link, #fff);
	text-decoration: underline;
}

/* The button. A site button (.fmc-btn and a variant) is styled by the theme;
   these :where() rules have no specificity, so they only stand in when the
   theme doesn't have them. */
.fmc-live-banner__button {
	flex: none;
	box-sizing: border-box;
	width: var(--fmc-live-btn-width, auto);
	justify-content: center;
}

:where(.fmc-live-banner__button) {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 24px;
	border-radius: 4px;
	background: #fff;
	color: #245a8b;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

/* A custom button: everything from the Style tab. */
.fmc-live-banner .fmc-live-banner__button--custom {
	display: inline-flex;
	align-items: center;
	min-height: var(--fmc-live-btn-height, 44px);
	padding: 0 var(--fmc-live-btn-pad-x, 24px);
	border: var(--fmc-live-btn-border, 0px) solid var(--fmc-live-btn-border-color, transparent);
	border-radius: var(--fmc-live-btn-radius, 4px);
	background: var(--fmc-live-btn-bg, #fff);
	color: var(--fmc-live-btn-color, #245a8b);
	font-family: var(--fmc-live-btn-font, inherit);
	font-size: var(--fmc-live-btn-size, 16px);
	font-weight: var(--fmc-live-btn-weight, 600);
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fmc-live-banner .fmc-live-banner__button--custom:is(:hover, :focus-visible) {
	border-color: var(--fmc-live-btn-hover-border, transparent);
	background: var(--fmc-live-btn-hover-bg, #f2f6fa);
	color: var(--fmc-live-btn-hover-color, #245a8b);
}

/* The focus ring: the theme's blue one doesn't show on a blue banner. */
.fmc-live-banner a:focus-visible {
	outline: 2px solid var(--fmc-live-focus, #fff);
	outline-offset: 2px;
	box-shadow: none;
}

.fmc-live-banner .screen-reader-text,
.fmc-live-banner__announce {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* The close button (Dismiss on): inside the content area, at its end. The
   Kit styles every <button>, so these rules are scoped to outrank it. */
.fmc-live-banner__inner {
	position: relative;
}

.fmc-live-banner--dismissible .fmc-live-banner__inner {
	padding-right: calc(var(--fmc-live-pad-x, 32px) + 44px);
}

.fmc-live-banner .fmc-live-banner__close {
	position: absolute;
	top: var(--fmc-live-close-top, 50%);
	right: max(4px, calc(var(--fmc-live-pad-x, 32px) - 22px));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	min-width: 44px;
	height: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: var(--fmc-live-close-color, #fff);
	line-height: 1;
	cursor: pointer;
	transform: translateY(var(--fmc-live-close-shift, -50%));
	transition: background-color 0.15s ease, color 0.15s ease;
}

.fmc-live-banner .fmc-live-banner__close:is(:hover, :focus-visible) {
	background: var(--fmc-live-close-hover-bg, rgba(255, 255, 255, 0.15));
	color: var(--fmc-live-close-hover-color, #fff);
}

.fmc-live-banner .fmc-live-banner__close:focus-visible {
	outline: 2px solid var(--fmc-live-focus, #fff);
	outline-offset: 2px;
}

.fmc-live-banner__close-icon {
	display: block;
	width: var(--fmc-live-close-size, 20px);
	height: var(--fmc-live-close-size, 20px);
}

/* Floating bars. The top bar sits below the WordPress admin bar when it
   shows; in "below the header" mode live-banner.js sets --fmc-live-top to
   the header's bottom edge as it moves. */
.fmc-live-banner--top,
.fmc-live-banner--bottom {
	position: fixed;
	right: 0;
	left: 0;
	z-index: var(--fmc-live-z, 1000);
}

.fmc-live-banner--top {
	top: var(--fmc-live-top, var(--wp-admin--admin-bar--height, 0px));
}

.fmc-live-banner--bottom {
	bottom: 0;
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Room for the bars, so they don't cover the page (set by live-banner.js
   while a bar shows). */
html.fmc-live-push-top body {
	padding-top: var(--fmc-live-page-top, 0px) !important;
}

html.fmc-live-push-bottom body {
	padding-bottom: var(--fmc-live-page-bottom, 0px) !important;
}

/*
 * Fixed header: live-banner.js adds fmc-live-shifted to the header (the
 * Display tab's selector) while the banner is on screen, with the offset in
 * --fmc-live-offset. A margin, not a transform: a transform would make the
 * header the containing block for its fixed off-canvas menu. When the theme
 * slides the header away (is-hidden, site-header.js), the margin is dropped
 * so none of it stays in view (--fmc-live-base: its own margin).
 */
.fmc-live-shifted {
	margin-top: var(--fmc-live-offset, 0px) !important;
}

.fmc-live-shifted.is-hidden {
	margin-top: var(--fmc-live-base, 0px) !important;
}

/* The defaults' phone values, for when the generated CSS is missing. */
@media (max-width: 767px) {
	.fmc-live-banner__inner {
		gap: var(--fmc-live-gap, 12px);
		padding: var(--fmc-live-pad-y, 16px) var(--fmc-live-pad-x, 16px);
	}

	.fmc-live-banner__body {
		flex: var(--fmc-live-body-grow, 1) 1 var(--fmc-live-body-basis, 100%);
		flex-direction: var(--fmc-live-body-dir, column);
		align-items: var(--fmc-live-body-align, flex-start);
		gap: var(--fmc-live-body-gap, 8px);
	}

	.fmc-live-banner__text {
		flex-direction: var(--fmc-live-text-dir, column);
		align-items: var(--fmc-live-text-align-items, flex-start);
		gap: var(--fmc-live-text-gap, 4px);
	}

	.fmc-live-banner__button {
		width: var(--fmc-live-btn-width, 100%);
	}
}

/* Bottom bar, inset on phones: off the edges, rounded, with a shadow. */
@media (max-width: 767px) {
	.fmc-live-banner--bottom.fmc-live-banner--phone-inset {
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		left: 12px;
		padding-bottom: 0;
		border-radius: 12px;
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fmc-live-banner__dot {
		animation: none;
	}

	.fmc-live-banner .fmc-live-banner__button--custom {
		transition: none;
	}

	.fmc-live-banner .fmc-live-banner__close {
		transition: none;
	}
}
