/*
 * Hubka Theme
 *
 * Phase: 11B.5 — Content & Editorial Components
 * Purpose: Visual polish for the Featured Collection pattern's
 * presentation only — grid spacing and no-results integration. The
 * Book Card it renders is styled exclusively in components/book-card.css,
 * not duplicated here.
 *
 * Revision note: HOMEPAGE_EDITORIAL_SPEC.md specifies "4-up desktop /
 * 2-up mobile" for this section. Confirmed live that without an explicit
 * mobile override, WooCommerce's own default flex-wrap behavior for
 * `displayLayout:{"columns":4}` collapses all the way to 1-up on mobile,
 * not 2-up — making an 8-product collection nearly 9000px tall on a
 * phone. Forced to a real 2-column CSS grid below, at mobile only,
 * mirroring the exact approach genre-grid.css already uses for its own
 * mobile grid.
 *
 * Rules:
 * - Reuse theme.json tokens.
 * - Use logical properties.
 * - Keep selectors shallow.
 * - Do not duplicate component styling.
 */

.hubka-featured-collection__grid {
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

.hubka-featured-collection__grid .wc-block-product-template {
	gap: var(--wp--preset--spacing--50);
}

/* The <li> product cells already stretch to equal height (flex default),
 * confirmed live — but WordPress renders Book Card here as a template
 * part, wrapped in an extra `.wp-block-template-part` div the <li>'s
 * direct child, which does NOT inherit that stretched height on its own
 * (a block child doesn't fill a flex-stretched parent unless told to).
 * Without this, Book Card's own block-size:100% (components/book-card.css)
 * has no definite height to resolve against. This is grid-wrapper
 * plumbing, not Book Card's own styling, so it belongs here rather than
 * in book-card.css per this component's "styled only in its own file"
 * rule. */
.hubka-featured-collection__grid .wc-block-product-template > li > .wp-block-template-part {
	block-size: 100%;
}

@media (max-width: 782px) {
	.hubka-featured-collection__grid .wc-block-product-template {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--wp--preset--spacing--40);
	}
}

.hubka-featured-collection__grid .wp-block-woocommerce-product-collection-no-results {
	padding-block: var(--wp--preset--spacing--50);
	text-align: center;
}
