/*
 * SES Electrical Services
 * Rebuilt from the archive.org capture of seselectric.com.au (Purify theme).
 *
 * Headings/labels are Raleway; body copy is Roboto Slab. Both are self-hosted
 * from fonts/ via css/fonts.css, so the page fetches nothing off-site.
 */

:root {
	--red: #ce001b;
	--navy: #172b42;
	--ink: #333;
	--box: #111;
	--grey: #eee;
	--raleway: Raleway, sans-serif;
	--roboto-slab: "Roboto Slab", serif;
}

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

/* Visually hidden, still read out. */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* On html, not body, so the root element is not left on the UA's Times. */
html {
	font: 17px/25px var(--roboto-slab);
	color: var(--navy);
	background: #fff;
}

body { margin: 0; }

/* Form controls default to the UA's own font (Arial), which would be a third
   stack on the page. */
input, textarea, select, button { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6, strong, b, th { font-family: var(--raleway); }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.2; }

/* `pretty` only fixes the last line of a block, which is what long left-aligned
   body copy wants — but Chrome and Safari are the only engines that have it,
   Firefox 140 does not support it and wraps normally.
   `balance` evens every line instead, and it does work in Firefox. That suits
   the short centred copy in .prose and the hero, where a normal wrap was
   leaving one word stranded ("…at the right price." was a 44px last line in a
   970px column). Both engines give up on balancing once a block runs long —
   measured, no effect past 4 lines in Chrome 150 or 5 in Firefox 140 — so it
   stays off the taller left-aligned columns, which keep `pretty`. */
p { text-wrap: pretty; }
.hero p, .prose p { text-wrap: balance; }
h1, h2, h3, h4, h5, h6, .statement, blockquote cite { text-wrap: balance; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
svg { display: block; }

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 15px;
}

/* ---------- Top bar ---------- */

.topbar {
	background: #000;
	color: #fff;
	font-family: var(--raleway);
	font-size: 15px;
}

.topbar ul {
	list-style: none;
	margin: 0;
	padding: 13px 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 30px;
}

.topbar li { display: flex; align-items: center; gap: 10px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { color: var(--red); }
.topbar .licence { color: var(--red); font-weight: 700; }
.topbar .licence span { color: #fff; font-weight: normal; }

/* Small red disc holding a line icon, used in the top bar. */
.disc {
	flex: none;
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: var(--red);
	color: var(--navy);
	display: grid;
	place-items: center;
}

.disc svg { width: 13px; height: 13px; }

/* ---------- Header ---------- */

.site-header { background: #fff; }

.site-header .container {
	display: flex;
	align-items: center;
	gap: 20px 50px;
	flex-wrap: wrap;
	min-height: 99px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-header .logo { width: 118px; }

/* Burger. Hidden on desktop, and hidden entirely without JS so the nav below
   stays reachable rather than being collapsed behind a dead button. */
.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 5px;
}

.nav-toggle span:not(.sr-only) {
	display: block;
	width: 28px;
	height: 3px;
	background: var(--navy);
}

.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 45px;
}

.site-nav a {
	font-family: var(--raleway);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--navy);
}

.site-nav a:hover, .site-nav [aria-current="page"] { color: var(--red); }

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

.hero {
	height: 560px;
	display: flex;
	align-items: center;
	background: #333 url("../img/hero-ses-van.jpg") center / cover no-repeat;
	color: #fff;
}

.hero .container { width: 100%; }
.hero-inner { max-width: 500px; }

.hero h1 {
	font-size: 40px;
	margin-bottom: 20px;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.hero p {
	margin: 0 0 30px;
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-block;
	font-family: var(--raleway);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 50px;
	height: 50px;
	padding: 0 40px 0 26px;
	border: 0;
	border-radius: 6px;
	background: var(--red);
	color: #fff;
	cursor: pointer;
	position: relative;
}

.btn::after {
	content: "\203A";
	position: absolute;
	right: 22px;
	top: -2px;
	font-size: 18px;
}

.btn:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--navy); color: #fff; }

/* ---------- Red contact bar with the protruding call box ---------- */

/* Starts where the hero ends and carries the grey of the section below, so the
   bar and its call box sit on grey rather than on a white band. flow-root is
   required: without a block formatting context the bar's negative top margin
   collapses through this wrapper and drags it up over the hero, shortening the
   hero instead of overlapping it. */
.contact-bar-wrap {
	display: flow-root;
	background: var(--grey);
}

.contact-bar {
	position: relative;
	font-family: var(--raleway);
	z-index: 2;
	margin-top: -60px;
	background: var(--red);
	color: #fff;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	min-height: 120px;
}

.contact-bar h2 {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.contact-bar p { margin: 0; }
.contact-bar a { color: #fff; text-decoration: none; }
.contact-bar a:hover { text-decoration: underline; }

.bar-cell {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 20px 30px;
}

.bar-cell svg { width: 42px; height: 42px; flex: none; }

/* The black box overhangs the bar top and bottom and ends in a chevron. The
   bottom padding has to clear the chevron so the text never sits in the point. */
.call-box {
	align-self: stretch;
	width: 327px;
	margin: -46px 0 -62px;
	padding: 40px 20px 62px;
	background: var(--box);
	text-align: center;
	clip-path: polygon(0 0, 100% 0, 100% 89%, 50% 100%, 0 89%);
}

.call-box svg { width: 34px; height: 34px; margin: 0 auto 16px; }
.call-box h2 { font-size: 28px; letter-spacing: 0; margin-bottom: 14px; }
.call-box p { font-size: 17px; }

/* ---------- Sections ---------- */

.section { padding: 90px 0; }
.section-grey { background: var(--grey); }
.section-tall { padding-top: 150px; }

.section-led {
	background: var(--grey) url("../img/led-closeup.jpg") center / cover no-repeat;
}

/* Small dark label above a large red statement, with a short red rule. */
.heading { text-align: center; margin-bottom: 45px; }

.heading .label {
	font-family: var(--raleway);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--ink);
	margin: 0 0 30px;
}

.heading .statement {
	font-family: var(--raleway);
	font-size: 28px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--red);
	/* Held to a measure so the long statements break onto two lines as they did
	   originally; text-wrap: balance then evens those lines, no <br> needed. */
	max-width: 620px;
	margin: 0 auto;
}

.heading .rule, .rule {
	display: block;
	width: 30px;
	height: 4px;
	background: var(--red);
	border: 0;
	margin: 40px auto 0;
}

.heading-icon { color: var(--red); margin: 0 auto 55px; }
.heading-icon svg { width: 52px; height: 52px; margin: 0 auto; }

.prose { max-width: 970px; margin: 0 auto; text-align: center; }
.prose p { margin: 0 0 20px; }
.prose .btn { margin-top: 20px; }

/* ---------- Testimonials ---------- */

.testimonials { max-width: 860px; margin: 0 auto; }
.testimonials blockquote { margin: 0 0 35px; }
.testimonials cite { font-family: var(--raleway); font-style: normal; font-weight: 700; }
.testimonials p { margin: 0; }

/* ---------- Service rows ---------- */

.service {
	display: grid;
	gap: 45px;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	margin-bottom: 60px;
}

.service:last-child { margin-bottom: 0; }
.service.reverse .service-body { order: -1; }

/* Source photos vary in aspect ratio; crop them so the rows line up. */
.service img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.service h3 {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 25px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.service h3 span {
	flex: none;
	width: 40px;
	height: 40px;
	line-height: 40px;
	text-align: center;
	border-radius: 50%;
	background: var(--red);
	color: #fff;
	font-size: 16px;
}

.service p { margin: 0 0 20px; }

/* ---------- About ---------- */

.page-banner { width: 100%; height: 340px; object-fit: cover; object-position: center 40%; }

.about-grid {
	display: grid;
	gap: 45px;
	grid-template-columns: 1fr 1fr;
	align-items: center;
}

.about-grid h3 { font-size: 18px; margin-bottom: 12px; }
.about-grid h3 + p { margin-top: 0; }

.counters {
	display: grid;
	gap: 30px;
	grid-template-columns: repeat(4, 1fr);
	text-align: center;
	margin-top: 90px;
}

.counters svg {
	width: 88px;
	height: 88px;
	padding: 24px;
	border-radius: 50%;
	background: var(--red);
	color: #fff;
	margin: 0 auto 23px;
}

.counters strong {
	display: block;
	font-size: 80px;
	font-weight: 100;
	line-height: 1;
	margin-bottom: 8px;
}

.counters span {
	font-family: var(--raleway);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--ink);
}

/* ---------- Contact page ---------- */

.contact-grid {
	display: grid;
	gap: 45px;
	grid-template-columns: 1fr 1fr;
	align-items: start;
}

.contact-list { list-style: none; margin: 30px 0 0; padding: 0; font-family: var(--raleway); }

.contact-list li {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 16px;
	font-size: 17px;
}

.contact-list svg { width: 26px; height: 26px; flex: none; color: var(--red); }
.contact-list a { color: var(--navy); text-decoration: none; }
.contact-list a:hover { color: var(--red); }

form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.form-field { display: flex; flex-direction: column; }
form button { align-self: flex-start; }

label {
	display: block;
	font-family: var(--raleway);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin-bottom: 6px;
}

input, textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	background: #fff;
}

input:focus, textarea:focus { outline: 2px solid var(--red); border-color: transparent; }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
	background: var(--grey);
	font-family: var(--raleway);
	font-size: 13px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	padding: 16px 0;
}

.breadcrumbs ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.breadcrumbs a { color: var(--navy); text-decoration: none; }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs li + li::before { content: "/"; margin-right: 10px; color: #999; }

/* ---------- Footer ---------- */

.site-footer {
	background: #000;
	color: #fff;
	text-align: center;
	padding: 55px 0;
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 30px;
	justify-content: center;
}

.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--red); }

.site-footer li a {
	font-family: var(--raleway);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.footer-line {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-family: var(--raleway);
	font-weight: 600;
	margin: 45px 0 0;
}

/* flex: none or the long address squeezes the icon — flex items shrink by default. */
.footer-line svg { width: 24px; height: 24px; flex: none; color: var(--red); }
.footer-line.phone { font-size: 22px; margin-top: 25px; }
.footer-line.phone a { color: var(--red); }

/* ---------- Back to top ---------- */

.to-top {
	position: fixed;
	right: 15px;
	bottom: 60px;
	width: 34px;
	height: 34px;
	background: var(--red);
	color: #fff;
	display: grid;
	place-items: center;
	text-decoration: none;
	border-radius: 3px;
}

.to-top svg { width: 16px; height: 16px; }

/* Nothing to scroll back up to while still on the first screenful, so site.js
   only adds .visible once past it. Without JS the button just stays put. */
.js .to-top {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.js .to-top.visible { opacity: 1; visibility: visible; }

/* ---------- Enquiry overlay ---------- */

/* form.js sets #overlay to "loading" while the request is in flight, then to
   "visible error" to show the API's message. Success redirects instead. */
#overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(23, 43, 66, 0.85);
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#overlay.visible, #overlay.loading { display: flex; }

#overlay #message {
	background: #fff;
	border-top: 4px solid var(--red);
	padding: 35px;
	max-width: 480px;
	text-align: center;
}

#overlay.loading #message { display: none; }

#overlay.loading::after {
	content: "Sending\2026";
	font-family: var(--raleway);
	font-size: 22px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
}

#messageText { margin: 0 0 25px; }
#messageText span { display: block; font-family: var(--raleway); font-weight: 600; }

@media (min-width: 620px) {
	.form-row { display: flex; gap: 18px; }
	.form-row .form-field { flex: 1; }
}

@media (max-width: 900px) {
	/* Burger left, logo optically centred between equal gutters. */
	.site-header .container {
		display: grid;
		grid-template-columns: 44px 1fr 44px;
		align-items: center;
		gap: 0;
		min-height: 0;
		padding-top: 18px;
		padding-bottom: 18px;
	}

	.nav-toggle { display: flex; }
	.logo-link { justify-self: center; }
	.site-nav { grid-column: 1 / -1; }
	.js .site-nav { display: none; }
	.js .site-nav.open { display: block; }

	.site-nav ul { flex-direction: column; gap: 0; margin-top: 14px; }
	.site-nav li + li { border-top: 1px solid var(--grey); }
	.site-nav a { padding: 14px 0; }
	.hero { height: auto; padding: 70px 0; }
	.hero h1 { font-size: 30px; }
	.contact-bar { grid-template-columns: 1fr; margin-top: 0; }
	.call-box { width: auto; margin: 0; padding: 30px 20px; clip-path: none; }
	.bar-cell { justify-content: center; }
	.section { padding: 60px 0; }
	.section-tall { padding-top: 60px; }
	.service, .about-grid, .contact-grid { grid-template-columns: 1fr; }
	.service.reverse .service-body { order: 0; }
	.counters { grid-template-columns: repeat(2, 1fr); }
	.counters strong { font-size: 56px; }
	.heading .statement { font-size: 22px; }
	.to-top { display: none; }
}
