/* ────────────────────────────────────────────────────────────
   03-text-media-stats.css — text + media with two impact stats
   Class chain: .text-media-stats [.media-left | .media-right]
   Bg styles (is-style-bg-* on the core/group outer):
     light / medium: navy numbers, centered, divider between
     dark:           white text
   Layout/type tokens mirror 03-text-media.css; stat number/label
   tokens mirror 03-stats-collection.css. Stats are deliberately
   open (no tile fill) — lighter than Stats Collection's tiles.
   ──────────────────────────────────────────────────────────── */

/* ── Section wrapper ──────────────────────────────────────── */
.text-media-stats {
	padding-top:    var(--spacing-4xl);
	padding-bottom: var(--spacing-4xl);
	padding-left:   var(--spacing-md);
	padding-right:  var(--spacing-md);
}

.text-media-stats__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--spacing-2xl);
	max-width: var(--container-max-width);
	margin-left:  auto;
	margin-right: auto;
}

.text-media-stats__media img {
	display: block;
	width: 100%;
	height: auto;
}

.text-media-stats__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--spacing-sm);
}

/* ── Type ─────────────────────────────────────────────────── */
.text-media-stats h2 {
	font-family: var(--font-primary);
	font-size: var(--text-heading-xl);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: var(--color-text-heading);
	margin: 0;
}

.text-media-stats__content > p {
	font-family: var(--font-body);
	font-size: var(--text-body-base);
	line-height: var(--line-height-relaxed);
	color: var(--color-text-body);
	margin: 0;
}

/* ── Stats ────────────────────────────────────────────────── */
/* Open treatment (no tile fill): centered navy number and body
   label with a thin divider between the two. Same recipe on all
   three backgrounds; only text and divider colors flip on dark. */
.text-media-stats__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin-top: var(--spacing-sm);
}

.text-media-stats__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	padding-inline: var(--spacing-md);
	text-align: center;
}

/* Divider between the two stats */
.text-media-stats__stat + .text-media-stats__stat {
	border-left: 1px solid var(--color-gray-stroke);
}

.text-media-stats__number {
	font-family: var(--font-primary);
	font-size: var(--text-display-xl);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
	color: var(--color-text-heading);
	margin: 0;
}

.text-media-stats__stat p.text-media-stats__label {
	font-family: var(--font-body);
	font-size: var(--text-body-base);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-normal);
	color: var(--color-text-body);
	margin: 0;
}

/* ── Dark bg: text flip, translucent divider ──────────────── */
.is-style-bg-dark .text-media-stats h2,
.is-style-bg-dark .text-media-stats__content > p,
.is-style-bg-dark .text-media-stats__number,
.is-style-bg-dark .text-media-stats__stat p.text-media-stats__label {
	color: var(--color-text-body-inverse);
}
.is-style-bg-dark .text-media-stats__stat + .text-media-stats__stat {
	border-left-color: color-mix(in srgb, var(--color-white) 30%, transparent);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1023px) {
	.text-media-stats {
		padding-top:    var(--spacing-2xl);
		padding-bottom: var(--spacing-2xl);
	}
}

@media (max-width: 767px) {
	.text-media-stats__row {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--spacing-xl);
	}
	/* media-right: image is last in source — pull it above content */
	.text-media-stats.media-right .text-media-stats__media { order: -1; }
	.text-media-stats__stat { padding-inline: var(--spacing-sm); }
}

@media (max-width: 768px) {
	.text-media-stats {
		padding-left:  var(--spacing-sm);
		padding-right: var(--spacing-sm);
	}
}
