/* ==========================================================================
   Home Banner — hero carousel
   All styles scoped to .home-banner
   ========================================================================== */

.home-banner {
  --home-banner-border-color: #f4222d;
  --home-banner-intro-accent: #ffe65e;
  --home-banner-bg: #0c171c;
  --home-banner-text: #ffffff;
  --home-banner-dot: rgba(150, 150, 150, 0.5);
  --home-banner-dot-active: #ffffff;
  /* Fit the whole framed hero (bottom border included) in the first screen:
     viewport minus the header (measured by site-header.js; 128px until it
     runs) and the logged-in admin bar. Never below 600px, never taller
     than the 880px design. */
  --home-banner-max-height: 880px;
  --home-banner-header-h: var(--site-header-h, 128px);
  --home-banner-height: clamp(
    600px,
    calc(100svh - var(--home-banner-header-h) - var(--wp-admin--admin-bar--height, 0px)),
    var(--home-banner-max-height)
  );

  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  height: var(--home-banner-height);
  background: var(--home-banner-bg);
  overflow: hidden;
  font-family: 'Quattrocento', Georgia, serif;
  color: var(--home-banner-text);
  isolation: isolate;
}

/* Glide's .glide__track / .glide__slides / .glide__slide handle transforms.
   Give each level an explicit height so slides don't collapse. */
.home-banner .glide__track {
  height: var(--home-banner-height);
  overflow: hidden;
}

.home-banner .glide__slides {
  height: var(--home-banner-height);
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: normal;
}

.home-banner__slide {
  position: relative;
  height: var(--home-banner-height);
  overflow: hidden;
}

/* Border frame overlay (per-slide color via CSS var) */
.home-banner__frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow: inset 0 0 0 clamp(12px, 2vw, 40px) var(--home-banner-border-color);
}

/* ==========================================================================
   Attorney slides
   ========================================================================== */

.home-banner__slide--attorney {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.home-banner__main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 40px 110px;
  gap: 55px;
  /* No z-index here — children set their own so the portrait can layer between them. */
}

.home-banner__side {
  position: absolute;
  bottom: 0;
  right: 0;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 40px;
  padding: 80px 70px;
  z-index: 3;
}

/* When a slide has no attorney name, group headline + CTAs and center them. */
.home-banner__slide--no-name .home-banner__main {
  justify-content: end;
  gap: 40px;
}

.home-banner__slide--no-name .home-banner__headline {
  font-size: 88px;
  line-height: 96px;
  z-index: 3;
}

.home-banner__slide--no-name .home-banner__portrait img {
  max-height: 990px;
}

.home-banner__backplate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(-1, -1);
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.home-banner__headline {
  position: relative;
  margin: 0;
  max-width: 1560px;
  font-family: 'Quattrocento', Georgia, serif;
  font-weight: 400;
  font-size: 152px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--home-banner-text);
  z-index: 1;
}

.home-banner__headline em {
  font-style: italic;
}

.home-banner__headline strong {
  font-weight: 700;
  font-style: italic;
}

.home-banner__portrait {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 2;
  pointer-events: none;
}

.home-banner__portrait img {
  height: 100%;
  width: 100%;
  max-height: 720px;
  max-width: 100%;
  display: block;
  object-fit: contain;
  object-position: bottom center;
}

.home-banner__name {
  position: relative;
  margin-top: auto;
  max-width: 720px;
  font-family: 'Quattrocento', Georgia, serif;
  font-weight: 400;
  font-size: 72px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--home-banner-text);
  z-index: 3;
}

.home-banner__ctas {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 705px;
  z-index: 3;
}

/* Buttons come from the shared .c-btn component (_template-parts/components/_button.php). */

.home-banner__ctas .c-btn {
  flex: 1 1 0;
}

/* 50th badge — sits in the right sidebar, second slot */
.home-banner__badge {
  width: 200px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Optional extra icon — sits in the right sidebar, first slot */
.home-banner__extra {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

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

.home-banner__extra-text {
  font-family: 'Quattrocento Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--home-banner-intro-accent);
}

.home-banner__badge-label {
  font-family: 'Quattrocento Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.16em;
  line-height: 0.95;
  text-align: center;
  color: var(--home-banner-intro-accent);
  text-transform: uppercase;
}

.home-banner__badge-mark {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Intro / anniversary slide (different layout)
   ========================================================================== */

.home-banner__slide--intro {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.home-banner__intro-content {
  flex: 0 0 auto;
  width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Vertical padding scales with the banner height (≈110px at 880px) so the
     content still fits at the 600px minimum. */
  padding: calc(var(--home-banner-height) * 0.11) 60px calc(var(--home-banner-height) * 0.11) 100px;
  gap: 40px;
  background: var(--home-banner-bg);
  z-index: 2;
}

.home-banner__intro-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
}

.home-banner__intro-ctas {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-banner__intro-media {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

/* <picture> is inline by default. `display: contents` removes it from the
   box tree so the <img> is treated as a direct flex child of `.__intro-media`
   and its `height:100% + object-fit:cover` cover the whole slide. */
.home-banner__intro-media picture {
  display: contents;
}

.home-banner__intro-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.home-banner__intro-label {
  align-self: stretch;
  text-align: center;
  font-family: 'Quattrocento Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  color: var(--home-banner-intro-accent);
  line-height: 0.92;
}

.home-banner__intro-label--top {
  font-size: 56px;
  letter-spacing: 0.04em;
}

.home-banner__intro-label--bottom {
  font-size: 37px;
  letter-spacing: 0.06em;
}

.home-banner__intro-number {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(300px, calc(var(--home-banner-height) * 0.34));
  object-fit: contain;
}

/* ==========================================================================
   Dot nav
   ========================================================================== */

.home-banner__dots {
  position: absolute;
  left: 50%;
  bottom: 65px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 6;
}

.home-banner__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--home-banner-dot);
  padding: 0;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.home-banner__dot:hover {
  background: rgba(255, 255, 255, 0.55);
}

.home-banner__dot.glide__bullet--active {
  background: var(--home-banner-dot-active);
  border-color: var(--home-banner-dot-active);
}

/* ==========================================================================
   Editor + responsive
   ========================================================================== */

/* ------------------------------------------------------------------ */
/* Gutenberg editor preview — Glide never mounts, so we render just the
   first slide (the intro) at a scaled-down size. The block still
   renders at true 1920×880 internally; a scale transform on a wrapper
   shrinks it visually so it fits the narrow editor iframe.             */
/* ------------------------------------------------------------------ */

.home-banner--is-preview {
  /* zoom scales the whole box (dimensions + content), so the block's
     bounding box in the editor matches what we see visually. Supported
     in Chrome, Safari, Edge, and Firefox 126+.                          */
  zoom: 0.55;
  /* The editor iframe's viewport means nothing here — keep the design height. */
  --home-banner-height: 880px;
}

.home-banner--is-preview .home-banner__track,
.home-banner--is-preview .home-banner__slides {
  display: block;
}

.home-banner--is-preview .home-banner__slide {
  width: 100%;
}

.home-banner--is-preview .home-banner__slide ~ .home-banner__slide {
  display: none;
}

.home-banner--is-preview .home-banner__dots {
  display: none;
}

/* Preview reveal defaults — no Glide = no .glide__slide--active class,
   so make sure everything shows in the editor.                         */
.home-banner--is-preview .home-banner__headline,
.home-banner--is-preview .home-banner__portrait,
.home-banner--is-preview .home-banner__name,
.home-banner--is-preview .home-banner__ctas,
.home-banner--is-preview .home-banner__badge,
.home-banner--is-preview .home-banner__extra,
.home-banner--is-preview .home-banner__intro-content {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Mobile — matches the 393×645 mobile Figma design
   ========================================================================== */

@media (max-width: 1414px) {
  .home-banner__headline {
    font-size: 110px;
  }

  .home-banner__slide--no-name .home-banner__headline {
    font-size: 60px;
    line-height: 1;
  }
}

@media (max-width: 1200px) {
  .home-banner__portrait img {
    max-height: 650px;
  }

  .home-banner__side {
    bottom: 40%;
    padding: 10px 40px;
  }

  .home-banner__slide--no-name .home-banner__side {
    top: 30px;
    bottom: inherit;
    left: 0;
    right: inherit;
  }

  .home-banner__badge {
    width: 150px;
  }

  .home-banner__badge-label {
    font-size: 7px;
    line-height: 6px;
  }

  .home-banner__dots {
    bottom: 40px;
  }

  .home-banner__intro-content {
    width: 45%;
  }

  .home-banner__intro-label--top {
    font-size: 30px;
  }

  .home-banner__intro-label--bottom {
    font-size: 20px;
  }

  .home-banner__intro-number {
    max-width: 240px;
  }

  .home-banner__intro-ctas {
    margin-top: 0;
  }

  .home-banner__intro-content {
    padding: 0 30px 0 50px;
    justify-content: center;
  }
}

@media (max-width: 767px) {
  .home-banner {
    --home-banner-max-height: 645px;
    --home-banner-header-h: var(--site-header-h, 84px);
    min-height: 0;
  }

  /* Frame inset gets thinner on mobile per design (20px flat). */
  .home-banner__frame {
    box-shadow: inset 0 0 0 20px var(--home-banner-border-color);
  }

  /* ---------------- Attorney slide ----------------
     Only the backplate + portrait stay absolute — those are background
     layers behind the flex-flow content. Everything else (headline, name,
     CTAs, badge) lives in natural flow inside .home-banner__main. */

  .home-banner__slide--attorney {
    flex-direction: column;
    padding: 0;
  }

  /* Portrait keeps its desktop `inset: 0` — just resize the image inside. */
  .home-banner__portrait img {
    max-height: 405px;
    max-width: 100%;
  }

  /* Bottom fade overlay behind the CTAs. */
  .home-banner__slide--attorney::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(33, 27, 27, 0) 0%, rgba(33, 27, 27, 0.8) 55%);
    pointer-events: none;
    z-index: 2;
  }

  /* Main content column — natural flex: headline at top, CTAs at bottom.
     padding-top clears the absolutely-positioned .home-banner__side badge. */
  .home-banner__main {
    padding: 150px 50px 80px;
    gap: 20px;
    justify-content: flex-start;
  }

  .home-banner__headline {
    max-width: none;
    font-size: 68px;
    line-height: 0.9;
    letter-spacing: -0.04em;
  }

  .home-banner__slide--no-name .home-banner__headline {
    position: relative;
    z-index: 0;
  }

  /* Slides with longer copy get a smaller headline. */
  .home-banner__slide--attorney .home-banner__headline:has(br) {
    font-size: 36px;
    line-height: 1.1;
  }

  /* Attorney name is hidden — the ghost CTA already carries it on mobile. */
  .home-banner__name {
    display: none;
  }

  /* CTAs stack and get pushed to the bottom via margin-top:auto. */
  .home-banner__ctas {
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    max-width: none;
  }

  /* Side aside → floats top-left. Only floating element on mobile, so it
     keeps its absolute position from desktop but re-anchored. */
  .home-banner__side,
  .home-banner__slide--no-name .home-banner__side {
    top: 30px;
    left: 30px;
    right: auto;
    bottom: auto;
    padding: 0;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .home-banner__extra {
    display: none;
  }

  .home-banner__badge {
    width: 95px;
    margin-top: 0;
    gap: 4px;
  }

  .home-banner__badge-label {
    font-size: 7.5px;
    letter-spacing: 0.16em;
  }

  /* ---------------- Intro / anniversary slide ---------------- */

  .home-banner__slide--intro {
    flex-direction: column;
    padding: 0;
  }

  /* Photo covers the whole slide (Gloria Allred fills). */
  .home-banner__intro-media {
    position: absolute;
    inset: 0;
    min-height: 0;
    z-index: 0;
  }

  .home-banner__intro-media picture,
  .home-banner__intro-media img,
  .home-banner__intro-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 0px;
  }

  .home-banner__slide--no-name .home-banner__portrait img {
    max-height: 400px;
  }

  .home-banner__slide--no-name .home-banner__headline {
    font-size: 36px;
    line-height: 35px;
  }

  /* Content is the centered "CELEBRATING / 50 / YEARS OF SERVICE" block
     plus a single CTA at the bottom. */
  .home-banner__intro-content {
    position: absolute;
    inset: 0;
    width: auto;
    padding: 40px 50px 80px;
    background: transparent;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transform: none;
  }

  .home-banner__intro-labels {
    gap: 8px;
    max-width: 200px;
  }

  .home-banner__intro-label--top {
    font-size: 16px;
    letter-spacing: 0.16em;
  }

  .home-banner__intro-label--bottom {
    font-size: 16px;
    letter-spacing: 0.16em;
  }

  .home-banner__intro-number {
    max-height: 160px;
  }

  .home-banner__intro-ctas {
    width: 100%;
    max-width: none;
    margin-top: 0;
  }

  /* Button sizes come from the shared .c-btn mobile styles. */

  /* ---------------- Dots ---------------- */

  .home-banner__dots {
    bottom: 40px;
  }
}

@media (max-width: 540px) {
  .home-banner__headline {
    font-size: 58px;
  }

  .home-banner__slide--no-name .home-banner__headline {
    font-size: 28px;
  }

  .home-banner__slide--attorney .home-banner__headline:has(br) {
    font-size: 30px;
  }

  .home-banner__slide--no-name .home-banner__portrait img {
    max-height: 380px;
  }
}
