/**
 * Pattern: Card Grid — Query Loop overrides  (patterns/card-grid-query.php)
 *
 * All visual rules (section band, card anatomy, responsive grid) live in
 * card-grid.css which is shared by both kds/card-grid and kds/card-grid-query.
 * This partial holds Query Loop-specific structural overrides only:
 * — wp:query and wp:post-template introduce extra wrapper divs that need
 *   their own layout resets so they don't break the CSS grid.
 *
 * Auto-enqueued by inc/enqueue.php glob (dep on kd-global only).
 */

/* wp:query block — reset any WP-injected layout wrapper margin/padding so
   the inner post-template grid sits flush inside the section constrained
   content area. */
.kd-card-grid-query.wp-block-query {
	margin-block: 0 !important;
	width: 100%;
}

/* wp:post-template renders as a <ul> with WP's grid layout class.
   card-grid.css already targets .kd-card-grid-query .wp-block-post-template
   for the grid definition. This resets the list styling that WP adds. */
.kd-card-grid-query .wp-block-post-template.is-flex-container {
	/* WP 6.x adds display:flex + flex-wrap for its own grid; override to CSS grid */
	display: grid !important;
	flex-wrap: unset !important;
}

/* Each <li> inside the post-template — reset list item defaults that interfere
   with the grid cell sizing. */
.kd-card-grid-query .wp-block-post-template > li {
	margin: 0 !important;
	padding: 0 !important;
}
