/*!
 * Section: Card Grid
 *
 * Scoped CSS for inc/sections/card-grid.php. Stub partial — visual composition
 * lands during page-migration WPs (RENDER-WP5–WP11).
 *
 * @package Mystwood_Studios_AB
 * @since   Topic 17 RENDER-WP1
 */

/* Topic 23 REDESIGN-WP7 — section rhythm token applied.
 * Card-grid padding-block anchors to --mw-space-section (120px) max. */
.mw-section--card-grid {
	padding-block: clamp(2rem, 6vw, var(--mw-space-section, 120px));
}

.mw-section--card-grid .mw-section__inner {
	max-width: var(--mw-content-width, 72rem);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Topic 36 CORR-WP1 Item 5 — additive `align="center"` centres the eyebrow +
 * headline, mirroring `.mw-section--body.mw-section--center` exactly. There is
 * no `.mw-section__headline` in card-grid.php's markup itself — the section
 * emits a plain `<h2 class="mw-section__headline">`, same selector as body. */
.mw-section--card-grid.mw-section--center .mw-section__eyebrow,
.mw-section--card-grid.mw-section--center .mw-section__headline {
	text-align: center;
}

.mw-card-grid {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 0;
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
}

.mw-card-grid--cols-1 { grid-template-columns: 1fr; }
.mw-card-grid--cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.mw-card-grid--cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.mw-card-grid--cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* Equal-height cards — SITE-WIDE DEFAULT (Topic 33 FIX-WP18, 2026-07-31).
 * Owner directive: every card in a row is the same height, CTAs aligned.
 *
 * Supersedes the Topic 25 KLEI-WP1-B scoping, which read "About cohort cards
 * only / NOT applied globally". That scoping was moot: no call site ever
 * passed `equal_height`, so the modifier below was dead code from the day it
 * shipped and the About cards it named never actually received it.
 *
 * `align-items: stretch` is declared explicitly rather than left to the grid
 * default. `.mw-card-grid__item` (the <li>) carries no CSS of its own, so
 * `height: 100%` on the card resolves ONLY because that <li> is a stretched
 * grid item with a definite used size. Stating it keeps the invariant
 * self-documenting — page CSS already reaches into this grid (lore.css:107),
 * and an `align-items` set there would otherwise revert the site to ragged
 * cards with no error anywhere.
 *
 * SCOPE GUARD: the only permitted vertical-distribution change is
 * `margin-block-start: auto` on `.mw-card__view-link` (see below). Do NOT add
 * `justify-content` to `.mw-card` — `space-between` would fling eyebrow,
 * title and body apart on every grid site-wide. Trailing space under a
 * CTA-less card is the intended result of equal height, not a bug to absorb. */
.mw-card-grid { align-items: stretch; }
.mw-card-grid .mw-card { height: 100%; }

/* Retained no-op alias. inc/sections/card-grid.php:220 still emits this class
 * when the `equal_height` arg is true, and
 * tools/probe-topic-25-klei-page-system.php:130 asserts the literal string is
 * present in this file. Redundant since FIX-WP18 — the base rule above already
 * covers it — but removing it would break the probe and the partial's arg. */
.mw-card-grid--equal-height { align-items: stretch; }
.mw-card-grid--equal-height .mw-card { height: 100%; }

.mw-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mw-card__media img {
	width: 100%;
	height: auto;
	display: block;
}

.mw-card__eyebrow {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0;
	opacity: 0.85;
}

.mw-card__title {
	font-family: var(--mw-font-display, system-ui, sans-serif);
	font-size: 1.25rem;
	line-height: 1.3;
	margin: 0;
}

.mw-card__title a {
	color: inherit;
	text-decoration: none;
}

.mw-card__title a:hover,
.mw-card__title a:focus-visible {
	text-decoration: underline;
}

.mw-card__body {
	font-size: 0.9375rem;
	line-height: 1.5;
	margin: 0;
}

/* CTA pinned to the card's bottom edge so links align across a row
 * (Topic 33 FIX-WP18). `.mw-card` is already a column flex container
 * (see above), so `auto` on the block-start absorbs the free space that
 * equal height creates.
 *
 * Written as the full `margin` shorthand, NOT `margin-block-start`, because
 * `.mw-card__view-link` is a <p>: the UA sheet's `margin-block-end: 1em`
 * would survive and float the link 1em above the card's bottom edge on every
 * page without a scoped override (e.g. /press/), while the two pages that DO
 * zero their margin sat flush. That is the per-page inconsistency this WP
 * exists to remove. The two scoped rules below are written the same way. */
.mw-card__view-link {
	margin: auto 0 0;
}

/* -----------------------------------------------------------------------
 * Publishing filter pills (Topic 25 KLEI-WP9)
 *
 * Scoped under .mw-page-publishing so the K-World locked 3x3 grid and
 * lore vellum cards CANNOT regress. The pills container is hidden in
 * the static HTML ([hidden]) and revealed by publishing-filter.js on init
 * so that a JS failure leaves all 6 cards visible with no dead pill row.
 * ----------------------------------------------------------------------- */

.mw-page-publishing .mw-publishing-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-block-end: 1.75rem;
	list-style: none;
	padding: 0;
}

/* [hidden] attribute added by PHP; JS removes it on init. */
.mw-page-publishing .mw-publishing-filter[hidden] {
	display: none;
}

.mw-page-publishing .mw-publishing-filter__pill {
	display: inline-flex;
	align-items: center;
	padding: 0.375rem 1rem;
	border: 2px solid currentColor;
	border-radius: 2rem;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.mw-page-publishing .mw-publishing-filter__pill[aria-pressed="true"] {
	background: var(--mw-color-violet, #6765e8);
	border-color: var(--mw-color-violet, #6765e8);
	color: #ffffff;
}

.mw-page-publishing .mw-publishing-filter__pill:hover,
.mw-page-publishing .mw-publishing-filter__pill:focus-visible {
	background: var(--mw-color-violet, #6765e8);
	border-color: var(--mw-color-violet, #6765e8);
	color: #ffffff;
	outline-offset: 2px;
}

/* aria-live region — visually hidden but read by assistive tech. */
.mw-publishing-filter-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* View → link (optional per-card "view_label" arg).
 * FIX-WP18: `0.25rem` block-start replaced by `auto` so the CTA pins to the
 * card bottom under the site-wide equal-height default. Nothing is lost in
 * the tallest-card case where `auto` resolves to 0 — `.mw-page-publishing` is
 * not in the `gap: 0` override list below, so the card's own `gap: 0.5rem`
 * still clears the body by more than the 0.25rem given up. */
.mw-page-publishing .mw-card__view-link {
	margin: auto 0 0;
}

.mw-page-publishing .mw-card__view-link-anchor {
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--mw-color-violet, #6765e8);
	text-decoration: none;
}

.mw-page-publishing .mw-card__view-link-anchor:hover,
.mw-page-publishing .mw-card__view-link-anchor:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* -----------------------------------------------------------------------
 * K-World brand variant (Topic 17 RENDER-WP7)
 *
 * Card-grid background painting + card surface treatment for the K-World
 * tier. Topic 13 KWORLD-WP4-B dark-glass cascade is preserved: on
 * kw-castle-stone surfaces, cards take a white inner panel for legibility.
 * Topic 13 KWORLD-WP4 ruling: 9-realms grid stays 3×3 on mobile (Figma wins).
 * ----------------------------------------------------------------------- */
.mw-section--card-grid[data-bg-token="kw-sky"]          { background-color: var(--kw-sky-surface);  color: #040420; }
.mw-section--card-grid[data-bg-token="kw-gold"]         { background-color: var(--kw-gold-surface); color: #040420; }
.mw-section--card-grid[data-bg-token="kw-cream"]        { background-color: var(--kw-cream);        color: #040420; }
.mw-section--card-grid[data-bg-token="kw-sunset"]       { background-color: var(--kw-sunset);       color: #ffffff; }
.mw-section--card-grid[data-bg-token="kw-castle-stone"] { background-color: var(--kw-castle-stone); color: #ffffff; }

/* Card surface on K-World pages — cream/white inner per Topic 13 Figma 97:6. */
.mw-section--card-grid.mw-section--brand-k-world .mw-card {
	background-color: #ffffff;
	color: #040420;
	padding: clamp(1rem, 2vw, 1.5rem);
	border-radius: var(--mw-radius-soft, 8px);
	box-shadow: var(--mw-shadow-elevation-1, 0 2px 8px rgba(0, 0, 0, 0.12));
}

.mw-section--card-grid.mw-section--brand-k-world[data-bg-token="kw-cream"] .mw-card {
	/* On a cream band, cards stay cream to maintain the warm tone. */
	background-color: #fff8e7;
}

.mw-section--card-grid.mw-section--brand-k-world[data-bg-token="kw-gold"] .mw-card,
.mw-section--card-grid.mw-section--brand-k-world[data-bg-token="kw-sky"] .mw-card {
	/* Topic 33 FIX-WP6 Task E — white card on kw-gold-surface measures 1.50:1,
	 * confirmed below the 3:1 non-text contrast guideline. A boundary ring
	 * restores a visible edge (3.51:1) without restyling the card fill.
	 *
	 * EXTENDED TO kw-sky — Topic 36 CORR-WP1 Item 2. `--kw-sky-surface` /
	 * `--kw-gold-surface` both flipped to white, so a white card on kw-sky now
	 * measures 1:1 — no edge at all, the same defect class this rule already
	 * fixed for kw-gold. */
	box-shadow: 0 0 0 1px rgba(4, 4, 32, 0.5), var(--mw-shadow-elevation-1, 0 2px 8px rgba(0, 0, 0, 0.12));
}

/* 9-realms 3×3 mobile-locked grid (Topic 13 KWORLD-WP4 — Figma wins).
 * The hub composes this as a card-grid with columns=3 + bg_token=kw-sky; the
 * 3-column shape is locked even on narrow viewports per Topic 13 ruling.
 *
 * 2026-08-24 — SCOPED TO `.mw-page-k-world-hub`. It was keyed on the attribute
 * pair alone, which is a PROXY for "the hub's realm grid", not the thing
 * itself — so any page that happened to compose a K-World card-grid at
 * columns=3 on kw-sky silently inherited realm-tile styling: tighter padding,
 * centred text, shrunken title and body type.
 *
 * That is exactly what hit /bedtime-tales-vol-1/. Its three tale cards are the
 * same component, from the same helper, as the ones on /bedtime-stories/ — but
 * because that page's band is kw-sky and the sibling's is kw-cream, only one of
 * the two wore the costume. The pair rule below could not correct it either:
 * this selector computes (0,5,0) and the page-scoped rules compute (0,4,0), so
 * it won on specificity. Bumping those to match would have been an override
 * layered on a mis-scoped selector; this fixes the selector instead.
 *
 * NOTE FOR THE NEXT READER: as of this change these four rules match NOTHING.
 * The hub's only card-grid now sits on kw-cream (k-world/hub.php:208), so the
 * shape they describe is not currently composed anywhere on the site — checked
 * across /k-world/, /bedtime-stories/, /bedtime-tales-vol-1/, /book-product/,
 * /coloring-book-product/ and /coloring-books/. They are kept rather than
 * deleted because the Topic 13 ruling they implement still stands, and a
 * restored realm grid on the hub should get it back for free. If the hub is
 * rebuilt on a different band, move the `[data-bg-token]` here to match. */
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world[data-columns="3"][data-bg-token="kw-sky"] .mw-card-grid {
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(0.5rem, 1.5vw, 1rem);
}

.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world[data-columns="3"][data-bg-token="kw-sky"] .mw-card {
	padding: clamp(0.625rem, 1.5vw, 1rem);
	text-align: center;
}

.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world[data-columns="3"][data-bg-token="kw-sky"] .mw-card__title {
	font-size: clamp(0.875rem, 2vw, 1.125rem);
}

.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world[data-columns="3"][data-bg-token="kw-sky"] .mw-card__body {
	font-size: clamp(0.75rem, 1.5vw, 0.875rem);
}

/* -----------------------------------------------------------------------
 * Lore brand variant (Topic 17 RENDER-WP8)
 *
 * Topic 14 manuscript/codex identity — card-grid for the Kaeros hub
 * 4-card cluster (Cosmology / Timeline / Characters / Realms). Cards
 * take a vellum inner surface with a thin gilt rule, system-serif title.
 * ----------------------------------------------------------------------- */
.mw-section--card-grid[data-bg-token="lore-parchment"] { background-color: var(--lore-parchment); color: var(--lore-ink); }
.mw-section--card-grid[data-bg-token="lore-vellum"]    { background-color: var(--lore-vellum);    color: var(--lore-ink); }

.mw-section--card-grid.mw-section--brand-lore .mw-section__headline {
	font-family: var(--mw-font-lore-serif, Georgia, "Times New Roman", serif);
	letter-spacing: -0.005em;
}

.mw-section--card-grid.mw-section--brand-lore .mw-card {
	background-color: var(--lore-vellum);
	color: var(--lore-ink);
	padding: clamp(1rem, 2vw, 1.5rem);
	border: 1px solid rgba(168, 125, 50, 0.4); /* gilt edge */
	border-radius: 2px; /* manuscript: square-ish, not pillowy */
	box-shadow: 0 1px 4px rgba(27, 20, 16, 0.08);
}

.mw-section--card-grid.mw-section--brand-lore[data-bg-token="lore-vellum"] .mw-card {
	background-color: var(--lore-parchment); /* invert on vellum bands */
}

.mw-section--card-grid.mw-section--brand-lore .mw-card__title {
	font-family: var(--mw-font-lore-serif, Georgia, "Times New Roman", serif);
	font-size: 1.25rem;
	letter-spacing: -0.005em;
}

.mw-section--card-grid.mw-section--brand-lore .mw-card__eyebrow {
	font-family: var(--mw-font-lore-serif, Georgia, "Times New Roman", serif);
	font-style: italic;
	letter-spacing: 0.1em;
	/* Topic 33 FIX-WP10: undeclared gilt TEXT hit — the card's inner surface
	 * is vellum (line 238 above), so this is the exact 2.56 pair. Routed
	 * through the surface-aware indirection declared in theme-tokens.css. */
	color: var(--lore-gilt-text, var(--lore-gilt, #A87D32));
	opacity: 1;
}

.mw-section--card-grid.mw-section--brand-lore .mw-card a {
	color: inherit;
	text-decoration: none;
}

.mw-section--card-grid.mw-section--brand-lore .mw-card a:hover,
.mw-section--card-grid.mw-section--brand-lore .mw-card a:focus-visible {
	color: var(--lore-oxblood);
	text-decoration: underline;
	text-decoration-color: var(--lore-gilt);
	text-underline-offset: 0.2em;
}

/* -----------------------------------------------------------------------
 * Section intro sub-headline (Topic 27 BRAND-WP4, S5)
 *
 * Shared atom — defined here (card-grid CSS loads globally) but consumed by
 * card-grid / key-facts / timeline callers that pass `intro`. A short lead
 * paragraph under the section h2 (Claude Design SectionHeading.intro).
 * ----------------------------------------------------------------------- */
.mw-section__intro {
	font-size: 1.0625rem;
	line-height: 1.6;
	max-width: 44rem;
	margin: 0.25rem 0 1.25rem;
	opacity: 0.9;
}

.mw-section--card-grid.mw-section--brand-studio .mw-section__intro {
	margin-inline: auto;
	text-align: center;
}

/* -----------------------------------------------------------------------
 * Plain "trirow" layout (Topic 27 BRAND-WP4, S4) — card-grid layout='plain'.
 *
 * Unboxed columns with a colored top-rule for Claude Design "how it works /
 * what we publish / how we work" bands. No `.mw-card` surface chrome.
 * ----------------------------------------------------------------------- */
.mw-trirow {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 0;
	display: grid;
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

.mw-trirow--cols-1 { grid-template-columns: 1fr; }
.mw-trirow--cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.mw-trirow--cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.mw-trirow--cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.mw-trirow__item {
	border-block-start: 3px solid var(--mw-color-primary, #6765e8);
	padding-block-start: 1rem;
}

.mw-trirow__eyebrow {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
	margin: 0 0 0.35rem;
}

.mw-trirow__title {
	font-family: var(--mw-font-display, system-ui, sans-serif);
	font-size: 1.25rem;
	line-height: 1.3;
	margin: 0 0 0.5rem;
}

.mw-trirow__title a {
	color: inherit;
	text-decoration: none;
}

.mw-trirow__title a:hover,
.mw-trirow__title a:focus-visible {
	text-decoration: underline;
}

.mw-trirow__body {
	font-size: 0.9375rem;
	line-height: 1.6;
	margin: 0;
}

/* -----------------------------------------------------------------------
 * Image-forward feature cards (Topic 30 CORR-WP4) — card-grid `variant`
 * ('feature') layout switch. Self-contained `.feat-grid` container (see
 * inc/sections/card-grid.php ul-level branch) — replaces the Home "We Create
 * More Than Just Fun" grid's boxed white value-card treatment below.
 *
 * Rules VERBATIM from the Claude Design handoff
 * (design-corrections/corrections.css §4, L68-77), including the
 * position/z-index stack (img z0 / scrim z1 / body z2 inside
 * `.feat-card { isolation: isolate; overflow: hidden }`) that legibility
 * depends on. THREE additions the handoff omits (reviewer-mandated):
 * link reset, :focus-visible outline (WCAG 2.4.7), and a
 * prefers-reduced-motion freeze of the hover lift/scale.
 * ----------------------------------------------------------------------- */
.feat-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(1.1rem, 2.4vw, 2.25rem);
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}

@media (max-width: 720px) {
	.feat-grid {
		grid-template-columns: 1fr;
	}
}

.feat-card {
	position: relative;
	display: block;
	isolation: isolate;
	overflow: hidden;
	aspect-ratio: 540 / 424;
	border-radius: 22px;
	text-decoration: none;
	color: inherit;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feat-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 40px 70px -34px rgba(0, 0, 0, 0.85);
}

.feat-card:focus-visible {
	outline: 3px solid var(--mw-color-primary, #6765e8);
	outline-offset: 3px;
}

.feat-card__img {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.feat-card:hover .feat-card__img {
	transform: scale(1.05);
}

.feat-card__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(4, 3, 26, 0) 30%, rgba(4, 3, 26, 0.55) 62%, rgba(4, 3, 26, 0.92) 100%);
}

.feat-card__body {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	z-index: 2;
	padding: clamp(1.25rem, 2.4vw, 1.9rem);
}

.feat-card__title {
	font-family: var(--mw-font-display, system-ui, sans-serif);
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	color: #ffffff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
	margin: 0;
}

.feat-card__desc {
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.86);
	max-width: 34ch;
	margin: 0.5rem 0 0;
}

.feat-card__cta {
	display: inline-flex;
	align-items: center;
	margin-top: 0.7rem;
	padding: 0.5rem 1.25rem;
	border-radius: 999px;
	background: var(--mw-color-primary, #6765e8);
	color: #ffffff;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
	.feat-card,
	.feat-card__img {
		transition: none;
	}

	.feat-card:hover {
		transform: none;
		box-shadow: none;
	}

	.feat-card:hover .feat-card__img {
		transform: none;
	}
}

/* -----------------------------------------------------------------------
 * K-World media cards (Topic 27 BRAND-WP4 Iter 3) — a boxed K-World surface
 * card with a flush cover photo on top and padded body, mirroring the Claude
 * Design .story-card / .pcard. Scoped to the pages that use image cards so
 * text-only K-World card-grids keep their padded surface. Iter 3a wired the
 * bedtime tale cards; Iter 3b joins the K-World hub product cross-sell (which
 * also carries a per-card `view_label` CTA link → padded to match the body).
 *
 * 2026-08-24 — `.mw-page-bedtime-tales-vol-1` joined every selector list below.
 * It was missed when the Vol. 1 product page was built, and the omission was
 * visible: that page renders the SAME three tale cards from the SAME helper
 * (`mystwood_studios_ab_bedtime_stories_cards()`), so with none of these rules
 * reaching it the images fell back to `aspect-ratio: auto` / `object-fit: fill`
 * and staggered — 320×215, 320×215, 320×162 — because the sources are two
 * different shapes (1600×1073 and 1600×812).
 *
 * Added to ALL nine groups, not just the `img` one. The `.mw-card` rule sets
 * `padding: 0` so the cover photo can go flush; the `__eyebrow` / `__title` /
 * `__body` rules further down put that padding back on the text. Wiring the
 * first without the last three would run the copy into the card edge.
 * ----------------------------------------------------------------------- */
.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card {
	padding: 0;
	overflow: hidden;
	gap: 0;
}

.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card__media,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__media,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card__media {
	margin: 0;
	/* Task C hover zoom needs its OWN clip. `.mw-card` above already has
	 * overflow:hidden, but that only clips outside the card — a scaled image
	 * would still paint down over the eyebrow and title. */
	overflow: hidden;
}

.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card__media img,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__media img,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card__media img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	/* Transition on the BASE rule, not the :hover — otherwise the zoom eases in
	 * and snaps out. Duration/curve/scale are lifted from `.feat-card__img`
	 * (:460-465) rather than re-invented, per the WP's "extend, do not build a
	 * parallel system". */
	transition: transform 0.6s ease;
}

/* Topic 33 FIX-WP24 Task C — "On Hover zoom into the images a bit" (owner,
 * 2026-07-30). Scale the IMAGE inside its clipped frame, never the card:
 * WP-18 made these cards equal-height, so anything that changed card size
 * would reflow the whole row.
 *
 * `:focus-within` is not decoration. `.mw-card` is an <article>, not a link —
 * it contains two independent anchors (`.mw-card__title a` and
 * `.mw-card__view-link-anchor`), so a keyboard user never triggers :hover and
 * would otherwise get no feedback at all that the card is interactive.
 *
 * Applied to BOTH pages on purpose. This block has been maintained as a
 * matched bedtime-stories/k-world-hub pair since Topic 27 Iter 3a; the cards
 * are the same component with the same markup, so scoping the zoom to the hub
 * alone would leave visually identical cards behaving differently. */
.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card:hover .mw-card__media img,
.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card:focus-within .mw-card__media img,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card:hover .mw-card__media img,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card:focus-within .mw-card__media img,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card:hover .mw-card__media img,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card:focus-within .mw-card__media img {
	transform: scale(1.05);
}

/* ---------------------------------------------------------------------------
 * Topic 33 FIX-WP32 Task A — dev-log index card media.
 *
 * The WP said to reuse the existing card vocabulary and to "verify it does
 * rather than assuming". Verified 2026-08-02, and it did NOT: with a featured
 * image wired in, a dev-log card image rendered **144px wide inside a 347px
 * card**, centred, while the visually identical K-World card filled its 347px.
 *
 * THE CAUSE IS `_studio.css:170-173`:
 *
 *     .mw-section--card-grid.mw-section--brand-studio .mw-card__media {
 *         margin: 0 auto 0.75rem;
 *         max-width: 9rem;          <- 9rem IS the 144px
 *     }
 *
 * That is a MASCOT treatment — a small, centred icon — and it is right for the
 * studio card grids it was written for (/team/ character portraits,
 * /publishing/ book icons). It is wrong for a dev-log entry, whose thumbnail
 * wants to be a wide photograph. The rule predates the dev log having images
 * at all, so nothing was broken when it shipped; wiring featured images in is
 * what made a 9rem cap visible.
 *
 * (First diagnosis here blamed a missing `aspect-ratio`, on the theory that
 * `.mw-card__media` was shrink-wrapping. Applying the ratio changed nothing —
 * the image stayed at exactly 144px — which is what sent the search back to
 * the parent's `max-width`. Recorded because the wrong answer was plausible
 * and someone will reach for it again.)
 *
 * SPECIFICITY: the studio rule computes (0,3,0). A `.mw-page-devblog-index
 * .mw-section--card-grid .mw-card__media` selector ALSO computes (0,3,0) and
 * loses the tie on load order — `_studio.css` loads after this file, verified
 * live. Restating `.mw-section--brand-studio` here reaches (0,4,0) and wins
 * outright, and it documents that this is a studio-brand grid being
 * re-treated, not a generic override.
 *
 * SCOPED, not promoted to the base rule, deliberately. /team/ and
 * /publishing/ use the same 9rem treatment and it suits them; their images
 * also lazy-load, so an off-screen probe could not measure how they actually
 * render (`complete: false`, natural 0x0 = unloaded, NOT broken). Changing two
 * launch pages on evidence I do not have is the wrong trade. Logged for the
 * FIX-WP9 sweep: measure those two on-screen and decide whether the mascot cap
 * should become opt-in rather than the studio default.
 *
 * Ratio and fit are lifted from the K-World block above rather than
 * re-invented, per that block's own "extend, do not build a parallel system"
 * note. No hover zoom: that is a K-World card affordance and this WP was not
 * asked to spread it.
 * ------------------------------------------------------------------------- */
.mw-page-devblog-index .mw-section--card-grid.mw-section--brand-studio .mw-card__media {
	max-width: none;
	margin: 0 0 0.75rem;
	overflow: hidden;
	border-radius: var(--mw-radius-soft, 8px);
}

.mw-page-devblog-index .mw-section--card-grid.mw-section--brand-studio .mw-card__media img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* Reduced-motion freeze. Deliberately a SEPARATE block from the `.feat-card`
 * one at :510-523 — that block is a different component (Topic 30 Home
 * image-cards) and its rules are verbatim from the Claude Design handoff;
 * folding K-World selectors into it would conflate the two. Same guard, right
 * scope. */
@media (prefers-reduced-motion: reduce) {
	.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card__media img,
	.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__media img,
	.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card__media img {
		transition: none;
	}

	.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card:hover .mw-card__media img,
	.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card:focus-within .mw-card__media img,
	.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card:hover .mw-card__media img,
	.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card:focus-within .mw-card__media img,
	.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card:hover .mw-card__media img,
	.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card:focus-within .mw-card__media img {
		transform: none;
	}
}

.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card__eyebrow,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__eyebrow,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card__eyebrow {
	padding: 1rem clamp(1rem, 2vw, 1.5rem) 0;
}

.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card__title,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__title,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card__title {
	padding: 0 clamp(1rem, 2vw, 1.5rem);
}

.mw-page-bedtime-stories .mw-section--card-grid.mw-section--brand-k-world .mw-card__body,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__body,
.mw-page-bedtime-tales-vol-1 .mw-section--card-grid.mw-section--brand-k-world .mw-card__body {
	padding: 0 clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2vw, 1.5rem);
}

/* Per-card CTA link ("See the book" / "See the game" / "Peek inside") — the
 * K-World hub cross-sell cards render the card-grid `view_label` link; pad it
 * to line up with the card body and push it to the card's warm accent. */
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__view-link {
	padding: 0 clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2vw, 1.5rem);
	/* FIX-WP18: was `margin: 0`. At (0,4,0) this shorthand outranked — and
	 * silently killed — the base `.mw-card__view-link` bottom-pin, on the one
	 * page the owner screenshotted. Fixed here at the source rather than by
	 * layering a higher-specificity override (project no-cover-up-fixes rule). */
	margin: auto 0 0;
}

.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__view-link-anchor {
	font-weight: 600;
	color: var(--kw-castle-stone, #3f4a6b);
	text-decoration: none;
}

.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__view-link-anchor:hover,
.mw-page-k-world-hub .mw-section--card-grid.mw-section--brand-k-world .mw-card__view-link-anchor:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
