/* Review pages (/item.php) — any catalog item with a written review or a Steam
   review. The head: a cover beside the title, one row of facts and the
   actions; then each review as a card. Site tokens only (theme, dark mode,
   high contrast carry through). Was an inline <style> in item.php. */

[data-component="item-head"],
[data-component="item-review"],
[data-component="steam-review"] {
	--item-line: color-mix(in srgb, var(--primary-color) 14%, transparent);
	/* As Social's cards (social.css --so-card): a little of the text colour in
	   the page colour — darker in light mode, lighter in dark. */
	--item-card: color-mix(in srgb, var(--primary-text-color) 5%, var(--bg-color));
	--item-muted: color-mix(in srgb, var(--primary-text-color) 68%, var(--bg-color));
	--item-radius: 0.75rem;
}
/* High contrast: card edges at full strength. */
[data-accessibility~="high-contrast"] :is([data-component="item-head"], [data-component="item-review"], [data-component="steam-review"]) {
	--item-line: var(--primary-text-color);
}


/* ── Banner: a Steam review's cover, full width (animated when it is) ── */
/* Hung like a Social profile cover (social.css [data-part="cover"]): right
   under the breadcrumb tab, the same 3.2:1 frame and corner. The site gives a
   <figure> margin and padding of its own; none here. */
[data-component="item-banner"] {
	margin: 0;
	padding: 0;
}

[data-component="item-banner"] img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 5; /* a 1920 × 620 cover loses ~1.5% top and bottom */
	object-fit: cover;
	object-position: center;
	border-radius: 0.6rem;
	background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-color));
}

[data-component="item-banner"] + [data-component="item-head"] {
	margin-top: var(--spacing-large);
}

/* ── Head ────────────────────────────────────────────────────────────── */
[data-component="item-head"] {
	display: grid;
	grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
	gap: var(--spacing-large);
	align-items: start;
	margin: var(--spacing-normal) 0 var(--spacing-xx-large);
}

/* Covers come in every shape (posters, square art, wide Steam headers): shown
   whole, never taller than the column needs. */
[data-component="item-head"] [data-part="cover"] {
	display: block;
	width: 100%;
	height: auto;
	max-height: 21rem;
	object-fit: contain;
	object-position: left top;
	border-radius: var(--item-radius);
}

[data-component="item-head"][data-type-key="steam"] {
	grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
}

/* No image beside the title (the banner above is the picture). */
[data-component="item-head"][data-no-image] {
	grid-template-columns: minmax(0, 1fr);
}

[data-component="item-head"] [data-part="info"] {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-small);
	min-width: 0;
}

[data-component="item-head"] [data-part="kicker"] {
	margin: 0;
	font-size: var(--font-size-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--focus-color);
}

[data-component="item-head"] h1 {
	margin: 0;
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	line-height: 1.05;
	overflow-wrap: anywhere;
}

/* The facts: label over value, side by side, wrapping. */
[data-component="item-head"] [data-part="facts"] {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-small) var(--spacing-large);
	margin: var(--spacing-x-small) 0 0;
	padding: var(--spacing-small) 0;
	border-block: 0.05rem solid var(--item-line);
}

[data-component="item-head"] [data-part="facts"] dt {
	font-size: var(--font-size-small);
	color: var(--item-muted);
}

[data-component="item-head"] [data-part="facts"] dd {
	margin: 0;
	font-weight: 600;
}

[data-component="item-head"] [data-part="actions"] {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--spacing-small) var(--spacing-normal);
	margin: var(--spacing-x-small) 0 0;
}

@container page (max-width: 38.4rem) {
	[data-component="item-head"],
	[data-component="item-head"][data-type-key="steam"] {
		grid-template-columns: minmax(0, 1fr);
	}

	[data-component="item-head"] [data-part="cover"] {
		max-width: 14rem;
	}

	[data-component="item-head"][data-type-key="steam"] [data-part="cover"] {
		max-width: 100%;
	}
}

/* ── Reviews ─────────────────────────────────────────────────────────── */
[data-component="item-review"],
[data-component="steam-review"] {
	max-width: 46rem;
	margin-bottom: var(--spacing-large);
	padding: var(--spacing-large);
	border: 0.05rem solid var(--item-line);
	border-radius: var(--item-radius);
	background: var(--item-card);
}

[data-component="item-review"] > h2 {
	margin-top: 0;
}
