/* ==========================================================================
   Sector pages (DESIGN-SPEC 6.2, v6.1): one template, five views.
   Enqueued on page key "sector" after main.css. Owner: sector role (12.2).

   v6 tokens only (2.7): no hex, no px font size, no raw z-index. Core carries
   the parts (.phero, .ptile-grid, spec rows, buttons, grounds); this file
   composes them per view. Each view ends on the form, so the footer's closing
   row is off.

   Grounds in order (neighbours never share one):
     Commercial, hospitality  hero blue + photo, types wall, projects night,
                              proof amber | wall, form blue
     Industrial               hero blue + three frames, scope night + photo,
                              licence amber, form blue
     Institutional            hero blue + photo, projects night,
                              standards photo | wall, tender amber, form blue
     Residential              hero blue + photo, fit wall | amber, licence fog,
                              form blue
   The hero photo keeps the opening parallax from 64em (sector.js sets core's
   --shift). Motion elsewhere is core's .sym-draw on the rows that link.
   ========================================================================== */

.sx {
	--sx-band-h: clamp(15rem, 40vw, 44rem);
	--sx-edge: max(var(--gutter), (100vw - var(--container)) / 2); /* the .wrap edge, from inside a full-bleed panel */
}

/* Section headings: core's h2 (display 800, --fs-3, --fg-head on any ground). */
.sx-h2 { margin: 0; max-width: 22ch; }

.sx .spec-rows,
.sx .sx-group__rows { list-style: none; }

/* ==========================================================================
   1. Hero (data-ph-section="hero"): core's .phero, then the photo edge to edge
   ========================================================================== */

.sx-hero.phero { padding-block: 0; }
.sx-hero__copy { display: grid; gap: var(--s-4); padding-block: var(--s-6) var(--s-4); }

/* The sector word: capitals by CSS only (the H1 stays "Commercial electrical
   projects.", SEO-SPEC 3.1), as wide as the page allows up to the cap.
   --sx-fit is 1 over the word's width in em, set per word below. */
.sx-hero { --sx-fit: .2; }
.sx-hero--commercial { --sx-fit: .224; }
.sx-hero--hospitality { --sx-fit: .234; }
.sx-hero--industrial { --sx-fit: .252; --sx-band-h: clamp(18rem, 44vw, 46rem); }
.sx-hero--institutional { --sx-fit: .198; }
.sx-hero--residential { --sx-fit: .233; }
.sx-hero__word {
	display: block;
	font-size: min((100vw - 2 * var(--gutter)) * var(--sx-fit), 15rem);
	line-height: .86;
	letter-spacing: var(--track-caps);
	text-transform: uppercase;
}
.sx-hero__after {
	display: block;
	margin-top: var(--s-2);
	font-size: var(--fs-3);
	line-height: 1;
}
.sx-hero__intro { margin-top: 0; }
.sx-hero__btn {
	justify-self: start;
	min-height: 3.382rem;
	padding-inline: var(--s-6);
	font-size: 1.128rem;
}
@media (max-width: 47.99em) { .sx-hero__btn { justify-self: stretch; padding-inline: var(--s-3); } }
@media (min-width: 64em) {
	.sx-hero__copy { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--gutter); }
	.sx-hero__title { grid-area: 1 / 1 / 2 / 3; }
	.sx-hero__btn { grid-area: 1 / 2 / 2 / 3; align-self: end; justify-self: end; }
	.sx-hero__intro, .sx-crumbs { grid-column: 1 / -1; }
}

/* Breadcrumbs (chrome's arc_breadcrumbs(), or the fallback here). */
.sx-crumbs { color: var(--fg); }
.arc-crumbs__list, .sx-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); margin: 0; padding: 0; list-style: none; }
.arc-crumbs__item, .sx-crumbs__item { display: inline-flex; align-items: center; gap: var(--s-2); }
.arc-crumbs__sep, .sx-crumbs__sep { color: var(--fg-muted); }
.arc-crumbs__link, .sx-crumbs__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--target);
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: var(--bw-hair);
	text-underline-offset: .3em;
}
.arc-crumbs__link:hover, .sx-crumbs__link:hover { color: inherit; text-decoration-thickness: var(--bw-control); }
.arc-crumbs__here, .sx-crumbs__here { display: inline-flex; align-items: center; min-height: var(--target); font-weight: var(--fw-ui); }

/* The band: one link with a nameplate at the page's left edge, like the tiles. */
.sx-band {
	position: relative;
	height: var(--sx-band-h);
	aspect-ratio: auto;
	background: var(--c-night);
	color: var(--c-ink);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.sx-band::after, .sx-frame::after { content: none; }
.sx-band__plate {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: var(--z-plate);
	display: block;
	max-width: calc(100% - var(--s-5));
	padding: var(--s-2) var(--s-5) var(--s-2) var(--sx-edge);
	background: var(--c-wall);
	transition: background-color var(--t-fast) var(--ease-out);
}
.sx-band__name {
	display: block;
	color: var(--c-blue);
	font-family: var(--font-display);
	font-size: var(--fs-1);
	font-weight: var(--fw-display);
	line-height: 1.1;
}
.sx-band:hover { color: var(--c-ink); text-decoration: none; }
.sx-band:hover .sx-band__plate { background: var(--c-amber); }
.sx-band:hover .sx-band__name { color: var(--c-ink); }
.sx-band:focus-visible { outline: var(--bw-focus) solid var(--c-amber); outline-offset: calc(var(--bw-focus) * -1); }

/* Industrial: ARC's three reel frames edge to edge. */
.sx-frames {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	height: var(--sx-band-h);
}
.sx-frame { height: 100%; aspect-ratio: auto; background: var(--c-night); }

/* ==========================================================================
   2. Scope (data-ph-section="scope", id="scope")
   ========================================================================== */

/* Commercial: the four building types standing on one grade line, like a
   street. Each symbol's own grade line (y 20 of 24) lands on the line. */
.sx-scope--types { --sx-type-sym: 2.618rem; padding-block: var(--s-4) var(--s-3); }
.sx-types__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}
.sx-type { position: relative; }
.sx-type__link {
	--grade: calc(var(--s-4) + var(--sx-type-sym) * 20 / 24);
	position: relative;
	display: grid;
	align-content: start;
	row-gap: var(--s-3);
	height: 100%;
	padding: var(--s-4) var(--s-4) var(--s-3) 0;
	color: var(--c-ink);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.sx-type__link::before,
.sx-type__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	pointer-events: none;
}
.sx-type__link::before {
	top: calc(var(--grade) - var(--bw-hair) / 2);
	height: var(--bw-hair);
	background: var(--c-line);
}
.sx-type__link::after {
	top: calc(var(--grade) - var(--bw-selected) / 2);
	right: var(--s-4);
	height: var(--bw-selected);
	background: var(--c-blue);
	opacity: 0;
}
.sx-type__sym {
	position: relative;
	width: var(--sx-type-sym);
	height: var(--sx-type-sym);
	margin-bottom: var(--s-3);
	color: var(--c-blue);
}
.sx-type__label {
	font-size: var(--fs-1);
	font-weight: var(--fw-strong);
	line-height: var(--lh-h3);
	text-wrap: balance;
}
.sx-type__link:hover::after,
.sx-type__link:focus-visible::after,
.sx-type.is-current .sx-type__link::after { opacity: 1; }
.sx-type__link:hover .sx-type__label,
.sx-type.is-current .sx-type__label { color: var(--c-blue); }
.sx-type__link:hover .sx-type__label {
	text-decoration: underline;
	text-decoration-thickness: .08em;
	text-underline-offset: .2em;
}
.sx-type__link:active .sx-type__label { color: var(--c-blue-deep); }
.sx-type__link:focus-visible { outline-offset: calc(var(--bw-focus) * -1); }
@media (min-width: 48em) {
	.sx-types__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.sx-type__link { padding-right: var(--s-5); }
	.sx-type__link::after { right: var(--s-5); }
}

/* Industrial: a reel frame full height beside the legend. */
.sx-scope--legend { display: grid; }
.sx-scope__photo { display: none; overflow: hidden; background: var(--c-blue-deep); } /* Under 64em the hero's three frames sit right above: no photo on a photo. */
.sx-scope__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.sx-scope__body { min-width: 0; padding: var(--section) var(--gutter); }
.sx-legend { --spec-sym: 2rem; margin-top: var(--s-5); }
.sx-scope__line {
	max-width: var(--measure);
	margin: var(--s-5) 0 0;
	font-size: var(--fs-1);
	line-height: var(--lh-h3);
	text-wrap: pretty;
}
@media (min-width: 64em) {
	.sx-scope--legend { grid-template-columns: minmax(0, 1fr) minmax(0, 2.058fr); }
	.sx-scope__photo { display: block; }
	.sx-scope__body { padding: var(--section) var(--sx-edge) var(--section) var(--s-7); }
}

/* ==========================================================================
   3. Projects (data-ph-section="projects", id="projects"): the wall on night
   ========================================================================== */

.sx-projects { padding-block: var(--section); }
.sx-projects__title {
	max-width: none;
	margin-bottom: var(--s-5);
	font-size: var(--fs-4);
	line-height: var(--lh-plate);
}
.sx-group__rows { margin: 0; padding: 0; }
.sx-group__row { display: block; min-width: 0; }
.sx-group__sym { flex: none; width: 2.618rem; height: 2.618rem; color: var(--sym); }
.sx-group__title {
	margin: 0;
	color: var(--fg-head);
	font-family: var(--font-display);
	font-size: var(--fs-2);
	font-weight: var(--fw-display);
	line-height: 1;
}

/* Commercial: one grid. A building type is a solid blue tile, then its photos. */
.sx-projects--commercial .sx-group,
.sx-projects--commercial .sx-group__rows { display: contents; }
.sx-projects--commercial .sx-group__head {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	min-width: 0;
	padding: var(--s-3) var(--s-4);
	background: var(--c-blue);
}
@media (min-width: 48em) {
	.sx-projects--commercial .sx-group__head {
		flex-direction: column;
		align-items: flex-start;
		justify-content: space-between;
		padding: var(--s-5);
	}
	.sx-projects--commercial .sx-group__sym { width: 3.33rem; height: 3.33rem; }
}

/* Institutional: five types, two over three, each label over its one tile. */
.sx-projects--institutional .sx-groups { display: grid; gap: var(--s-5) var(--s-4); }
.sx-projects--institutional .sx-group { min-width: 0; }
.sx-projects--institutional .sx-group__head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.sx-projects--institutional .ptile-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48em) {
	.sx-projects--institutional .sx-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sx-projects--institutional .sx-group:first-child { grid-column: 1 / -1; }
}
@media (min-width: 64em) {
	.sx-projects--institutional .sx-groups { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.sx-projects--institutional .sx-group { grid-column: span 2; }
	.sx-projects--institutional .sx-group:first-child,
	.sx-projects--institutional .sx-group:nth-child(2) { grid-column: span 3; }
}

/* ==========================================================================
   4. The hard split: two solid surfaces, edge to edge
   ========================================================================== */

.sx-split { display: grid; }
.sx-split__panel { min-width: 0; padding: var(--section) var(--gutter); }
@media (min-width: 64em) {
	.sx-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sx-split__panel--a { padding: var(--section) var(--s-7) var(--section) var(--sx-edge); }
	.sx-split__panel--b { padding: var(--section) var(--sx-edge) var(--section) var(--s-7); }
}

/* Residential. */
.sx-kinds { --spec-sym: 2.5rem; margin-top: var(--s-5); }
.sx-kinds .spec-row:not(.spec-row--link) { align-items: center; }
.sx-kinds .spec-row__sym { margin-top: 0; }
.sx-kinds .spec-row__label { font-size: var(--fs-1); }
.sx-steps { position: relative; margin: var(--s-5) 0 0; padding: 0; list-style: none; }
/* One run with a solid connection dot at each step (the drawing convention). */
.sx-step {
	--dot-y: calc(var(--s-2) + .81em);
	position: relative;
	max-width: var(--measure);
	padding: var(--s-2) 0 var(--s-4) var(--s-6);
	color: var(--fg);
	font-size: var(--fs-1);
	line-height: var(--lh-h3);
	text-wrap: pretty;
}
.sx-step::before {
	content: "";
	position: absolute;
	left: calc(var(--s-3) - var(--bw-control) / 2);
	top: 0;
	bottom: 0;
	width: var(--bw-control);
	background: var(--fg-head);
}
.sx-step:first-child::before { top: var(--dot-y); }
.sx-step:last-child { padding-bottom: 0; }
.sx-step:last-child::before { bottom: auto; height: var(--dot-y); }
.sx-step::after {
	content: "";
	position: absolute;
	left: calc(var(--s-3) / 2);
	top: calc(var(--dot-y) - var(--s-3) / 2);
	width: var(--s-3);
	height: var(--s-3);
	border-radius: 50%;
	background: var(--fg-head);
}

/* ==========================================================================
   5. Survey (data-ph-section="survey"): the blue band, the page's last section
   ========================================================================== */

.sx-survey { position: relative; padding-block: var(--section); }

/* ==========================================================================
   6. Proof (data-ph-section="proof")
   ========================================================================== */

/* Commercial and hospitality: ARC's line on amber, the services beside it. */
.sx-proof--operating .sx-h2 { max-width: 16ch; }
.sx-proof__line {
	max-width: var(--measure);
	margin: var(--s-4) 0 var(--s-2);
	font-size: var(--fs-1);
	line-height: var(--lh-h3);
	text-wrap: pretty;
}
.sx-services { --spec-sym: 2.5rem; }
.sx-services .spec-row__label { font-size: var(--fs-1); }
.sx-proof--operating .sx-split__panel--b { display: grid; align-content: center; }

/* Institutional: ARC's crew beside the standards. */
.sx-proof__photo { height: clamp(14rem, 56vw, 24rem); overflow: hidden; background: var(--c-fog); }
.sx-proof__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; } /* keeps the ARC logo on the sign in frame */
.sx-standards { --spec-sym: 2rem; margin-top: var(--s-5); }
.sx-standards .spec-row__label { font-size: var(--fs-1); }
@media (min-width: 64em) {
	.sx-proof__photo { height: auto; }
}

/* Industrial and Residential: the licence row as one strip. */
.sx-proof--licence { padding-block: var(--s-5); }
.sx-proof__strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3) var(--s-6);
}
.sx-licence { --spec-sym: 3rem; flex: 1 1 32rem; border-top: 0; }
.sx-licence .spec-row { border-bottom: 0; }
.sx-licence .spec-row:not(.spec-row--link) { align-items: center; }
.sx-licence .spec-row__sym { margin-top: 0; }
.sx-licence .spec-row__label { font-size: var(--fs-1); }
.sx-licence .spec-row__text { color: var(--fg); }

/* ==========================================================================
   7. Institutional tender band (data-ph-section="cta"), ARC's own
   ========================================================================== */

.sx-closing { padding-block: var(--section); }
.sx-closing__wrap { display: grid; gap: var(--s-5); }
.sx-closing__title { max-width: 18ch; }
.sx-closing__line { max-width: var(--measure); margin: 0; font-size: var(--fs-1); line-height: var(--lh-h3); text-wrap: pretty; }
.sx-closing__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-3) var(--s-5);
	margin-top: var(--s-4);
}
.sx-closing__call .btn__label {
	font-family: var(--font-display);
	font-size: var(--fs-2);
	font-weight: var(--fw-display);
	font-variant-numeric: tabular-nums;
	line-height: 1;
	white-space: nowrap;
}
.sx-closing__call .btn__sym { width: 1.75rem; height: 1.75rem; }
@media (min-width: 64em) {
	.sx-closing__wrap {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: var(--s-7);
		align-items: center;
	}
}
