/*
 * Metal Coils & Sheets page components.
 *
 * Loaded only by page-coils-sheets.php. Follows the Homeowner Hub layout
 * language: dark photo hero, bordered cards, details/summary FAQ, primary
 * closing band. The stock matrix markup inside .coils-matrix / .coils-key is
 * Gutenberg content with its own inline styles; only the wrappers are styled.
 */

.coils-page {
	color: var(--color-brand-800);
}

.coils-section {
	padding: 4rem 0;
}

@media (min-width: 960px) {
	.coils-section {
		padding: 6rem 0;
	}
}

.coils-head {
	max-width: 52rem;
	margin: 0 auto;
	text-align: center;
}

.coils-head .lede {
	margin-top: 1rem;
}

.coils-link {
	color: var(--color-primary-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.coils-link:hover,
.coils-link:focus-visible {
	color: var(--color-primary);
}

.coils-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
}

.coils-actions--center {
	justify-content: center;
}

.coils-body {
	margin-top: 1rem;
	font-size: var(--text-base);
	line-height: 1.7;
	color: var(--color-brand-700);
}

/* ---------- Hero ---------- */

.coils-hero {
	position: relative;
	overflow: hidden;
	background: var(--color-brand-950);
}

.coils-hero__image,
.coils-hero__scrim {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.coils-hero__image {
	object-fit: cover;
	object-position: 50% 50%;
}

.coils-hero__scrim {
	background:
		linear-gradient(90deg, rgba(8, 23, 35, 0.95) 0%, rgba(8, 23, 35, 0.85) 50%, rgba(8, 23, 35, 0.6) 100%),
		linear-gradient(0deg, rgba(8, 23, 35, 0.5), transparent 45%);
}

.coils-hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 3rem;
	padding-top: 4rem;
	padding-bottom: 4rem;
}

.coils-hero__lede {
	max-width: 40rem;
	margin-top: 1.25rem;
	font-size: var(--text-lg);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.9);
	text-wrap: pretty;
}

.coils-hero__video {
	align-self: center;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 0.25rem;
	box-shadow: 0 24px 46px -28px rgba(0, 0, 0, 0.85);
	background: var(--color-brand-950);
}

@media (min-width: 960px) {
	.coils-hero__inner {
		grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
		align-items: center;
		gap: 4rem;
		padding-top: 6rem;
		padding-bottom: 6rem;
	}
}

@media (max-width: 781px) {
	.coils-hero h1 {
		font-size: var(--text-4xl);
		line-height: var(--text-4xl--line-height);
	}

	.coils-hero__lede {
		font-size: var(--text-base);
	}
}

/* ---------- Products ---------- */

.coils-products {
	display: grid;
	gap: 1rem;
	margin: 3rem 0 0;
	padding: 0;
	list-style: none;
}

.coils-product {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 2rem;
	border: 1px solid var(--color-brand-200);
	border-radius: 0.25rem;
	background: var(--color-brand-50);
}

/* Bleeds to the card edge; a fixed ratio keeps the three cards' text aligned. */
.coils-product__media {
	margin: -2rem -2rem 1.5rem;
	aspect-ratio: 3 / 2;
	background: var(--color-brand-200);
}

.coils-product__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.coils-product__title a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: inherit;
}

.coils-product__title a svg {
	color: var(--color-primary);
	transition: transform 0.2s ease-out;
}

.coils-product__title a:hover svg,
.coils-product__title a:focus-visible svg {
	transform: translateX(3px);
}

.coils-checks {
	display: grid;
	gap: 0.625rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.coils-checks li {
	display: flex;
	gap: 0.625rem;
	font-size: var(--text-base);
	line-height: 1.5;
	color: var(--color-brand-700);
}

.coils-checks svg {
	flex: 0 0 auto;
	margin-top: 0.125rem;
	color: var(--color-primary);
}

.coils-product__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 1.5rem;
}

/* primary at 10% over the card's brand-50: primary-ink text is 5.69:1. */
.coils-product__tags .pill {
	background: rgb(38 138 202 / 0.1);
	color: var(--color-primary-ink);
}

/* Only cards that link somewhere (Coasteel) get a CTA; the title link alone
   was easy to miss. */
.coils-product__cta {
	align-self: flex-start;
	margin-top: 1.5rem;
}

@media (min-width: 782px) {
	.coils-products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------- Stock matrix tabs ---------- */

.coils-tabs__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 3rem;
}

.coils-tabs__list[hidden] {
	display: none;
}

.coils-tabs__tab {
	padding: 0.625rem 1.25rem;
	border: 1px solid var(--color-brand-300);
	border-radius: 9999px;
	background: #fff;
	font-family: var(--font-display);
	font-size: var(--text-base);
	font-weight: 600;
	line-height: 1.25;
	color: var(--color-brand-800);
	cursor: pointer;
	transition: background-color 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
}

.coils-tabs__tab:hover {
	border-color: var(--color-primary);
	color: var(--color-primary-ink);
}

.coils-tabs__tab[aria-selected="true"] {
	border-color: var(--color-primary);
	background: var(--color-primary);
	color: #fff;
}

.coils-tabs__tab:focus-visible,
.coils-tabs__panel:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 3px;
}

.coils-tabs__panel + .coils-tabs__panel {
	margin-top: 4rem;
}

.coils-tabs.is-ready .coils-tabs__panel + .coils-tabs__panel {
	margin-top: 0;
}

.coils-matrix,
.coils-key {
	overflow-x: auto;
	border: 1px solid var(--color-brand-200);
	border-radius: 0.25rem;
	background: #fff;
}

.coils-matrix {
	margin-top: 2.5rem;
	padding: 1rem;
}

.coils-key {
	padding: 1rem;
}

/*
 * Keep the Color column pinned while the table scrolls sideways, so people on
 * phones (the QR code from the color chart lands here) can still tell which
 * row they're reading. The table markup and its inline <style> live in post
 * content; these rules restyle borders and add stickiness. Selectors carry
 * the wrapper class to outrank that inline style.
 *
 * Collapsed borders belong to the table, not the cell, so a sticky cell in a
 * collapsed table lets scrolled content show through its edges. Separate
 * borders (right + bottom per cell) keep the same 1px grid and fix that.
 */
.coils-matrix .stock-table-wrapper table.stock-table {
	border-collapse: separate;
	border-spacing: 0;
}

.coils-matrix .stock-table-wrapper table.stock-table :is(th, td) {
	border-width: 0 1px 1px 0;
}

.coils-matrix .stock-table-wrapper table.stock-table thead th {
	border-top-width: 1px;
}

.coils-matrix .stock-table-wrapper table.stock-table :is(th, td):first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	border-left-width: 1px;
	box-shadow: 2px 0 4px rgb(0 0 0 / 0.08);
}

@media (max-width: 768px) {
	/* The post's inline style pulls the wrapper 15px past our padding, which
	   lets scrolled cells peek out left of the pinned column. */
	.coils-matrix .stock-table-wrapper {
		margin: 0;
	}

	/* Let long names wrap so the pinned column doesn't eat the screen. */
	.coils-matrix .stock-table-wrapper table.stock-table td.color-cell {
		min-width: 7rem;
		max-width: 9rem;
		white-space: normal;
		line-height: 1.2;
	}
}

.coils-legend {
	display: grid;
	gap: 2rem;
	margin-top: 2.5rem;
}

.coils-legend__title {
	margin-bottom: 1rem;
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: 600;
	color: var(--color-brand-950);
}

.coils-notes {
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding-left: 1.25rem;
	list-style: disc;
	font-size: var(--text-sm);
	line-height: 1.6;
	color: var(--color-brand-700);
}

.coils-notes li::marker {
	color: var(--color-primary);
}

.coils-disclaimer {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-brand-200);
	font-size: var(--text-xs);
	line-height: 1.6;
	color: var(--color-brand-500);
}

@media (min-width: 960px) {
	.coils-legend {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: 3rem;
	}
}

/* ---------- Steps ---------- */

.coils-steps {
	color: var(--color-brand-100);
}

.coils-steps__title {
	max-width: 36ch;
	margin: 0 auto;
	text-align: center;
}

.coils-steps__list {
	display: grid;
	gap: 1rem;
	margin: 3rem 0 0;
	padding: 0;
	list-style: none;
}

.coils-step {
	padding: 2rem;
	border: 1px solid var(--color-brand-700);
	border-radius: 0.25rem;
	background: rgba(255, 255, 255, 0.04);
}

.coils-step__number {
	font-family: var(--font-display);
	font-size: var(--text-sm);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-secondary);
}

.coils-step h3 {
	margin-top: 0.75rem;
	font-size: var(--text-xl);
}

.coils-step p {
	margin-top: 0.5rem;
	line-height: 1.65;
	color: var(--color-brand-300);
}

@media (min-width: 782px) {
	.coils-steps__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------- COOLR ---------- */

.coils-coolr {
	display: grid;
	gap: 2.5rem;
}

.coils-coolr__media {
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border-radius: 0.25rem;
	background: var(--color-brand-200);
}

.coils-coolr__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (min-width: 960px) {
	.coils-coolr {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
		gap: 4rem;
	}
}

/* ---------- Testimonial ---------- */

/* Hero Patterns "graph paper", recolored: primary #268ACA lines on brand-50.
   Hex literals because data-URI SVG backgrounds can't read CSS variables. */
.coils-quote {
	background-color: #f6f8fa;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23268aca' fill-opacity='0.16'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9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9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.coils-quote__inner {
	max-width: 56rem;
	margin: 0 auto;
	padding-top: 5rem;
	padding-bottom: 5rem;
	text-align: center;
}

.coils-quote__icon {
	width: 3rem;
	height: 3rem;
	margin: 0 auto;
	color: var(--color-primary);
}

.coils-quote__text {
	margin-top: 1.5rem;
	font-family: var(--font-display);
	font-size: var(--text-2xl);
	font-weight: 600;
	line-height: 1.35;
	color: var(--color-brand-900);
	text-wrap: balance;
}

.coils-quote figcaption {
	margin-top: 2rem;
}

.coils-quote__name {
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: 600;
	color: var(--color-brand-900);
}

.coils-quote__company {
	margin-top: 0.25rem;
	font-size: var(--text-sm);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-brand-600);
}

@media (min-width: 960px) {
	.coils-quote__inner {
		padding-top: 7rem;
		padding-bottom: 7rem;
	}

	.coils-quote__text {
		font-size: var(--text-3xl);
	}
}

/* ---------- FAQ ---------- */

.coils-faqs {
	max-width: 58rem;
	margin: 3rem auto 0;
	border-top: 1px solid var(--color-brand-200);
}

.coils-faqs details {
	border-bottom: 1px solid var(--color-brand-200);
}

.coils-faqs summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.25rem 0;
	cursor: pointer;
	list-style: none;
}

.coils-faqs summary h3 {
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: 600;
	line-height: 1.35;
	color: var(--color-brand-900);
}

.coils-faqs summary:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

.coils-faqs summary::-webkit-details-marker {
	display: none;
}

.coils-faqs summary svg {
	flex: 0 0 auto;
	color: var(--color-primary-ink);
	transition: transform 0.2s ease-out;
}

.coils-faqs details[open] summary svg {
	transform: rotate(180deg);
}

.coils-faqs details > p {
	max-width: 52rem;
	padding: 0 2.5rem 1.5rem 0;
	font-size: var(--text-base);
	line-height: 1.7;
	color: var(--color-brand-700);
}

.coils-faqs details > p a {
	color: var(--color-primary-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Closing CTA ---------- */

.coils-close {
	padding: 4rem 0;
	color: #fff;
}

.coils-close__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.5rem;
}

.coils-close p {
	max-width: 44rem;
	margin-top: 1rem;
	font-size: var(--text-lg);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.92);
}

@media (min-width: 782px) {
	.coils-close__inner {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 3rem;
	}

	.coils-close .btn {
		flex: 0 0 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.coils-product__title a svg,
	.coils-tabs__tab,
	.coils-faqs summary svg {
		transition: none;
	}
}
