/*
Theme Name: Chesters Building Services
Theme URI: https://chestersservices.co.uk/
Author: Chesters Building Services
Description: Custom theme for Chesters Building Services: loft conversions, extensions, groundworks, paving, fencing, landscaping and drainage. On activation it creates the Home, About, Services (with one page per service), Gallery and Contact pages and the main menu. Business details are set in Appearance > Customize > Business details.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: chesters
*/

:root {
	--green: #c8102e;
	--green-dark: #a00c24;
	--green-light: #ff4b40;
	--orange: #2b2b31;
	--orange-dark: #111114;
	--grey: #efefef;
	--grey-mid: #8f9097;
	--slate: #575760;
	--slate-dark: #45454d;
	--ink: #222;
	--paper: #f7f8f9;
	--white: #fff;
	--radius: 4px;
	--wrap: 1200px;
	--font: "Telex", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: clamp(22px, 2.6vw, 30px); }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 820px; }
.center { text-align: center; }
.lead { font-size: 1.15em; }
.screen-reader-text, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--green); color: #fff; padding: 8px 14px; z-index: 1000; }
.skip-link:focus { left: 8px; }

/* Buttons */
.btn {
	display: inline-block;
	background: var(--green);
	color: #fff;
	text-transform: uppercase;
	text-decoration: none;
	font-size: 15px;
	letter-spacing: .02em;
	padding: 13px 26px;
	border: 2px solid var(--green);
	border-radius: var(--radius);
	cursor: pointer;
	font-family: inherit;
	transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; transform: translateY(-1px); }
.btn--orange { background: var(--orange); border-color: var(--orange); }
.btn--orange:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn--white { background: #fff; border-color: #fff; color: var(--green); }
.btn--white:hover { background: transparent; color: #fff; border-color: #fff; }
.btn--ghost { background: transparent; border-color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--green); border-color: #fff; }

/* Header */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: #fff;
	box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; }
.brand img { width: 230px; max-height: 70px; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.site-nav .menu > li { position: relative; }
.site-nav .menu a { display: block; padding: 10px 12px; color: var(--ink); text-decoration: none; font-size: 15px; }
.site-nav .menu a:hover,
.site-nav .menu .current-menu-item > a,
.site-nav .menu .current-menu-ancestor > a,
.site-nav .menu .current_page_item > a { color: var(--green); }
.site-nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.site-nav .sub-menu {
	list-style: none; margin: 0; padding: 8px 0;
	position: absolute; top: 100%; left: 0; min-width: 230px;
	background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); border-top: 3px solid var(--green);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s;
}
.site-nav .menu li:hover > .sub-menu,
.site-nav .menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { padding: 8px 18px; }
.header-phone { color: #fff; background: var(--green); padding: 9px 16px; border-radius: var(--radius); text-decoration: none; white-space: nowrap; }
.header-phone:hover { background: var(--green-dark); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span:not(.screen-reader-text) { display: block; width: 26px; height: 2px; background: var(--ink); margin: 6px 0; transition: .2s; }

/* Hero */
.hero {
	position: relative;
	min-height: min(88vh, 760px);
	display: flex; align-items: center;
	background-size: cover; background-position: center;
	color: #fff;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.5) 55%, rgba(0,0,0,.25) 100%); }
.hero__content { position: relative; padding-top: 80px; padding-bottom: 140px; }
.hero__kicker { font-size: 17px; margin-bottom: .4em; }
.hero__title { font-size: clamp(38px, 6.4vw, 72px); text-transform: uppercase; line-height: 1.02; margin-bottom: .35em; }
.hero__title span { display: block; color: var(--green-light); }
.hero__lead { font-size: clamp(20px, 2.6vw, 30px); max-width: 820px; margin-bottom: .4em; }
.hero__sub { font-size: 17px; opacity: .95; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* Green curved intro band */
.intro {
	position: relative;
	background: var(--green);
	color: #fff;
	text-align: center;
	padding: 90px 0 120px;
	margin-top: -70px;
	border-radius: 60% 40% 0 0 / 70px 50px 0 0;
	overflow: hidden;
}
.intro::after {
	content: ""; position: absolute; right: -40px; bottom: 30px; width: 300px; height: 300px;
	background: url("assets/img/logo-white.svg") no-repeat left center / auto 100%;
	opacity: .1; pointer-events: none;
}
.intro__inner { max-width: 760px; position: relative; z-index: 1; }
.intro h2 { color: #fff; }

/* Grey section heading with curve */
.section-head {
	background: var(--grey);
	text-align: center;
	padding: 90px 24px 40px;
	margin-top: -60px;
	border-radius: 0 100% 0 0 / 0 80px 0 0;
	position: relative;
}
.section-head h2 { margin: 0; }

/* Alternating service blocks */
.services { background: #fff; }
.svc { display: grid; grid-template-columns: 1fr 1fr; min-height: 420px; }
.svc__text { padding: 60px clamp(24px, 6vw, 90px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: var(--grey); }
.svc__kicker { color: var(--green); text-transform: uppercase; font-size: 14px; letter-spacing: .04em; margin-bottom: .3em; }
.svc h3 { color: var(--ink); font-size: clamp(26px, 3vw, 36px); }
.svc__img { position: relative; overflow: hidden; }
.svc__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.svc:hover .svc__img img { transform: scale(1.04); }
.svc--green .svc__text { background: var(--green); color: #fff; position: relative; overflow: hidden; }
.svc--green h3 { color: #fff; }
.svc--green .svc__kicker { color: #ffd3cf; }
.svc--green .svc__text::after {
	content: ""; position: absolute; right: -60px; bottom: -20px; width: 260px; height: 200px;
	background: url("assets/img/logo-white.svg") no-repeat left center / auto 100%; opacity: .08;
}
.svc--flip .svc__text { order: 2; }

/* Why choose us (slate band) */
.why {
	background: var(--grey-mid);
	color: #fff;
	text-align: center;
	padding: 100px 0;
	position: relative;
	overflow: hidden;
}
.why h2 { color: #fff; }
.why__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; margin: 40px 0 50px; text-align: left; }
.why__item { background: rgba(255,255,255,.1); border-radius: 6px; padding: 28px 24px; }
.why__item h3 { font-size: 21px; color: #fff; }
.why__item p { margin: 0; font-size: 16px; }
.why__icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--green); color: #fff; font-size: 22px; margin-bottom: 14px; }
.why__logo { margin: 0 auto; width: 300px; opacity: .9; }
.why--compact { padding: 80px 0; }
.why__grid--svc { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 0; }
.why__item--link { text-decoration: none; color: #fff; transition: background .2s; }
.why__item--link:hover { background: var(--green); color: #fff; }

/* Recent work / small galleries */
.recent, .service-gallery { padding: 90px 0; background: #fff; text-align: center; }
.recent__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 30px 0; }
.recent__grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); }
.recent__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.recent__grid a:hover img { transform: scale(1.06); }

/* CTA band */
.cta-band { background: var(--green); color: #fff; padding: 56px 0; }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .2em; }
.cta-band p { margin: 0; }
.cta-band__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Inner page hero */
.page-hero {
	position: relative;
	background-size: cover; background-position: center;
	color: #fff;
	padding: 140px 0 110px;
}
.page-hero::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.page-hero .container { position: relative; }
.page-hero h1 { font-size: clamp(36px, 5.5vw, 62px); text-transform: uppercase; margin: 0; }
.page-hero--short { padding: 100px 0 80px; }
.page-hero::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 50px;
	background: var(--paper);
	border-radius: 100% 0 0 0 / 50px 0 0 0;
}

/* Service page */
.service-body { padding: 60px 0 80px; }
.service-body__grid { display: grid; grid-template-columns: 2fr 1fr; gap: 50px; align-items: start; }
.service-body h2 { color: var(--green); font-size: 32px; margin-top: 1em; }
.ticks { list-style: none; padding: 0; margin: 0 0 30px; }
.ticks li { position: relative; padding: 8px 0 8px 36px; border-bottom: 1px solid #e3e5e7; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.side-box { background: #fff; padding: 26px; border-radius: 6px; box-shadow: 0 4px 20px rgba(0,0,0,.06); margin-bottom: 20px; }
.side-box h3 { font-size: 22px; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li a { display: block; padding: 9px 0; border-bottom: 1px solid #eee; text-decoration: none; color: var(--ink); }
.side-box li a:hover, .side-box li.is-current a { color: var(--green); }
.side-box li.is-current a { font-weight: 700; }
.side-box--green { background: var(--green); color: #fff; }
.side-box--green h3, .side-box--green a { color: #fff; font-size: 22px; text-decoration: none; }
.service-gallery { background: var(--grey); }

/* Enquiry band + form */
.enquiry-band { background: var(--slate); color: #fff; padding: 80px 0; }
.enquiry-band__inner { display: grid; grid-template-columns: 1fr 1.3fr; gap: 50px; align-items: start; }
.enquiry-band h2 { color: #fff; }
.enquiry-form { background: #fff; color: var(--ink); padding: 30px; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.enquiry-form label { display: block; font-size: 15px; margin-bottom: 14px; }
.enquiry-form input, .enquiry-form select, .enquiry-form textarea {
	display: block; width: 100%; margin-top: 5px; padding: 12px 14px;
	font: inherit; font-size: 16px; color: var(--ink);
	border: 1px solid #cfd3d6; border-radius: var(--radius); background: #fff;
}
.enquiry-form input:focus, .enquiry-form select:focus, .enquiry-form textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-note { padding: 12px 16px; border-radius: var(--radius); }
.form-note--ok { background: #e3f5ea; color: #1d6b3c; }
.form-note--err { background: #fde8e2; color: #a2330f; }

/* Services overview cards */
.cards { padding: 70px 0 90px; }
.cards__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.card { background: #fff; border-radius: 6px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 4px 20px rgba(0,0,0,.06); transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 34px rgba(0,0,0,.12); color: var(--ink); }
.card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.card__body { padding: 24px; }
.card h2 { font-size: 26px; color: var(--green); }
.card__more { color: var(--green); }

/* Gallery page */
.gallery-page { padding: 60px 0 90px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 30px; }
.filter { font: inherit; font-size: 15px; padding: 8px 16px; border: 1px solid #cfd3d6; background: #fff; border-radius: 30px; cursor: pointer; }
.filter.is-active, .filter:hover { background: var(--green); border-color: var(--green); color: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gallery-grid a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-grid a:hover img { transform: scale(1.06); }
.gallery-grid span { position: absolute; left: 0; bottom: 0; background: rgba(200,16,46,.92); color: #fff; font-size: 14px; padding: 5px 12px; border-top-right-radius: var(--radius); }
.gallery-grid a.is-hidden { display: none; }

/* About */
.about { padding: 60px 0 90px; }
.about__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center; }
.about h2 { color: var(--green); }
.about__img img { border-radius: 6px; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* Contact page */
.contact-page { padding: 60px 0 90px; }
.contact-page__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 50px; align-items: start; }
.contact-page h2 { color: var(--green); }
.contact-list { list-style: none; padding: 0; margin: 20px 0 0; }
.contact-list li { padding: 14px 0; border-bottom: 1px solid #e3e5e7; }
.contact-list strong { display: block; font-size: 14px; text-transform: uppercase; color: var(--grey-mid); letter-spacing: .04em; }

/* Plain content */
.plain { padding: 50px 0 80px; }
.entry img { border-radius: var(--radius); }
.entry .wp-block-gallery { margin-bottom: 30px; }
.post-item { padding-bottom: 24px; border-bottom: 1px solid #e3e5e7; margin-bottom: 24px; }

/* Footer */
.site-footer { background: var(--slate); color: #e6e6ea; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 70px; padding-bottom: 50px; }
.site-footer__logo { width: 230px; margin-bottom: 18px; }
.site-footer h3 { color: #fff; font-size: 20px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a { color: #e6e6ea; text-decoration: none; }
.site-footer a:hover { color: var(--green-light); }
.socials a { margin-right: 14px; }
.site-footer__bar { background: var(--slate-dark); font-size: 14px; padding: 16px 0; color: #b9b9c0; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 30px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius); }
.lightbox__close { position: absolute; top: 14px; right: 20px; background: none; border: 0; color: #fff; font-size: 42px; cursor: pointer; line-height: 1; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .45s ease, transform .45s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; transition: none; }
	html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 1080px) {
	.why__grid { grid-template-columns: repeat(2, 1fr); }
	.site-nav { gap: 14px; }
	.site-nav .menu a { padding: 10px 8px; }
}
@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.site-nav {
		position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 0;
		background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.12);
		padding: 10px 24px 24px;
		max-height: calc(100vh - 92px); overflow-y: auto;
		display: none;
	}
	.site-nav.is-open { display: flex; }
	.site-nav .menu { flex-direction: column; gap: 0; }
	.site-nav .menu a { padding: 12px 0; border-bottom: 1px solid #eee; }
	.site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 16px; }
	.header-phone { margin-top: 16px; text-align: center; }
	.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
	.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
	.svc { grid-template-columns: 1fr; }
	.svc__img { min-height: 300px; order: -1; }
	.svc--flip .svc__text { order: 0; }
	.service-body__grid, .enquiry-band__inner, .about__grid, .contact-page__grid { grid-template-columns: 1fr; }
	.recent__grid { grid-template-columns: repeat(2, 1fr); }
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
	.site-footer__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
	body { font-size: 16px; }
	.container { padding: 0 16px; }
	.site-header__inner { min-height: 72px; }
	.brand img { width: 180px; }
	.site-nav { max-height: calc(100vh - 72px); padding: 10px 16px 20px; }
	.hero__content { padding-bottom: 110px; }
	.intro { padding: 70px 0 100px; border-radius: 60% 40% 0 0 / 36px 26px 0 0; }
	.section-head { border-radius: 0 100% 0 0 / 0 40px 0 0; }
	.why { padding: 70px 0; }
	.why__grid { grid-template-columns: 1fr; }
	.form-row { grid-template-columns: 1fr; }
	.enquiry-form { padding: 20px; }
	.site-footer__grid { grid-template-columns: 1fr; }
	.cards__grid { grid-template-columns: 1fr; }
	.gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.gallery-grid span { font-size: 12px; padding: 3px 8px; }
	.page-hero { padding: 100px 0 80px; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
