/* Inspirations provider output on composed routes.
 *
 * Companion to `components/reviews-provider.css`, and it exists for exactly the
 * same reason. The `sequoia/inspirations` block and the `[sequoia-inspirations]`
 * shortcode are both rendered by the sequoia-blocks plugin
 * (`includes/inspirations/class-sequoia-inspirations-owner.php`). That markup
 * used to be dressed entirely by the legacy 206KB `themes/sequoia/style.css`,
 * which composed routes never load -- so without this sheet the grid paints as
 * a bare vertical stack of full-bleed images at their intrinsic size.
 *
 * The block's own `style.scss` contributes only `.sequoia-inspirations .css-grid
 * { width: 100% }`, at (0,2,0). Every rule here that has to beat it is scoped to
 * at least (0,3,0), which is why the `.layout-creative-grid` class is carried in
 * the selector rather than dropped for brevity.
 *
 * Layout re-states the legacy "creative grid" mosaic from `style.css:5853-5899`
 * -- a 3-column grid where every sixth item takes a double-width or double-height
 * cell, so the wall of square thumbnails gets a rhythm. That mosaic is the design
 * as authored; only the values are restated, in the design's tokens rather than
 * the legacy `--global--spacing-*` custom properties, which this theme does not
 * define. Two of those legacy declarations are deliberately NOT carried over:
 * `max-width: … !important` on the wrapper, because band width is owned by the
 * route's layout container here and not by the provider, and the `!important` on
 * the image sizing, which was only needed to outrank the legacy theme's own
 * `img` rules.
 *
 * The filter form is shortcode-only in practice: the block does not emit it, and
 * `[sequoia-inspirations]` is the whole of production page 56
 * (/outdoor-living-designs/). It is styled here anyway, because that page is a
 * live 200 on production and is the target of Rank Math redirection id=69.
 */

/* ── Grid ──────────────────────────────────────────────────────── */

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations {
	box-sizing: border-box;
	min-width: 0;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .results-info {
	color: var(--sq-muted, #6b6860);
	font-family: var(--v2-mono, "IBM Plex Mono", "Courier New", monospace);
	font-size: 12px;
	letter-spacing: .08em;
	margin: 0 0 16px;
	text-transform: uppercase;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid {
	display: grid;
	gap: 24px;
	grid-auto-rows: minmax(15rem, 18rem);
	grid-template-columns: repeat(3, 1fr);
	width: 100%;
}

/* `color` and `text-decoration` are declared for the same reason `background` and
 * `border-radius` are declared on `.load-more`: core's `a:where(:not(.wp-element-button))`
 * and this theme's base `a` rule both reach these anchors, so leaving the
 * properties undeclared inherits forest green and an underline.
 *
 * That is invisible while the images load -- the anchor's only child is an <img>,
 * so there is no text to colour or underline. It is NOT invisible when an image
 * fails: verified by 404-ing /uploads/** in a browser, the band renders as a
 * column of green underlined alt-text links. A flaky connection, a bad upload
 * path or a migrated media root all produce that. Declaring both properties
 * costs nothing and removes a failure mode that only appears when something else
 * has already gone wrong. */
:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item {
	color: inherit;
	display: block;
	overflow: hidden;
	position: relative;
	text-decoration: none;
}

/* The mosaic. Six-item cycle; every cell is explicit so the pattern repeats
 * cleanly however many records come back. */
:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+1) {
	grid-column: 1;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+2) {
	grid-column: 2 / 4;
	grid-row: span 2;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+3) {
	grid-column: 1;
	grid-row: span 2;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+4) {
	grid-column: 2 / 4;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+5) {
	grid-column: 1 / 3;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+6) {
	grid-column: 3;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

/* ── Load more ─────────────────────────────────────────────────── */

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .wp-block-button {
	display: block;
	margin: 40px auto 0;
	max-width: 15rem;
}

/* `background` and `border-radius` are declared, not inherited, and that is the
 * whole point of these two lines. WordPress core's global styles emit
 * `:root :where(.wp-element-button, .wp-block-button__link) { background-color:
 * #32373c; color: #fff }` and `:where(.wp-block-button__link) { border-radius:
 * 9999px }`. The markup carries `wp-block-button__link`, so an outline button
 * that sets only `border` and `color` inherits core's dark fill underneath its
 * own dark ink -- measured at roughly 1.3:1 contrast, effectively illegible --
 * and a pill radius that contradicts the site-wide square-corner directive.
 * Specificity is not the issue: this selector is (0,2,0) against core's (0,1,0)
 * and (0,0,0). Not declaring the property at all was. */
:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .load-more {
	background: transparent;
	border: 1px solid var(--sq-ink, #17160f);
	border-radius: 0;
	color: var(--sq-ink, #17160f);
	display: block;
	font-family: var(--v2-display, Montserrat, Arial, sans-serif);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	padding: 14px 20px;
	text-align: center;
	text-decoration: none;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .load-more:hover,
:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .load-more:focus-visible {
	background: var(--sq-ink, #17160f);
	border-radius: 0;
	color: var(--sq-white, #ffffff);
}

/* ── Category filter (shortcode path) ──────────────────────────── */

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations #inspirations-filter {
	background: var(--sq-cream, #f6f4ee);
	border: 1px solid var(--sq-line, #e3dfd3);
	margin-bottom: 32px;
	padding: 24px;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .filter-by-label {
	color: var(--sq-ink, #17160f);
	font-family: var(--v2-mono, "IBM Plex Mono", "Courier New", monospace);
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .category-checklist {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .category-checklist li {
	break-inside: avoid;
	margin: 0 0 6px;
}

:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .category-checklist label {
	margin-left: 6px;
}

@media only screen and (min-width: 482px) {
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .category-checklist {
		column-count: 2;
	}
}

@media only screen and (min-width: 652px) {
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .category-checklist {
		column-count: 3;
	}
}

@media only screen and (min-width: 1024px) {
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations .category-checklist {
		column-count: 4;
	}
}

/* ── Narrow viewports ──────────────────────────────────────────── */

/* The mosaic's explicit `grid-column` values are what have to be undone here,
 * and each is (0,4,0) with its `:nth-child()`. `revert` on a single-column grid
 * would fall back to the same authored value, so the override is explicit and
 * matched in weight rather than relying on `!important` as the legacy sheet did. */
@media only screen and (max-width: 481px) {
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid {
		grid-auto-rows: auto;
		grid-template-columns: 1fr;
	}

	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+1),
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+2),
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+3),
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+4),
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+5),
	:where(.entry-content, .editor-styles-wrapper) .sequoia-inspirations.layout-creative-grid .css-grid .grid-item:nth-child(6n+6) {
		grid-column: auto;
		grid-row: auto;
	}
}
