/* Responsive header, careers strip, and gallery corrections. */
.skip-link:not(:focus) {
  transform: translateY(-200%);
}

.brand-link .header-wordmark,
.brand-link .official-logo--header.header-wordmark {
  display: inline-flex;
  position: static;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #171717 !important;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
  white-space: nowrap;
}

.careers-strip__inner > img {
  display: block;
  width: 120px !important;
  height: 120px !important;
  max-width: 100%;
  object-fit: contain;
  flex: 0 0 120px;
}

/* Keep the full, approved D1 mark visible; the source image itself includes
   the wordmark, Tennessee emblem, services line, and phone number. */
.hero__image-frame {
  height: auto !important;
  aspect-ratio: 2.18 / 1;
  clip-path: none !important;
  background: #fff !important;
}

.hero__image-frame .hero-logo {
  position: relative !important;
  inset: auto !important;
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  background: #fff !important;
  object-fit: contain !important;
  object-position: center;
}

.hero__image-frame .hero__image-shade,
.hero__image-frame .hero__project-note {
  display: none !important;
}

.hero__image-frame:before {
  display: none !important;
}

/* Keep the service cards below the logo, including its phone number. */
.hero__category-grid {
  margin-top: 18px !important;
}

.about__art--full-logo {
  min-height: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  overflow: visible;
}

.about__art--full-logo .about-logo-frame {
  width: 100%;
  padding: clamp(12px, 2vw, 24px);
}

.about__art--full-logo .about-full-logo {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
}

.site-footer__logo {
  display: block;
  width: min(100%, 410px) !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  background: #fff;
}

.about__art--full-logo::before {
  display: none !important;
  content: none !important;
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  columns: initial;
}

.photo-gallery-item {
  display: block;
  min-width: 0;
  margin: 0;
  cursor: zoom-in;
}

.photo-gallery-item img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}

/* CSS-only in-page photo viewer; it works without a click-handler script. */
.gallery-lightbox {
  display: none;
}

.gallery-lightbox:target {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(10 10 10 / 92%);
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  display: block;
}

.gallery-lightbox__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  width: min(1100px, 100%);
  max-height: 94vh;
}

.gallery-lightbox__figure {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  max-height: 94vh;
  margin: 0;
}

.gallery-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
}

.gallery-lightbox__figure figcaption {
  color: #fff;
  font: 700 13px/1.4 system-ui, sans-serif;
  text-align: center;
}

.gallery-lightbox__button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  background: rgb(20 20 20 / 78%);
  color: #fff;
  font: 700 26px/1 system-ui, sans-serif;
}

.gallery-lightbox__close {
  position: absolute;
  z-index: 2;
  top: -54px;
  right: 0;
}

@media (max-width: 560px) {
  .gallery-lightbox:target { padding: 10px; }

  .gallery-lightbox__content {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 4px;
  }

  .gallery-lightbox__button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .gallery-lightbox__close { top: -42px; }
}

.d1-photo-lightbox {
  width: min(94vw, 1100px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: #fff;
}

.d1-photo-lightbox::backdrop {
  background: rgb(10 10 10 / 88%);
}

.d1-photo-lightbox__layout {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  max-height: 94vh;
}

.d1-photo-lightbox__figure {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  max-height: 94vh;
  margin: 0;
}

.d1-photo-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
}

.d1-photo-lightbox__figure figcaption {
  color: #fff;
  font: 700 13px/1.4 system-ui, sans-serif;
  text-align: center;
}

.d1-photo-lightbox__button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  background: rgb(20 20 20 / 78%);
  color: #fff;
  font: 700 26px/1 system-ui, sans-serif;
  cursor: pointer;
}

.d1-photo-lightbox__close {
  position: fixed;
  z-index: 2147483647;
  top: 16px;
  right: 16px;
  transform: none;
  pointer-events: auto;
}

@media (max-width: 1050px) {
  .site-header__inner {
    gap: 14px;
  }
}

@media (max-width: 820px) {
  .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand cta" "nav nav";
    gap: 8px 12px;
    padding-block: 10px;
  }

  .brand-link { grid-area: brand; }

  .header-cta {
    grid-area: cta;
    justify-self: end;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .desktop-nav {
    display: flex !important;
    grid-area: nav;
    grid-column: 1 / -1;
    width: 100%;
    gap: clamp(14px, 4vw, 28px);
    margin: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .desktop-nav a {
    flex: 0 0 auto;
    padding-block: 6px;
    font-size: 12px;
  }

  .photo-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .careers-strip__inner > img {
    width: 88px !important;
    height: 88px !important;
    flex-basis: 88px;
  }

  .photo-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-gallery-item img { height: 140px; }

  .d1-photo-lightbox__layout {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 4px;
  }

  .d1-photo-lightbox__button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
}

/* v9 branding refresh: artistic D1 header mark + matching service banner. */
.brand-link .header-wordmark,
.brand-link .official-logo--header.header-wordmark {
  display: block !important;
  width: clamp(190px, 22vw, 300px) !important;
  height: auto !important;
  aspect-ratio: 8 / 3 !important;
  overflow: hidden !important;
  text-indent: -9999px;
  white-space: nowrap;
  background: #fff url('/d1-artistic-logo.png') center / contain no-repeat !important;
}

.hero__image-frame {
  aspect-ratio: 8 / 3 !important;
  background: #fff url('/d1-services-banner.png') center / contain no-repeat !important;
}

.hero__image-frame .hero-logo {
  visibility: hidden !important;
  width: 100% !important;
  aspect-ratio: 8 / 3 !important;
}

@media (max-width: 760px) {
  .brand-link .header-wordmark,
  .brand-link .official-logo--header.header-wordmark {
    width: clamp(155px, 48vw, 220px) !important;
  }

  .hero__image-frame {
    background-size: contain !important;
  }
}

/* v11: enlarge the artistic header logo so it fills the header space better. */
.brand-link .header-wordmark,
.brand-link .official-logo--header.header-wordmark {
  width: clamp(300px, 34vw, 480px) !important;
  aspect-ratio: 4 / 1 !important;
  background-size: contain !important;
}

.site-header__inner {
  min-height: 116px;
}

@media (max-width: 1100px) {
  .brand-link .header-wordmark,
  .brand-link .official-logo--header.header-wordmark {
    width: clamp(240px, 31vw, 360px) !important;
  }
}

@media (max-width: 760px) {
  .brand-link .header-wordmark,
  .brand-link .official-logo--header.header-wordmark {
    width: min(92vw, 390px) !important;
  }
  .site-header__inner {
    min-height: 100px;
  }
}

/* v12: permanently hide the legacy Commercial / Residential hero category block.
   This also covers the copy recreated by the site's hydration payload. */
.hero__category-grid {
  display: none !important;
}

/* v13: give the new service banner more visual weight in the hero. */
@media (min-width: 901px) {
  .hero__grid {
    grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr) !important;
    gap: clamp(28px, 4vw, 64px) !important;
    align-items: center !important;
  }

  .hero__visual,
  .hero__image-frame {
    width: 100% !important;
    max-width: none !important;
  }
}

/* Let the artwork use nearly all of its column, without the extra white inset. */
.hero__image-frame {
  background-size: 100% auto !important;
}


/* v20: stable four-row hero headline.
   Keep every row in normal flow and control spacing with an explicit grid gap. */
.hero__copy h1 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  row-gap: 0 !important;
  position: static !important;
  align-items: center !important;
}
.hero__copy h1 .hero-line,
.hero__copy h1 .hero-amp {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
.hero__copy h1 .hero-line {
  line-height: .88 !important;
}
.hero__copy h1 .hero-amp {
  text-align: center !important;
  font-style: normal !important;
  color: #111 !important;
  font-size: .58em !important;
  line-height: .62 !important;
  margin-top: .02em !important;
  margin-bottom: -.02em !important;
  pointer-events: auto !important;
}
.hero__copy h1 .hero-line--residential {
  margin-top: -.02em !important;
}

/* v21: compact hero headline based on the verified v20 desktop rendering.
   Flex column avoids inherited grid/row sizing and makes the four lines pack tightly. */
.hero__copy h1 {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  row-gap: 0 !important;
  column-gap: 0 !important;
  line-height: 1 !important;
  min-height: 0 !important;
  height: auto !important;
}
.hero__copy h1 > .hero-line,
.hero__copy h1 > .hero-amp {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}
.hero__copy h1 > .hero-line {
  line-height: .84 !important;
}
.hero__copy h1 > .hero-amp {
  align-self: center !important;
  width: auto !important;
  font-size: .56em !important;
  line-height: .72 !important;
  margin: .03em 0 .01em !important;
}
.hero__copy h1 > .hero-line--residential,
.hero__copy h1 > .hero-line--electricians {
  margin-top: 0 !important;
}

/* v22: screenshot-calibrated headline spacing.
   The lower two lines are translated upward as a unit so the browser's
   oversized ampersand line box cannot leave a large visual hole. */
.hero__copy h1 > .hero-line--residential,
.hero__copy h1 > .hero-line--electricians {
  transform: translateY(-0.92em) !important;
}
.hero__copy h1 > .hero-line--electricians {
  margin-top: -0.02em !important;
}
/* Recover the space removed visually so the intro follows the headline closely. */
.hero__copy h1 {
  margin-bottom: -0.78em !important;
}
@media (max-width: 760px) {
  .hero__copy h1 > .hero-line--residential,
  .hero__copy h1 > .hero-line--electricians {
    transform: translateY(-0.72em) !important;
  }
  .hero__copy h1 {
    margin-bottom: -0.58em !important;
  }
}


/* v24: single-line hero headline. Replaces all earlier stacked-headline overrides. */
.hero__copy h1.hero-headline-single {
  display: block !important;
  position: static !important;
  width: max-content !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 clamp(18px, 1.8vw, 28px) !important;
  padding: 0 !important;
  transform: none !important;
  white-space: nowrap !important;
  line-height: .98 !important;
  font-size: clamp(38px, 3.65vw, 66px) !important;
  letter-spacing: -0.05em !important;
}
.hero__copy h1.hero-headline-single > span,
.hero__copy h1.hero-headline-single > em {
  display: inline !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  line-height: inherit !important;
}
.hero__copy h1.hero-headline-single > em {
  color: var(--red, #d31f3b) !important;
  font-style: normal !important;
}
@media (min-width: 901px) {
  .hero__grid { grid-template-columns: 1fr !important; }
  .hero__copy { display: contents !important; }
  .hero__copy .eyebrow,
  .hero__copy h1.hero-headline-single,
  .hero__visual,
  .hero__intro,
  .hero__actions,
  .hero__markets { grid-column: 1 !important; }
}
@media (max-width: 1100px) {
  .hero__copy h1.hero-headline-single {
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    font-size: clamp(38px, 6.2vw, 62px) !important;
  }
}

/* v25: structural desktop hero layout.
   Headline spans the full hero width; supporting copy and artwork return to two columns. */
@media (min-width: 901px) {
  .hero__grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr) !important;
    grid-template-rows: auto auto auto auto auto !important;
    column-gap: clamp(36px, 5vw, 84px) !important;
    align-items: start !important;
  }
  .hero__copy { display: contents !important; }
  .hero__copy .eyebrow {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }
  .hero__copy h1.hero-headline-single {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: none !important;
    white-space: nowrap !important;
    font-size: clamp(42px, 4.15vw, 72px) !important;
    line-height: .96 !important;
    margin: 0 0 clamp(24px, 2.4vw, 38px) !important;
  }
  .hero__copy .hero__intro {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }
  .hero__copy .hero__actions {
    grid-column: 1 !important;
    grid-row: 4 !important;
  }
  .hero__copy .hero__markets {
    grid-column: 1 !important;
    grid-row: 5 !important;
  }
  .hero__visual {
    grid-column: 2 !important;
    grid-row: 3 / 6 !important;
    align-self: start !important;
    margin-top: 0 !important;
  }
}

/* v27: safe post-hydration hero layout. No RSC/hydration payload edits. */
@media (min-width: 901px) {
  .hero__grid.v27-hero-ready {
    display: grid !important;
    grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: clamp(28px, 4vw, 64px) !important;
    row-gap: clamp(18px, 2vw, 28px) !important;
    align-items: start !important;
  }
  .hero__grid.v27-hero-ready > .v27-hero-headline {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    font-size: clamp(38px, 4.25vw, 70px) !important;
    line-height: .96 !important;
    letter-spacing: -0.055em !important;
  }
  .hero__grid.v27-hero-ready > .v27-hero-headline .v27-residential {
    color: var(--red, #d31f3b) !important;
    font-style: normal !important;
  }
  .hero__grid.v27-hero-ready > .hero__copy {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: block !important;
    align-self: start !important;
  }
  .hero__grid.v27-hero-ready > .hero__visual {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    margin: 0 !important;
  }
  .hero__grid.v27-hero-ready .hero__copy > h1 { display: none !important; }
  .hero__grid.v27-hero-ready .hero__copy .eyebrow { margin-top: 0 !important; }
}
@media (max-width: 900px) {
  .v27-hero-headline { display: none !important; }
}

/* v32: make the Facebook project-updates link a prominent call-to-action. */
.project-proof > a[href*="facebook.com"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: .55rem !important;
  margin-top: .75rem !important;
  padding: .9rem 1.2rem !important;
  border: 2px solid currentColor !important;
  border-radius: 6px !important;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem) !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: .01em !important;
  text-decoration: none !important;
}
.project-proof > a[href*="facebook.com"] .arrow-icon {
  font-size: 1.15em !important;
  line-height: 1 !important;
}
.project-proof > a[href*="facebook.com"]:hover,
.project-proof > a[href*="facebook.com"]:focus-visible {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* v33: emphasize the Commercial Momentum project update. */
.project-proof {
  padding: clamp(1.35rem, 2.4vw, 2rem) !important;
  border-left: 5px solid var(--red, #d31f3b) !important;
  background: rgba(255,255,255,.06) !important;
}
.project-proof > p {
  font-size: clamp(1.08rem, 1.35vw, 1.3rem) !important;
  line-height: 1.55 !important;
  max-width: 72ch !important;
  margin: 0 !important;
}
.project-proof > p > strong {
  display: block !important;
  margin-bottom: .5rem !important;
  font-size: clamp(1.35rem, 2vw, 1.8rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -.02em !important;
  color: var(--red, #d31f3b) !important;
}

/* v34: emphasize the Additional Service generator callout. */
.service-extra {
  margin-top: clamp(1.5rem, 2.5vw, 2.25rem) !important;
  padding: clamp(1.1rem, 2vw, 1.5rem) clamp(1.15rem, 2.25vw, 1.75rem) !important;
  border-left: 5px solid var(--red, #d31f3b) !important;
  background: rgba(211,31,59,.06) !important;
  font-size: clamp(1.08rem, 1.25vw, 1.22rem) !important;
  line-height: 1.5 !important;
}
.service-extra > strong {
  display: inline-block !important;
  margin-right: .3rem !important;
  color: var(--red, #d31f3b) !important;
  font-size: 1.12em !important;
  font-weight: 800 !important;
  letter-spacing: -.01em !important;
}

/* v36: blend the full header/logo strip into the logo's cream background. */
.site-header,
.site-header .site-header__inner,
.site-header .brand-link,
.brand-link .header-wordmark,
.brand-link .official-logo--header.header-wordmark {
  background-color: #f5f2e9 !important;
}
.brand-link .header-wordmark,
.brand-link .official-logo--header.header-wordmark {
  background-image: url('/d1-artistic-logo.png') !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

/* v38: remove the white banner frame and display the corrected hero artwork with rounded corners. */
.hero__image-frame {
  aspect-ratio: 3 / 1 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background-color: transparent !important;
  background-image: url('/d1-services-banner.png') !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  box-shadow: none !important;
}
.hero__image-frame .hero-logo {
  display: none !important;
}
