@media (min-width: 981px) {
  .hero-slider .slide > .photo-hero-bg {
    background-position: 78% center;
  }
}

@media (min-width: 641px) {
  html[dir="rtl"].homepage .slide:has(> .photo-hero-bg) > .slide-content::before {
    right: auto;
    left: -24px;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 4px solid var(--teal);
    border-radius: 0 24px 24px 0;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  html.homepage #home.hero-slider {
    height: calc(100svh - var(--header-height, 77px));
    min-height: 0;
  }

  html.homepage .hero-slider .slide > .photo-hero-bg {
    background-position: center 16%;
    animation: none;
    transform: none;
  }

  .snow-hero-bg {
    --portrait-hero-image: url("/images/home/hero/leadcom-snow-mountain-mobile.webp");
  }

  .efficiency-hero-bg {
    --portrait-hero-image: url("/images/home/hero/leadcom-energy-review-mobile.webp");
  }

  /* The carousel writes its desktop image inline when the slide first loads. */
  .photo-hero-bg[style*="background-image"] {
    background-image: var(--portrait-hero-image) !important;
  }

  html.homepage .slide:has(> .photo-hero-bg) > .slide-overlay {
    background: linear-gradient(180deg, transparent 23%, rgba(5, 22, 39, 0.64) 52%, rgba(5, 22, 39, 0.78) 100%);
  }

  html.homepage .slide:has(> .photo-hero-bg) > .slide-content {
    justify-content: flex-end;
    padding-block-end: clamp(60px, 9svh, 76px);
  }

  html.homepage .slide:has(> .photo-hero-bg) > .slide-content::before {
    display: none;
  }

  html.homepage #home .slide-kicker {
    margin-bottom: clamp(8px, 1.5svh, 14px);
    font-size: clamp(13px, 3.6vw, 17px);
  }

  html.homepage #home .slide-content :is(h1, h2) {
    margin-bottom: clamp(12px, 2.5svh, 22px);
    font-size: clamp(26px, 8.4vw, 42px);
    line-height: 1.12;
  }

  html.homepage #home .slide-content h1::after {
    margin-top: clamp(7px, 1.6svh, 12px);
  }

  html.homepage #home .slide-content > p:not(.slide-kicker) {
    margin-bottom: clamp(13px, 2.8svh, 24px);
    font-size: clamp(13px, 3.9vw, 17px);
    line-height: 1.47;
  }

  html.homepage #home .slide-btn {
    min-height: 44px;
    padding: 9px 22px;
  }

  html.homepage #home .slider-dots {
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 2px;
  }

  html.homepage #home .slider-dots .dot {
    display: grid;
    width: 26px;
    height: 26px;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
  }

  html.homepage #home .slider-dots .dot::before {
    content: "";
    box-sizing: border-box;
    width: 11px;
    height: 11px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
  }

  html.homepage #home .slider-dots .dot.active::before {
    border-color: var(--teal);
    background: var(--teal);
  }
}

@media (max-width: 460px) and (orientation: portrait) {
  html.homepage #home .slider-dots {
    left: 4%;
    transform: none;
  }
}
