/**
 * upcomer/highlight-card-row
 *
 * Tinted gray canvas with white cards "lifting" off it. Each card has a red
 * accent: by default a solid rule across the top edge with a subtle dark hairline
 * on the other three sides; an alternative variant wraps the card in a full
 * red border (no top rule).
 *
 * Compliance with the "no new colors" rule (CLAUDE.md → Design conventions):
 * the canvas (very light gray) and the card (white) are intrinsic to the
 * block's visual definition — they ARE the contrast that makes "lift" work,
 * not palette colors. The red accent is exposed as an editor-controlled
 * Color Picker field (`accent_color`) following the page-hero-intro pattern;
 * the default red here is the per-block fallback when the editor leaves the
 * picker empty.
 */

/* ---- Tokens ----------------------------------------------------------- */

.upcomer-block--highlight-card-row {
	/* Canvas / card surfaces */
	--canvas-bg: #f1f1f1;
	--card-bg: #ffffff;

	/* Foreground: bound to currentColor so cards adapt if a parent context
	   ever inverts the color scheme. */
	--card-fg: inherit;
	--card-fg-muted: color-mix(in srgb, currentColor 65%, transparent);
	--card-border: color-mix(in srgb, currentColor 8%, transparent);

	/* Red accent — overridden inline by render.php when the editor sets a
	   value via the accent_color picker. */
	--card-accent: #c81e1e;

	/* Geometry */
	--card-rule: 3px;
	--card-padding: clamp(1.75rem, 3vw, 2.5rem);
	--row-gap: clamp(0.875rem, 1.75vw, 1.5rem);

	/* 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));

	background: var(--canvas-bg);
	color: #0f0f0f;
	padding-block: clamp(2.5rem, 5vw, 4.5rem);
	margin-block: 0;
}

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

.upcomer-block--highlight-card-row .upcomer-block__inner {
	max-width: var(--page-hero-content-max);
	margin-inline: auto;
}

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

/* ---- Grid ------------------------------------------------------------- */

.upcomer-block--highlight-card-row .highlight-card-row__items {
	display: grid;
	gap: var(--row-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.upcomer-block--highlight-card-row .highlight-card-row__items--cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.upcomer-block--highlight-card-row .highlight-card-row__items--cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.upcomer-block--highlight-card-row .highlight-card-row__items--cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 991px) {
	.upcomer-block--highlight-card-row .highlight-card-row__items--cols-2,
	.upcomer-block--highlight-card-row .highlight-card-row__items--cols-3,
	.upcomer-block--highlight-card-row .highlight-card-row__items--cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.upcomer-block--highlight-card-row .highlight-card-row__items--cols-2,
	.upcomer-block--highlight-card-row .highlight-card-row__items--cols-3,
	.upcomer-block--highlight-card-row .highlight-card-row__items--cols-4 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---- Card ------------------------------------------------------------- */

.upcomer-block--highlight-card-row .highlight-card {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	margin: 0;
	padding: var(--card-padding);
	background: var(--card-bg);
	color: var(--card-fg);

	transition:
		transform 250ms cubic-bezier(0.2, 0.6, 0.2, 1),
		box-shadow 250ms ease,
		border-top-width 200ms ease;
}

/* Variant: top-rule (default) ------------------------------------------- */
.upcomer-block--highlight-card-row--top-rule .highlight-card {
	border-top: var(--card-rule) solid var(--card-accent);
	border-right: 1px solid var(--card-border);
	border-bottom: 1px solid var(--card-border);
	border-left: 1px solid var(--card-border);
}

/* On hover, the rule grows by 1px (and the lift compensates) so the
   accent feels like it's pressing forward, not like the card is sliding. */
.upcomer-block--highlight-card-row--top-rule .highlight-card:hover {
	border-top-width: calc(var(--card-rule) + 1px);
}

/* Variant: full-border -------------------------------------------------- */
.upcomer-block--highlight-card-row--full-border .highlight-card {
	border: var(--card-rule) solid var(--card-accent);
}

/* Shared lift on hover */
.upcomer-block--highlight-card-row .highlight-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px color-mix(in srgb, currentColor 8%, transparent);
}

/* ---- Card type -------------------------------------------------------- */

.upcomer-block--highlight-card-row .highlight-card__title {
	margin: 0;
	font-family: "Barlow Condensed", "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.9375rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	line-height: 1.1;
	color: var(--card-fg);
	text-wrap: balance;
}

.upcomer-block--highlight-card-row .highlight-card__body {
	margin: 0;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--card-fg-muted);
	text-wrap: pretty;
}

.upcomer-block--highlight-card-row .highlight-card__body em {
	font-style: italic;
}

.upcomer-block--highlight-card-row .highlight-card__body strong {
	font-weight: 700;
	color: var(--card-fg);
}
