/*
 * Industry grid (S-03; the `sealcoin/industry-grid` block, Phase 13, ADR
 * 0003). Ported from the redesign PoC (css/site.css @ ed0ab9f7, ".filters",
 * "Industry grid") using theme.json tokens and base.css aliases only. Loaded
 * only where the block is used (functions.php) and in the editor.
 *
 * Without JavaScript the industries are a list of cards with all their text.
 * With view.js (`.is-enhanced`) they are image tiles with filters above and
 * the selected industry's detail panel below; filtered-out tiles are
 * `hidden`. Hover only outlines buttons (G-12). Breakpoints follow docs/05
 * §3.1: the PoC's 1000px becomes lg, 760px sm and 560px xs. Literal values
 * kept from the PoC: 1px borders and the square tile images.
 */

.sc-industries > *,
.sc-industry > *,
.sc-industry-detail-col > * {
	margin-block: 0;
}

/* ---------- Without JavaScript: a list of industries ---------- */

.sc-industry-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--wp--custom--industries--list-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sc-industry {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--industries--tile-gap);
	padding: var(--wp--custom--industries--detail-padding);
	border: 1px solid var(--line-soft);
	border-radius: var(--r-card);
	background: var(--c-panel);
}

.sc-industry[hidden] {
	display: none;
}

.sc-industry-image {
	display: block;
	width: 100%;
	max-width: var(--wp--custom--industries--image-width);
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.sc-industry-new,
.sc-industry-group,
.sc-industry-apps-label,
.sc-industry-eyebrow {
	font-family: var(--f-display);
	font-size: var(--wp--custom--font-size--industry-new);
	letter-spacing: var(--wp--custom--industries--new-letter-spacing);
	text-transform: uppercase;
	color: var(--c-blue);
}

/* The PoC's eyebrows are spans in a body-text line, so their line box is
   one body line high. */
.sc-industry-apps-label,
.sc-industry-eyebrow {
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 600;
	line-height: calc(var(--wp--preset--font-size--body) * var(--wp--custom--line-height--body));
	letter-spacing: var(--wp--custom--letter-spacing--eyebrow);
	color: var(--c-orange);
}

.sc-industry-text {
	color: var(--c-muted);
}

.sc-industry-apps {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--industries--apps-gap);
	margin: 0;
	padding-left: var(--wp--custom--industries--apps-indent);
	font-size: var(--wp--custom--font-size--industry-apps);
	color: var(--c-muted);
}

/* ---------- Enhanced: filters ---------- */

.sc-industry-filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--industries--filters-gap);
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--wp--custom--industries--filters-offset);
}

.sc-industry-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--custom--industries--chips-gap);
}

.sc-industry-filter {
	padding: var(--wp--custom--industries--chip-padding);
	border: 1px solid var(--line-soft);
	border-radius: var(--r-pill);
	background: transparent;
	font-family: var(--f-display);
	font-size: var(--wp--custom--font-size--industry-chip);
	font-weight: 600;
	color: var(--c-muted);
	cursor: pointer;
}

.sc-industry-filter:hover {
	border-color: var(--line);
	color: var(--c-text);
}

.sc-industry-filter[aria-pressed="true"],
.sc-industry-filter[aria-pressed="true"]:hover {
	border-color: var(--c-orange);
	background: var(--c-orange);
	color: var(--c-on-orange);
}

.sc-industry-hint {
	margin: 0;
	font-size: var(--wp--custom--font-size--industry-hint);
	color: var(--c-muted);
}

/* ---------- Enhanced: tiles ---------- */

.sc-industries.is-enhanced .sc-industry-list {
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--wp--custom--industries--grid-gap);
}

.sc-industries.is-enhanced .sc-industry {
	display: block;
	padding: 0;
	border: 0;
	background: none;
}

/* Filtered out (D6, changed 2026-10-06): dimmed in place as in the
   redesign (`.ind.dim`), and inert (set by view.js): not clickable, no Tab
   stop, out of the accessibility tree, so the dimmed text is an inactive
   component (WCAG 1.4.3 exception). */
.sc-industries.is-enhanced .sc-industry.is-filtered {
	opacity: var(--wp--custom--industries--filtered-opacity);
	transform: scale(var(--wp--custom--industries--filtered-scale));
}

.sc-industry-tile {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--industries--tile-gap);
	align-items: center;
	width: 100%;
	height: 100%;
	padding: var(--wp--custom--industries--tile-padding);
	border: 1px solid var(--line-soft);
	border-radius: var(--r-card);
	background: var(--c-black);
	font: inherit;
	color: var(--c-text);
	cursor: pointer;
}

.sc-industry-tile:hover,
.sc-industry-tile[aria-pressed="true"] {
	border-color: var(--c-orange);
}

.sc-industry-tile-name {
	font-family: var(--f-display);
	font-size: var(--wp--custom--font-size--industry-name);
	font-weight: 600;
	text-align: center;
}

.sc-industry-tile .sc-industry-new {
	margin: 0;
}

/* ---------- Enhanced: detail panel ---------- */

.sc-industry-detail {
	margin-top: var(--wp--custom--industries--detail-offset);
	padding: var(--wp--custom--industries--detail-padding);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	background: var(--c-panel);
}

.sc-industry-detail-item:not([hidden]) {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--custom--industries--detail-gap);
}

.sc-industry-detail .sc-industry-name {
	margin-bottom: var(--wp--custom--industries--detail-title-offset);
}

.sc-industry-detail .sc-industry-apps {
	margin-top: var(--wp--custom--industries--apps-offset);
}

@media (prefers-reduced-motion: no-preference) {

	.sc-industry-filter,
	.sc-industry-tile {
		transition: border-color var(--motion-base), background var(--motion-base), color var(--motion-base);
	}

	.sc-industries.is-enhanced .sc-industry {
		transition: opacity var(--motion-slow), transform var(--motion-slow);
	}
}

/* lg (PoC: 1000px) */
@media (max-width: 1080px) {

	.sc-industries.is-enhanced .sc-industry-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* sm (PoC: 760px) */
@media (max-width: 760px) {

	.sc-industry-detail-item:not([hidden]) {
		grid-template-columns: 1fr;
	}
}

/* xs (PoC: 560px) */
@media (max-width: 520px) {

	.sc-industries.is-enhanced .sc-industry-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Block editor ---------- */

/* The editor shows the industries as the no-JavaScript list of cards. The
   image is the button that opens the media library: it keeps the tile
   image's size instead of overflowing the button. */
.sc-industry-editor {
	display: flex;
	flex-direction: column;
	gap: var(--wp--custom--industries--tile-gap);
	padding: var(--wp--custom--industries--detail-padding);
	border: 1px solid var(--line-soft);
	border-radius: var(--r-card);
	background: var(--c-panel);
}

.sc-industry-editor > * {
	margin-block: 0;
}

.sc-industry-editor .components-button:has(> img) {
	align-self: flex-start;
	height: auto;
	padding: 0;
	background: none;
}

.sc-industry-editor .components-button > img {
	display: block;
	width: var(--wp--custom--industries--image-width);
	max-width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.sc-industry-editor h3 {
	font-family: var(--f-display);
	font-size: var(--wp--custom--font-size--industry-name);
}

.sc-industry-editor p {
	color: var(--c-muted);
}

.sc-industries-editor > .block-editor-inner-blocks > * {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--wp--custom--industries--list-gap);
}
