/**
 * Electrical tape product story.
 *
 * Image-and-text modules built from the same data the text reads from.
 * Scoped under .story so nothing here can leak into the rest of the theme.
 *
 * Colour and spacing follow the theme's existing custom-property names where
 * they exist, and fall back to values that hold on their own if the token is
 * missing, so this file also reads correctly inside the exported static build.
 */

/* ---------------------------------------------------------------- shell */

.story {
	--story-ink: #14202e;
	--story-muted: #55657a;
	--story-line: #dfe5ec;
	--story-bg: #f5f7fa;
	--story-card: #ffffff;
	--story-accent: #1f5f8b;
	--story-accent-soft: #e8f0f7;
	--story-warn: #8a5a12;
	--story-warn-soft: #fdf3e2;
	--story-good: #1c6b4a;
	--story-good-soft: #e6f4ec;

	display: grid;
	gap: clamp(3rem, 6vw, 5.5rem);
	margin-block: clamp(2.5rem, 5vw, 4rem);
}

.story-block {
	min-width: 0;
}

.story-kicker {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--story-accent);
}

.story-block__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.5rem, 2.6vw, 2.125rem);
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--story-ink);
}

/* ---------------------------------------------------------------- hero */

.story-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: clamp(1.75rem, 4vw, 3.5rem);
	align-items: center;
}

.story-hero__media {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background: var(--story-bg);
	box-shadow:
		inset 0 0 0 1px rgba(20, 32, 46, 0.06),
		0 1px 2px rgba(20, 32, 46, 0.05),
		0 12px 32px -18px rgba(20, 32, 46, 0.35);
}

.story-hero__media img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.story-hero__media:hover img {
	transform: scale(1.03);
}

.story-hero__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.75rem, 3.4vw, 2.75rem);
	line-height: 1.12;
	letter-spacing: -0.022em;
	color: var(--story-ink);
}

.story-hero__text {
	margin: 0 0 1.5rem;
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--story-muted);
	max-width: 46ch;
}

/* ---------------------------------------------------------------- stats */

.story-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
}

.story-stat {
	padding: 0.875rem 0.9375rem;
	background: var(--story-card);
	border: 1px solid var(--story-line);
	border-radius: 10px;
}

.story-stat dt {
	margin: 0 0 0.3125rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--story-muted);
}

.story-stat dd {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--story-ink);
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}

.story-stat__text {
	font-size: 1.125rem !important;
}

.story-stat__unit {
	margin-left: 0.1875rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--story-muted);
}

.story-stat__note {
	margin: 0.375rem 0 0;
	font-size: 0.75rem;
	color: var(--story-muted);
}

/* ---------------------------------------------------------------- split */

.story-split {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: clamp(1.75rem, 4vw, 3.5rem);
	align-items: center;
}

.story-split__media {
	padding: clamp(1rem, 2.5vw, 2rem);
	background: var(--story-card);
	border: 1px solid var(--story-line);
	border-radius: 14px;
}

.story-split__copy p {
	margin: 0 0 0.875rem;
	font-size: 1rem;
	line-height: 1.68;
	color: var(--story-muted);
}

.story-ticks {
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.5rem;
}

.story-ticks li {
	position: relative;
	padding-left: 1.5rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--story-ink);
}

.story-ticks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.4375em;
	width: 0.5rem;
	height: 0.75rem;
	border-right: 2px solid var(--story-accent);
	border-bottom: 2px solid var(--story-accent);
	transform: rotate(45deg);
}

/* ---------------------------------------------------------------- charts */

.story-chartblock__lede {
	max-width: 68ch;
	margin: 0 0 1.75rem;
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--story-muted);
}

/*
 * The chart keeps its own scale rather than shrinking to fit. At a 390 px phone
 * a 920-unit viewBox renders the 10.5 px labels at about 5 px — present in the
 * DOM and unreadable on the glass. Scrolling the plot sideways, same as the
 * grade table does, keeps every label above roughly 12 px.
 */
.chart-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--story-line);
	border-radius: 14px;
	background: var(--story-card);
}

.elec-chart {
	display: block;
	width: 100%;
	height: auto;
	min-width: 860px;
}

.elec-chart__grid {
	stroke: #e7ecf2;
	stroke-width: 1;
}

.elec-chart__tick {
	font-size: 13px;
	fill: var(--story-muted);
	font-variant-numeric: tabular-nums;
}

.elec-chart__tick--y {
	text-anchor: end;
}

.elec-chart__tick--x {
	text-anchor: middle;
}

.elec-chart__axisname {
	font-size: 13.5px;
	font-weight: 600;
	fill: var(--story-ink);
	text-anchor: middle;
}

.elec-chart__axisname--y {
	text-anchor: middle;
}

.elec-chart__ref {
	stroke: #b9c4d2;
	stroke-width: 1.5;
	stroke-dasharray: 6 5;
	fill: none;
}

.elec-chart__reflabel {
	font-size: 12.5px;
	fill: var(--story-muted);
	text-anchor: start;
}

.elec-chart__dot {
	fill: var(--story-accent);
	stroke: #fff;
	stroke-width: 1.5;
	opacity: 0.9;
}

.elec-chart__dot--listed {
	fill: #b4632a;
}

.elec-chart__label {
	font-size: 12px;
	fill: var(--story-muted);
	text-anchor: middle;
	font-variant-numeric: tabular-nums;
}

.elec-chart__label--listed {
	fill: #8a5a12;
	font-weight: 700;
}

@media (min-width: 1200px) {
	.chart-scroll {
		border: 0;
		background: transparent;
	}

	.elec-chart {
		border: 1px solid var(--story-line);
		border-radius: 14px;
	}
}

.story-chart__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin-top: 0.875rem;
	font-size: 0.8125rem;
	color: var(--story-muted);
}

.story-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4375rem;
}

.story-legend__dot {
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 50%;
	background: var(--story-accent);
}

.story-legend__dot--listed {
	background: #b4632a;
}

.story-legend__line {
	width: 1.25rem;
	height: 0;
	border-top: 2px dashed #b9c4d2;
}

/* ---------------------------------------------------------------- insights */

.story-insights {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin-top: 2rem;
}

.story-insight {
	padding: 1.125rem 1.25rem;
	background: var(--story-card);
	border: 1px solid var(--story-line);
	border-radius: 12px;
	border-left: 3px solid var(--story-accent);
}

.story-insight h4 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	line-height: 1.35;
	color: var(--story-ink);
}

.story-insight p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--story-muted);
}

/* ---------------------------------------------------------------- applications */

.story-apps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	gap: 1rem;
	margin-top: 1.5rem;
}

.story-app {
	padding: 1.25rem 1.375rem;
	background: var(--story-card);
	border: 1px solid var(--story-line);
	border-radius: 12px;
}

.story-app__title {
	margin: 0 0 0.5rem;
	font-size: 1.0625rem;
	color: var(--story-ink);
}

.story-app__text {
	margin: 0 0 0.875rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--story-muted);
}

.story-app__grades {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0;
}

.story-chip {
	display: inline-block;
	padding: 0.1875rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--story-accent);
	background: var(--story-accent-soft);
	border-radius: 5px;
}

/* ---------------------------------------------------------------- table */

.table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--story-line);
	border-radius: 12px;
	background: var(--story-card);
}

.story-table {
	width: 100%;
	min-width: 62rem;
	border-collapse: collapse;
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
}

.story-table caption {
	padding: 0.875rem 1rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	text-align: left;
	color: var(--story-muted);
	border-bottom: 1px solid var(--story-line);
}

.story-table th,
.story-table td {
	padding: 0.625rem 0.875rem;
	text-align: left;
	border-bottom: 1px solid #eef2f6;
	white-space: nowrap;
}

.story-table thead th {
	position: sticky;
	top: 0;
	background: var(--story-bg);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--story-ink);
}

.story-table tbody th {
	font-weight: 700;
	color: var(--story-ink);
}

.story-table tbody tr:last-child th,
.story-table tbody tr:last-child td {
	border-bottom: 0;
}

.story-table__kv {
	font-weight: 700;
	color: var(--story-accent);
}

.story-pill {
	display: inline-block;
	padding: 0.125rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 999px;
}

.story-pill--yes {
	color: var(--story-good);
	background: var(--story-good-soft);
}

.story-pill--no {
	color: #7a8798;
	background: #eef2f6;
}

.story-pill--listed {
	color: var(--story-warn);
	background: var(--story-warn-soft);
}

.story-table__note {
	margin: 0.875rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--story-muted);
	max-width: 82ch;
}

/* ---------------------------------------------------------------- colours */

.story-colours {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
	gap: 1rem;
	margin: 1.5rem 0 0;
	padding: 0;
	list-style: none;
}

.story-colour {
	display: grid;
	gap: 0.5rem;
	justify-items: center;
}

.story-colour__frame {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow:
		inset 0 0 0 1px rgba(20, 32, 46, 0.08),
		0 1px 2px rgba(20, 32, 46, 0.05);
}

.story-colour__frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.story-colour:hover .story-colour__frame img {
	transform: scale(1.05);
}

.story-colour__swatch {
	display: block;
	width: 100%;
	height: 100%;
}

.story-colour__swatch--black  { background: #1c1f24; }
.story-colour__swatch--blue   { background: #1f4f9e; }
.story-colour__swatch--green  { background: #1f7a4d; }
.story-colour__swatch--red    { background: #b8342f; }
.story-colour__swatch--yellow { background: #e3b21c; }
.story-colour__swatch--white  { background: #f2f4f7; }

.story-colour__label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--story-ink);
}

/* ---------------------------------------------------------------- cert panel */

.story-cert {
	padding: clamp(1.25rem, 3vw, 2rem);
	background: var(--story-card);
	border: 1px solid var(--story-line);
	border-radius: 14px;
}

.story-cert__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	color: var(--story-ink);
}

.story-cert__intro {
	margin: 0 0 1.25rem;
	font-size: 0.9375rem;
	line-height: 1.65;
	color: var(--story-muted);
	max-width: 76ch;
}

.story-cert__list {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--story-line);
}

.story-cert__item {
	display: grid;
	grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 0.5rem 1rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid #eef2f6;
	font-size: 0.875rem;
	line-height: 1.5;
}

.story-cert__label {
	font-weight: 700;
	color: var(--story-ink);
}

.story-cert__status {
	color: var(--story-muted);
}

.story-cert__source {
	color: var(--story-muted);
	font-style: italic;
}

.story-cert__foot {
	margin: 1rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--story-muted);
}

/* ---------------------------------------------------------------- cross-section */

.elec-section {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * The two layers are drawn as real material, not as flat colour swatches: the
 * PVC film reads as a translucent amber-ish film with a highlight along the cut
 * edge, the rubber-resin coat as a matte dark band. Without these rules the
 * rects fall back to the SVG default fill and render as solid black.
 */
.elec-section__film {
	fill: #f0e2c4;
	stroke: #b99a5e;
	stroke-width: 1.5;
}

.elec-section__coat {
	fill: #3c4149;
	stroke: #23272d;
	stroke-width: 1;
}

.elec-section__dim {
	stroke: var(--story-muted);
	stroke-width: 1.2;
}

.elec-section__dimlabel {
	font-size: 13px;
	font-weight: 700;
	fill: var(--story-ink);
	font-variant-numeric: tabular-nums;
}

.elec-section__leader {
	stroke: var(--story-muted);
	stroke-width: 1;
	stroke-dasharray: 3 3;
}

.elec-section__layerlabel {
	font-size: 13px;
	font-weight: 600;
	fill: var(--story-ink);
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
	.story-hero,
	.story-split {
		grid-template-columns: minmax(0, 1fr);
	}

	.story-insights {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.story-cert__item {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.125rem;
	}

	.story-cert__source {
		font-size: 0.8125rem;
	}
}

@media (max-width: 620px) {
	.story-stats {
		grid-template-columns: minmax(0, 1fr);
	}

	.story-insights {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
	.story-hero__media img,
	.story-colour__frame img {
		transition: none;
	}

	.story-hero__media:hover img,
	.story-colour:hover .story-colour__frame img {
		transform: none;
	}
}

/* ---------------------------------------------------------------- print */

@media print {
	.story {
		gap: 1.5rem;
	}

	.story-block,
	.story-insight,
	.story-app,
	.story-cert,
	.story-colour__frame {
		break-inside: avoid;
		box-shadow: none;
	}

	.story-hero__media img,
	.story-colour__frame img {
		transform: none;
	}
}
