/* ==========================================================================
   EEMCL Engineering theme
   Design notes
   - Palette from the logo (leaf green, charcoal) plus the hi-vis yellow worn on site.
   - Headings: Barlow Condensed (highway-sign proportions). Body: Source Sans 3.
   - Two signature devices, both taken from the work itself:
     .rail      a cable-tray ladder used as a divider
     .titleblock the title block from an engineering drawing, used for jobs
   ========================================================================== */

:root {
	--ink: #12303f;
	--ink-2: #1c4559;
	--leaf: #2f7420;
	--leaf-bright: #7ac143;
	--hivis: #f4b400;
	--hivis-dark: #d99f00;
	--paper: #f6f7f4;
	--concrete: #e4e8e2;
	--steel: #55656d;
	--white: #ffffff;
	--line: rgba(18, 48, 63, 0.2);
	--radius: 2px;
	--wrap: 1180px;
	--font-head: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1.125rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: var(--leaf);
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--ink);
}

:focus-visible {
	outline: 3px solid var(--hivis);
	outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.5em;
	font-family: var(--font-head);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: 0.005em;
	text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: 20px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 12px 18px;
	background: var(--hivis);
	color: var(--ink);
	font-weight: 700;
}

.skip-link:focus {
	left: 12px;
	top: 12px;
}

/* --- Signature device: cable-tray ladder -------------------------------- */
.rail {
	height: 14px;
	color: var(--hivis);
	border-block: 2px solid currentColor;
	background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 20px);
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
	display: inline-block;
	padding: 0.8em 1.4em;
	border: 2px solid transparent;
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn--hivis { background: var(--hivis); color: var(--ink); }
.btn--hivis:hover { background: var(--hivis-dark); color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: var(--ink-2); color: var(--white); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--ink); }

/* --- Header ------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--white);
	border-bottom: 1px solid var(--line);
}

.site-header .wrap { max-width: 1320px; }

.topbar {
	background: var(--ink);
	color: var(--white);
	font-size: 0.9rem;
}

.topbar__inner {
	display: flex;
	justify-content: flex-end;
	gap: 24px;
	padding-block: 6px;
}

.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.header-main {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: 10px;
}

.brand,
.custom-logo-link {
	flex: 0 0 auto;
	display: block;
}

.brand img,
.custom-logo {
	width: auto;
	max-width: none;
	height: 48px;
}

.primary-nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.nav-cta { white-space: nowrap; padding-inline: 1.1em; }

.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav .menu a {
	display: block;
	padding: 10px 9px;
	white-space: nowrap;
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}

.primary-nav .menu a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a {
	box-shadow: inset 0 -3px 0 var(--leaf-bright);
}

.menu-item-has-children { position: relative; }

.sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 60;
	min-width: 320px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--white);
	border: 1px solid var(--line);
	border-top: 3px solid var(--leaf-bright);
}

.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
	display: block;
}

.sub-menu a { padding: 9px 16px; font-weight: 400; }

.nav-toggle { display: none; }

/* --- Hero --------------------------------------------------------------- */
.hero {
	background: var(--ink);
	color: var(--white);
}

.hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: 56px;
	align-items: center;
	padding-block: 72px 64px;
}

.hero h1 {
	max-width: 19ch;
	margin-bottom: 0.45em;
}

.hero__lead {
	max-width: 52ch;
	margin-bottom: 1.6em;
	font-size: 1.25rem;
	color: rgba(255, 255, 255, 0.86);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.hero__figure {
	margin: 0;
	border: 2px solid var(--white);
	background: var(--ink-2);
}

.hero__figure img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* --- Title block (engineering drawing) ---------------------------------- */
.titleblock {
	margin: 0;
	border: 1.5px solid var(--ink);
	background: var(--white);
	font-size: 0.95rem;
	line-height: 1.35;
}

.titleblock__row {
	display: grid;
	grid-template-columns: 8.5em minmax(0, 1fr);
}

.titleblock__row + .titleblock__row {
	border-top: 1px solid var(--line);
}

.titleblock dt,
.titleblock dd {
	margin: 0;
	padding: 7px 10px;
}

.titleblock dt {
	border-right: 1px solid var(--line);
	background: var(--concrete);
	font-weight: 700;
}

.titleblock--dark {
	border: 0;
	border-top: 2px solid var(--white);
	background: transparent;
	color: var(--white);
}

.titleblock--dark .titleblock__row + .titleblock__row { border-top-color: rgba(255, 255, 255, 0.25); }
.titleblock--dark dt { border-right-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }

/* --- Page heading band -------------------------------------------------- */
.page-head {
	background: var(--ink);
	color: var(--white);
}

.page-head .wrap { padding-block: 48px 40px; }
.page-head h1 { max-width: 22ch; margin-bottom: 0; }
.page-head__crumb { margin: 0 0 12px; font-size: 0.95rem; }
.page-head__crumb a { color: var(--leaf-bright); }
.page-head__lead { max-width: 60ch; margin: 14px 0 0; font-size: 1.2rem; color: rgba(255, 255, 255, 0.86); }

/* --- Sections ----------------------------------------------------------- */
.section { padding-block: 72px; }
.section--tint { background: var(--concrete); }
.section__title { margin-bottom: 0.3em; }
.section__lead { max-width: 60ch; margin-bottom: 2em; color: var(--steel); font-size: 1.2rem; }
.section__more { margin: 32px 0 0; }

.intro__grid {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
	gap: 56px;
	align-items: start;
}

.intro h2 { margin: 0; }
.intro__text { font-size: 1.3rem; line-height: 1.5; }

/* --- Scope directory (services) ---------------------------------------- */
.scope-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px;
}

.scope {
	border-top: 6px solid var(--ink);
	background: var(--white);
	padding: 24px 24px 8px;
}

.scope--management { border-top-color: var(--leaf); }
.scope__title { margin-bottom: 0.1em; }
.scope__text { margin-bottom: 12px; color: var(--steel); }
.scope__list { margin: 0; padding: 0; list-style: none; }
.scope__list li + li .scope-row { border-top: 1px solid var(--line); }

.scope-row {
	display: block;
	margin-inline: -24px;
	padding: 16px 24px;
	color: var(--ink);
	text-decoration: none;
	transition: background-color 0.15s;
}

.scope-row:hover { background: var(--paper); }
.scope-row:hover .scope-row__name { text-decoration: underline; text-decoration-color: var(--leaf-bright); text-decoration-thickness: 3px; }

.scope-row__name {
	display: block;
	font-family: var(--font-head);
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.15;
}

.scope-row__text {
	display: block;
	margin-top: 4px;
	color: var(--steel);
	font-size: 1rem;
	line-height: 1.45;
}

/* --- Completed jobs ----------------------------------------------------- */
.job-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px;
}

.job-list--stack { grid-template-columns: 1fr; gap: 56px; }

.job {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.job-list--stack .job {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: 40px;
	align-items: start;
}

.job__media {
	display: block;
	border: 1.5px solid var(--ink);
	background: var(--concrete);
}

.job__media img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.job__title { margin-bottom: 0.4em; }
.job__title a { color: var(--ink); text-decoration: none; }
.job__title a:hover { text-decoration: underline; }
.job__excerpt { color: var(--steel); }
.job .titleblock { margin-block: 16px; }
.job__more { margin: 0; }

/* --- Safety band -------------------------------------------------------- */
.safety { background: var(--concrete); }

.safety__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}

.safety__text { max-width: 54ch; font-size: 1.2rem; }

.safety__facts {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1.5px solid var(--ink);
	background: var(--white);
}

.safety__facts li {
	padding: 16px 20px;
	font-size: 1rem;
	line-height: 1.5;
}

.safety__facts li + li { border-top: 1px solid var(--line); }

.safety__facts strong {
	display: block;
	font-family: var(--font-head);
	font-size: 1.3rem;
	line-height: 1.2;
}

/* --- Call to action ----------------------------------------------------- */
.cta-band {
	background: var(--hivis);
	color: var(--ink);
}

.cta-band__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	padding-block: 48px;
}

.cta-band h2 { margin-bottom: 0.2em; }
.cta-band p { max-width: 58ch; margin: 0; font-size: 1.15rem; }

/* --- Prose (page content) ---------------------------------------------- */
.prose { max-width: 72ch; }
.prose--intro { margin-bottom: 40px; font-size: 1.2rem; }
.prose h2 { margin-top: 1.6em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 0; list-style: none; }

.prose ul li {
	position: relative;
	margin-bottom: 0.5em;
	padding-left: 1.4em;
}

.prose ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.6em;
	height: 0.6em;
	background: var(--leaf-bright);
}

.prose ol.steps {
	margin: 1.5em 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.prose ol.steps li {
	position: relative;
	margin: 0;
	padding: 0 0 28px 64px;
	counter-increment: step;
}

.prose ol.steps li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: -2px;
	width: 42px;
	height: 42px;
	background: var(--ink);
	color: var(--white);
	font-family: var(--font-head);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 42px;
	text-align: center;
}

.prose ol.steps li::after {
	content: "";
	position: absolute;
	left: 20px;
	top: 46px;
	bottom: 4px;
	width: 2px;
	background: var(--line);
}

.prose ol.steps li:last-child::after { display: none; }

/* Gallery shortcode output */
.gallery {
	display: grid;
	gap: 14px;
	margin: 1.5em 0;
}

.gallery-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery br { display: none; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; height: auto; border: 1.5px solid var(--ink); }
.gallery-caption { margin-top: 6px; color: var(--steel); font-size: 0.95rem; line-height: 1.4; }

/* --- Two-column layout (service and project pages) --------------------- */
.two-col {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 56px;
	align-items: start;
}

.side { position: sticky; top: 130px; display: grid; gap: 24px; }
.side__box { padding: 22px; border: 1.5px solid var(--ink); background: var(--white); }
.side__box h2 { font-size: 1.5rem; }
.side__box--cta { border-color: var(--hivis); background: var(--ink); color: var(--white); }
.side__box--cta p { color: rgba(255, 255, 255, 0.86); }
.side__list { margin: 0; padding: 0; list-style: none; }
.side__list li + li { border-top: 1px solid var(--line); }
.side__list a { display: block; padding: 10px 0; color: var(--ink); text-decoration: none; }
.side__list a:hover { text-decoration: underline; }
.side__list a[aria-current="page"] { font-weight: 700; box-shadow: inset 4px 0 0 var(--leaf-bright); padding-left: 12px; }
.side .titleblock { border: 0; }
.side .titleblock__row { grid-template-columns: 1fr; }
.side .titleblock dt { border-right: 0; background: none; padding-bottom: 0; color: var(--steel); font-weight: 600; }
.side .titleblock dd { padding-top: 0; }

/* --- Contact ------------------------------------------------------------ */
.contact-grid {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: 56px;
	align-items: start;
}

.detail-list { margin: 0 0 32px; }
.detail-list div { padding: 14px 0; border-top: 1px solid var(--line); }
.detail-list dt { color: var(--steel); font-size: 0.95rem; font-weight: 600; }
.detail-list dd { margin: 2px 0 0; font-size: 1.15rem; }
.map iframe { width: 100%; height: 320px; border: 1.5px solid var(--ink); }

.quote-form {
	padding: 32px;
	border: 1.5px solid var(--ink);
	background: var(--white);
}

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }

.field input,
.field select,
.field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--steel);
	border-radius: var(--radius);
	background: var(--white);
	color: var(--ink);
	font: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--ink); outline: 3px solid var(--hivis); outline-offset: 0; }

.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.notice { margin-bottom: 20px; padding: 14px 16px; border-left: 6px solid var(--leaf); background: var(--concrete); }
.notice--error { border-left-color: #b3261e; }

/* --- Blog fallbacks ----------------------------------------------------- */
.post-list { max-width: 72ch; }
.post-item { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.post-item__title { margin-bottom: 0.2em; }
.post-item__title a { color: var(--ink); text-decoration: none; }
.post-item__meta { color: var(--steel); font-size: 0.95rem; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
	background: var(--ink);
	color: rgba(255, 255, 255, 0.88);
	font-size: 1rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.3fr 0.8fr 1.1fr;
	gap: 48px;
	padding-block: 56px 40px;
}

.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--hivis); }
.site-footer .widget-title { margin-bottom: 0.7em; color: var(--white); font-size: 1.5rem; }
.site-footer .widget { margin-bottom: 24px; }
.footer-mark { width: 64px; height: auto; margin-bottom: 14px; padding: 8px; background: var(--white); }
.footer-name { margin-bottom: 0.5em; color: var(--white); font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.footer-menu,
.site-footer .menu { margin: 0; padding: 0; list-style: none; }
.footer-menu a,
.site-footer .menu a { display: block; padding: 5px 0; text-decoration: none; }
.footer-menu a:hover,
.site-footer .menu a:hover { text-decoration: underline; }
.footer-address { font-style: normal; }
.footer-hours { margin-top: 16px; color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; }
.social-links { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; }

.footer-bar { border-top: 1px solid rgba(255, 255, 255, 0.18); }
.footer-bar__inner { padding-block: 18px; }
.footer-bar p { margin: 0; color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1180px) {
	.nav-toggle {
		display: inline-flex;
		align-items: center;
		padding: 10px 16px;
		border: 2px solid var(--ink);
		border-radius: var(--radius);
		background: var(--white);
		color: var(--ink);
		font: inherit;
		font-weight: 700;
		cursor: pointer;
	}

	.primary-nav {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 8px 20px 20px;
		background: var(--white);
		border-bottom: 1px solid var(--line);
		max-height: calc(100vh - 120px);
		overflow-y: auto;
	}

	.primary-nav.is-open { display: flex; }
	.primary-nav .menu { flex-direction: column; align-items: stretch; }
	.primary-nav .menu a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
	.sub-menu { display: block; position: static; min-width: 0; border: 0; padding: 0 0 0 16px; }
	.sub-menu a { font-size: 1rem; }
	.nav-cta { margin-top: 16px; }
}

@media (max-width: 980px) {
	.hero__grid,
	.intro__grid,
	.safety__grid,
	.contact-grid,
	.two-col { grid-template-columns: 1fr; gap: 36px; }

	.hero__grid { padding-block: 48px 40px; }
	.hero h1 { max-width: 18ch; }
	.side { position: static; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.job-list--stack .job { grid-template-columns: 1fr; gap: 20px; }

}

@media (max-width: 720px) {
	body { font-size: 1.0625rem; }
	.section { padding-block: 48px; }
	.scope-grid,
	.job-list,
	.footer-grid,
	.field-row { grid-template-columns: 1fr; }
	.cta-band__inner { flex-direction: column; align-items: flex-start; }
	.topbar__inner { justify-content: flex-start; flex-wrap: wrap; gap: 4px 20px; }
	.gallery-columns-3,
	.gallery-columns-2 { grid-template-columns: 1fr 1fr; }
	.quote-form { padding: 22px; }
	.brand img,
	.custom-logo { height: 42px; }
	.titleblock__row { grid-template-columns: 7em minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .site-footer, .cta-band, .rail { display: none; }
	body { background: #fff; }
}
