/* Accessibility corrections preserve all approved hero geometry and media. */
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .desktopnav .gdb-nav-portal,
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .desktopnav .gdb-nav-portal:hover,
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .desktopnav .gdb-nav-portal:focus-visible {
  color: var(--orange);
}
/* Client Portal retains brand orange; the hover indicator is black. */
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .desktopnav .gdb-nav-portal::after {
  background: var(--ink-900);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .desktopnav .gdb-nav-portal:focus-visible::after {
  right: 0;
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .mobilemenu .gdb-nav-portal:hover,
body:is(.gdb-redesign,.gdb-newchrome-legacy) > header .mobilemenu .gdb-nav-portal:focus-visible {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-color: var(--ink-900);
}
body main .eyebrow:not(.home-hero-eyebrow) { color: var(--ink-600); }
body main .gdb-review-carousel .eyebrow { color: var(--accent-500); }
body main .service-planning :is(h2,h3),
body main .planning-items h3,
body > footer .footer-grid :is(h2,h3) { color: var(--white); }
body main .step-num,
body main .credential-review span[aria-hidden],
body main .guide-card a > span[aria-hidden] { color: var(--accent-text); }
body main .nf h1 { color: inherit; }
body main .nf .btn { color: var(--ink-800); }

body.homepage #process .step-num,
body.homepage #credentials .home-rating-value span[aria-hidden],
body.homepage main .guides a > span[aria-hidden] { color: var(--accent-text) !important; }

/* Motion control lives in the footer; the approved hero remains untouched. */
.gdb-footer-video-toggle {
  appearance: none; background: none; border: 0; padding: 0;
  color: var(--white); font: inherit; text-align: left;
  text-decoration: underline; cursor: pointer;
}
.gdb-footer-video-toggle[hidden] { display: none; }
.gdb-footer-video-toggle:focus-visible { outline: auto; outline-offset: var(--space-3xs); }


/* Legacy pages only. The approved redesigned homepage/hero is excluded. */
body.v2 main .btn:not(.btn--ghost) {
  color: var(--ink-800);
}
body.v2 main .next__card > span:not(.blog__ph):not(.blog__meta) {
  color: var(--accent-text);
}
body.v2 main .grev .grev__rate b,
body.v2 main .pg .pg__top .eyebrow,
body.v2 main .ty .eyebrow,
body.v2 main .ty .ty__h {
  color: var(--white);
}

/* Process text stays readable before its progress marker reaches the scroll line. */
body.v2 main .sx.anim .sproc li { opacity: 1; }

/* Correct heading levels without changing the existing article type scale. */
body.v2 .prose h2:is(
  [id="1-the-building-envelope-insulation--air-sealing"],
  [id="2-modernizing-the-electrical--smart-systems"],
  [id="3-high-roi-kitchen--bath-maintenance"],
  [id="4-basement-waterproofing--backwater-valves"],
  [id="5-curb-appeal-with-a-structural-purpose"],
  [id="the-grand-design-build-approach"],
  [id="1-upgrade-to-a-modern-kitchen"],
  [id="2-create-a-spa-like-bathroom"],
  [id="3-add-smart-home-features"],
  [id="4-design-a-walk-in-closet"],
  [id="5-refresh-your-outdoor-space"],
  [id="6-use-high-quality-finishes"],
  [id="7-improve-lighting"],
  [id="key-changes-in-bill-17-that-affect-custom-home-projects"],
  [id="custom-homes-and-infill-builds-expected-to-surge-in-toronto"],
  [id="why-this-matters-for-homeowners"]
) {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  margin-block-start: var(--space-xl);
}


/* Service accessibility corrections: color only; approved geometry is unchanged. */
body.service-page main .service-planning .eyebrow {
  color: var(--white);
}

/* The small numbered labels sit on pale service-section backgrounds. */
body.service-expanded-page #main :is(.sfeat__n, .sproc__n) {
  color: var(--accent-text);
}

/* These two review carousels retain their dark background. */
body:is(.service-design-and-permits, .service-project-management) #main .gdb-review-heading .eyebrow {
  color: var(--white);
}

/* The laneway review heading remains on the existing pale section background. */
body.service-laneway-housing #main #reviews :is(#rev-h, .grev__rate b, .grev__head .link, .gdb-review-heading .link) {
  color: var(--ink-800);
}
body.service-laneway-housing #main #reviews :is(.grev__count, .gdb-review-heading .eyebrow) {
  color: var(--ink-600);
}


/* Main desktop navigation only. Preserve header height, dropdowns and mobile. */
@media(min-width:1051px){
 body:is(.gdb-redesign,.gdb-newchrome-legacy) > header nav.desktopnav{
  --nav-item-gap:calc(var(--space-s) + var(--space-3xs));
  gap:var(--nav-item-gap);
  font-size:var(--font-nav-size);
  font-weight:var(--weight-medium);
 }
 body:is(.gdb-redesign,.gdb-newchrome-legacy) > header nav.desktopnav > :is(a,div){position:relative}
 body:is(.gdb-redesign,.gdb-newchrome-legacy) > header nav.desktopnav > :is(a,div):not(:first-child)::before{
  content:"";position:absolute;
  left:calc(var(--nav-item-gap) / -2);
  top:50%;transform:translateY(-50%);
  width:var(--stroke-hairline);height:var(--space-s);
  background:color-mix(in srgb,var(--text) 12%,transparent);
  pointer-events:none;
 }
}
@media(min-width:1051px) and (max-width:1279px){
 body:is(.gdb-redesign,.gdb-newchrome-legacy) > header nav.desktopnav{
  --nav-item-gap:calc(var(--space-xs) + var(--space-3xs) / 2);
  font-size:var(--step--1);
 }
}


/* Neutral section surfaces only. Header, heroes, hero benefits and media are excluded. */
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer {
  background-color: var(--brand-700);
  color: var(--text-inverse);
}
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer .footer-grid :is(h2,h3) {
  color: var(--text-inverse);
}
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer .footer-grid :is(p,a),
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer .footer-bottom {
  color: var(--text-inverse-muted);
}
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer .footer-bottom {
  border-top-color: var(--text-muted);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) main > .related-services {
  background-color: var(--brand-50);
}

body:is(.gdb-redesign,.gdb-newchrome-legacy) main > section:not(:where(.hero,.service-hero,.company-hero,.area-hero,#top,#why-choose-us,.gdb-review-carousel)) {
  --bg: var(--text-inverse);
  --bg-subtle: var(--brand-50);
  --text: var(--brand-700);
  --paper: var(--bg-subtle);
  --white: var(--bg);
  --ink: var(--text);
  --text-muted: var(--brand-500);
  --muted: var(--text-muted);
  --line: var(--border-strong);
  --deep: var(--text);
  --service-tint: var(--bg-subtle);
  background-color: var(--bg);
  color: var(--text);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) main > :is(.scope-section,.projects-section,.company-services,.home-contact-editorial,.contact-form-section,.gallery-notes,.gallery-close,.source-service-proof,.area-proof,.sx--tint,.sx--warm,.faq,.area-directory-section) {
  background-color: var(--bg-subtle);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) main > :is(.service-planning,.areas,.cband) {
  --muted: var(--text-inverse-muted);
  --service-tint: var(--brand-700);
  background-color: var(--brand-700);
  color: var(--text-inverse);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) main > :is(.service-planning,.areas,.cband) :is(h2,h3,a,.areas__ask) {
  color: var(--text-inverse);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) main > :is(.service-planning,.areas,.cband) :is(p,li,.sec-sub,.eyebrow,.areas__more,.areas__askb) {
  color: var(--text-inverse-muted);
}
body:is(.gdb-redesign,.gdb-newchrome-legacy) main > :is(.service-planning,.areas,.cband) :is(.btn:not(.btn--ghost),.button) {
  color: var(--brand-700);
}

/* Guide templates share the legacy colour ramp, independent of their layout. */
body:is(.guides-index,.guides-article) main {
  --ink-800: var(--brand-700);
  --ink-700: var(--brand-600);
  --ink-600: var(--brand-500);
  --ink-500: var(--brand-500);
  --ink-400: var(--brand-300);
  --ink-200: var(--border-strong);
  --ink-100: var(--border);
  --ink-50: var(--brand-50);
  --white: var(--text-inverse);
}

/* Legacy v2 palettes shadow the neutral ramp. Rebind only their review surfaces. */
body.gdb-newchrome-legacy main .gdb-review-carousel {
  --ink-800: var(--text);
  --ink-700: var(--text-muted);
  --ink-50: var(--text-inverse);
  --ink-300: var(--text-inverse-muted);
}
body.area-layout-page main section.grev.gdb-review-carousel {
  --white: var(--bg);
}
body.area-layout-page main .grev .gdb-review-heading :is(p,.grev__count) {
  color: var(--text-muted);
}
body.area-layout-page main .grev .gdb-review-heading .eyebrow {
  color: var(--accent-text);
}

/* Shared copyright and owner-requested in-house team credit. */
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer .footer-bottom > .footer-copyright {
  display:block;
  max-width:var(--measure-narrow);
}
html body:is(.gdb-redesign,.gdb-newchrome-legacy) > footer .footer-team-credit {
  margin:var(--space-2xs) 0 0;
  color:var(--text-inverse-muted);
  font-size:inherit;
  line-height:var(--leading-normal);
}


/* Approved mobile-only film, copy and benefits sequence. Desktop is unchanged. */
@media (max-width:700px) {
  /* Allen-approved screenshot: normal page space, never a fixed white rail. */
  body .home-opening {
    padding-top:var(--space-xs);
    padding-bottom:calc(var(--space-2xl) + var(--space-s));
    min-height:calc(100svh - var(--gdb-opening-header, var(--mobile-home-header-fallback)));
    box-sizing:border-box;
    background:var(--white);
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay {
    display:flex;
    flex-direction:column;
    height:auto;
    min-height:0;
    aspect-ratio:auto;
    background:var(--white);
    overflow:visible;
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .hero-photo.gdb-hero-video {
    order:0;
    position:relative;
    inset:auto;
    flex:none;
    width:100%;
    height:auto;
    aspect-ratio:var(--mobile-home-video-ratio);
    margin:0;
    overflow:hidden;
  }
  body .home-opening .home-hero-overlay .gdb-hero-video-stage {
    width:100%;
    height:auto;
    aspect-ratio:var(--mobile-home-video-ratio);
  }
  body .home-opening .home-hero-overlay .gdb-hero-video-stage::after {
    background:var(--mobile-hero-tint);
    opacity:1;
    backdrop-filter:none;
    mask-image:none;
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .gdb-hero-video-poster,
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .gdb-hero-video-media {
    filter:none;
    object-fit:cover;
    object-position:center;
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .hero-copy {
    order:1;
    position:relative;
    inset:auto;
    width:100%;
    padding:var(--space-l) var(--gutter) var(--space-m);
    margin:0;
    color:var(--ink-800);
    background:var(--white);
    text-shadow:none;
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .hero-copy::after {
    content:"";
    position:absolute;
    left:var(--gutter);
    bottom:var(--space-2xs);
    width:var(--space-xl);
    height:var(--stroke-hairline);
    background:var(--accent-500);
    pointer-events:none;
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .home-hero-eyebrow {
    margin:0 0 var(--space-2xs);
    color:var(--accent-text);
    font-size:var(--step--2);
    line-height:var(--leading-snug);
    letter-spacing:var(--tracking-widest);
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay h1 {
    margin:0 0 var(--space-xs);
    color:var(--ink-800);
    font-size:var(--step-3);
    line-height:var(--leading-snug);
    letter-spacing:var(--tracking-tight);
    text-wrap:balance;
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .hero-service-summary {
    max-width:none;
    margin:0 0 var(--space-2xs);
    color:var(--ink-700);
    font-size:var(--step--1);
    line-height:var(--leading-normal);
  }
  body .home-opening .editorial-hero.home-hero-wide.home-hero-overlay .hero-lead {
    max-width:none;
    margin:0;
    color:var(--ink-600);
    font-size:var(--step-0);
    line-height:var(--leading-normal);
  }
  body .home-opening .home-values-section {
    margin:0;
    padding:var(--space-2xs) var(--space-s) var(--space-m);
    background:var(--white);
    color:var(--ink-800);
  }
}

/* Only the enquiry button floats above the page; no full-width mobile rail. */
@media (max-width:850px) {
  html:has(body.gdb-mobile-contact-page:not(.gdb-contact-destination)) {
    scroll-padding-bottom:calc(var(--space-xl) + var(--space-xs) * 3 + env(safe-area-inset-bottom, 0px));
  }
  body.gdb-mobile-contact-page:not(.gdb-contact-destination),
  body.gdb-newchrome-legacy.gdb-mobile-contact-page:not(.gdb-contact-destination) {
    padding-bottom:0;
  }
  body.gdb-mobile-contact-page:not(.gdb-contact-destination) .gdb-contact-widget {
    left:auto;
    right:max(var(--space-s), env(safe-area-inset-right, 0px));
    bottom:calc(8px + env(safe-area-inset-bottom, 0px));
    width:max-content;
    max-width:calc(100% - var(--space-s) * 2);
    min-height:0;
    justify-content:flex-end;
    gap:0;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
    pointer-events:none;
  }
  body.gdb-mobile-contact-page .gdb-contact-widget .gdb-contact-prompt {
    display:none;
  }
  body.gdb-mobile-contact-page .gdb-contact-widget .gdb-contact-link {
    min-height:var(--space-xl);
    max-width:100%;
    box-shadow:none;
    pointer-events:auto;
  }
}

/* Normal footer space keeps final links above the fixed mobile enquiry action. */
@media (max-width:850px) {
  body.gdb-mobile-contact-page:not(.gdb-contact-destination) > footer {
    padding-bottom:calc(96px + env(safe-area-inset-bottom, 0px));
  }
}


/* Shared decorative sequence numbers; factual figures and article lists are untouched. */
body main :is(.editorial-number,.sfeat__n,.scard__n,.step-num,.area-card-number,.company-service>.number,.svc-step>.num,.svc-list-item>.n,.sproc__n),
body main .slist li>b,
body main .number>b {
  color:var(--accent-text);
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  font-family:var(--font-display);
  font-size:var(--step-2);
  font-weight:var(--weight-regular,400);
  line-height:var(--leading-snug);
  letter-spacing:var(--tracking-tight);
  font-variant-numeric:lining-nums proportional-nums;
  padding:0;
  min-width:0;
}
body main .intro-body li:has(>b.editorial-number) {
  display:grid;
  grid-template-columns:var(--space-l) minmax(0,1fr);
  align-items:start;
  column-gap:var(--space-xs);
  padding-block:var(--space-2xs);
}
body main .intro-body li>b.editorial-number {
  width:auto;
  margin:0;
  line-height:var(--leading-tight);
}
body main .service-card-copy .number>b.editorial-number {
  display:inline-block;
  width:auto;
  height:auto;
  margin-right:var(--space-xs);
}

/* Match the legacy component specificity without changing its layout. */
body.about-page main .company-service>.number.editorial-number,
body.service-expanded-page #main .sig .eyebrow.editorial-number {
  display:block;
  width:auto;
  height:auto;
  min-width:0;
  padding:0;
  color:var(--accent-text);
  background:transparent;
  border:0;
  border-radius:0;
  font-family:var(--font-display);
  font-size:var(--step-2);
  font-weight:var(--weight-regular,400);
  line-height:var(--leading-snug);
  letter-spacing:var(--tracking-tight);
}


/* Shared project captions: preserve photographs, tracks, links and all project details. */
body #main .photo-slider .project > h3,
body #main .service-project-feature .photo-slide > figcaption > b,
body #main .work .wk__cap > .wk__n {
  display:block;
  margin:20px 0 9px;
  padding:0;
  color:var(--ink-800);
  font-family:var(--font-display);
  font-size:clamp(24px,2vw,30px);
  font-weight:var(--weight-regular,400);
  line-height:1.2;
  letter-spacing:var(--tracking-tight);
  text-transform:none;
  max-width:30ch;
}
body #main .photo-slider .project > h3::before,
body #main .service-project-feature .photo-slide > figcaption > b::before,
body #main .work .wk__cap > .wk__n::before {
  content:"";
  display:block;
  width:26px;
  height:2px;
  margin-bottom:12px;
  background:var(--accent-text);
}
body #main .photo-slider .project .project-type,
body #main .photo-slider .project:hover .project-type > span,
body #main .photo-slider .project .project-type > span,
body #main .service-project-feature .photo-slide > figcaption > span,
body #main .work .wk__category {
  color:var(--accent-text);
  font-size:11px;
  font-weight:500;
  line-height:1.5;
  letter-spacing:.08em;
  text-transform:uppercase;
}
body #main .service-project-feature .photo-slide > figcaption > span,
body #main .work .wk__category {display:block;margin:0 0 12px;}
body #main .photo-slider .project .project-type {margin:0 0 12px;}
body #main .photo-slider .project > .home-project-detail,
body #main .service-project-feature .project-caption-note,
body #main .work .wk__cap > .wk__note {
  margin:12px 0 0;
  max-width:60ch;
  font-size:14px!important;
  line-height:1.65!important;
  font-weight:400;
  color:var(--ink-600);
}
body #main .photo-slider .project > .home-project-year {
  margin:16px 0 0;
  font-size:12px;
  color:var(--ink-600);
}
body #main .work .wk__meta {margin-top:16px;}
@media(max-width:700px){
 body #main .photo-slider .project > h3,
 body #main .service-project-feature .photo-slide > figcaption > b,
body #main .work .wk__cap > .wk__n {margin-top:16px;font-size:24px;}
 body #main .photo-slider .project > .home-project-detail,
 body #main .service-project-feature .project-caption-note,
body #main .work .wk__cap > .wk__note {max-width:none;}
}

body #main .service-project-feature .photo-slide > figcaption {display:block;padding:0;background:transparent;}
body #main .service-project-feature .photo-slide > figcaption > span {display:block;margin:0 0 12px;}


/* Contact-only alignment; Buildertrend remains in its existing form column. */
@media (min-width:851px) {
  body.contact-page .contact-main {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    column-gap:var(--space-2xl);
    row-gap:var(--space-xl);
    align-items:start;
  }
  body.contact-page .contact-intro {
    grid-column:1;
    grid-row:1;
    display:grid;
    grid-template-rows:auto auto auto minmax(0,1fr);
    align-self:stretch;
  }
  body.contact-page .contact-family-photo {
    align-self:center;
    margin:var(--space-l) 0;
  }
  body.contact-page .contact-form {grid-column:2;grid-row:1}
  body.contact-page .contact-office {
    grid-column:1 / -1;
    grid-row:2;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:var(--space-2xl);
    align-items:start;
    padding-top:var(--space-m);
    border:0;
    border-radius:0;
    background:transparent;
  }
  body.contact-page .contact-office .office-details {
    padding:0;
    background:transparent;
  }
  body.contact-page .contact-office .office-heading {
    font-family:var(--font-display);
    font-size:var(--step-3);
    margin-bottom:var(--space-m);
  }
  body.contact-page .contact-office .contact-photo {
    margin:0;
    border:0;
    border-radius:0;
    overflow:visible;
  }
  body.contact-page .contact-office .contact-photo img {
    height:auto;
    width:100%;
    object-fit:contain;
  }
}

/* Desktop photo follows the hosted form content rather than its viewport-sized blank area. */
@media (min-width:851px) {
  body.contact-page .contact-intro {
    height:var(--contact-photo-aligned-height,auto);
    align-self:start;
  }
  body.contact-page .contact-family-photo {
    align-self:end;
    margin:var(--space-l) 0 0;
  }
}
