/**
 * Homepage: fused quick-step bar overlapping hero.
 * Overlap ≈ 1/6 of cell height. Pull-up is on #about because a hidden section
 * sits between .ph-hero-carousel-wrap and #about (adjacent-sibling margin would not apply).
 */

#about.about-us.section.ph-about-split {
  --ph-step-min-h: 12rem;
  --ph-step-pt: 2.15rem;
  --ph-step-pb: 2.2rem;
  --ph-step-overlap: max(
    3rem,
    calc((var(--ph-step-min-h) + var(--ph-step-pt) + var(--ph-step-pb)) / 6)
  );

  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  background: transparent;
  position: relative;
  z-index: 6;
  isolation: isolate;
}

/* Only when a hero carousel exists above (skips when /api/banner is empty) */
.ph-hero-carousel-wrap ~ #about.about-us.section.ph-about-split {
  margin-top: calc(-1 * var(--ph-step-overlap)) !important;
}

.ph-quick-steps-band {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: var(--ph-section-gap, 1.5rem);
  background: transparent;
}

.ph-quick-steps-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(1, 40, 100, 0.32);
  overflow: hidden;
  align-items: stretch;
}

.ph-quick-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: var(--ph-step-pt) 1.75rem var(--ph-step-pb);
  min-height: var(--ph-step-min-h);
  box-sizing: border-box;
  border-radius: 0;
  background: linear-gradient(180deg, #0a5fc9 0%, #014ab2 45%, #052a66 100%);
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.ph-quick-step:last-child {
  border-right: none;
}

.ph-quick-step:hover {
  filter: brightness(1.1);
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.07);
  text-decoration: none;
  color: inherit;
}

.ph-quick-step:focus-visible {
  outline: 3px solid #fff8a8;
  outline-offset: 3px;
  z-index: 1;
}

.ph-quick-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 1.22rem;
  font-size: 2.35rem;
  line-height: 1;
  color: #fff;
  opacity: 0.98;
}

.ph-quick-step-title {
  display: block;
  width: 100%;
  font-size: 1.28rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.55rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: center;
}

.ph-quick-step-chevron {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  margin-left: 0.12em;
}

.ph-quick-step-desc {
  display: block;
  width: 100%;
  font-size: 1.02rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  margin: 0;
  text-align: center;
}

.ph-quick-step-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  width: 100%;
  text-align: center;
  min-width: 0;
}

@media (max-width: 768px) {
  #about.about-us.section.ph-about-split {
    background: transparent !important;
  }
}

@media (max-width: 991.98px) {
  #about.about-us.section.ph-about-split {
    --ph-step-min-h: 10.75rem;
    --ph-step-pt: 1.85rem;
    --ph-step-pb: 1.9rem;
    /* Slightly less pull on tablet so hero stays readable */
    --ph-step-overlap: max(
      2rem,
      calc((var(--ph-step-min-h) + var(--ph-step-pt) + var(--ph-step-pb)) / 7)
    );
  }

  .ph-quick-steps-band {
    padding-bottom: var(--ph-section-gap, 1.25rem);
  }

  .ph-quick-steps-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ph-quick-step:nth-child(2n) {
    border-right: none;
  }

  .ph-quick-step:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }

  .ph-quick-step-icon {
    font-size: 2.1rem;
    margin-bottom: 1.05rem;
  }

  .ph-quick-step-title {
    font-size: 1.18rem;
  }

  .ph-quick-step-desc {
    font-size: 0.98rem;
  }
}

@media (max-width: 575.98px) {
  #about.about-us.section.ph-about-split {
    --ph-step-min-h: 0rem;
    --ph-step-pt: 1.5rem;
    --ph-step-pb: 1.55rem;
  }

  /* No overlap on phones — cards sit fully below the hero */
  .ph-hero-carousel-wrap ~ #about.about-us.section.ph-about-split {
    margin-top: 0 !important;
  }

  .ph-quick-steps-band {
    padding-top: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: var(--ph-section-gap, 1.25rem);
  }

  .ph-quick-steps-card {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }

  .ph-quick-step {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    padding: var(--ph-step-pt) 1.05rem var(--ph-step-pb) 1rem !important;
  }

  .ph-quick-step:last-child {
    border-bottom: none;
  }

  .ph-quick-step-icon {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    padding-top: 0;
  }

  .ph-quick-step-body {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .ph-quick-step-title {
    font-size: 1.12rem;
    margin-bottom: 0.35rem;
  }

  .ph-quick-step-desc {
    font-size: 0.94rem;
  }
}

@media (min-width: 1200px) {
  #about.about-us.section.ph-about-split {
    --ph-step-min-h: 13rem;
    --ph-step-pt: 2.4rem;
    --ph-step-pb: 2.45rem;
  }

  .ph-quick-steps-band {
    padding-bottom: var(--ph-section-gap, 1.5rem);
  }

  .ph-quick-step-icon {
    font-size: 2.6rem;
    margin-bottom: 1.28rem;
  }

  .ph-quick-step-title {
    font-size: 1.38rem;
  }

  .ph-quick-step-desc {
    font-size: 1.06rem;
  }
}
