/**
 * Promo banner — visual styling.
 *
 * Banner markup is emitted by inc/promo/template/banner.php. All dynamic
 * values (colors, weight, position, image, aspect ratio) come in through
 * CSS custom properties on the banner root, so this file only needs the
 * stable rules.
 */

.promo-banner {
	margin-bottom: 3rem;
}

/* ---------- Image mode ---------- */

.promo-banner__image-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.promo-banner__image {
	display: block;
	width: var(--promo-banner-width, 100%);
	max-width: 100%;
	height: var(--promo-banner-height, auto);
}

.promo-banner__image--fixed-height {
	object-fit: cover;
	object-position: center;
}

/* ---------- Background + button mode ---------- */

.promo-banner__bg {
	box-sizing: border-box;
	max-width: 100%;
	width: var(--promo-banner-width, 100%);
	height: var(--promo-banner-height, auto);
	overflow: hidden;
	background-image: var(--promo-banner-bg-image);
	background-size: cover;
	background-position: var(--promo-banner-bg-position, top center);
	background-repeat: no-repeat;
	display: flex;
	align-items: var(--promo-banner-align-items, center);
	justify-content: var(--promo-banner-justify-content, center);
	padding: 2rem;
	text-decoration: none;
	color: inherit;
}

/* Box height variants when no explicit Height is set in the admin. */
.promo-banner__bg--aspect {
	aspect-ratio: var(--promo-banner-aspect-ratio);
	height: auto;
}

.promo-banner__bg--min-height {
	min-height: 200px;
	height: auto;
}

/* Call-to-action button. */
.promo-banner__button {
	display: inline-block;
	padding: 1.2rem 2.4rem;
	background-color: var(--promo-banner-button-bg);
	color: var(--promo-banner-button-color) !important;
	font-weight: var(--promo-banner-button-font-weight, 600);
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover propagates from the wrapper so hovering anywhere on the background
   (or focusing the link with the keyboard) triggers the button hover state. */
.promo-banner__bg:hover .promo-banner__button,
.promo-banner__bg:focus .promo-banner__button,
.promo-banner__bg:focus-within .promo-banner__button {
	background-color: var(--promo-banner-button-bg-hover);
	color: var(--promo-banner-button-color-hover) !important;
}
