/* ==========================================================================
   Hightech Roofing — theme styles.
   Ported from the original one-pager (source/assets/styles.css). Section
   background/text/accent colours come from the engine's per-scheme <style>
   (bc_render_scheme_css ← theme/helpers.php bc_theme_palette), exposed as
   --sch-bg / --sch-text / --sch-muted / --sch-accent.
   ========================================================================== */

:root {
  --ink: #0b0e0c;
  --ink-soft: #151a16;
  --lime: #d5fb5a;
  --mist: #eff1eb;
  --muted: #a7afa6;
  --line: rgba(239, 241, 235, .16);
  --black-line: rgba(11, 14, 12, .13);
  --display: "Space Grotesk", "Arial Narrow", Arial, sans-serif;
  --header-h: 86px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--ink); color: var(--mist); font-family: Manrope, Arial, sans-serif; min-width: 320px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
main { display: block; }
.shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* Rule colour that follows the section scheme (light text → light rules). */
.dark, .charcoal { --rule: var(--line); }
.light, .grey, .cream, .gold-tint { --rule: rgba(11, 14, 12, .22); }

/* --- Eyebrow (colour from scheme accent via engine CSS) ------------------- */
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--lime); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--lime); border-radius: 50%; flex: none; }
.dark .eyebrow::before, .charcoal .eyebrow::before { box-shadow: 0 0 0 5px rgba(213,251,90,.12); }

/* --- Header (overlays the first, dark section of every page) ------------- */
.site-header-wrap { position: absolute; top: var(--bc-admin-bar-h, 0); left: 0; right: 0; z-index: 20; color: var(--mist); }
.site-header { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; letter-spacing: -.04em; font-size: 1.16rem; white-space: nowrap; }
.brand-word span { color: var(--lime); }
.brand .brand-mark { width: 27px; height: 27px; border: 2px solid var(--lime); transform: skewX(-18deg); position: relative; flex: none; }
.brand-mark::before { content: ''; position: absolute; height: 2px; width: 24px; background: var(--lime); transform: rotate(-46deg); top: 11px; left: -3px; }
.site-header nav { display: flex; gap: 27px; align-items: center; color: #c9cec5; font-size: .88rem; font-weight: 600; }
.site-header nav a:hover { color: var(--lime); }
.site-header nav .nav-cta { display: none; }
.nav-toggle { display: none; order: 3; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--mist); cursor: pointer; position: relative; }
.nav-toggle span[aria-hidden], .nav-toggle span[aria-hidden]::before, .nav-toggle span[aria-hidden]::after { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; transition: transform .2s; }
.nav-toggle span[aria-hidden] { top: 20px; }
.nav-toggle span[aria-hidden]::before, .nav-toggle span[aria-hidden]::after { content: ''; left: 0; right: 0; }
.nav-toggle span[aria-hidden]::before { top: -6px; }
.nav-toggle span[aria-hidden]::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span[aria-hidden] { background: transparent; }
.nav-toggle[aria-expanded="true"] span[aria-hidden]::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span[aria-hidden]::after { transform: translateY(-6px) rotate(-45deg); }

/* --- Buttons & links ------------------------------------------------------ */
.header-cta { white-space: nowrap; }
.header-cta, .button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 13px; padding: 14px 19px; border-radius: 4px; font-weight: 800; font-size: .84rem; cursor: pointer; transition: transform .2s ease, background .2s ease; background: var(--lime); color: var(--ink); }
.button:hover, .header-cta:hover { transform: translateY(-2px); background: #e4ff89; }
.text-link { color: inherit; font-size: .86rem; font-weight: 800; padding: 12px 0; }
.text-link:hover { color: var(--sch-accent, var(--lime)); }
.text-link span { color: var(--sch-accent, var(--lime)); padding-left: 7px; }

/* --- Typography ----------------------------------------------------------- */
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 800px; font-family: var(--display); letter-spacing: -.065em; font-size: clamp(3.35rem, 7vw, 6.5rem); line-height: .93; margin: 18px 0 28px; }
h1 em { color: var(--lime); font-style: normal; }
h2 { font-family: var(--display); font-size: clamp(2.45rem, 4vw, 4.35rem); letter-spacing: -.06em; line-height: 1; margin: 13px 0 0; }
h2 em { font-style: normal; color: var(--sch-accent); }

/* --- Hero ----------------------------------------------------------------- */
.hero { min-height: 645px; position: relative; overflow: hidden; padding-top: var(--header-h); }
.hero.dark { background: linear-gradient(112deg, #0b0e0c 38%, #151b17 100%); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .42; background-image: linear-gradient(rgba(213,251,90,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(213,251,90,.10) 1px, transparent 1px); background-size: 46px 46px; -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 65%); mask-image: linear-gradient(90deg, #000 0%, transparent 65%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center; padding: 93px 0 83px; }
.hero-copy { max-width: 540px; color: #c8cec4; font-size: 1.08rem; line-height: 1.7; margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .text-link { color: var(--mist); }
.hero .text-link:hover { color: var(--lime); }
.roof-spec { position: relative; min-height: 407px; border: 1px solid rgba(213,251,90,.34); background: rgba(9,12,10,.58); padding: 25px; display: flex; flex-direction: column; justify-content: space-between; backdrop-filter: blur(6px); }
.roof-spec::after { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(239,241,235,.08); pointer-events: none; }
.spec-top, .spec-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; color: var(--muted); font-family: var(--display); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.spec-top b { color: var(--lime); }
.roof-planes { position: absolute; inset: 74px 47px 62px; z-index: 0; transform: perspective(500px) rotateX(4deg); }
.plane { position: absolute; border: 2px solid var(--lime); background: linear-gradient(150deg, rgba(213,251,90,.20), rgba(213,251,90,.015)); }
.plane-a { inset: 0 42% 0 0; clip-path: polygon(0 100%, 59% 0, 100% 0, 41% 100%); }
.plane-b { inset: 0 0 0 38%; clip-path: polygon(0 0, 43% 0, 100% 100%, 59% 100%); }
.seams { position: absolute; inset: 6% 38% 6% 7%; background: repeating-linear-gradient(133deg, transparent 0 18px, rgba(213,251,90,.55) 19px 20px, transparent 21px 39px); transform: skewY(-6deg); }
.solar-grid { position: absolute; inset: 21% 10% 15% 51%; background-image: linear-gradient(rgba(213,251,90,.56) 1px, transparent 1px), linear-gradient(90deg, rgba(213,251,90,.56) 1px, transparent 1px); background-size: 22px 22px; transform: skewY(7deg); }
.stat-strip { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 27px 0; border-right: 1px solid var(--line); }
.stat:last-child { border: 0; padding-left: 29px; }
.stat + .stat { padding-left: 29px; }
.stat strong { display: block; font-family: var(--display); letter-spacing: -.045em; font-size: 2rem; color: var(--lime); }
.stat span { display: block; max-width: 205px; font-size: .78rem; font-weight: 700; color: var(--muted); line-height: 1.5; margin-top: 5px; }

/* Inner-page hero */
.page-hero { min-height: 0; }
.page-hero__inner { position: relative; padding: 88px 0 78px; }
.page-hero h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); }

/* Hero background photo (ht_hero_media): photo → ink overlay → grid → content.
   The overlay is darkest behind the headline (left) and along the bottom
   (stats / facts strip), so white text passes contrast on any photo. */
.hero > .page-head__bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; }
.hero > .page-head__bg picture, .hero > .page-head__bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero.has-photo > .page-head__overlay { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11,14,12,.93) 0%, rgba(11,14,12,.82) 38%, rgba(11,14,12,.42) 72%, rgba(11,14,12,.3) 100%),
              linear-gradient(0deg, rgba(11,14,12,.88) 0%, rgba(11,14,12,0) 34%),
              linear-gradient(180deg, rgba(11,14,12,.7) 0%, rgba(11,14,12,0) calc(var(--header-h) + 40px)); }
.hero.has-photo::before { z-index: 1; opacity: .22; }
.hero.has-photo > .shell { position: relative; z-index: 2; }
.hero.has-photo .roof-spec { background: rgba(9,12,10,.5); }
.hero > .bc-bg-controls { top: calc(var(--header-h) + 12px); }
/* Phones: text spans the full width, so darken evenly instead of left → right. */
@media (max-width: 820px) {
  .hero.has-photo > .page-head__overlay { background: linear-gradient(180deg, rgba(11,14,12,.82) 0%, rgba(11,14,12,.74) 45%, rgba(11,14,12,.9) 100%); }
}

/* --- Solutions (tabs) ----------------------------------------------------- */
.solutions { padding: 112px 0 106px; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: end; margin-bottom: 45px; }
.section-lead { max-width: 475px; margin: 0; color: var(--sch-muted, #576159); line-height: 1.7; font-size: 1rem; }
.solution-layout { display: grid; grid-template-columns: .92fr 1.08fr; min-height: 480px; border: 1px solid var(--black-line); }
.solution-tabs { display: grid; align-content: stretch; background: #e5e9e2; }
.solution-tab { appearance: none; width: 100%; text-align: left; display: grid; grid-template-columns: 52px 1fr 24px; gap: 16px; align-items: center; padding: 22px 26px; color: #4d554f; border: 0; border-bottom: 1px solid var(--black-line); background: transparent; cursor: pointer; transition: background .2s, color .2s; }
.solution-tab:last-child { border-bottom: 0; }
.solution-tab:hover, .solution-tab[aria-selected="true"] { color: var(--ink); background: var(--lime); }
.solution-tab .num { color: inherit; font-family: var(--display); font-size: .72rem; font-weight: 700; }
.solution-tab strong { font-family: var(--display); letter-spacing: -.035em; font-size: 1.25rem; }
.solution-tab span { font-size: 1.15rem; font-weight: 700; }
.solution-panels { display: grid; background: var(--ink); }
.solution-detail { position: relative; padding: 45px; background: var(--ink); color: var(--mist); overflow: hidden; }
.solution-detail[hidden] { display: none; }
.solution-detail::before { content: ''; position: absolute; width: 330px; height: 330px; border: 1px solid rgba(213,251,90,.25); border-radius: 50%; right: -112px; top: -120px; box-shadow: 0 0 0 36px rgba(213,251,90,.045), 0 0 0 72px rgba(213,251,90,.025); }
.detail-meta { color: var(--lime); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.detail-name { position: relative; max-width: 560px; font-family: var(--display); letter-spacing: -.055em; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1; margin: 19px 0 18px; }
.detail-text { position: relative; max-width: 500px; color: #b5bdb3; line-height: 1.7; }
.benefit-list { position: relative; list-style: none; padding: 0; margin: 38px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 13px 24px; }
.benefit-list li { border-top: 1px solid var(--line); padding-top: 11px; color: #dce0d9; font-size: .86rem; font-weight: 700; }
.benefit-list li::before { content: '— '; color: var(--lime); }
.solution-detail .detail-link { position: relative; display: inline-block; margin-top: 26px; color: var(--mist); }
.solution-detail .detail-link span { color: var(--lime); }

/* --- Sectors -------------------------------------------------------------- */
.commercial { padding: 112px 0; }
.commercial-top { display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 45px; }
.commercial-copy { font-size: 1rem; line-height: 1.7; color: var(--sch-muted); max-width: 450px; margin: 0 0 7px; }
.sector-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 53px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sector { padding: 28px 23px 30px 0; min-height: 193px; border-right: 1px solid var(--rule); }
.sector + .sector { padding-left: 23px; }
.sector:last-child { border-right: 0; }
.sector-index { display: inline-flex; width: 28px; height: 28px; border: 1px solid currentColor; opacity: .7; border-radius: 50%; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; }
.sector h3 { font-family: var(--display); font-size: 1.37rem; letter-spacing: -.04em; margin: 24px 0 8px; }
.sector h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.sector p { font-size: .84rem; color: var(--sch-muted); line-height: 1.55; margin: 0; }

/* --- Process -------------------------------------------------------------- */
.process { padding: 112px 0; }
.process-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 49px; }
.process-head h2 { max-width: 600px; }
.process-label { padding-bottom: 8px; color: var(--sch-muted); max-width: 280px; font-size: .84rem; line-height: 1.6; margin: 0; }
.process-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
.process-item { padding: 25px 22px 18px 0; border-right: 1px solid var(--rule); min-height: 215px; }
.process-item + .process-item { padding-left: 22px; }
.process-item:last-child { border-right: 0; }
.process-num { color: var(--sch-accent); font: 700 .76rem var(--display); letter-spacing: .1em; }
.process-item h3 { font: 700 1.3rem var(--display); letter-spacing: -.04em; margin: 43px 0 8px; }
.process-item p { margin: 0; color: var(--sch-muted); font-size: .82rem; line-height: 1.55; }

/* --- CTA box -------------------------------------------------------------- */
.cta { padding: 93px 0 34px; }
.cta-box { padding: 48px; background: var(--ink); color: var(--mist); display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 35px; position: relative; overflow: hidden; }
.cta-box .eyebrow { color: var(--lime); }
.cta-box .eyebrow::before { background: var(--lime); box-shadow: 0 0 0 5px rgba(213,251,90,.12); }
.cta-box::after { content: 'HTR'; position: absolute; right: -20px; bottom: -49px; color: transparent; font-family: var(--display); font-size: 13rem; font-weight: 700; letter-spacing: -.1em; -webkit-text-stroke: 1px rgba(213,251,90,.2); pointer-events: none; }
.cta h2 { max-width: 650px; }
.cta-box h2 em { color: var(--lime); }
.cta-box p { position: relative; z-index: 1; margin: 0 0 8px; max-width: 350px; color: #b7beb4; font-size: .96rem; line-height: 1.7; }
.cta-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cta-box .text-link { color: var(--mist); }
.cta-box .text-link span { color: var(--lime); }

/* --- FAQ ------------------------------------------------------------------ */
.faq { padding: 100px 0; }
.faq-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; align-items: start; }
.faq-list { border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item summary { cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.03em; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 4px; top: 18px; font-size: 1.5rem; color: var(--sch-accent); }
.faq-item[open] summary::after { content: '–'; }
.faq-answer { padding: 0 0 22px; color: var(--sch-muted); line-height: 1.7; max-width: 680px; }
.faq-answer p:last-child { margin-bottom: 0; }

/* --- Prose (long-form) ---------------------------------------------------- */
.prose { padding: 80px 0; }
.wrap-narrow { width: min(760px, calc(100% - 48px)); margin: 0 auto; }
.prose .wrap-narrow { line-height: 1.75; font-size: 1.02rem; }
.prose h2 { font-size: clamp(1.9rem, 3vw, 2.7rem); margin: 1.4em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--display); font-size: 1.4rem; letter-spacing: -.03em; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.4em 0; padding-left: 20px; border-left: 3px solid var(--sch-accent); color: var(--sch-muted); }
.prose a:not(.button) { color: var(--sch-accent); text-decoration: underline; text-underline-offset: 3px; }

/* --- Contact form --------------------------------------------------------- */
.contact-section { padding: 90px 0; }
.contact-section .section-title { font-family: var(--display); font-size: clamp(2.2rem, 4vw, 3.6rem); letter-spacing: -.06em; line-height: 1; margin: 13px 0 16px; }
.contact-section .lede { line-height: 1.7; }
.bc-form { margin-top: 28px; display: grid; gap: 16px; }
.bc-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bc-form__field { display: grid; gap: 6px; }
.bc-form__field > span { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sch-muted); }
.bc-form input, .bc-form textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--rule); border-radius: 4px; font: inherit; background: transparent; color: inherit; }
.bc-form input:focus, .bc-form textarea:focus { outline: none; border-color: var(--sch-accent); }
.bc-form button { justify-self: start; border: 0; padding: 14px 22px; border-radius: 4px; font-weight: 800; background: var(--lime); color: var(--ink); cursor: pointer; }
.form-notice { padding: 12px 16px; border-radius: 4px; margin: 16px 0; font-size: 15px; }
.form-notice--ok  { background: rgba(46,160,67,.12); border: 1px solid rgba(46,160,67,.5); }
.form-notice--err { background: rgba(220,80,80,.12); border: 1px solid rgba(220,80,80,.5); }

/* --- Footer --------------------------------------------------------------- */
.site-footer-wrap { background: var(--mist); color: #4d554f; border-top: 1px solid var(--black-line); }
.footer-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 48px; padding: 64px 0 40px; }
.footer-brand__name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.04em; color: var(--ink); }
.footer-brand__name span, .site-footer strong span { color: #47711a; }
.footer-brand p { margin: 10px 0 0; font-size: .9rem; line-height: 1.6; max-width: 280px; }
.footer-contact { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--ink); }
.footer-cta { display: inline-flex; margin-top: 22px; padding: 12px 16px; border-radius: 4px; background: var(--ink); color: var(--lime); font-weight: 800; font-size: .82rem; }
.footer-cta:hover { background: #1b221c; }
.footer-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.fgroup__toggle { all: unset; display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #47711a; margin-bottom: 14px; }
.fgroup__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.fgroup__list a { font-size: .9rem; font-weight: 600; color: #3a423c; }
.fgroup__list a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer { padding: 22px 0 34px; border-top: 1px solid var(--black-line); display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: .76rem; font-weight: 700; flex-wrap: wrap; }
.site-footer strong { color: var(--ink); }

/* Phones: link groups become an accordion (main.js collapses them). */
@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr; gap: 28px; padding: 44px 0 20px; }
  .footer-nav { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--black-line); }
  .fgroup { border-bottom: 1px solid var(--black-line); }
  .fgroup__toggle { box-sizing: border-box; width: 100%; margin: 0; padding: 18px 36px 18px 0; min-height: 48px; position: relative; cursor: pointer; font-size: .8rem; color: var(--ink); }
  .fgroup__toggle::after { content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; font-weight: 700; color: #47711a; transition: transform .2s; }
  .fgroup__toggle[aria-expanded="true"]::after { content: '–'; }
  .fgroup__toggle:focus-visible { outline: 2px solid #47711a; outline-offset: 2px; }
  .fgroup__list { padding: 0 0 18px; gap: 0; }
  .fgroup__list a { display: block; padding: 12px 0; font-size: 1rem; }   /* ≥ 48px tap targets */
  .fgroup.is-collapsed .fgroup__list { display: none; }
}

/* --- Breadcrumbs ---------------------------------------------------------- */
.crumbs ol { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a:hover { color: var(--lime); }
.crumbs [aria-current] { color: var(--mist); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Key-facts strip under inner-page heroes */
.fact-strip { margin: 0; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.fact-strip dt { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact-strip dd { margin: 6px 0 0; font-family: var(--display); font-size: 1.45rem; letter-spacing: -.035em; color: var(--lime); }
.fact-strip .stat:last-child { padding-left: 29px; }
.fact-strip .stat:first-child { padding-left: 0; }

/* --- Rich text (overview / prose / articles) ----------------------------- */
.rich { line-height: 1.75; font-size: 1.02rem; min-width: 0; }
.rich > :first-child { margin-top: 0; }
.rich h2 { font-size: clamp(1.9rem, 3vw, 2.7rem); margin: 1.5em 0 .5em; }
.rich h3 { font-family: var(--display); font-size: 1.35rem; letter-spacing: -.03em; margin: 1.5em 0 .4em; }
.rich p, .rich ul, .rich ol { margin: 0 0 1.05em; }
.rich ul, .rich ol { padding-left: 1.3em; }
.rich li { margin-bottom: .45em; }
.rich li::marker { color: var(--sch-accent); }
.rich a:not(.button) { color: inherit; text-decoration: underline; text-decoration-color: var(--sch-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.rich a:not(.button):hover { color: var(--sch-accent); }
.rich blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--sch-accent); color: var(--sch-muted); }
.rich table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .92rem; line-height: 1.5; }
.rich th, .rich td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
.rich thead th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sch-muted); border-bottom-width: 2px; }
.rich tbody th { font-weight: 800; }
.rich figure { margin: 2em 0; }
.rich figure img { width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; }
.rich figcaption { margin-top: 10px; font-size: .84rem; line-height: 1.55; color: var(--sch-muted); }
.rich figure.photo img { border: 0; background: #e5e9e2; aspect-ratio: 3 / 2; object-fit: cover; }
.rich figcaption .credit { display: block; margin-top: 4px; font-size: .72rem; opacity: .85; }
.rich figcaption .credit a { text-decoration-thickness: 1px; }
@media (max-width: 820px) { .rich figure { margin-inline: 0; } }

/* --- Overview (text + sticky facts aside) -------------------------------- */
.overview { padding: 96px 0; }
.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: start; }
.overview-layout .rich { max-width: 740px; }
.overview-aside { position: sticky; top: calc(var(--bc-admin-bar-h, 0px) + 24px); }
.aside-card { background: var(--ink); color: var(--mist); padding: 30px; }
.aside-card p { color: #b5bdb3; font-size: .9rem; line-height: 1.6; margin: 18px 0 20px; }
.fact-list { margin: 16px 0 0; }
.fact-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.fact-list dt { color: var(--muted); font-weight: 700; }
.fact-list dd { margin: 0; text-align: right; font-weight: 800; }

/* --- Link cards ------------------------------------------------------------ */
.links { padding: 96px 0; }
.link-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.link-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 28px 26px 30px; min-height: 190px; background: var(--sch-bg); transition: background .2s, color .2s; }
.link-card:hover { background: var(--lime); color: var(--ink); }
.link-card__kicker { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--sch-accent); }
.link-card:hover .link-card__kicker, .link-card:hover .link-card__desc { color: var(--ink); }
.link-card__title { font-family: var(--display); font-size: 1.4rem; letter-spacing: -.04em; line-height: 1.1; padding-right: 26px; }
.link-card__desc { font-size: .88rem; line-height: 1.6; color: var(--sch-muted); }
.link-card__arrow { position: absolute; top: 24px; right: 24px; font-weight: 800; }

/* --- Cost calculator ------------------------------------------------------- */
.calculator { padding: 100px 0; }
.calc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); border: 1px solid var(--black-line); }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; padding: 34px; background: #e5e9e2; color: var(--ink); align-content: start; }
.calc-field { display: grid; gap: 7px; }
.calc-field[hidden] { display: none; }
.calc-field--wide { grid-column: 1 / -1; }
.calc-field span { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #4d554f; }
.calc select, .calc input, .bc-form select { width: 100%; padding: 12px 13px; border: 1px solid rgba(11,14,12,.25); border-radius: 4px; font: inherit; font-weight: 600; background: #fff; color: var(--ink); }
.calc select:focus, .calc input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.calc-result { padding: 34px; background: var(--ink); color: var(--mist); display: flex; flex-direction: column; gap: 6px; }
.calc-total { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.05em; line-height: 1.05; color: var(--lime); margin-top: 12px; }
.calc-psf { font-weight: 700; color: #c8cec4; }
.calc-note { color: #b5bdb3; font-size: .86rem; line-height: 1.6; margin: 10px 0 0; }
.calc-note[hidden] { display: none; }
.calc-result .cta-actions { margin-top: 18px; }
.calc-result .text-link { color: var(--mist); }
.calc-result .text-link span { color: var(--lime); }
.calc-result .text-link[hidden] { display: none; }
.calc-disclaimer { margin: 18px 0 0; font-size: .8rem; line-height: 1.6; color: var(--sch-muted); max-width: 900px; }
.calc-table { margin-top: 64px; }
.calc-table h3 { font-family: var(--display); font-size: 1.6rem; letter-spacing: -.04em; margin: 0 0 18px; }
.table-scroll { overflow: auto; border: 1px solid var(--rule); max-height: 620px; }
.calc-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.calc-table th, .calc-table td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.calc-table thead th { position: sticky; top: 0; background: var(--sch-bg); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sch-muted); z-index: 1; }
.calc-table .text-link { padding: 0; font-size: .8rem; }

/* --- Contact layout ------------------------------------------------------ */
.contact-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 60px; align-items: start; }
.contact-steps { list-style: none; counter-reset: step; margin: 34px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.contact-steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.contact-steps li::before { content: "0" counter(step); grid-row: span 2; font: 700 .76rem var(--display); color: var(--sch-accent); padding-top: 4px; }
.contact-steps strong { font-family: var(--display); font-size: 1.1rem; letter-spacing: -.03em; }
.contact-steps span { font-size: .88rem; color: var(--sch-muted); line-height: 1.55; }
.contact-card { background: #fff; color: var(--ink); padding: 34px; border: 1px solid var(--black-line); }
.contact-card .bc-form { margin-top: 0; }
.contact-card input, .contact-card textarea, .contact-card select { border-color: rgba(11,14,12,.25); background: #fff; color: var(--ink); }
.contact-card .bc-form__field > span { color: #4d554f; }
.form-privacy { font-size: .78rem; color: #576159; margin: 0; }
.form-privacy a { text-decoration: underline; }

/* Article header */
.article-head .eyebrow span { color: inherit; }
.article-author { color: var(--muted); font-weight: 700; font-size: .86rem; }
.article-body { padding: 72px 0 40px; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 820px) {
  :root { --header-h: 74px; }
  .overview-layout, .calc, .contact-layout { grid-template-columns: 1fr; }
  .overview-layout, .contact-layout { gap: 40px; }
  .overview-aside { position: static; }
  .link-grid { grid-template-columns: 1fr 1fr; }
  .overview, .links, .calculator { padding: 72px 0; }
  .fact-strip { grid-template-columns: 1fr 1fr; }
  .fact-strip .stat:last-child { grid-column: auto; border-top: 0; }
  .shell { width: min(100% - 32px, 1240px); }
  .nav-toggle { display: block; }
  .site-header { gap: 12px; }
  .site-header .brand { margin-right: auto; }
  .site-header nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 18px; background: var(--ink); border-bottom: 1px solid var(--line); font-size: 1rem; }
  .site-header nav.is-open { display: flex; }
  .site-header nav a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .site-header nav a:last-child { border-bottom: 0; }
  .site-header nav .nav-cta { display: block; color: var(--lime); font-weight: 800; }
  .header-cta { padding: 11px 13px; font-size: .76rem; }
  .hero { min-height: auto; }
  .hero-grid, .section-head, .commercial-top, .cta-box, .faq-layout { grid-template-columns: 1fr; }
  .hero-grid { padding: 66px 0 52px; gap: 38px; }
  h1 { font-size: clamp(3.25rem, 13vw, 5.1rem); }
  .roof-spec { min-height: 330px; }
  .stat-strip, .sector-grid, .process-list { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:last-child { padding-left: 0; grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .solution-layout { grid-template-columns: 1fr; }
  .solution-tabs { grid-template-columns: 1fr 1fr; }
  .solution-tab:nth-child(odd) { border-right: 1px solid var(--black-line); }
  .solution-tab:nth-last-child(-n+2) { border-bottom: 0; }
  .commercial, .solutions, .process, .faq { padding: 78px 0; }
  .sector:nth-child(2) { border-right: 0; }
  .sector:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .process-item:nth-child(2) { border-right: 0; }
  .process-item:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .process-head { display: block; }
  .process-label { margin-top: 17px; }
  .faq-layout { gap: 26px; }
}
@media (max-width: 520px) {
  .site-header .header-cta { display: none; }
  .link-grid, .calc-form, .fact-strip { grid-template-columns: 1fr; }
  .calc-form, .calc-result, .contact-card, .aside-card { padding: 24px 20px; }
  .fact-strip .stat, .fact-strip .stat:last-child { padding-left: 0; }
  .brand { font-size: 1rem; } .brand .brand-mark { width: 23px; height: 23px; }
  .header-cta { padding: 9px 10px; font-size: .72rem; }
  .roof-planes { inset: 76px 30px 57px; }
  .stat-strip, .sector-grid, .process-list, .solution-tabs { grid-template-columns: 1fr; }
  .stat, .stat + .stat, .stat:last-child { padding: 21px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .solution-tab, .solution-tab:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--black-line); }
  .solution-tab:nth-last-child(-n+2) { border-bottom: 1px solid var(--black-line); }
  .solution-tab:last-child { border-bottom: 0; }
  .solution-detail { padding: 34px 25px; }
  .benefit-list { grid-template-columns: 1fr; }
  .sector, .sector + .sector, .process-item, .process-item + .process-item { padding: 23px 0; border-right: 0; border-top: 1px solid var(--rule); }
  .sector:first-child, .process-item:first-child { border-top: 0; }
  .cta { padding-top: 55px; } .cta-box { padding: 34px 25px; }
  .site-footer { display: block; line-height: 1.8; }
  .bc-form__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .header-cta { transition: none; }
}

/* ==========================================================================
   Mobile optimisation (home first, shared blocks benefit everywhere).
   Desktop is untouched: everything below is inside max-width queries, except
   the stretched sector link, which is a better tap target at any width.
   ========================================================================== */

/* Whole sector card is the link (was: 28px-tall title only). Guests only —
   in the admin the overlay would block inline editing. */
.sector { position: relative; }
body:not([data-document-slug]) .sector h3 a::after { content: ''; position: absolute; inset: 0; }
.sector:has(h3 a):hover { background: rgba(11, 14, 12, .04); }

@media (max-width: 820px) {
  /* Tap targets ≥ 44px */
  .brand { padding-block: 11px; }
  .nav-toggle { width: 44px; height: 44px; }
  .text-link { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-brand__name { display: inline-block; padding-block: 9px; }
  .footer-cta { min-height: 44px; align-items: center; }

  /* Hero: decorative schematic smaller and cheaper; stats on one row */
  .roof-spec { min-height: 230px; backdrop-filter: none; background: rgba(9,12,10,.8); }
  .roof-planes { inset: 52px 34px 74px; }
  .hero h1 br { display: none; }   /* let the headline wrap naturally on phones */
  .stat-strip:not(.fact-strip) { grid-template-columns: repeat(3, 1fr); }
  .stat-strip:not(.fact-strip) .stat, .stat-strip:not(.fact-strip) .stat + .stat,
  .stat-strip:not(.fact-strip) .stat:last-child { padding: 18px 10px 18px 0; border-right: 1px solid var(--line); border-top: 0; border-bottom: 0; grid-column: auto; }
  .stat-strip:not(.fact-strip) .stat + .stat { padding-left: 12px; }
  .stat-strip:not(.fact-strip) .stat:last-child { border-right: 0; }
  .stat strong { font-size: 1.5rem; }
  .stat span { font-size: .72rem; }

  /* Solutions: tabs become a horizontal, swipeable strip */
  .solution-tabs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .solution-tabs::-webkit-scrollbar { display: none; }
  .solution-tab, .solution-tab:nth-child(odd), .solution-tab:nth-last-child(-n+2), .solution-tab:last-child {
    flex: 0 0 auto; width: auto; scroll-snap-align: start; display: inline-flex; gap: 8px; padding: 12px 16px; min-height: 44px;
    border: 1px solid var(--black-line); border-radius: 999px; background: #fff; white-space: nowrap; }
  .solution-tab strong { font-size: 1rem; }
  .solution-tab span[aria-hidden] { display: none; }
  .solution-layout { min-height: 0; }

  /* Cards: drop desktop minimum heights */
  .sector, .process-item, .link-card { min-height: 0; }
  .process-item h3 { margin-top: 14px; }
  .sector h3 { margin-top: 14px; }
}

@media (max-width: 520px) {
  main section.solutions, main section.commercial, main section.process, main section.overview,
  main section.links, main section.faq, main section.calculator, main section.contact-section { padding: 56px 0; }
  .cta { padding-top: 40px; }
  h2 { font-size: 2rem; }
  .detail-name { font-size: 1.85rem; }
  .section-head { margin-bottom: 28px; gap: 14px; }
  .commercial-top { gap: 14px; }
  .process-head { margin-bottom: 24px; }

  /* Sectors: two compact columns instead of four tall rows */
  .sector-grid { grid-template-columns: 1fr 1fr; margin-top: 32px; }
  .sector, .sector + .sector { padding: 18px 12px 20px; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); }
  .sector:nth-child(2n) { border-right: 0; }
  .sector:nth-child(-n+2) { border-top: 0; }
  .sector h3 { font-size: 1.15rem; margin: 10px 0 6px; }
  .sector p { font-size: .8rem; }

  .process-item, .process-item + .process-item { padding: 18px 0; }
  .link-card { padding: 20px 18px 22px; }
  .link-card__title { font-size: 1.2rem; }
  .cta-box::after { font-size: 8rem; bottom: -30px; }
}

/* --- Mobile optimisation: inner pages, calculator, articles --------------- */
.calc-live { display: none; }
.mobile-cta[hidden] { display: none !important; }

@media (max-width: 820px) {
  /* Breadcrumbs, photo credits, privacy link: 44px tap area without moving layout */
  .crumbs a, .rich figcaption .credit a, .form-privacy a { display: inline-block; padding: 14px 0; margin: -14px 0; }

  /* Inner-page hero: less padding, smaller headline, facts in one compact row */
  .page-hero__inner { padding: 36px 0 32px; }
  .crumbs ol { margin-bottom: 16px; }
  .page-hero h1 { font-size: clamp(2.2rem, 10vw, 2.9rem); margin: 14px 0 18px; }
  .page-hero .hero-copy { font-size: 1rem; margin-bottom: 22px; }
  .fact-strip, .fact-strip.stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact-strip .stat, .fact-strip .stat + .stat, .fact-strip .stat:last-child { padding: 14px 8px 16px 0; border-right: 1px solid var(--line); border-top: 0; border-bottom: 0; }
  .fact-strip .stat + .stat { padding-left: 10px; }
  .fact-strip .stat:last-child { border-right: 0; }
  .fact-strip dt { font-size: .6rem; letter-spacing: .08em; }
  .fact-strip dd { font-size: .95rem; line-height: 1.2; }

  /* Overview aside after the text: a compact summary, not a second page */
  .overview-layout { gap: 32px; }
  .aside-card { padding: 22px 20px; }
  .fact-list > div { padding: 9px 0; }

  /* Calculator: live total pinned to the bottom while editing the fields */
  .calc-form { position: relative; }
  .calc-live { display: flex; position: sticky; bottom: 0; z-index: 5; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 10px;
    margin: 6px -34px -34px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--mist); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .calc-live strong { font-family: var(--display); font-size: 1.15rem; letter-spacing: -.02em; text-transform: none; color: var(--lime); }
  .calc-table { margin-top: 40px; }
  .calc-table h3 { font-size: 1.25rem; }
  .table-scroll { max-height: 480px; }

  /* Articles and long text */
  .article-body { padding: 40px 0 24px; }
  .rich { font-size: 1rem; line-height: 1.7; }
  .rich h2 { font-size: 1.7rem; margin-top: 1.3em; }
  .rich h3 { font-size: 1.2rem; }
  .faq-item summary { font-size: 1.05rem; padding: 18px 36px 18px 0; }

  /* Thumb-reach action bar */
  .mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(11, 14, 12, .96); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .25); }
  .mobile-cta a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 4px; font-weight: 800; font-size: .9rem; }
  .mobile-cta__primary { background: var(--lime); color: var(--ink); }
  .mobile-cta__secondary { border: 1px solid var(--line); color: var(--mist); }
  body.has-mobile-cta { padding-bottom: 72px; }
}

@media (max-width: 520px) {
  .calc-form { gap: 14px; }
  .calc-live { margin: 6px -20px -24px; }

  /* Related-link grids: 2 compact columns (title only); the guides list keeps
     its descriptions because they are the reason to click. */
  .links:not(.postlist) .link-grid { grid-template-columns: 1fr 1fr; }
  .links:not(.postlist) .link-card { padding: 16px 14px 18px; gap: 6px; }
  .links:not(.postlist) .link-card__desc { display: none; }
  .links:not(.postlist) .link-card__title { font-size: 1.02rem; padding-right: 14px; }
  .links:not(.postlist) .link-card__kicker { font-size: .62rem; }
  .links:not(.postlist) .link-card__arrow { top: 14px; right: 12px; font-size: .85rem; }
  .postlist .link-card__desc { font-size: .85rem; }

  .contact-card { padding: 22px 18px; }
  .contact-steps li { padding: 14px 0; }
}

/* Glossary links (contractorsglossary.com): dotted underline = "definition". */
.rich a.gloss { text-decoration-style: dotted; text-decoration-thickness: 1.5px; }
.rich a.gloss:hover { text-decoration-style: solid; }
