/**
 * Promo Bar non-critical styles (M4).
 *
 * The bar is a position:fixed OVERLAY (out of normal flow) so its own appearance
 * contributes ZERO CLS by construction (spec §11). The idle state is
 * visibility:hidden + opacity:0 + transform — NEVER display:none / [hidden],
 * which would force a layout change on reveal. Reveal removes the idle class and
 * adds --visible (animated via transform + opacity only, never top/height).
 *
 * M4 renders an inert, empty shell; the bar's content + rich runtime is M5.
 */

.hrck-promo-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99990;
	box-sizing: border-box;
	width: 100%;
	min-height: 0; /* min-height, never a hard height (text-spacing / 200% zoom) */
	margin: 0;
	/* Palette (M8a). The runtime sets these custom properties per-bar from the
	   manifest's validated style; absent => these AA-safe defaults (dark bar,
	   white text) stand, contrast ~15:1 by construction. */
	background: var(--hrck-promo-bg, #1d2327);
	color: var(--hrck-promo-text, #ffffff);
	/* Idle defaults (overridden by --visible). */
	visibility: hidden;
	opacity: 0;
	will-change: transform, opacity;
	transition: transform 200ms ease, opacity 200ms ease;
	pointer-events: none;
}

.hrck-promo-bar--top {
	top: 0;
	transform: translateY(-100%);
}

.hrck-promo-bar--bottom {
	bottom: 0;
	transform: translateY(100%);
}

/* Idle is explicit too, so a stylesheet-order accident never leaks the bar. */
.hrck-promo-bar--idle {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* The ONLY reveal: transform back to place + show. No layout property animates. */
.hrck-promo-bar--visible {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	.hrck-promo-bar {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * M5 rendered content (copy / CTA / dismiss / countdown).
 *
 * All of this lives INSIDE the position:fixed overlay, so it contributes ZERO
 * CLS by construction — nothing here animates a layout property (top / height /
 * margin), only the parent's transform + opacity reveal. min-height (never a
 * hard height) on the bar already accommodates wrapping / 200% zoom; content
 * wraps (up to 2 lines), it never clips.
 * ------------------------------------------------------------------------- */

.hrck-promo-bar__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 16px;
	font-size: 15px;
	line-height: 1.4;
}

.hrck-promo-bar__body {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
	flex: 1 1 auto;
	min-width: 0; /* allow wrapping instead of overflow */
}

.hrck-promo-bar__headline {
	font-weight: 600;
}

.hrck-promo-bar__subtext {
	opacity: 0.9;
}

/* Countdown digits never reflow on tick (9:59 -> 10:00). */
.hrck-promo-bar__countdown-digits {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Visually-hidden reveal-time live region (a11y §12). Off-screen but in the
   accessibility tree so the polite announcement is heard, never seen. */
.hrck-promo-bar__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.hrck-promo-bar__cta {
	flex: 0 0 auto;
	display: inline-block;
	padding: 8px 16px;
	border-radius: 4px;
	font-weight: 600;
	text-decoration: none;
	/* CTA color contrast (>=4.5:1 text, >=3:1 fill vs bar) is enforced at
	   settings time per spec §12. The runtime sets these custom properties from
	   the validated palette; absent => AA-safe defaults (white fill, dark text). */
	background: var(--hrck-promo-cta-bg, #ffffff);
	color: var(--hrck-promo-cta-text, #1d2327);
}

/* Dismiss control: >=24x24 hit target (SC 2.5.8) with an >=8px gap from the CTA. */
.hrck-promo-bar__dismiss {
	flex: 0 0 auto;
	min-width: 24px;
	min-height: 24px;
	margin-left: 8px;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.hrck-promo-bar__dismiss:focus-visible {
	outline: 2px solid currentColor; /* >=2px, >=3:1 focus ring (SC 2.4.7/2.4.11) */
	outline-offset: 2px;
}

/* Forced-colors / Windows High Contrast (a11y §12). */
@media (forced-colors: active) {
	.hrck-promo-bar--visible {
		border: 1px solid CanvasText;
	}

	.hrck-promo-bar__dismiss {
		forced-color-adjust: auto;
		color: ButtonText;
		background: Canvas;
	}
}
