/**
 * Component: banner card (parts/components/banner-card.php).
 *
 * Used by the banner section and by the Article Detail right rail, which
 * takes the narrow variant at desktop width.
 *
 * Figma banner/default:
 *   desktop 1940:47921 (Trade Partners): 1220 wide, 64px padding, text and a
 *     310px button/M on one row; header/XL + body/M white, 8px apart.
 *   narrow 1598:49137 (Article Detail rail, 391 wide): 32px / 20px padding,
 *     text over a full-width button 24px apart; header/L + body/XS.
 * Both: photo under a rgba(9, 3, 19, 0.75) overlay, radius 20.
 * Mobile 1405:34395 (REF/12-banner-default.md): 350 wide, 32px / 20px padding,
 * the narrow layout above. REF/12 says the mobile button drops its arrow, but
 * the Planning screen in the Figma export (REF/HOMZ.zip) shows it, 350x253.
 */

.banner {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 2rem 1.25rem;
	color: var(--color-text-white);
	background-color: var(--color-text-dark);
	border-radius: var(--radius-20);
}

.banner__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.banner::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	content: "";
	background-color: rgba(9, 3, 19, 0.75);
}

.banner__content {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.banner__text {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.banner__title {
	font: var(--type-header-l);
	color: inherit;
}

.banner__subtitle {
	font: var(--type-body-xs);
}

.banner__button {
	width: 100%;
}

@media (min-width: 64rem) {
	.banner {
		padding: 4rem;
	}

	.banner__content {
		flex-direction: row;
		gap: 1.5rem;
		align-items: center;
		justify-content: space-between;
	}

	.banner__title {
		font: var(--type-header-xl);
	}

	.banner__subtitle {
		font: var(--type-body-m);
	}

	.banner__button {
		flex-shrink: 0;
		width: 19.375rem; /* 310 */
	}

	/* The rail keeps the narrow layout at every width (1598:49137): 282 tall
	 * with the text and the full-width button centred in it. */
	.banner--narrow {
		min-height: 17.625rem; /* 282 */
		padding: 2rem 1.25rem;
	}

	.banner--narrow .banner__content {
		flex-direction: column;
		gap: 1.5rem;
		align-items: stretch;
		justify-content: center;
		height: 100%;
	}

	.banner--narrow .banner__title {
		font: var(--type-header-l);
	}

	.banner--narrow .banner__subtitle {
		font: var(--type-body-xs);
	}

	.banner--narrow .banner__button {
		width: 100%;
	}
}
