/**
 * Blue Ridge Core Theme — Homepage Sections
 * Rebuilt in this pass to a simpler, cohesive "premium modern contractor"
 * spec: clean, spacious, strong photography, no floating cards, no
 * decorative textures, no cards-inside-cards, no overlapping sections.
 *
 * Scoped with a `.home-` prefix throughout so these rules only ever affect
 * the homepage — other pages' shared components (.card, .btn, .container)
 * are untouched by this file.
 *
 * Spacing contract (desktop / tablet / mobile):
 *   section padding: 96px / 64px / 48px   (target band 88-104px desktop)
 *   gutters:         32px / 24px / 18px
 *   grid gaps:       32px (one consistent value across every grid here)
 */

.home-container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 18px;
}

/* Offsets the in-page jump for the header nav's "FAQ" link (/#faq) so the
   sticky header doesn't cover the section heading when it scrolls into
   view. */
#faq {
  scroll-margin-top: 112px;
}

/* Wider variant — used where a grid needs more room per-item (e.g. the
   4-across application cards) than the standard 1180px content width
   allows without cramping. */
.home-container--wide {
  max-width: 1360px;
}

.home-section {
  padding-block: 56px;
}

@media (min-width: 768px) {
  .home-container {
    padding-inline: 24px;
  }

  .home-section {
    padding-block: 64px;
  }
}

@media (min-width: 1024px) {
  .home-container {
    padding-inline: 32px;
  }

  .home-section {
    padding-block: 96px;
  }
}

.home-section--white {
  background-color: var(--wp--preset--color--white);
}

.home-section--surface {
  background-color: var(--wp--preset--color--surface);
}

.home-section--warm {
  background-color: var(--brand-cream);
}

.home-section--navy {
  background-color: var(--wp--preset--color--navy);
  color: var(--wp--preset--color--white);
  overflow-x: hidden;
}

.home-section--navy h2 {
  color: var(--wp--preset--color--white);
}

.home-eyebrow {
  display: block;
  font-size: var(--wp--preset--font-size--xs);
  font-weight: var(--wp--custom--typography--font-weight-bold);
  letter-spacing: var(--wp--custom--typography--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--wp--preset--color--heating-orange-text);
  margin-bottom: 12px;
}

.home-section--navy .home-eyebrow {
  color: var(--wp--preset--color--heating-orange-text);
}

.home-heading-block {
  max-width: 42rem;
  text-align: center;
  margin-inline: auto;
  margin-bottom: 48px;
}

.home-heading-block--tight {
  margin-bottom: 32px;
}

.home-heading-block p {
  color: var(--wp--preset--color--gray-500);
  font-size: var(--wp--preset--font-size--lg);
  margin-top: 12px;
}

.home-section--navy .home-heading-block p {
  color: rgba(255, 255, 255, .78);
}

/* ===== 2. Hero ===== */
.home-hero {
  background-color: var(--brand-cream);
  overflow-x: hidden;
}

.home-hero__grid {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.home-hero__content {
  flex: 1 1 440px;
  max-width: 560px;
}

.home-hero__media {
  flex: 1.15 1 520px;
  align-self: stretch;
  min-height: 380px;
}

.home-hero h1 {
  color: var(--wp--preset--color--navy);
  margin-top: 26px;
  /* Scoped +6px over the global H1 token (theme.json's display-lg clamp,
     40px-64px) — hero-only per the final polish pass, other pages' H1s are
     untouched. Same vw slope, whole curve shifted up 6px end to end. */
  font-size: clamp(2.875rem, 2.254rem + 2.652vw, 4.375rem);
}

.home-hero__subtext {
  color: var(--wp--preset--color--gray-700);
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.6;
  margin-top: 28px;
  max-width: 520px;
}

.home-hero__actions {
  margin-top: 44px;
}

.home-trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 40px;
  padding: 0;
  list-style: none;
}

.home-trust-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--wp--preset--font-size--sm);
  font-weight: var(--wp--custom--typography--font-weight-semibold);
  color: var(--wp--preset--color--navy);
  position: relative;
}

.home-trust-points li:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background-color: var(--wp--preset--color--gray-200);
}

.home-trust-points .icon {
  width: 18px;
  height: 18px;
  color: var(--wp--preset--color--forest-green);
  flex-shrink: 0;
}

.home-hero__media-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  overflow: hidden;
}

.home-hero__media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Biased toward the upper-left, where the wall-mounted mini split sits in
     the source photo, so it stays in frame under object-fit:cover at every
     aspect ratio this column renders at (desktop/tablet/mobile). */
  object-position: 22% 18%;
  display: block;
}

@media (min-width: 1024px) {
  .home-hero {
    min-height: 700px;
    display: flex;
    align-items: stretch;
  }

  .home-hero .home-container {
    height: 100%;
  }

  .home-hero__grid {
    flex-wrap: nowrap;
    align-items: stretch;
    height: 100%;
  }

  .home-hero__content {
    flex: 0 0 44%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Full-bleed to the viewport's right edge, matching the mockup — the
     content column stays inside .home-container, but this item grows to
     consume all remaining row space AND extends past the container's own
     right edge via the negative margin (a standard one-sided bleed
     technique: the negative margin gives the flex row extra free space on
     this axis, which flex-grow then claims). Requires .home-hero's
     overflow-x:hidden above to avoid a stray horizontal scrollbar from
     subpixel rounding. */
  .home-hero__media {
    flex: 1 1 0;
    margin-right: calc(50% - 50vw);
  }
}

@media (max-width: 1023px) {
  .home-hero__media {
    order: 2;
    width: 100%;
  }

  .home-hero__content {
    order: 1;
    width: 100%;
  }
}

/* ===== 3. Simple Benefits ===== */
.home-benefits-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.home-benefit {
  text-align: center;
  padding-inline: 12px;
  position: relative;
}

.home-benefit:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background-color: var(--wp--preset--color--gray-200);
}

.home-benefit__icon {
  width: 58px;
  height: 58px;
  margin-inline: auto;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-navy);
}

.home-benefit__icon--orange {
  color: var(--brand-orange);
}

.home-benefit__icon--green {
  color: var(--brand-green);
}

.home-benefit__icon--navy {
  color: var(--brand-navy);
}

.home-benefit__icon .icon {
  width: 32px;
  height: 32px;
  stroke-width: 1.6;
}

.home-benefit p {
  font-size: var(--wp--preset--font-size--base);
  font-weight: var(--wp--custom--typography--font-weight-semibold);
  color: var(--wp--preset--color--gray-900);
}

.home-benefit p.home-benefit__desc {
  font-size: var(--wp--preset--font-size--sm);
  font-weight: var(--wp--custom--typography--font-weight-regular);
  color: var(--wp--preset--color--gray-500);
  margin-top: 4px;
}

@media (max-width: 900px) {
  .home-benefits-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 40px;
  }

  .home-benefit:not(:first-child)::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .home-benefits-row {
    grid-template-columns: 1fr;
    row-gap: 32px;
    gap: 20px;
  }
}

/* ===== 4. Applications ===== */
.home-apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  align-items: stretch;
}

.home-app-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--wp--preset--color--white);
  box-shadow: var(--wp--preset--shadow--sm);
  transition: transform var(--wp--custom--motion--duration-base) var(--wp--custom--motion--ease-out);
}

@media (hover: hover) {
  .home-app-card:hover {
    transform: translateY(-3px);
  }
}

.home-app-card__media {
  aspect-ratio: 4 / 3;
  width: 100%;
  flex-shrink: 0;
}

.home-app-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-app-card__body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.home-app-card__body h3 {
  font-size: var(--wp--preset--font-size--lg);
  font-weight: var(--wp--custom--typography--font-weight-semibold);
  color: var(--brand-navy);
  margin-bottom: 6px;
  padding-right: 28px;
}

.home-app-card__body p {
  font-size: var(--wp--preset--font-size--sm);
  color: var(--wp--preset--color--gray-500);
  line-height: 1.55;
  padding-right: 28px;
}

.home-app-card__arrow {
  position: absolute;
  right: 22px;
  bottom: 22px;
  color: var(--brand-orange);
  display: flex;
}

.home-app-card__arrow .icon {
  width: 18px;
  height: 18px;
}

.home-apps-link {
  display: block;
  text-align: center;
  margin-top: 44px;
  font-weight: var(--wp--custom--typography--font-weight-semibold);
  transition: color var(--wp--custom--motion--duration-base) var(--wp--custom--motion--ease-out);
}

@media (max-width: 1023px) {
  .home-apps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .home-apps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ===== 5. Why Blue Ridge ===== */
.home-why-grid {
  display: flex;
  align-items: center;
  gap: 56px;
  flex-wrap: wrap;
}

.home-why-grid > * {
  flex: 1 1 420px;
}

.home-why__media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  align-self: stretch;
}

.home-why__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-why__content p {
  color: rgba(255, 255, 255, .82);
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.65;
  margin-top: 20px;
  margin-bottom: 32px;
}

.home-check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 28px;
}

@media (min-width: 560px) {
  /* grid-auto-flow:column fills each column top-to-bottom before starting
     the next, so with 5 items + 3 explicit rows this groups the first 3
     DOM items into column 1 and the remaining 2 into column 2 — matching
     the reference's grouping, not the row-major default. */
  .home-check-list {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
  }
}

.home-check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.5;
  color: rgba(255, 255, 255, .92);
}

.home-section--white .home-check-list li,
.home-section--surface .home-check-list li,
.home-section--warm .home-check-list li {
  color: var(--wp--preset--color--gray-900);
}

.home-check-list .icon {
  width: 20px;
  height: 20px;
  color: var(--wp--preset--color--heating-orange-text);
  flex-shrink: 0;
  margin-top: 2px;
  stroke-width: 2.4;
}

@media (min-width: 901px) {
  .home-why-grid {
    align-items: stretch;
  }

  /* Full-bleed to the viewport's left edge, mirroring the hero's right-side
     bleed — same technique, opposite direction (margin-left instead of
     margin-right). Height matches the content column via align-items:stretch
     above, so aspect-ratio is dropped here (it would otherwise fight the
     stretched height). */
  .home-why__media {
    flex: 1 1 0;
    margin-left: calc(50% - 50vw);
    aspect-ratio: auto;
  }

  .home-why__content {
    flex: 0 0 45%;
    max-width: 480px;
  }
}

@media (max-width: 900px) {
  .home-why-grid {
    flex-direction: column;
  }

  /* Flex items default to min-width:auto, which floors their shrink at the
     content's min-content size (or the flex-basis, per spec) — without this
     override the 420px flex-basis from the desktop rule above prevents
     these from ever shrinking below ~420-560px, overflowing narrow
     viewports horizontally. */
  .home-why-grid > * {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }
}

/* ===== 6. Process ===== */
.home-process {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.home-process__step {
  flex: 1 1 0;
  text-align: center;
  position: relative;
  padding-inline: 16px;
}

.home-process__line {
  flex: 0 0 auto;
  width: 100%;
  height: 2px;
  background-color: var(--wp--preset--color--gray-200);
  margin-top: 32px;
  max-width: 90px;
}

.home-process__num {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background-color: var(--wp--preset--color--navy);
  color: var(--wp--preset--color--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--wp--custom--typography--font-weight-bold);
  font-size: var(--wp--preset--font-size--xl);
  margin-inline: auto;
  margin-bottom: 24px;
}

.home-process__step h3 {
  font-size: var(--wp--preset--font-size--xl);
  font-weight: var(--wp--custom--typography--font-weight-semibold);
  color: var(--wp--preset--color--navy);
  margin-bottom: 10px;
}

.home-process__step p {
  color: var(--wp--preset--color--gray-500);
  font-size: var(--wp--preset--font-size--sm);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .home-process {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: 26rem;
    margin-inline: auto;
  }

  .home-process__step {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    text-align: left;
    padding-inline: 0;
    padding-bottom: 36px;
    position: relative;
  }

  .home-process__step-text {
    flex: 1 1 0;
    min-width: 0;
  }

  .home-process__step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 31px;
    top: 64px;
    bottom: 0;
    width: 2px;
    background-color: var(--wp--preset--color--gray-200);
  }

  .home-process__num {
    margin-inline: 0;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .home-process__line {
    display: none;
  }
}

/* ===== 7. Mobile Home Feature ===== */
.home-mobile-grid {
  display: flex;
  align-items: center;
  gap: 56px;
  flex-wrap: wrap;
}

.home-mobile-grid > * {
  flex: 1 1 420px;
}

.home-mobile__media {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  align-self: stretch;
}

.home-mobile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-mobile__content p {
  color: var(--wp--preset--color--gray-500);
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.65;
  margin-top: 20px;
  margin-bottom: 28px;
}

.home-point-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-point-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.5;
  color: var(--wp--preset--color--gray-900);
}

.home-point-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--wp--preset--color--heating-orange-text);
  flex-shrink: 0;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .home-mobile-grid {
    flex-direction: column-reverse;
  }

  .home-mobile-grid > * {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }
}

/* ===== 8. Financing Strip ===== */
.home-financing-strip {
  background-color: var(--wp--preset--color--navy);
  color: var(--wp--preset--color--white);
  border-radius: 16px;
  padding: 56px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.home-financing-strip h2 {
  color: var(--wp--preset--color--white);
  font-size: var(--wp--preset--font-size--display-sm);
  margin-bottom: 8px;
}

.home-financing-strip p {
  color: rgba(255, 255, 255, .8);
  font-size: var(--wp--preset--font-size--base);
}

@media (max-width: 700px) {
  .home-financing-strip {
    flex-direction: column;
    align-items: flex-start;
    padding: 40px 32px;
  }

  .home-financing-strip .wp-block-button__link {
    width: 100%;
  }
}

/* ===== 9. FAQ ===== */
.home-faq-wrap {
  max-width: 900px;
  margin-inline: auto;
}

/* .faq's own 48rem (768px) cap is meant for the narrower non-homepage
   service-page context — on the homepage the wrapping .home-faq-wrap
   already sets the intended (wider) max-width, so let it fill that. */
.home-faq-wrap .faq {
  max-width: none;
}

/* ===== 10. Final CTA ===== */
.home-final-cta {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  padding: 112px 32px;
  isolation: isolate;
}

.home-final-cta__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-final-cta__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-final-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(var(--brand-navy-rgb), .78);
  z-index: 1;
}

.home-final-cta__content {
  position: relative;
  z-index: 2;
  max-width: 38rem;
  margin-inline: auto;
}

.home-final-cta h2 {
  color: var(--wp--preset--color--white);
}

.home-final-cta p {
  color: rgba(255, 255, 255, .88);
  font-size: var(--wp--preset--font-size--lg);
  margin-top: 16px;
}

.home-final-cta .wp-block-buttons {
  margin-top: 40px;
}

/* ===== Responsive type scale for homepage headings (mobile) ===== */
@media (max-width: 600px) {
  .home-hero__actions .wp-block-button__link,
  .home-final-cta .wp-block-button__link {
    width: 100%;
  }
}
