/* ============================================================
   Promo Banner
   Compact 3-slide promotional slider. 40% content / 60% image.
   Crossfade transition. Autoplay 6 s. Pause on hover / focus.
   Mobile: image-top / content-bottom stacked layout.
   ============================================================ */

/* ── Outer wrapper ──────────────────────────────────────────── */
.wpdl-promo-banner {
	position: relative;
	height: 18rem; /* 288px — fits 2-line headlines without clipping */
	overflow: hidden;
	margin-block: 0 !important;
}

/* Reset WP is-layout-flow margins on all direct children */
.wpdl-promo-banner > * {
	margin-block: 0;
}

/* Hidden aria-live region for screen reader announcements */
.wpdl-promo-banner__live {
	position: absolute;
	width: 0.0625rem;
	height: 0.0625rem;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* ── Slides — stacked via absolute + crossfade via opacity ──── */
.wpdl-promo-banner__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 500ms ease;
	pointer-events: none;
}

.wpdl-promo-banner__slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* ── Frame: arrows + dots constrained to 1200px, centered ────── */

/* position:absolute on frame means arrows inside are positioned   */

/* relative to the 75rem frame, not the full-width banner.         */
.wpdl-promo-banner__frame {
	position: absolute;
	inset: 0;
	max-inline-size: min(75rem, 100%);
	margin-inline: auto;
	pointer-events: none;
}

/* Re-enable pointer events on interactive children */
.wpdl-promo-banner__frame > * {
	pointer-events: auto;
}

/* ── Inner: constrained grid — background stays full-width ────── */

/* Two-class selector (0,2,0) + !important beats any WP override.  */
.wpdl-promo-banner .wpdl-promo-banner__inner {
	display: grid !important;
	grid-template-columns: 0.7fr 1fr;
	height: 100%;
	max-inline-size: min(75rem, 100%);
	margin-inline: auto;
	margin-block: 0 !important;
}

/* Reset WP flow margins on grid items (content + image) */
.wpdl-promo-banner .wpdl-promo-banner__inner > * {
	margin-block: 0 !important;
}

/* ── Content column (left 40%) ──────────────────────────────── */

/* Two-class selector beats WP's is-content-justification-left (0,1,0) */
.wpdl-promo-banner .wpdl-promo-banner__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--wp--custom--space--2);
	padding-inline: var(--wp--custom--space--6);
	padding-block: var(--wp--custom--space--5);
}

/* Reset WP flow margins inside flex content column */
.wpdl-promo-banner .wpdl-promo-banner__content > * {
	margin-block: 0;
}

/* Ensure buttons are always fully visible inside the flex column */
.wpdl-promo-banner .wpdl-promo-banner__content .wp-block-buttons {
	flex-shrink: 0;
}

/* ── Image column (right 60%) ───────────────────────────────── */
.wpdl-promo-banner__image {
	height: 100%;
	overflow: hidden;
}

.wpdl-promo-banner__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}

/* Subtle zoom on hover — desktop only (handled via is-active + :hover) */
.wpdl-promo-banner__slide.is-active:hover .wpdl-promo-banner__image img {
	transform: scale(1.02);
}

/* ── Eyebrow ────────────────────────────────────────────────── */
.wpdl-promo-banner__eyebrow {
	font-family: var(--wp--custom--font--family--body);
	font-size: var(--wp--custom--font--size--xs);
	font-weight: var(--wp--custom--font--weight--regular);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--custom--semantic--color--accent--primary);
}

/* ── Headline ───────────────────────────────────────────────── */
.wpdl-promo-banner__headline.wp-block-heading {
	font-family: var(--wp--custom--font--family--display);
	font-size: clamp(1.25rem, 2.64vw, 2.375rem);
	font-weight: var(--wp--custom--font--weight--medium);
	line-height: var(--wp--custom--font--line-height--tight);
}

/* ── Body ───────────────────────────────────────────────────── */
.wpdl-promo-banner__body {
	font-family: var(--wp--custom--font--family--body);
	font-size: var(--wp--custom--font--size--sm);
	font-weight: 300;
	line-height: var(--wp--custom--font--line-height--relaxed);
	max-width: 20rem;
}

/* Light slides — near-black headline, neutral body */
.wpdl-promo-banner__slide--light .wpdl-promo-banner__headline {
	color: var(--wp--custom--semantic--color--text--primary);
}

.wpdl-promo-banner__slide--light .wpdl-promo-banner__body {
	color: var(--wp--custom--semantic--color--text--secondary);
}

/* Dark slides — off-white headline, muted body */
.wpdl-promo-banner__slide--dark .wpdl-promo-banner__headline {
	color: var(--wp--custom--semantic--color--background--canvas);
}

.wpdl-promo-banner__slide--dark .wpdl-promo-banner__body {
	color: var(--wp--custom--semantic--color--text--muted);
}

/* ── Buttons ────────────────────────────────────────────────── */

/* Base reset — override wp-element-button global styles */
.wpdl-promo-banner .wp-block-button__link {
	font-family: var(--wp--custom--font--family--body);
	font-size: var(--wp--custom--font--size--xs);
	font-weight: var(--wp--custom--font--weight--medium);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	min-height: 2.75rem;
	padding-inline: var(--wp--custom--space--5);
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	border-radius: 0;
	text-decoration: none;
	transition: opacity 200ms ease;
}

.wpdl-promo-banner .wp-block-button__link:hover {
	opacity: 0.82;
}

/* Primary: dark fill, light text */
.wpdl-promo-banner .wpdl-btn-primary .wp-block-button__link {
	background: var(--wp--custom--semantic--color--text--primary);
	color: var(--wp--custom--semantic--color--background--canvas);
	border: none;
}

/* Outline: transparent + 1px border */
.wpdl-promo-banner .wpdl-btn-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--custom--semantic--color--text--primary);
	border: 0.0625rem solid var(--wp--custom--semantic--color--text--primary);
}

/* Light: for dark slides — off-white fill, near-black text */
.wpdl-promo-banner .wpdl-btn-light .wp-block-button__link {
	background: var(--wp--custom--semantic--color--background--canvas);
	color: var(--wp--custom--semantic--color--text--primary);
	border: none;
}

/* ── Controls: dots + pause ──────────────────────────────────── */
.wpdl-promo-banner__controls {
	position: absolute;
	bottom: var(--wp--custom--space--3);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: var(--wp--custom--space--1);
	z-index: 10;
}

.wpdl-promo-banner__dots {
	display: flex;
	align-items: center;
}

/* Dot: 44px hit area; visual indicator via ::before */
.wpdl-promo-banner__dot {
	min-width: 2.75rem;
	min-height: 2.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
}

.wpdl-promo-banner__dot::before {
	content: '';
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--wp--custom--semantic--color--text--muted);
	flex-shrink: 0;
	transition: width 200ms ease, background 200ms ease, border-radius 200ms ease;
}

.wpdl-promo-banner__dot.is-active::before {
	width: 1.25rem;
	border-radius: 0.25rem;
	background: var(--wp--custom--semantic--color--text--primary);
}

/* Pause / play toggle button (WCAG 2.1 SC 2.2.2) — hidden until design confirmed */
.wpdl-promo-banner__pause {
	display: none;
	min-width: 2.75rem;
	min-height: 2.75rem;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--wp--custom--semantic--color--text--muted);
	transition: color 200ms ease;
}

.wpdl-promo-banner__pause:hover,
.wpdl-promo-banner__pause:focus-visible {
	color: var(--wp--custom--semantic--color--text--primary);
}

.wpdl-promo-banner__pause:focus-visible {
	outline: 0.125rem solid var(--wp--custom--semantic--color--accent--primary);
	outline-offset: 0.125rem;
	border-radius: 0.25rem;
}

/* Swap icons: show pause when playing, show play when paused */
.wpdl-promo-banner__icon-play { display: none; }
.wpdl-promo-banner.is-paused .wpdl-promo-banner__icon-pause { display: none; }
.wpdl-promo-banner.is-paused .wpdl-promo-banner__icon-play  { display: block; }

/* Dark slide: light dots + pause */
[data-theme="dark"] .wpdl-promo-banner__dot::before {
	background: rgb(255 255 255 / 50%);
}

[data-theme="dark"] .wpdl-promo-banner__dot.is-active::before {
	background: var(--wp--custom--semantic--color--background--canvas);
}

[data-theme="dark"] .wpdl-promo-banner__pause {
	color: rgb(255 255 255 / 55%);
}

[data-theme="dark"] .wpdl-promo-banner__pause:hover,
[data-theme="dark"] .wpdl-promo-banner__pause:focus-visible {
	color: var(--wp--custom--semantic--color--background--canvas);
}

/* ── Tablet 768 ─────────────────────────────────────────────── */
@media (width <= 47.9375rem) {
	.wpdl-promo-banner {
		height: 13.75rem; /* 220px */
	}

	.wpdl-promo-banner__content {
		padding-inline: var(--wp--custom--space--5);
		gap: var(--wp--custom--space--2);
	}

	/* Body hidden on tablet — headline + CTA only */
	.wpdl-promo-banner__body {
		display: none;
	}

	.wpdl-promo-banner__headline.wp-block-heading {
		font-size: 1.625rem;
	}

	.wpdl-promo-banner__controls {
		left: var(--wp--custom--space--5);
		bottom: var(--wp--custom--space--2);
		transform: none;
	}
}

/* ── Mobile 375 — image-top / content-bottom ────────────────── */
@media (width <= 29.9375rem) {
	.wpdl-promo-banner {
		height: auto;
		overflow: visible;
	}

	/* Slides: leave flow (no absolute), hidden by default */
	.wpdl-promo-banner__slide {
		position: relative;
		display: none;
		opacity: 1;
		transition: none;
		pointer-events: none;
	}

	.wpdl-promo-banner__slide.is-active {
		display: block;
		pointer-events: auto;
	}

	/* Two-class (0,2,0) to beat the desktop rule of same specificity */
	.wpdl-promo-banner .wpdl-promo-banner__inner {
		grid-template-columns: 1fr;
		height: auto;
		max-inline-size: 100%;
		margin-block: 0 !important;
	}

	/* Image moves to row 1, content to row 2 */
	.wpdl-promo-banner__image {
		grid-row: 1;
		height: 11.25rem; /* 180px */
	}

	.wpdl-promo-banner__content {
		grid-row: 2;
		padding-inline: var(--wp--custom--space--5);
		padding-block: var(--wp--custom--space--5);
		align-items: center;
		text-align: center;
	}

	/* Body visible on mobile */
	.wpdl-promo-banner__body {
		display: block;
		max-width: 100%;
	}

	.wpdl-promo-banner__eyebrow {
		font-size: 0.625rem;
	}

	.wpdl-promo-banner__headline.wp-block-heading {
		font-size: 1.25rem;
	}

	/* Frame: become relative on mobile so dots flow below slide content */
	.wpdl-promo-banner__frame {
		position: relative;
		inset: auto;
		max-inline-size: 100%;
		pointer-events: auto;
	}

	/* Controls: flow below content, centered */
	.wpdl-promo-banner__controls {
		position: relative;
		bottom: auto;
		left: auto;
		transform: none;
		justify-content: center;
		padding-block: var(--wp--custom--space--4);
	}
}
