/*
 * Hubka Theme
 *
 * Phase: 12F — Author Spotlight: Real Fixes
 * Purpose: First dedicated stylesheet for Author Spotlight — it
 * previously had none at all (only inherited Section Heading's type
 * styles via shared classes), which is why the portrait had no real
 * image treatment and there was no hover/spacing tuned to this
 * section specifically.
 *
 * Rules:
 * - Reuse theme.json tokens.
 * - Use logical properties.
 * - Keep selectors shallow.
 * - Do not duplicate component styling.
 */

.hubka-author-spotlight {
	gap: var(--wp--preset--spacing--60);
	padding-block: var(--wp--preset--spacing--50);
}

.hubka-author-spotlight__portrait-image {
	margin: 0;
	border-radius: var(--wp--custom--book-cover--radius);
	overflow: hidden;
}

.hubka-author-spotlight__portrait-image img {
	inline-size: 100%;
	block-size: auto;
	box-shadow: var(--wp--custom--book-cover--shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* WordPress shows the Media Library attachment's stored caption here by
 * default if one exists — confirmed live that a real portrait upload
 * carried a raw attachment UUID as its caption, visible under the photo
 * to real visitors. The design was never meant to show a caption here
 * (the bio paragraph beside the portrait already carries the editorial
 * text), so this is suppressed outright rather than left to depend on
 * every future portrait upload having its caption field manually
 * cleared in the Media Library. */
.hubka-author-spotlight__portrait-image figcaption {
	display: none;
}

/* Gentle lift only — the spec explicitly disallows a grayscale-to-color
 * hover transform here, too dramatic for an editorial portrait. */
.hubka-author-spotlight__portrait:hover .hubka-author-spotlight__portrait-image img {
	transform: translateY(-4px);
	box-shadow: var(--wp--custom--book-cover--shadow-hover);
}

.hubka-author-spotlight__bio {
	line-height: 1.6;
	max-inline-size: 47.5rem;
	margin-block: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

@media (max-width: 782px) {
	.hubka-author-spotlight {
		gap: var(--wp--preset--spacing--40);
	}

	/* Confirmed live: a real uploaded portrait (500×592, ratio 0.845)
	 * renders at ~574px tall at 100% mobile width with no cap — a
	 * disproportionate share of the screen for one image. Two prior
	 * attempts at capping this via cropping (a fixed block-size, then an
	 * aspect-ratio close to the photo's own) were both rejected by the
	 * user in favor of shrinking the whole image uniformly instead —
	 * "reduce the size, don't cut it." Scales the figure itself to 65%
	 * of the column width (a flat 35% reduction) and centers it; the img
	 * keeps its base block-size:auto with no aspect-ratio/object-fit
	 * override, so it renders at its true natural proportions with zero
	 * cropping — confirmed live (rendered ratio 0.844, matching the
	 * photo's natural 0.845 almost exactly). Desktop is untouched (the
	 * two-column layout there already keeps the portrait column narrow
	 * enough that this doesn't apply). */
	.hubka-author-spotlight__portrait-image {
		inline-size: 65%;
		margin-inline: auto;
	}
}
