/* ==========================================================================
   hero.css — two-image hero banner with an overlaid content box.
   Requires common.css.

   Mobile : image 1, then the text box, then image 2 (the second image is
            moved below the content with `order`). Both images use a fixed /
            parallax effect — they stay put while the page scrolls.
   Desktop: the two images become a full-bleed split background (50% each)
            and the content box overlays the bottom-left.
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* --- Images (parallax) ----------------------------------------------------
   The image is position:fixed (so it stays in place on scroll) and the
   slot's clip-path clips it to the slot's box, producing the reveal.       */
.hero__media {
  position: relative;
  height: 34rem;
  overflow: hidden;
  clip-path: inset(0);
}

.hero__media--second {
  order: 1; /* render after the content box on mobile */
}

.hero__image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

/* --- Content -------------------------------------------------------------- */
.hero__box {
  padding: 4rem 3.5rem;
  background: #f2f0eb;
  color: #2b2a2a;
}

.hero__heading {
  margin: 0;
  font-size: 4rem;
  font-weight: 400;
  line-height: 1.1;
}

.hero__text {
  margin: 1.5rem 0 0;
  font-size: 1.8rem;
  line-height: 1.5;
}

.hero__text p {
  margin: 0;
}

.hero__buttons {
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  min-width: 12rem;
  padding: 0 3rem;
  background: #f5f5f5;
  color: #303030;
  font-size: 1.5rem;
  text-decoration: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

/* --- Desktop -------------------------------------------------------------- */
@media (min-width: 750px) {
  .hero {
    flex-direction: row;
    min-height: 56rem;
  }

  /* Images become the background, split into two halves */
  .hero__media {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
  }

  .hero__media--first {
    left: 0;
  }

  .hero__media--second {
    left: 50%;
  }

  .hero__image {
    width: 50%; /* fixed -> 50% of the viewport = half the screen */
  }

  .hero__media--second .hero__image {
    left: 50%;
  }

  /* Black-to-transparent gradient at the bottom so the overlaid text reads */
  .hero::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: none;
    z-index: 0;
  }

  /* Content overlays bottom-left */
  .hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 5rem;
  }

  .hero__box {
    max-width: 68rem;
    padding: 1rem 0;
    background: transparent;
    color: var(--hero-heading-color, #fff);
  }

  .hero__heading {
    font-size: 5.2rem;
  }
}
