/* Flip Countdown Banner */

.fcb-banner,
.fcb-banner * {
	box-sizing: border-box;
}

.fcb-banner {
	--fcb-bg: #2563eb;
	--fcb-text: #fff;
	--fcb-card-bg: #111827;
	--fcb-card-text: #fff;
	--fcb-btn-bg: #fff;
	--fcb-btn-text: #1d4ed8;
	--fcb-h: 52px; /* flip card height; everything else scales from this */

	position: relative;
	width: 100%;
	margin: 0;
	padding: 0;
	background: var(--fcb-bg);
	color: var(--fcb-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	z-index: 99990;
}

.fcb-banner--sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
}

.admin-bar .fcb-banner--sticky {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .fcb-banner--sticky {
		top: 46px;
	}
}

.fcb-banner [hidden] {
	display: none !important;
}

html.fcb-dismissed .fcb-banner {
	display: none !important;
}

.fcb-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 32px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 12px 20px;
}

.fcb-has-close .fcb-inner {
	padding-left: 48px;
	padding-right: 48px;
}

/* Text + button */

.fcb-content {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 16px;
	text-align: center;
}

.fcb-text {
	margin: 0;
	font-size: 1.05em;
	font-weight: 600;
	color: var(--fcb-text);
}

.fcb-text a {
	color: inherit;
	text-decoration: underline;
}

.fcb-banner a.fcb-button {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 999px;
	background: var(--fcb-btn-bg);
	color: var(--fcb-btn-text);
	font-size: 0.9em;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fcb-banner a.fcb-button:hover,
.fcb-banner a.fcb-button:focus {
	color: var(--fcb-btn-text);
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.fcb-expired {
	font-size: 1.05em;
	font-weight: 600;
	text-align: center;
}

/* Clock */

.fcb-clock {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 14px;
}

/* Hidden for a moment while the script learns the server time (no wrong numbers flash on cached pages). */
.fcb-clock {
	transition: opacity 0.2s ease;
}

.fcb-syncing .fcb-clock {
	opacity: 0;
}

.fcb-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.fcb-digits {
	display: flex;
	gap: 3px;
}

.fcb-label {
	margin-top: 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1;
	text-transform: uppercase;
	opacity: 0.9;
}

/* One flip card (a single digit) */

.fcb-digit {
	position: relative;
	display: block;
	width: calc(var(--fcb-h) * 0.7);
	height: var(--fcb-h);
	font-size: calc(var(--fcb-h) * 0.74);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	perspective: calc(var(--fcb-h) * 6);
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.fcb-half {
	position: absolute;
	left: 0;
	width: 100%;
	height: 50%;
	overflow: hidden;
	background: var(--fcb-card-bg);
	color: var(--fcb-card-text);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Each half shows one half of a full-height number. */
.fcb-half > span {
	position: absolute;
	left: 0;
	width: 100%;
	height: var(--fcb-h);
	line-height: var(--fcb-h);
	text-align: center;
}

.fcb-top {
	top: 0;
	border-radius: 6px 6px 0 0;
}

.fcb-top > span {
	top: 0;
}

.fcb-bot {
	bottom: 0;
	border-radius: 0 0 6px 6px;
}

.fcb-bot > span {
	bottom: 0;
}

/* Subtle shading so the halves read as separate leaves. */
.fcb-half::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	pointer-events: none;
}

.fcb-top::after {
	background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.12));
}

.fcb-bot::after {
	background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.04));
}

/* The centre hinge line. */
.fcb-digit::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	margin-top: -1px;
	background: rgba(0, 0, 0, 0.6);
	z-index: 5;
	pointer-events: none;
}

.fcb-flap {
	z-index: 3;
}

.fcb-flap-top {
	transform-origin: 50% 100%;
}

.fcb-flap-bot {
	transform-origin: 50% 0;
}

.fcb-digit.is-flipping .fcb-flap-top {
	animation: fcb-flip-top 0.22s ease-in both;
}

.fcb-digit.is-flipping .fcb-flap-bot {
	animation: fcb-flip-bot 0.22s ease-out 0.22s both;
}

@keyframes fcb-flip-top {
	from {
		transform: rotateX(0deg);
	}
	to {
		transform: rotateX(-90deg);
	}
}

@keyframes fcb-flip-bot {
	from {
		transform: rotateX(90deg);
	}
	to {
		transform: rotateX(0deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fcb-digit.is-flipping .fcb-flap-top,
	.fcb-digit.is-flipping .fcb-flap-bot {
		animation: none;
	}
}

/* Dismiss button */

.fcb-banner button.fcb-close {
	position: absolute;
	top: 50%;
	right: 12px;
	width: 32px;
	height: 32px;
	margin: -16px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 26px;
	line-height: 32px;
	text-align: center;
	cursor: pointer;
	opacity: 0.8;
	box-shadow: none;
}

.fcb-banner button.fcb-close:hover,
.fcb-banner button.fcb-close:focus {
	background: rgba(255, 255, 255, 0.18);
	color: inherit;
	opacity: 1;
}

/* Small screens */

@media (max-width: 640px) {
	.fcb-banner {
		--fcb-h: 40px;
	}

	.fcb-inner {
		gap: 10px 16px;
		padding: 10px 12px;
	}

	.fcb-has-close .fcb-inner {
		padding-right: 42px;
		padding-left: 12px;
	}

	.fcb-clock {
		gap: 9px;
	}

	.fcb-label {
		font-size: 9px;
	}

	.fcb-text {
		font-size: 0.95em;
	}
}

@media print {
	.fcb-banner {
		display: none !important;
	}
}
