/**
 * SigmaGraft Products — 02 / Material Portfolio.
 *
 * Heading + search, category filter chips, a live count, and an accordion list
 * of materials. Own `sgxs-mp` namespace, scoped throughout.
 *
 * The row is a grid, not a table: index / body / summary / toggle. On mobile
 * the summary moves under the title by grid placement rather than being hidden,
 * so no content is lost on a phone.
 */

.sgxs-mp {
	--sgxs-mp-line: #DCE4EF;
	--sgxs-mp-accent: #1457A6;
	--sgxs-mp-ink: #0E2E5C;
	--sgxs-mp-detail-max: 350px;
	--sgxs-mp-t: 400ms;

	position: relative;
	background-color: #FFFFFF;
	padding: 100px 0;
}

.sgxs-mp__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.sgxs-mp__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	margin-inline: auto;
	padding-inline: 7vw;
}

.sgxs-mp--boxed .sgxs-mp__inner {
	max-width: 1200px;
}

.sgxs-mp--full .sgxs-mp__inner {
	max-width: none;
}

/* ═════════ Head ═════════ */

.sgxs-mp__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 30px;
}

.sgxs-mp__head-copy {
	min-width: 0;
}

.sgxs-mp__kicker {
	margin: 0 0 22px;
	color: var(--sgxs-mp-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

.sgxs-mp__title {
	margin: 0;
	color: var(--sgxs-mp-ink);
	font-size: clamp(32px, 4vw, 52px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.sgxs-mp__title em,
.sgxs-mp__title i {
	color: var(--sgxs-mp-ink);
	font-family: inherit;
	font-style: normal;
	font-weight: inherit;
}

/* ═════════ Search ═════════ */

.sgxs-mp__search {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	width: 300px;
	max-width: 100%;
	padding: 13px 15px;
	background-color: #FFFFFF;
	border: 1px solid #CCD7E3;
	border-radius: 2px;
	transition: border-color 200ms ease, box-shadow 200ms ease;
}

.sgxs-mp__search:focus-within {
	border-color: var(--sgxs-mp-accent);
	box-shadow: 0 0 0 3px rgba(20, 87, 166, 0.12);
}

.sgxs-mp__search-icon {
	flex: 0 0 auto;
	color: #8A9BB0;
	font-size: 14px;
	line-height: 1;
}

/*
 * `appearance: none` strips Safari's inset search styling, and the clear
 * button is left alone — a native way to empty the field is useful.
 */
.sgxs-mp .sgxs-mp__search-input {
	appearance: none;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: #243B5B;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
}

.sgxs-mp .sgxs-mp__search-input:focus {
	outline: 0;
	box-shadow: none;
}

.sgxs-mp__search-input::placeholder {
	color: #8A9BB0;
	opacity: 1;
}

/* ═════════ Filter chips ═════════ */

.sgxs-mp__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 50px 0 28px;
}

/*
 * Two classes, deliberately. Hello Elementor's reset carries
 * `[type=button], [type=submit], button { border: 1px solid #c36 }` — an
 * attribute selector ties with a single class and the theme sheet loads last,
 * so a one-class rule loses and every chip gets a pink border.
 */
.sgxs-mp .sgxs-mp__chip {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 11px 17px;
	background-color: #FFFFFF;
	border: 1px solid #CBD7E4;
	border-radius: 2px;
	color: #405979;
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.sgxs-mp .sgxs-mp__chip:hover {
	border-color: var(--sgxs-mp-accent);
	color: var(--sgxs-mp-accent);
}

.sgxs-mp .sgxs-mp__chip[aria-pressed="true"] {
	background-color: var(--sgxs-mp-accent);
	border-color: var(--sgxs-mp-accent);
	color: #FFFFFF;
}

.sgxs-mp .sgxs-mp__chip:focus-visible {
	outline: 2px solid var(--sgxs-mp-accent);
	outline-offset: 2px;
}

/* ═════════ Count ═════════ */

.sgxs-mp__count {
	padding-bottom: 12px;
	color: #718299;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.16em;
	line-height: 1.4;
	text-align: right;
	text-transform: uppercase;
}

/* ═════════ List ═════════ */

.sgxs-mp__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sgxs-mp__item {
	margin: 0;
	border-top: 1px solid var(--sgxs-mp-line);
}

/*
 * :last-child would put the closing rule under whichever row happens to be
 * last in the markup, not the last one still visible after filtering. The
 * script maintains this class instead.
 */
.sgxs-mp__item.is-last {
	border-bottom: 1px solid var(--sgxs-mp-line);
}

.sgxs-mp__item[hidden] {
	display: none;
}

/* ═════════ Row ═════════ */

.sgxs-mp .sgxs-mp__row {
	appearance: none;
	display: grid;
	grid-template-columns: 55px minmax(0, 1.4fr) minmax(0, 1fr) 40px;
	align-items: center;
	gap: 25px;
	width: 100%;
	margin: 0;
	padding: 26px 18px;
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--sgxs-mp-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background-color 200ms ease;
}

.sgxs-mp .sgxs-mp__row:hover {
	background-color: #F7F9FC;
}

.sgxs-mp .sgxs-mp__row:focus-visible {
	outline: 2px solid var(--sgxs-mp-accent);
	outline-offset: -2px;
}

.sgxs-mp__index {
	color: #6584AB;
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 0.13em;
	line-height: 1.4;
	text-transform: uppercase;
}

.sgxs-mp__row-body {
	min-width: 0;
}

.sgxs-mp__cat {
	margin: 0;
	color: #6584AB;
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 0.13em;
	line-height: 1.4;
	text-transform: uppercase;
}

.sgxs-mp__name {
	margin: 5px 0;
	color: var(--sgxs-mp-ink);
	font-size: 23px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.03em;
	text-wrap: pretty;
}

/* Optional per-material icon, sitting inline before the name. */
.sgxs-mp__name-icon {
	margin-inline-end: 8px;
	color: var(--sgxs-mp-accent);
	font-size: 0.8em;
	vertical-align: baseline;
}

.sgxs-mp__summary {
	min-width: 0;
	margin: 0;
	color: #687B91;
	font-size: 14px;
	line-height: 1.6;
	text-wrap: pretty;
}

.sgxs-mp__toggle {
	justify-self: end;
	color: var(--sgxs-mp-accent);
	font-size: 28px;
	font-weight: 200;
	line-height: 1;
	text-align: right;
}

/* ═════════ Detail ═════════ */

/*
 * max-height rather than height:auto so the open/close is animatable. It is a
 * control, because the ceiling has to clear the tallest detail block — and that
 * is much taller once the two columns stack.
 *
 * visibility keeps the collapsed contents out of the tab order and away from
 * screen readers; max-height alone would leave focusable children reachable.
 */
.sgxs-mp__detail {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 70px;
	max-height: 0;
	padding-left: 80px;
	opacity: 0;
	visibility: hidden;
	overflow: hidden;
	transition:
		max-height var(--sgxs-mp-t) ease,
		opacity var(--sgxs-mp-t) ease,
		padding-bottom var(--sgxs-mp-t) ease,
		visibility var(--sgxs-mp-t) ease;
}

.sgxs-mp__item.is-open .sgxs-mp__detail {
	max-height: var(--sgxs-mp-detail-max);
	padding-bottom: 32px;
	opacity: 1;
	visibility: visible;
}

.sgxs-mp__detail-main {
	min-width: 0;
}

.sgxs-mp__detail-text {
	margin: 0;
	color: #52667E;
	font-size: 14px;
	line-height: 1.7;
	text-wrap: pretty;
}

.sgxs-mp__type {
	display: block;
	margin-top: 15px;
	color: var(--sgxs-mp-accent);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.sgxs-mp__tags {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 7px;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sgxs-mp__tag {
	margin: 0;
	padding: 8px 12px;
	background-color: #F7F9FC;
	border: 1px solid #CCD8E5;
	border-radius: 2px;
	color: #526B87;
	font-size: 10px;
	line-height: 1.3;
}

.sgxs-mp__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 16px;
	color: var(--sgxs-mp-accent);
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
}

.sgxs-mp__link:hover,
.sgxs-mp__link:focus-visible {
	text-decoration: underline;
}

/* ═════════ Empty state ═════════ */

.sgxs-mp__empty {
	padding: 48px 18px;
	border-top: 1px solid var(--sgxs-mp-line);
	color: #687B91;
	font-size: 15px;
	line-height: 1.6;
	text-align: center;
}

.sgxs-mp__empty[hidden] {
	display: none;
}

/* ═════════ Laptop ═════════ */

@media (max-width: 1200px) {

	.sgxs-mp .sgxs-mp__row {
		grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1fr) 36px;
		gap: 20px;
	}

	.sgxs-mp__detail {
		gap: 48px;
		padding-left: 68px;
	}
}

/* ═════════ Tablet ═════════ */

@media (max-width: 1024px) {

	.sgxs-mp {
		padding: 80px 0;
	}

	.sgxs-mp .sgxs-mp__row {
		grid-template-columns: 40px minmax(0, 1.3fr) minmax(0, 1fr) 30px;
		gap: 18px;
	}

	.sgxs-mp__detail {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
		padding-left: 30px;
	}
}

/* ═════════ Mobile ═════════ */

@media (max-width: 767px) {

	.sgxs-mp {
		padding: 70px 0;
	}

	.sgxs-mp__inner {
		padding-inline: 6vw;
	}

	.sgxs-mp__head {
		flex-direction: column;
		align-items: stretch;
		gap: 22px;
	}

	.sgxs-mp__search {
		width: 100%;
	}

	.sgxs-mp__filters {
		margin: 32px 0 20px;
	}

	/*
	 * The reference hides the summary column at this width. Here it moves under
	 * the title instead — the row keeps three columns, and the summary spans the
	 * body column on a second row. Nothing is dropped on a phone.
	 */
	.sgxs-mp .sgxs-mp__row {
		grid-template-columns: 30px minmax(0, 1fr) 30px;
		gap: 8px 14px;
		padding: 22px 0;
	}

	.sgxs-mp__index {
		grid-column: 1;
		grid-row: 1;
		align-self: start;
		padding-top: 4px;
	}

	.sgxs-mp__row-body {
		grid-column: 2;
		grid-row: 1;
	}

	.sgxs-mp__toggle {
		grid-column: 3;
		grid-row: 1;
		align-self: start;
	}

	.sgxs-mp__summary {
		grid-column: 2;
		grid-row: 2;
	}

	.sgxs-mp__name {
		font-size: 20px;
	}

	.sgxs-mp__detail {
		padding-left: 0;
	}

	.sgxs-mp__count {
		text-align: left;
	}
}

/* ═════════ Small mobile ═════════ */

@media (max-width: 400px) {

	.sgxs-mp .sgxs-mp__chip {
		flex: 1 1 auto;
	}

	.sgxs-mp__name {
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.sgxs-mp__detail,
	.sgxs-mp .sgxs-mp__row,
	.sgxs-mp .sgxs-mp__chip,
	.sgxs-mp__search {
		transition: none !important;
	}
}
