/*
Theme Name: CanRoof
Description: Bilingual (English / 简体中文) website theme for a Canadian roofing contractor. Navy and slate palette with a copper accent; section edges follow a roof slope.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: canroof
*/

/* ------------------------------------------------------------------
   Tokens
------------------------------------------------------------------ */
:root {
	--navy: #11263f;
	--navy-2: #1b3656;
	--slate: #46566a;
	--mist: #edf1f5;
	--line: #d5dde6;
	--paper: #ffffff;
	--ink: #14202e;
	--copper: #a95a23;
	--copper-d: #8e4a1b;
	--copper-l: #e3a26b;
	--rise: clamp(22px, 3.4vw, 52px);
	--f-head: "Archivo", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
	--f-body: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ------------------------------------------------------------------
   Base
------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.65 var(--f-body);
	-webkit-font-smoothing: antialiased;
}
html[lang^="zh"] body { line-height: 1.8; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 0.18em; }
a:hover { color: var(--copper-d); }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link {
	position: absolute; left: 12px; top: -60px; z-index: 100;
	background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 4px;
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.narrow { max-width: 820px; }

h1, h2, h3 { font-family: var(--f-head); color: var(--navy); margin: 0 0 0.5em; line-height: 1.12; }
h1 { font-size: clamp(2.05rem, 4.6vw, 3.35rem); font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
html[lang^="zh"] h1,
html[lang^="zh"] h2,
html[lang^="zh"] h3 { letter-spacing: 0; line-height: 1.3; }

.lead { font-size: 1.2rem; line-height: 1.55; max-width: 52ch; }
.fine { font-size: 0.9rem; color: var(--slate); }
.note { margin-top: 1.5rem; max-width: 62ch; color: var(--slate); }
.prose p, .prose li { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.5rem; }
.prose h2:first-child { margin-top: 0; }

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------ */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 0 1.4rem;
	border: 2px solid transparent; border-radius: 4px;
	font: 700 1rem/1.1 var(--f-head);
	text-decoration: none; cursor: pointer; text-align: center;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-copper { background: var(--copper); color: #fff; }
.btn-copper:hover { background: var(--copper-d); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-block { width: 100%; }
.btn-row, .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); margin-right: auto; }
.brand:hover { color: var(--navy); }
.brand { flex-shrink: 0; }
.brand-name { font: 800 1.05rem/1.15 var(--f-head); letter-spacing: -0.01em; white-space: nowrap; }
.brand-below { flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 6px 0; }
.brand-below .brand-name { font-size: 0.98rem; line-height: 1.1; }
.brand-below .mark { width: 40px; height: 40px; }
.brand-below .brand-logo img, .brand-below .brand-logo .custom-logo { max-height: 48px !important; max-width: 150px !important; }
html[lang^="zh"] .brand-name { letter-spacing: 0.02em; }

.site-nav > ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav > ul > li > a {
	display: block; padding: 0.6rem 0.65rem; white-space: nowrap;
	font: 600 0.95rem/1.2 var(--f-head);
	color: var(--navy); text-decoration: none;
	border-bottom: 3px solid transparent;
}
.site-nav > ul > li > a:hover { color: var(--copper-d); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--copper); }

/* Services dropdown */
.has-sub { position: relative; }
.sub-toggle { display: none; }
.sub {
	display: none; position: absolute; top: 100%; left: -120px; z-index: 70;
	grid-template-columns: repeat(3, minmax(200px, 1fr)); gap: 8px 28px;
	width: max-content; max-width: 760px; padding: 22px 26px;
	background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--copper);
	box-shadow: 0 16px 30px rgba(17, 38, 63, 0.16);
}
.has-sub:hover .sub, .has-sub:focus-within .sub { display: grid; }
.sub-h { font: 700 0.85rem/1.3 var(--f-head); color: var(--slate); margin: 0 0 8px; }
.sub ul { list-style: none; margin: 0; padding: 0; }
.sub a { display: block; padding: 6px 0; font: 600 0.95rem/1.3 var(--f-head); color: var(--navy); text-decoration: none; border: 0; }
.sub a:hover { color: var(--copper-d); text-decoration: underline; }
.sub a[aria-current="page"] { color: var(--copper-d); }

.topbar { background: var(--navy); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 20px; min-width: 0; }
.topbar-right { gap: 14px; }
.topbar-call { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.topbar-call strong { font-family: var(--f-head); letter-spacing: 0.01em; }
.topbar-note { color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, 0.3); white-space: nowrap; }
.topbar .social { margin: 0; gap: 4px; }
.topbar .social a { min-width: 30px; height: 30px; padding: 0; border: 0; color: #fff; }
.topbar .social a:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.topbar .social .soc-ic { width: 17px; height: 17px; }
.topbar .social .wechat { display: none; }
@media (max-width: 1000px) { .topbar-note { display: none; } }
@media (max-width: 700px) { .topbar .social { display: none; } }
.topbar-call:hover { color: #fff; text-decoration: underline; }
.topbar .lang-switch { border-color: rgba(255, 255, 255, 0.4); }
.topbar .lang-switch a, .topbar .lang-switch .is-current { color: #fff; padding: 0.4rem 0.6rem; font-size: 0.82rem; }
.topbar .lang-switch a + a, .topbar .lang-switch .is-current + a, .topbar .lang-switch a + .is-current { border-left-color: rgba(255, 255, 255, 0.4); }
.topbar .lang-switch a:hover { background: rgba(255, 255, 255, 0.14); }
.topbar .lang-switch .is-current { background: #fff; color: var(--navy); }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; white-space: nowrap; }
.lang-switch a, .lang-switch .is-current {
	font: 700 0.88rem/1 var(--f-head); text-decoration: none; padding: 0.6rem 0.6rem; color: var(--navy);
}
.lang-switch a + a, .lang-switch .is-current + a, .lang-switch a + .is-current, .lang-switch span + span { border-left: 1px solid var(--line); }
.lang-switch a:hover { background: var(--mist); }
.lang-switch .is-current { background: var(--navy); color: #fff; }
.btn-call { min-height: 44px; padding: 0 1.1rem; white-space: nowrap; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 0; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
	display: block; width: 24px; height: 3px; background: var(--navy); border-radius: 2px; position: relative; margin-inline: auto;
	transition: transform 0.2s, background-color 0.2s;
}
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -8px; }
.nav-toggle .bars::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1320px) {
	.nav-toggle { display: block; }
	.site-nav {
		display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 72px); overflow-y: auto;
		background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 20px rgba(17, 38, 63, 0.12);
	}
	.site-nav.open { display: block; }
	.site-nav > ul { flex-direction: column; gap: 0; padding: 4px 20px 16px; }
	.site-nav > ul > li > a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; white-space: normal; }
	.site-nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--copper-d); }
	.has-sub { display: flex; flex-wrap: wrap; align-items: stretch; }
	.has-sub > a { flex: 1 1 auto; }
	.sub-toggle { display: block; flex: 0 0 52px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
	.sub-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -7px 0 0 -5px; border: solid var(--navy); border-width: 0 3px 3px 0; transform: rotate(45deg); transition: transform 0.15s; }
	.sub-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: -2px; }
	.has-sub:hover .sub, .has-sub:focus-within .sub { display: none; }
	.has-sub.open .sub { display: block; }
	.sub { position: static; flex: 1 1 100%; width: auto; max-width: none; padding: 6px 0 10px 14px; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; background: var(--mist); }
	.sub-col { margin-bottom: 8px; }
	.sub a { padding: 9px 0; }
}
@media (max-width: 560px) {
	.bar { min-height: 64px; }
	.brand-below .brand-logo img, .brand-below .brand-logo .custom-logo { max-height: 38px !important; max-width: 120px !important; }
	.brand-below .mark { width: 32px; height: 32px; }
	.brand-below .brand-name { font-size: 0.9rem; }
}

/* ------------------------------------------------------------------
   Sections and the roof-slope edge
------------------------------------------------------------------ */
.section { position: relative; padding: 72px 0; }
.slope {
	margin-top: calc(var(--rise) * -1);
	padding-top: calc(var(--rise) + 64px);
	clip-path: polygon(0 var(--rise), 100% 0, 100% 100%, 0 100%);
}
.bg-mist { background: var(--mist); }
.bg-navy { background: var(--navy); color: #fff; }
.bg-navy h2 { color: #fff; }
.bg-copper { background: var(--copper); color: #fff; }
.bg-copper h2 { color: #fff; }

/* Hero slides */
.hero.has-slides { background-image: none; }
.hero-slides { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.hero-slides::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17, 38, 63, 0.93) 0%, rgba(17, 38, 63, 0.8) 52%, rgba(17, 38, 63, 0.5) 100%); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-caption { margin-top: 32px; }
.hero-caps { display: grid; }
.hero-cap { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0.6s; border-left: 3px solid var(--copper); padding-left: 16px; }
.hero-cap.is-active { opacity: 1; visibility: visible; }
.hero-cap p { margin: 0; }
.hero-cap-title { font: 700 1.25rem/1.25 var(--f-head); color: #fff; }
.hero-cap-title a { color: #fff; text-decoration: none; }
.hero-cap-title a:hover { text-decoration: underline; }
.hero-cap-sub { margin-top: 4px; color: #d3dde9; }
.hero-ctl { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.hero-arrow, .hero-pause {
	width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); background: transparent; color: #fff;
	font-size: 1.4rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.hero-pause { font-size: 0.6rem; letter-spacing: -1px; margin-left: 6px; }
.hero-arrow:hover, .hero-pause:hover { background: rgba(255, 255, 255, 0.16); }
.hero-dots { display: flex; }
.hero-dot { width: 26px; height: 36px; border: 0; background: none; padding: 0; cursor: pointer; position: relative; }
.hero-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; }
.hero-dot.is-active::before { background: var(--copper); border-color: var(--copper); }
@media (prefers-reduced-motion: reduce) { .hero-slide, .hero-cap { transition: none; } }

/* Hero (home) */
.hero {
	position: relative; background: var(--navy); color: #fff;
	padding: clamp(40px, 6vw, 76px) 0 calc(var(--rise) + clamp(48px, 6vw, 72px));
	background-image: repeating-linear-gradient(-26.57deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 26px);
}
.hero-scape { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(150px, 20vw, 260px); pointer-events: none; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-slides + .wrap, .hero > .wrap.hero-grid { z-index: 1; }
.hero h1 { color: #fff; max-width: 20ch; }
html[lang^="zh"] .hero h1 { max-width: 14em; }
.hero .lead { color: #d3dde9; margin-bottom: 28px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.hero-actions { margin-bottom: 32px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-weight: 600; }
.hero-points li { position: relative; padding-left: 28px; }
.hero-points li::before {
	content: ""; position: absolute; left: 4px; top: 0.35em; width: 7px; height: 13px;
	border: solid var(--copper-l); border-width: 0 3px 3px 0; transform: rotate(40deg);
}
@media (max-width: 900px) {
	.hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.hero-points { grid-template-columns: 1fr; }
}

/* Inner page header */
.pagehero {
	background: var(--navy); color: #fff;
	padding: clamp(28px, 3.4vw, 42px) 0 calc(var(--rise) + clamp(22px, 2.6vw, 32px));
	background-image: repeating-linear-gradient(-26.57deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 26px);
}
.pagehero h1 { color: #fff; max-width: 32ch; font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 0.4em; }
html[lang^="zh"] .pagehero h1 { max-width: 20em; }
.pagehero .lead { color: #d3dde9; margin-bottom: 18px; max-width: 64ch; }

/* ------------------------------------------------------------------
   Content blocks
------------------------------------------------------------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 28px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px; }
.panel .illus { color: var(--navy); width: min(280px, 100%); margin-bottom: 20px; }
.panel h3 { font-size: 1.5rem; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.ticks { list-style: none; padding: 0; margin: 0 0 1.4em; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 0.5em; font-weight: 600; }
.ticks li::before {
	content: ""; position: absolute; left: 4px; top: 0.35em; width: 7px; height: 13px;
	border: solid var(--copper); border-width: 0 3px 3px 0; transform: rotate(40deg);
}
.ticks.dark li { font-weight: 400; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* Service list: hairline rows, two columns */
.svclist { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 5vw, 64px); }
.svclist li { padding: 20px 0; border-top: 1px solid var(--line); }
.svclist h3 { margin-bottom: 0.3em; }
.svclist p { margin: 0; color: var(--slate); max-width: 56ch; }
@media (max-width: 800px) { .svclist { grid-template-columns: 1fr; } }

/* Process: a real sequence, so numbered */
.steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; max-width: 820px; }
.steps li { counter-increment: step; position: relative; padding: 0 0 28px 72px; }
.steps li::before {
	content: counter(step); position: absolute; left: 0; top: -4px;
	font: 800 2.4rem/1 var(--f-head); color: var(--copper);
}
.steps li::after { content: ""; position: absolute; left: 14px; top: 44px; bottom: 6px; width: 2px; background: var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: 0.25em; }
.steps p { margin: 0; color: var(--slate); max-width: 60ch; }

/* Commitments: plain columns */
.commit { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 24px; }
.commit > div { border-top: 3px solid var(--navy); padding-top: 14px; }
.commit p { margin: 0; color: var(--slate); }
@media (max-width: 1000px) { .commit { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .commit { grid-template-columns: 1fr; } }

/* Materials table */
.mats { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mats-head, .mats-row { display: grid; grid-template-columns: 1.1fr 1fr 1.6fr 1.6fr; gap: 20px; padding: 16px 22px; }
.mats-head { background: var(--navy); color: #fff; font: 700 0.9rem/1.3 var(--f-head); }
.mats-row { border-top: 1px solid var(--line); }
.mats-row:first-of-type { border-top: 0; }
.mats-row strong { font-family: var(--f-head); color: var(--navy); }
@media (max-width: 800px) {
	.mats-head { display: none; }
	.mats-row { grid-template-columns: 1fr; gap: 6px; }
	.mats-row span::before { content: attr(data-label) ": "; font-weight: 700; color: var(--navy); }
}

/* Cities */
.chips, .areas { list-style: none; margin: 20px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li, .areas li { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 600; }
.areas li { font-size: 1.15rem; padding: 10px 22px; border-color: var(--navy); }

/* FAQ */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
	cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative;
	font: 700 1.1rem/1.35 var(--f-head); color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--copper); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 20px; max-width: 68ch; color: var(--slate); }

/* CTA band */
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.cta-inner h2 { margin-bottom: 0.3em; max-width: 24ch; }
html[lang^="zh"] .cta-inner h2 { max-width: 20em; }
.cta-inner p { margin: 0; }
.cta-inner > div p { max-width: 52ch; opacity: 0.92; }
.cta { padding-bottom: 80px; }
.emergency { padding-top: calc(var(--rise) + 40px); padding-bottom: 44px; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; margin: 24px 0; }
.project { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.project-photo { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--mist); }
.project-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.project:hover .project-photo img { transform: scale(1.04); }
.project-photo .tag-ba { position: absolute; left: 10px; bottom: 10px; background: rgba(17, 38, 63, 0.88); color: #fff; font: 700 0.8rem/1 var(--f-head); padding: 7px 10px; border-radius: 3px; }
.project-body { padding: 18px 22px 22px; }
.project-body h3 a { color: var(--navy); text-decoration: none; }
.project-body h3 a:hover { color: var(--copper-d); text-decoration: underline; }
.project-desc { margin: 0 0 0.8em; }
.project-more { margin: 0; font-weight: 700; }
.project-more a { text-decoration: none; }
.project-more a:hover { text-decoration: underline; }
.project-hero .compare { border-radius: 6px; }
.project-prose { margin-top: 28px; }
.notice-sample { margin-top: 16px; background: #fff7e6; border: 1px solid #e3b75a; border-radius: 4px; padding: 10px 14px; }
@media (prefers-reduced-motion: reduce) { .project-photo img { transition: none; } }
.project-body h3 { margin-bottom: 0.15em; }
.project-meta { color: var(--copper-d); font-weight: 600; margin-bottom: 0.6em; }
.compare { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--mist); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.compare:not(.single)::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(17, 38, 63, 0.25); pointer-events: none; }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 2; }
.compare .tag { position: absolute; bottom: 10px; z-index: 1; background: rgba(17, 38, 63, 0.85); color: #fff; font: 700 0.8rem/1 var(--f-head); padding: 6px 10px; border-radius: 3px; pointer-events: none; }
.tag-before { left: 10px; }
.tag-after { right: 10px; }
.empty { max-width: 560px; }

/* About */
.facts { background: var(--mist); border-radius: 6px; padding: 28px; align-self: start; }
.facts h2 { font-size: 1.4rem; }
.facts dt { font: 700 0.95rem/1.3 var(--f-head); color: var(--navy); margin-top: 16px; }
.facts dd { margin: 4px 0 0; color: var(--slate); }

/* ------------------------------------------------------------------
   Quote form
------------------------------------------------------------------ */
.qcard { background: #fff; color: var(--ink); border-radius: 6px; padding: 28px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28); }
.qcard-full { box-shadow: none; border: 1px solid var(--line); }
.qtitle { font-size: 1.5rem; margin-bottom: 0.2em; }
.qsub { color: var(--slate); margin-bottom: 18px; }
.qform p { margin: 0 0 14px; }
.qform .row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 480px) { .qform .row.two { grid-template-columns: 1fr; } }
.qform label { display: block; font: 700 0.92rem/1.3 var(--f-head); color: var(--navy); margin-bottom: 5px; }
.qform input[type="text"], .qform input[type="tel"], .qform input[type="email"], .qform select, .qform textarea {
	width: 100%; min-height: 48px; padding: 10px 12px;
	border: 1.5px solid #b6c2d0; border-radius: 4px; background: #fff;
	font: inherit; color: var(--ink);
}
.qform textarea { min-height: 90px; resize: vertical; }
.qform input:focus, .qform select:focus, .qform textarea:focus { border-color: var(--navy); outline: 3px solid rgba(169, 90, 35, 0.35); outline-offset: 0; }
.qform input[type="file"] { width: 100%; font: 500 0.92rem/1.4 var(--f-body); padding: 9px; border: 2px dashed #b6bfcc; border-radius: 6px; background: #f8fafc; color: var(--navy); }
.qform .qhint { display: block; margin-top: 5px; font-size: 0.82rem; color: #5b6676; }
.qform .qthumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qform .qthumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid #cfd6e0; }
.qform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.qform .fine { margin: 0; }
.notice { padding: 12px 14px; border-radius: 4px; font-weight: 600; margin-bottom: 16px; }
.notice-ok { background: #e4f2e7; color: #1c5a2c; }
.notice-err { background: #fbe9e5; color: #8a2a17; }

.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.big-phone { font: 800 2rem/1.1 var(--f-head); margin-bottom: 1em; }
.big-phone a { text-decoration: none; }
.contact-side h3 { margin-top: 1.4em; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.site-footer { background: var(--navy); color: #cfd9e5; padding-bottom: 36px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--copper-l); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-name { font: 800 1.35rem/1.2 var(--f-head); color: #fff; margin-bottom: 0.4em; }
.foot-phone { font: 700 1.3rem/1.2 var(--f-head); text-decoration: none; }
.foot-h { font: 700 1rem/1.2 var(--f-head); color: #fff; margin-bottom: 0.8em; }
.foot-list { list-style: none; margin: 0; padding: 0; }
.foot-list li { margin-bottom: 0.4em; }
.foot-base { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.92rem; }
.foot-base p { margin: 0 0 4px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* Service pages */
.svc-layout { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.svc-main h2 { font-size: 1.5rem; margin-top: 1.8em; }
.svc-main > .svc-intro:first-child { margin-top: 0; }
.svc-intro { max-width: 66ch; font-size: 1.12rem; }
.life { padding: 12px 16px; background: var(--mist); border-left: 4px solid var(--copper); max-width: 66ch; }
.svc-aside { position: sticky; top: 96px; display: grid; gap: 20px; }
.svc-aside .qcard { box-shadow: none; border: 1px solid var(--line); padding: 22px; }
.svc-aside .qtitle { font-size: 1.3rem; }
@media (max-width: 960px) {
	.svc-layout { grid-template-columns: 1fr; }
	.svc-aside { position: static; }
}

/* Lists of services */
.svc-links { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(28px, 5vw, 64px); }
.svc-links li { border-top: 1px solid var(--line); }
.svc-links a { display: block; padding: 18px 0; text-decoration: none; }
.svc-links strong { display: block; font: 700 1.15rem/1.3 var(--f-head); color: var(--navy); }
.svc-links span { display: block; margin-top: 4px; color: var(--slate); max-width: 52ch; }
.svc-links a:hover strong { color: var(--copper-d); text-decoration: underline; }
@media (max-width: 800px) { .svc-links { grid-template-columns: 1fr; } }
.svc-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 24px 0 32px; }
.svc-groups > div { border-top: 3px solid var(--navy); padding-top: 14px; }
.plain-links { list-style: none; margin: 0; padding: 0; }
.plain-links li { border-bottom: 1px solid var(--line); }
.plain-links a { display: block; padding: 10px 0; font-weight: 600; text-decoration: none; }
.plain-links a:hover { color: var(--copper-d); text-decoration: underline; }
@media (max-width: 900px) { .svc-groups { grid-template-columns: 1fr; } }
.chips a, .areas a { text-decoration: none; color: inherit; }
.chips li:hover, .areas li:hover { border-color: var(--copper); }

/* Image slots: photo, or a roof-texture panel until one is uploaded */
.media { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--mist); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel-media { margin-bottom: 20px; }
.ph { background-color: var(--navy-2); }
.ph-pitch { background-image: repeating-linear-gradient(-26.57deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 30px); }
.ph-shingle {
	background-image:
		linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0 2px, transparent 2px),
		repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0 3px, transparent 3px 26px);
	background-size: 52px 26px, auto;
	background-color: #3a4a5e;
}
.ph-cedar {
	background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 3px, transparent 3px 22px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 18px, transparent 18px 40px);
	background-color: #7a5a3c;
}
.ph-metal { background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 2px, rgba(0, 0, 0, 0.18) 2px 6px, transparent 6px 54px); background-color: #55677c; }
.ph-membrane { background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 70px), repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0 2px, transparent 2px 140px); background-color: #3b4654; }
.ph-hint {
	position: absolute; left: 12px; bottom: 12px; padding: 8px 12px; border-radius: 4px;
	background: #fff; color: var(--navy); font: 700 0.85rem/1 var(--f-head); text-decoration: none;
}

/* Home banner photo (optional) */
.hero.has-img { background-image: linear-gradient(90deg, rgba(17, 38, 63, 0.93) 0%, rgba(17, 38, 63, 0.8) 52%, rgba(17, 38, 63, 0.5) 100%), var(--hero-img); background-size: cover; background-position: center; }

/* Logo */
.brand-logo { flex: 0 0 auto; }
.brand-logo img, .brand-logo .custom-logo { max-height: 44px !important; max-width: 120px !important; width: auto !important; height: auto !important; object-fit: contain; }
.brand-logo .custom-logo-link { display: block; }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; margin: 24px 0; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.post-thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--mist); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tag-video { position: absolute; left: 10px; bottom: 10px; background: var(--copper); color: #fff; font: 700 0.8rem/1 var(--f-head); padding: 6px 10px; border-radius: 3px; }
.post-body { padding: 18px 22px 24px; }
.post-body h3 { margin-bottom: 0.4em; }
.post-body h3 a { text-decoration: none; }
.post-body h3 a:hover { text-decoration: underline; }
.post-body p { color: var(--slate); margin: 0; }
.post-body .post-date { margin-bottom: 0.4em; }
.post-date { font: 600 0.92rem/1.3 var(--f-head); color: var(--slate); }
.pagehero .post-date { color: #cfd9e5; margin-bottom: 0.8em; }
.crumb { color: #fff; }
.crumb:hover { color: var(--copper-l); }
.pager { margin-top: 12px; }
.pager .page-numbers { display: inline-block; min-width: 44px; padding: 10px 14px; margin: 0 6px 6px 0; text-align: center; border: 1px solid var(--line); border-radius: 4px; font-weight: 700; text-decoration: none; }
.pager .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.article .prose p, .article .prose li { max-width: none; font-size: 1.1rem; }
.article .prose img { border-radius: 6px; height: auto; }
.article .prose h2 { font-size: 1.6rem; }
.article .prose h3 { margin-top: 1.4em; }
.article-img, .video { margin: 0 0 28px; }
.article-img img { width: 100%; border-radius: 6px; }
.video { position: relative; }
.video iframe, .article .prose iframe, .prose .wp-block-embed iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 6px; }
.article-back { margin-top: 36px; }

/* Social links */
.social { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.social li { margin: 0; }
.social a {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 11px;
	border: 1px solid var(--navy); border-radius: 999px; color: var(--navy); font-weight: 600; text-decoration: none;
}
.social a:hover { background: var(--navy); color: #fff; }
.social .soc-ic { flex: 0 0 auto; display: block; }
.social-labels a { padding: 0 16px 0 13px; }
.social .wechat { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.foot-social { margin-top: 14px; }
.foot-social a { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.foot-social .wechat { color: #fff; }
.foot-social a:hover { background: #fff; color: var(--navy); }

/* Mobile call bar */
.callbar { display: none; }
@media (max-width: 760px) {
	.callbar {
		display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line);
		box-shadow: 0 -6px 16px rgba(17, 38, 63, 0.12);
	}
	body { padding-bottom: 68px; }
	.section { padding: 56px 0; }
	.slope { padding-top: calc(var(--rise) + 48px); }
}

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

@media print {
	.site-header, .callbar, .nav-toggle { display: none; }
	.slope { clip-path: none; margin-top: 0; }
}

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px; margin-top: 28px; }
.member h3 { margin: 16px 0 2px; font-size: 1.15rem; }
.member-photo { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--mist); display: flex; align-items: center; justify-content: center; }
.member-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-initials { font: 800 3rem/1 var(--f-head); color: var(--navy-2); letter-spacing: 0.04em; }
.member-role { margin: 0 0 8px; color: var(--copper-d); font: 700 0.92rem/1.3 var(--f-head); }
.member-bio { margin: 0; color: var(--slate); font-size: 0.97rem; }
.lead-sm { color: var(--slate); max-width: 60ch; margin: 6px 0 0; }

/* Contact detail icons */
.info-line { display: flex; align-items: flex-start; gap: 10px; }
.info-line .info-ico { flex: none; margin-top: 0.2em; color: var(--copper-l); }
.contact-side .info-line .info-ico { color: var(--copper); }
.foot-phone + .x, .info-line.big-phone .info-ico { width: 24px; height: 24px; margin-top: 0.15em; }
.info-line a, .info-line span { min-width: 0; overflow-wrap: anywhere; }

/* Desktop header: keep the menu close to the logo and name instead of pushing it to the far right */
@media (min-width: 1321px) {
	.brand { margin-right: clamp(32px, 4vw, 64px); }
	.bar .site-nav { margin-right: auto; }
}

/* Header estimate button and FAQ page */
.topbar-cta { background: var(--copper); color: #fff; text-decoration: none; font: 700 0.85rem/1 var(--f-head); padding: 0.55rem 0.95rem; border-radius: 4px; white-space: nowrap; }
.topbar-cta:hover { background: var(--copper-d); color: #fff; }
@media (max-width: 760px) { .topbar-cta { display: none; } }
.faq-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.faq-jump a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--navy); font-size: 0.92rem; }
.faq-jump a:hover { border-color: var(--copper); color: var(--copper-d); }
.faq-h { margin-top: 48px; scroll-margin-top: 130px; }
#general { scroll-margin-top: 130px; }
.faq-more { margin: 14px 0 0; font-weight: 700; }
.faq-more a { color: var(--copper-d); text-decoration: none; }
.faq-more a:hover { text-decoration: underline; }

/* About: Who we are */
.who-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: start; }
.who-grid.who-single { grid-template-columns: minmax(0, 760px); }
.since { display: inline-block; background: var(--mist); color: var(--copper-d); font: 700 0.85rem/1 var(--f-head); letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 12px; border-radius: 4px; margin: 0 0 14px; }
.who-side h3 { margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 20px 14px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--copper); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--copper); }
.timeline strong { display: block; font: 800 1.1rem/1.2 var(--f-head); color: var(--navy); }
.timeline span { color: var(--slate); }
@media (max-width: 860px) { .who-grid { grid-template-columns: 1fr; gap: 28px; } }

/* Xiaohongshu: its own red with white lettering, as on the official icon; same button size as the others */
.social a.soc-xhs, .foot-social a.soc-xhs { background: #ff2442; border-color: #ff2442; color: #fff; padding: 0 9px; }
.social a.soc-xhs:hover, .foot-social a.soc-xhs:hover { background: #e01b38; border-color: #e01b38; color: #fff; }
.social a.soc-xhs .soc-ic { width: 26px; height: 26px; }
.social-labels a.soc-xhs { padding: 0 16px 0 9px; }
.topbar .social a.soc-xhs, .topbar .social a.soc-xhs:hover { background: transparent; border: 0; min-width: 30px; height: 30px; padding: 0; }
.topbar .social a.soc-xhs:hover { background: rgba(255, 255, 255, 0.16); }
.topbar .social a.soc-xhs .soc-ic { width: 21px; height: 21px; padding: 1px; box-sizing: border-box; background: #ff2442; border-radius: 5px; }
.who-services { list-style: none; margin: 4px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.who-services li { margin: 0; padding-left: 18px; position: relative; }
.who-services li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; background: var(--copper); border-radius: 2px; }
.who-services a { text-decoration: none; color: var(--navy); font-weight: 600; }
.who-services a:hover { color: var(--copper-d); text-decoration: underline; }
@media (max-width: 520px) { .who-services { grid-template-columns: 1fr; } }
.who-glance h3 { margin-bottom: 8px; }
.who-glance .btn { margin-top: 6px; }

/* Meet the beaver */
.beaver-intro { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.beaver-intro-img img { width: 100%; height: auto; display: block; border-radius: 14px; box-shadow: 0 10px 30px rgba(17, 38, 63, 0.18); }
.beaver-points { list-style: none; margin: 18px 0 0; padding: 0; }
.beaver-points li { padding: 0 0 14px 22px; position: relative; }
.beaver-points li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--copper); }
.beaver-points strong { color: var(--navy); }
.beaver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; margin-top: 28px; }
.beaver-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.beaver-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(17, 38, 63, 0.16); }
.beaver-card img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.beaver-card-body { display: block; padding: 14px 18px 18px; }
.beaver-card-body strong { display: block; font: 800 1.1rem/1.25 var(--f-head); color: var(--navy); margin-bottom: 4px; }
.beaver-card-body span { color: var(--slate); font-size: 0.97rem; }
.gear-wide, .gear-two figure { margin: 28px 0 0; }
.gear-wide img, .gear-two img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); }
.gear-two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.gear-wide figcaption, .gear-two figcaption { margin-top: 8px; color: var(--slate); font-size: 0.92rem; }
.beaver-cta { text-align: center; }
.beaver-cta .hero-actions { justify-content: center; }
@media (max-width: 860px) {
	.beaver-intro { grid-template-columns: 1fr; gap: 28px; }
	.beaver-intro-img { max-width: 420px; margin: 0 auto; }
	.gear-two { grid-template-columns: 1fr; }
}
.beaver-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.beaver-featured + .beaver-grid { margin-top: 24px; }
@media (max-width: 640px) { .beaver-featured { grid-template-columns: 1fr; } }
.beaver-grid:not(.beaver-featured) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) { .beaver-grid:not(.beaver-featured) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .beaver-grid:not(.beaver-featured) { grid-template-columns: 1fr; } }
