/* Home. template-home.php, parts/home/*, data in inc/home.php.
 *
 * Reuses: carousel + news-card (News & Insights, Case Studies), buttons,
 * links. Hero and testimonials run on fade-slider.js: every slide sits in one
 * grid cell, so the block is always as tall as its tallest slide and nothing
 * below it moves when slides change.
 *
 * HERO PANEL. 25% white, blurred, square, flush to the window's left edge.
 * Text and buttons are the dark-ground set: white type like the old slider,
 * coral and white-outline buttons per standards/buttons.md. Contrast rides
 * on the photo, same as the old slider; a light text shadow helps. Without
 * backdrop-filter the block falls back to 55% navy.
 */

.hlb-home {
  overflow-x: clip;
}

.hlb-home-container {
  width: 100%;
  max-width: calc(var(--hlb-container) + (var(--hlb-gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--hlb-gutter);
}

.hlb-home .hlb-home-heading {
  margin: 0;
  padding: 0;
  font: 400 clamp(20px, 0.8vw + 14px, 26px)/1.2 var(--hlb-font-display);
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
  color: var(--hlb-ink);
}

.hlb-home .hlb-on-dark .hlb-home-heading {
  color: var(--hlb-white);
}

/* CTA text links on light sections are navy, like All News & Insights. */
.hlb-home-findpro {
  --hlb-link-fg: var(--hlb-navy);
}

.hlb-home-findpro__all .hlb-link,
.hlb-home-cases__all .hlb-link {
  font: 400 13px/1.4 var(--hlb-font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* === Hero === */

/* 560 at 1440 (the 1440 x 560 image spec), grows with wider screens. */
.hlb-home-hero {
  --hlb-home-hero-h: clamp(560px, 38.9vw, 760px);

  position: relative;
  background: var(--hlb-navy);
}

.hlb-home-hero__track {
  display: grid;
}

.hlb-home-hero__slide {
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  align-items: center;
  min-height: var(--hlb-home-hero-h);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
}

.hlb-home-hero__slide.is-current {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

/* Visibility flips after the fade out, so the old slide never pops. */
.hlb-fade--ready .hlb-home-hero__slide {
  transition: opacity .9s ease, visibility 0s linear .9s;
}

.hlb-fade--ready .hlb-home-hero__slide.is-current {
  transition: opacity .9s ease, visibility 0s;
}

.hlb-home-hero__media {
  position: absolute;
  inset: 0;
}

.hlb-home-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 70% 50%;
}

.hlb-home-hero__inner {
  position: relative;
  padding-block: 56px 88px;
}

/* Panel. Text sits on the container's left edge; the frosted block behind it
   runs out to the window edge. The block is a pseudo-element so the text
   line never moves. The slide clips it. */
.hlb-home-hero__panel {
  position: relative;
  isolation: isolate; /* keeps ::before above the photo */
  width: min(100%, 540px);
  padding: clamp(32px, 2vw + 16px, 48px) clamp(32px, 2vw + 16px, 48px) clamp(32px, 2vw + 16px, 48px) 0;
  color: var(--hlb-white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hlb-home-hero__panel::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: -100vw;
  z-index: -1;
  background: rgba(8, 53, 88, 0.55);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .hlb-home-hero__panel::before {
    background: rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

/* Per-slide "Hide Frosted Background". Text rides on the photo alone, so
   the shadow steps up. Needs a photo dark enough behind the text. */
.hlb-home-hero__slide--no-frost .hlb-home-hero__panel::before {
  content: none;
}

.hlb-home-hero__slide--no-frost .hlb-home-hero__panel {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.hlb-home .hlb-home-hero__title {
  margin: 0;
  padding: 0;
  font: 400 clamp(26px, 1.3vw + 16px, 38px)/1.2 var(--hlb-font-display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--hlb-white);
}

.hlb-home .hlb-home-hero__body {
  margin: 14px 0 0;
  font: 400 16px/26px var(--hlb-font-body);
  color: var(--hlb-white);
}

.hlb-home .hlb-home-hero__body p {
  margin: 0;
}

.hlb-home .hlb-home-hero__body p + p {
  margin-top: 10px;
}

/* Logos from Add Media. Capped so an oversized upload cannot blow out the panel. */
.hlb-home .hlb-home-hero__body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80px;
  margin: 0 0 12px;
}

.hlb-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  text-shadow: none;
}

/* Controls. White pill so dots read on any photo. */
.hlb-home-hero__controls {
  position: absolute;
  right: max(var(--hlb-gutter), calc((100% - var(--hlb-container)) / 2));
  bottom: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.hlb-home-hero__controls[hidden] {
  display: none;
}

.hlb-home .hlb-home-hero__dot,
.hlb-home .hlb-home-hero__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hlb-navy);
  cursor: pointer;
}

/* Navy ring on white: 12.65:1. Filled = current. */
.hlb-home-hero__dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition: background-color var(--hlb-speed) var(--hlb-ease), transform var(--hlb-speed) var(--hlb-ease);
}

.hlb-home-hero__dot:hover::before {
  transform: scale(1.2);
}

.hlb-home-hero__dot[aria-current]::before {
  background-color: currentColor;
}

.hlb-home-hero__toggle svg {
  fill: currentColor;
}

.hlb-home-hero__icon-play,
.hlb-home-hero__toggle.is-paused .hlb-home-hero__icon-pause {
  display: none;
}

.hlb-home-hero__toggle.is-paused .hlb-home-hero__icon-play {
  display: block;
}

.hlb-home-hero__toggle[hidden] {
  display: none;
}

.hlb-home .hlb-home-hero__dot:focus-visible,
.hlb-home .hlb-home-hero__toggle:focus-visible {
  outline: 2px solid var(--hlb-navy);
  outline-offset: 0;
}

/* Phones: text over the photo, frosted band full width at the bottom.
   Every slide is as tall as the longest, so controls sit top right where
   they stay put. */
@media (max-width: 767px) {
  .hlb-home-hero {
    --hlb-home-hero-h: 520px;
  }

  .hlb-home-hero__slide {
    align-items: end;
  }

  .hlb-home-hero__media img {
    object-position: 50% 50%;
  }

  .hlb-home-hero__inner {
    padding-block: 96px 0;
  }

  .hlb-home-hero__panel {
    width: 100%;
    padding: 28px 0 32px;
  }

  .hlb-home-hero__panel::before {
    right: -100vw;
  }

  .hlb-home-hero__controls {
    top: 12px;
    right: var(--hlb-gutter);
    bottom: auto;
  }

  .hlb-home .hlb-home-hero__slide--no-phone,
  .hlb-home .hlb-home-hero__dot--no-phone {
    display: none;
  }
}

/* Phones Only slides. fade-slider.js skips hidden slides */
@media (min-width: 768px) {
  .hlb-home .hlb-home-hero__slide--phone-only,
  .hlb-home .hlb-home-hero__dot--phone-only {
    display: none;
  }
}

/* === Find a Professional === */

.hlb-home-findpro {
  padding-block: clamp(56px, 5vw + 16px, 88px) clamp(32px, 3vw + 8px, 56px);
  text-align: center;
}

.hlb-home-findpro__form {
  max-width: 650px;
  margin: 32px auto 0;
  text-align: left;
}

.hlb-home .hlb-home-findpro__all {
  margin: 28px 0 0;
}

/* === News & Insights === */

.hlb-home-news {
  padding-block: 0 clamp(56px, 5vw + 16px, 96px);
  background: linear-gradient(to bottom, rgba(191, 199, 214, 0) 15%, rgba(191, 199, 214, 0.25) 74%);
}

/* === What Our Clients Say === */

.hlb-home-quotes {
  padding-block: clamp(64px, 6vw + 16px, 112px);
  background-color: var(--hlb-navy);
  background-image: var(--hlb-home-quotes-bg, none);
  background-position: center;
  background-size: cover;
  color: var(--hlb-white);
  text-align: center;
}

.hlb-home-quotes__icon {
  display: block;
  width: 51px;
  height: 48px;
  margin: 0 auto 24px;
  fill: var(--hlb-coral);
}

/* Figma frame 79: quote block about 635 wide. */
.hlb-home-quotes__track {
  display: grid;
  max-width: 680px;
  margin: 48px auto 0;
}

.hlb-home .hlb-home-quotes__slide {
  grid-area: 1 / 1;
  align-self: center;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
}

.hlb-home .hlb-home-quotes__slide.is-current {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Out: fade fast. In: fade and rise a touch slower, so they cross cleanly. */
.hlb-fade--ready .hlb-home-quotes__slide {
  transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
}

.hlb-home .hlb-fade--ready .hlb-home-quotes__slide.is-current {
  transition: opacity .6s ease .15s, transform .8s cubic-bezier(.22, .61, .36, 1) .15s, visibility 0s;
}

/* Uncode blockquote reset. */
.hlb-home .hlb-home-quotes__quote {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  quotes: none;
}

.hlb-home .hlb-home-quotes__quote::before,
.hlb-home .hlb-home-quotes__quote::after {
  content: none;
}

.hlb-home .hlb-home-quotes__quote p {
  margin: 0;
  font: 500 clamp(20px, 0.4vw + 16px, 24px)/1.35 var(--hlb-font-body);
  font-style: normal;
  color: var(--hlb-white);
}

/* Name over source. Name optional. */
.hlb-home .hlb-home-quotes__cite {
  margin: 32px 0 0;
}

.hlb-home .hlb-home-quotes__name {
  display: block;
  font: 500 18px/1.3 var(--hlb-font-body);
  color: var(--hlb-white);
}

/* Mint on navy 7.92:1. */
.hlb-home .hlb-home-quotes__source {
  display: block;
  margin: 0;
  font: 400 13px/1.4 var(--hlb-font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hlb-mint);
}

.hlb-home .hlb-home-quotes__name + .hlb-home-quotes__source {
  margin-top: 8px;
}

/* Arrows. Carousel design, white on dark. */
.hlb-fade__controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.hlb-fade__controls[hidden] {
  display: none;
}

.hlb-home .hlb-fade__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hlb-white);
  cursor: pointer;
}

.hlb-fade__btn::before {
  content: '';
  position: absolute;
  width: 37px;
  height: 37px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition: background-color var(--hlb-speed) var(--hlb-ease);
}

.hlb-fade__btn svg {
  position: relative;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hlb-home .hlb-fade__btn:hover {
  color: var(--hlb-navy);
}

.hlb-fade__btn:hover::before {
  background-color: var(--hlb-white);
  border-color: var(--hlb-white);
}

.hlb-home .hlb-fade__btn:focus-visible {
  outline: 2px solid var(--hlb-white);
  outline-offset: 2px;
}

/* === Case Studies === */

.hlb-home-cases {
  padding-block: clamp(56px, 5vw + 16px, 96px) clamp(72px, 7vw + 16px, 128px);
  background: var(--hlb-navy);
  color: var(--hlb-white);
}

.hlb-home .hlb-home-cases__all {
  margin: 16px 0 48px;
  text-align: center;
}

/* Card on navy. Line color comes from .hlb-on-dark (mint). */
.hlb-home-cases .hlb-news-card .hlb-news-card__title,
.hlb-home-cases .hlb-news-card__cat {
  color: var(--hlb-white);
}

.hlb-home-cases .hlb-news-card .hlb-news-card__title a:focus-visible::after {
  outline-color: var(--hlb-white);
}

/* === Diversity === */

.hlb-home-dei {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(560px, 30vw + 200px, 760px);
  padding-block: 64px;
  overflow: hidden;
  background: var(--hlb-navy);
}

.hlb-home-dei__media {
  position: absolute;
  inset: 0;
}

.hlb-home-dei__media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.hlb-home-dei__inner {
  position: relative;
}

.hlb-home-dei__box {
  width: min(100%, 640px);
  padding: clamp(32px, 2.5vw + 12px, 56px);
  background: var(--hlb-white);
}

.hlb-home .hlb-home-dei__title,
.hlb-home .hlb-home-feature__title {
  margin: 0;
  padding: 0;
  font: 400 clamp(22px, 0.6vw + 16px, 28px)/1.25 var(--hlb-font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hlb-ink);
}

.hlb-home .hlb-home-dei__text,
.hlb-home .hlb-home-feature__text {
  margin: 16px 0 0;
  font: 400 16px/26px var(--hlb-font-body);
  color: var(--hlb-ink);
}

.hlb-home-dei__actions,
.hlb-home-feature__actions {
  margin-top: 28px;
}

/* Phones: image stays behind, box sits low so the photo shows above it. */
@media (max-width: 767px) {
  .hlb-home-dei {
    align-items: end;
    min-height: 0;
    padding-block: 220px 32px;
  }
}

/* === Feature rows === */

.hlb-home-features {
  padding-block: clamp(64px, 5vw + 32px, 108px);
  background: linear-gradient(to bottom, rgba(191, 199, 214, 0) 14%, rgba(191, 199, 214, 0.25) 67%);
}

.hlb-home-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.hlb-home-feature + .hlb-home-feature {
  margin-top: clamp(64px, 5vw + 32px, 108px);
}

.hlb-home-feature__media a {
  display: block;
}

.hlb-home-feature__media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Media is first in the DOM, so phones get image above text for free. */
@media (min-width: 768px) {
  .hlb-home-feature {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(40px, 4vw + 8px, 80px);
  }

  .hlb-home-feature--image-right .hlb-home-feature__media {
    order: 2;
  }
}

/* === Reduced motion === */

@media (prefers-reduced-motion: reduce) {
  .hlb-fade--ready .hlb-home-hero__slide,
  .hlb-fade--ready .hlb-home-hero__slide.is-current,
  .hlb-fade--ready .hlb-home-quotes__slide,
  .hlb-home .hlb-fade--ready .hlb-home-quotes__slide.is-current,
  .hlb-home-hero__dot::before,
  .hlb-fade__btn::before {
    transition: none;
  }

  .hlb-home .hlb-home-quotes__slide {
    transform: none;
  }
}
