/**
 * upcomer/feature-module-with-tags
 *
 * Two-column explainer: a visual module on the left (1fr), heading +
 * description + tag pills on the right (2fr). Collapses to a single column on
 * mobile with the module first.
 *
 * Module variants:
 *  - .module--text-light (default): white text. If a background_image is set,
 *    the overlay darkens the image so light text reads.
 *  - .module--text-dark: black text. If a background_image is set, the overlay
 *    lightens the image instead.
 *  Editors pick the text color that contrasts best with their image; the
 *  overlay direction follows automatically.
 *
 * No-new-colors compliance (CLAUDE.md → Design conventions):
 *  - `--module-bg` defaults to #0a0a0a — the same dark surface page-hero-intro
 *    uses as its background fallback. It's editor-overridable via the
 *    `module_background_color` Color Picker, following the page-hero-intro
 *    accent_color pattern.
 *  - `--module-fg` is white for the light variant, near-black for the dark
 *    variant. Black/white are the only "new" colors here and they're the
 *    minimum needed for text contrast on photographic backgrounds — they're
 *    not brand accents, just text legibility constants.
 *  - All other colors derive from `currentColor` via `color-mix` so they
 *    adapt to whatever the page's text color is.
 */

.upcomer-block--feature-module-with-tags {
	--module-bg: #0a0a0a;
	--module-fg: #ffffff;
	--module-fg-muted: color-mix(in srgb, currentColor 78%, transparent);

	/* Overlay defaults to the light-text variant (darkening). Overridden below
	   for .module--text-dark. */
	--module-overlay: rgba(0, 0, 0, 0.45);

	--tag-border: color-mix(in srgb, currentColor 18%, transparent);
	--tag-fg-muted: color-mix(in srgb, currentColor 72%, transparent);

	/* Shared content column with the rest of the site (matches gamurs footer). */
	--page-hero-content-max: calc(1px * var(--wp--custom--bottom-nav--container--desktop--max-width, 1200));

	margin-block: clamp(2.5rem, 6vw, 4.5rem);
}

/* ---- Content column --------------------------------------------------- */

.upcomer-block--feature-module-with-tags .upcomer-block__inner {
	max-width: var(--page-hero-content-max);
	margin-inline: auto;
}

@media (max-width: 991px) {
	.upcomer-block--feature-module-with-tags .upcomer-block__inner {
		/* Match the gamurs site-wide mobile gutter (theme.css uses 15px). */
		padding-inline: 15px;
	}
}

/* ---- Outer 1fr 2fr grid ---------------------------------------------- */

.upcomer-block--feature-module-with-tags .feature-module-with-tags__grid {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: clamp(1.5rem, 3vw, 2.5rem);
	align-items: start;
}

@media (max-width: 991px) {
	.upcomer-block--feature-module-with-tags .feature-module-with-tags__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---- Module (left column) -------------------------------------------- */

.upcomer-block--feature-module-with-tags .module {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: clamp(1.5rem, 3vw, 2.5rem);
	aspect-ratio: 1 / 1;
	background: var(--module-bg);
	color: var(--module-fg);
	text-align: center;
	overflow: hidden;
	isolation: isolate;
}

/* Dark-text variant: flips foreground to near-black and overlay direction to
   lightening. Picked by the editor for use against light photography or a
   light background_color. */
.upcomer-block--feature-module-with-tags .module--text-dark {
	--module-fg: #0a0a0a;
	--module-overlay: rgba(255, 255, 255, 0.55);
}

/* Background image fills the module; overlay sits above it; flex children
   sit above both via z-index. */
.upcomer-block--feature-module-with-tags .module__bg-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.upcomer-block--feature-module-with-tags .module__overlay {
	position: absolute;
	inset: 0;
	background: var(--module-overlay);
	z-index: 1;
	pointer-events: none;
}

/* Lift flex children above the image + overlay. */
.upcomer-block--feature-module-with-tags .module__icon,
.upcomer-block--feature-module-with-tags .module-label {
	position: relative;
	z-index: 2;
}

@media (max-width: 991px) {
	.upcomer-block--feature-module-with-tags .module {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 599px) {
	.upcomer-block--feature-module-with-tags .module {
		aspect-ratio: auto;
		min-height: 12rem;
	}
}

.upcomer-block--feature-module-with-tags .module__icon {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	color: currentColor;
}

.upcomer-block--feature-module-with-tags .module__icon svg {
	width: min(60%, 7rem);
	height: auto;
	aspect-ratio: 1 / 1;
}

.upcomer-block--feature-module-with-tags .module__icon svg [fill]:not([fill="none"]) {
	fill: currentColor;
}

.upcomer-block--feature-module-with-tags .module__icon svg [stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

.upcomer-block--feature-module-with-tags .module__icon img {
	width: min(60%, 7rem);
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

.upcomer-block--feature-module-with-tags .module-label {
	margin: 1rem 0 0;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	line-height: 1.2;
	color: currentColor;
}

/* Module with no icon — center the label vertically. */
.upcomer-block--feature-module-with-tags .module--no-icon {
	justify-content: center;
}

.upcomer-block--feature-module-with-tags .module--no-icon .module-label {
	margin: 0;
}

/* ---- Content (right column) ----------------------------------------- */

.upcomer-block--feature-module-with-tags .content {
	display: flex;
	flex-direction: column;
	gap: clamp(1rem, 2vw, 1.5rem);
	min-width: 0;
}

.upcomer-block--feature-module-with-tags .content__heading {
	margin: 0;
	font-family: "Barlow Condensed", "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: inherit;
	text-wrap: balance;
}

.upcomer-block--feature-module-with-tags .content__description {
	margin: 0;
	max-width: 65ch;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 1rem;
	line-height: 1.55;
	color: color-mix(in srgb, currentColor 72%, transparent);
	text-wrap: pretty;
}

.upcomer-block--feature-module-with-tags .content__description em {
	font-style: italic;
}

.upcomer-block--feature-module-with-tags .content__description strong {
	font-weight: 700;
	color: currentColor;
}

.upcomer-block--feature-module-with-tags .content__description a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 1px;
}

/* ---- Tags (2-col grid of pills) ------------------------------------- */

.upcomer-block--feature-module-with-tags .tags {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.625rem 0.75rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 991px) {
	.upcomer-block--feature-module-with-tags .tags {
		grid-template-columns: minmax(0, 1fr);
	}
}

.upcomer-block--feature-module-with-tags .tag {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0;
	padding: 0.5rem 1rem 0.5rem 0.75rem;
	border: 1px solid var(--tag-border);
	border-radius: 999px;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	color: inherit;
	min-width: 0;
}

/* The icon span is always rendered so labels align across the row even when
   some tags have no icon (per the edge-case spec). min-width preserves the
   icon's 16px box even when the span is empty. */
.upcomer-block--feature-module-with-tags .tag__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	min-width: 16px;
	flex-shrink: 0;
	color: currentColor;
}

.upcomer-block--feature-module-with-tags .tag__icon svg {
	width: 100%;
	height: 100%;
}

.upcomer-block--feature-module-with-tags .tag__icon svg [fill]:not([fill="none"]) {
	fill: currentColor;
}

.upcomer-block--feature-module-with-tags .tag__icon svg [stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

.upcomer-block--feature-module-with-tags .tag__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.upcomer-block--feature-module-with-tags .tag .label {
	display: inline-block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
