/* -------------------------------------------------------------------------
 * Announcement bar (cfl_) — scoped, hand-written CSS (not Tailwind-compiled).
 * Background + text color come from the bg-* utilities in app.css; this file
 * owns layout, the CTA, and the close button. See inc/announcement-bar.php.
 * ---------------------------------------------------------------------- */

.cfl-ab {
	position: relative;
	width: 100%;
	font-family: var(--font-body, sans-serif);
	font-size: 0.9375rem;
	line-height: 1.4;
}

.cfl-ab__inner {
	margin-inline: auto;
	/* Extra right padding leaves room for the absolutely-positioned close button. */
	padding: 0.65rem 2.75rem 0.65rem 1.5rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem 1rem;
	text-align: center;
}

/* Content width — the colored bar stays full-bleed; only the inner row is
   constrained. text-wrap:balance (set on the message) does the rest. */
.cfl-ab--w-full .cfl-ab__inner { max-width: 100%; }
.cfl-ab--w-wide .cfl-ab__inner { max-width: 1280px; }
.cfl-ab--w-medium .cfl-ab__inner { max-width: 960px; }
.cfl-ab--w-narrow .cfl-ab__inner { max-width: 720px; }

.cfl-ab__message {
	/* Even out line lengths so the last line doesn't strand one or two words.
	   Inherited by the inner <p>; browsers skip balancing past a few lines. */
	text-wrap: balance;
}

.cfl-ab__message > * {
	margin: 0;
}

.cfl-ab__message a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cfl-ab__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: opacity 0.15s;
}

.cfl-ab__cta:hover {
	opacity: 0.85;
}

.cfl-ab__cta svg {
	width: 1em;
	height: 1em;
}

.cfl-ab__close {
	position: absolute;
	top: 50%;
	right: 0.5rem;
	transform: translateY(-50%);
	display: inline-flex;
	padding: 0.4rem;
	color: inherit;
	background: transparent;
	border: 0;
	cursor: pointer;
	line-height: 0;
	opacity: 0.75;
	transition: opacity 0.15s;
}

.cfl-ab__close:hover,
.cfl-ab__close:focus-visible {
	opacity: 1;
}

.cfl-ab__close svg {
	width: 14px;
	height: 14px;
}

@media (max-width: 640px) {
	.cfl-ab__inner {
		font-size: 0.875rem;
		padding-block: 0.55rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cfl-ab__cta,
	.cfl-ab__close {
		transition: none;
	}
}
