/* ==========================================================================
   Home page (app/views/pages/home.php)
   Measurements follow the live homepage (1920px render): container 1300px,
   section rhythm ~110px, hero 93vh, video band 85vh, testimonial 150px.
   Shared components (hero, search bar, carousel, beach card, badges) live in base.css;
   this file only positions and tunes them for the homepage.
   ========================================================================== */

/* Width of the .container content box, used to size slides from the viewport width
   when container query units are not available. */
:root { --home-cw: min(100vw - var(--gutter) * 2, var(--container)); }

/* Pictures inside fixed-ratio frames must fill the frame. */
.home-gallery__img picture,
.home-beach__img picture,
.pace-card__img picture,
.home-why__img picture { height: 100%; }

/* ----- 1. Hero ----- */
.home-hero__title { max-width: 8.8em; } /* breaks into three lines like the live site at every size */
.home-hero .page-hero__inner { gap: 26px; }

/* ----- 2. Search bar: half over the hero, half over the welcome section ----- */
.home-search { display: flow-root; background: var(--c-mist); }
.home-search .search-bar { margin-top: -54px; } /* bar is 108px tall: 30 + 48 + 30 */

/* ----- 3. Welcome + photo carousel ----- */
.home-welcome__top { padding: 106px 0 100px; background: var(--c-mist); } /* 160px from the hero edge, as live */
.home-welcome__intro { max-width: 820px; margin-inline: auto; }
.home-welcome__intro .brand-shell { margin-bottom: 12px; }
.home-welcome__intro .lead { max-width: 810px; }

/* The carousel starts at the container's left edge and bleeds off the right edge of the viewport.
   The mist background stops half-way down the photos. */
.home-gallery { position: relative; overflow: hidden; padding-bottom: 100px; }
.home-gallery__carousel { --gap: 30px; --n: 3; isolation: isolate; }
.home-gallery__carousel::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: -100vw; right: -100vw; height: 50%;
  background: var(--c-mist); pointer-events: none;
}
.home-gallery .carousel__viewport {
  margin-right: calc((100% - 100vw) / 2);
  grid-auto-columns: calc((var(--home-cw) - var(--gap) * (var(--n) - 1)) / var(--n));
}
@supports (width: 1cqw) {
  .home-gallery__carousel { container-type: inline-size; }
  .home-gallery .carousel__viewport { grid-auto-columns: calc((100cqw - var(--gap) * (var(--n) - 1)) / var(--n)); }
}
.home-gallery__img { aspect-ratio: 2 / 3; }
.home-gallery__note { margin-top: 20px; }

/* ----- 4. Video band ----- */
.home-video { position: relative; height: 85vh; min-height: 420px; overflow: hidden; background: var(--c-dark); }
.home-video video { background: var(--c-dark); }

/* ----- 5. Beaches carousel ----- */
.home-beaches { padding: 110px 0 90px; }
.home-beaches__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; margin-bottom: 55px;
}
.home-beaches__title { gap: 18px; }
.home-beaches__all { flex: none; }
.home-beaches__carousel {
  --gap: 50px;
  /* Arrows sit on the vertical middle of the square images (half a slide width from the top). */
  --btn-top: calc((var(--home-cw) - var(--gap) * (var(--per-view) - 1)) / var(--per-view) / 2);
}
@supports (width: 1cqw) {
  .home-beaches__carousel { container-type: inline-size; --btn-top: calc((100cqw - var(--gap) * (var(--per-view) - 1)) / var(--per-view) / 2); }
}
.home-beaches .carousel__dots { margin-top: 60px; }
.home-beach { height: 100%; }
.home-beach__img { position: absolute; inset: 0; }
.home-beach .beach-card__body { gap: 14px; }
.home-beach .beach-tags { margin-top: -4px; }
.home-beach__access { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.home-beach__access .access-badge { padding: 4px 10px 4px 8px; font-size: 12.5px; }
.home-beach__access .access-badge .icon { width: 14px; height: 14px; }
.home-beach__more { align-self: flex-start; margin-top: 2px; }

/* ----- 6. Pick Your Pace: image band with three cards overlapping into the white area ----- */
.home-pace__band { position: relative; padding: 110px 0 490px; overflow: hidden; background: var(--c-dark); }
.home-pace__band .media-cover img { object-position: center 45%; }
.home-pace__intro { position: relative; z-index: 1; }
.home-pace__intro .section-icon { margin-bottom: 0; }
.home-pace__cards { position: relative; z-index: 2; margin-top: -440px; padding-bottom: 120px; }
.home-pace__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 60px; align-items: start; }

.pace-card { position: relative; text-align: center; }
.pace-card:nth-child(2) { margin-top: 50px; } /* middle card sits lower, as live */
.pace-card__media { position: relative; }
.pace-card__frame { /* thin teal frame peeking out behind the photo */
  position: absolute; inset: 0; border: 1px solid var(--c-lagoon); pointer-events: none;
  transform: translate(-10px, -10px); transition: transform 0.9s var(--ease-out);
}
.pace-card__img { aspect-ratio: 2 / 3; }
.pace-card__title { margin-top: 34px; font-size: var(--fs-h5); line-height: 1.35; }
.pace-card__link { transition: color var(--t) var(--ease); }
.pace-card__link::after { content: ""; position: absolute; inset: 0; z-index: 3; } /* whole card is clickable */
.pace-card__text { max-width: 400px; margin: 14px auto 0; padding-inline: 14px; font-size: 15px; line-height: 1.6; }
.pace-card:hover .pace-card__frame,
.pace-card:focus-within .pace-card__frame { transform: translate(-16px, -16px); }
.pace-card:hover .pace-card__link { color: var(--c-lagoon); }
.pace-card:focus-within .img-frame img { transform: scale(1.04); }

/* ----- 7. Testimonial band ----- */
.home-quote { position: relative; padding: 150px 0; overflow: hidden; background: var(--c-dark); text-align: center; }
.home-quote__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.home-quote .section-icon { margin-bottom: 22px; }
.home-quote__figure { margin-top: 28px; }
.home-quote__text { max-width: 760px; margin-inline: auto; font-family: var(--ff-heading); font-size: var(--fs-quote); line-height: 1.5; color: var(--c-white); }
.home-quote__cite { display: block; margin-top: 28px; font-size: 14px; font-weight: 500; line-height: 1.4; letter-spacing: 0.1em; text-transform: uppercase; }
.home-quote__stars { display: flex; justify-content: center; gap: 6px; margin-top: 22px; color: var(--c-gold); }
.home-quote__stars .icon { width: 17px; height: 17px; fill: currentColor; stroke: none; }

/* ----- 8. Why book with Beach Pass ----- */
.home-why { padding: 110px 0; }
.home-why__grid {
  display: grid; grid-template-columns: minmax(0, 47fr) minmax(0, 53fr); column-gap: clamp(40px, 5vw, 70px); align-items: start;
}
.home-why__img { aspect-ratio: 2 / 3; }
.home-why__script { margin-top: 18px; text-align: right; }
.home-why__intro { gap: 18px; padding-top: 10px; }
.home-why__features {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 38px; margin: 50px 0 0; padding: 0; list-style: none;
}
.home-feature { display: flex; align-items: flex-start; gap: 24px; }
.home-feature__icon { width: 42px; height: 42px; color: var(--c-lagoon); stroke-width: 1.1; }
.home-feature__title { font-size: 18px; line-height: 1.4; }
.home-feature__text { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--c-text); }
.home-why__img--second { margin-top: 80px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .home-pace__grid { gap: 44px; }
  .home-why__features { column-gap: 28px; }
  .home-feature { gap: 18px; }
}

@media (max-width: 1024px) {
  .home-welcome__top { padding: 96px 0 80px; }
  .home-gallery { padding-bottom: 80px; }
  .home-gallery__carousel { --n: 2; --gap: 24px; }

  .home-video { height: 70vh; min-height: 380px; }

  .home-beaches { padding: 90px 0 80px; }
  .home-beaches__head { margin-bottom: 44px; }
  .home-beaches__carousel { --gap: 30px; }
  .home-beaches .carousel__dots { margin-top: 44px; }

  .home-pace__band { padding: 90px 0 320px; }
  .home-pace__cards { margin-top: -260px; padding-bottom: 90px; }
  .home-pace__grid { gap: 24px; }
  .pace-card:nth-child(2) { margin-top: 32px; }
  .pace-card__frame { transform: translate(-8px, -8px); }
  .pace-card:hover .pace-card__frame, .pace-card:focus-within .pace-card__frame { transform: translate(-12px, -12px); }
  .pace-card__title { margin-top: 26px; }
  .pace-card__text { padding-inline: 0; font-size: 14px; }

  .home-quote { padding: 110px 0; }

  /* Why book: heading and features full width, the two photos side by side, script line below. */
  .home-why { padding: 90px 0; }
  .home-why__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px;
    grid-template-areas: "intro intro" "features features" "first second" "script script";
  }
  .home-why__aside, .home-why__main { display: contents; }
  .home-why__intro { grid-area: intro; padding-top: 0; }
  .home-why__features { grid-area: features; margin: 44px 0 56px; }
  .home-why__img--first { grid-area: first; }
  .home-why__img--second { grid-area: second; margin-top: 0; }
  .home-why__script { grid-area: script; }
}

@media (max-width: 767px) {
  .home-search .search-bar { margin-top: -48px; }

  .home-welcome__top { padding: 64px 0 56px; }
  .home-welcome__intro .brand-shell { width: 54px; margin-bottom: 6px; }
  .home-welcome__intro .lead { font-size: 16px; }
  .home-gallery { padding-bottom: 64px; }
  .home-gallery__carousel { --n: 1.3; --gap: 16px; }
  .home-gallery__note { margin-top: 16px; }

  .home-video { height: 50vh; min-height: 280px; }

  .home-beaches { padding: 72px 0 64px; }
  .home-beaches__head { flex-direction: column; align-items: flex-start; margin-bottom: 36px; }
  .home-beaches__title { gap: 14px; }
  .home-beaches__all { height: 48px; padding: 0 28px; }
  .home-beaches__carousel { --gap: 16px; }
  .home-beaches .carousel__dots { margin-top: 30px; }

  /* Cards stack; only the first one overlaps the image band. */
  .home-pace__band { padding: 72px 0 190px; }
  .home-pace__cards { margin-top: -140px; padding-bottom: 72px; }
  .home-pace__grid { grid-template-columns: minmax(0, 1fr); gap: 56px; max-width: 440px; margin-inline: auto; }
  .pace-card:nth-child(2) { margin-top: 0; }
  .pace-card__media { margin-left: 8px; }
  .pace-card__img { aspect-ratio: 4 / 5; }
  .pace-card__title { margin-top: 24px; }
  .pace-card__text { margin-top: 10px; font-size: 15px; }

  .home-quote { padding: 88px 0; }
  .home-quote .section-icon { width: 48px; height: 48px; }
  .home-quote__figure { margin-top: 22px; }
  .home-quote__cite { margin-top: 22px; }

  .home-why { padding: 72px 0; }
  .home-why__grid { column-gap: 14px; }
  .home-why__features { grid-template-columns: minmax(0, 1fr); gap: 28px; margin: 36px 0 44px; }
  .home-feature { gap: 18px; }
  .home-feature__icon { width: 38px; height: 38px; }
  .home-why__script { margin-top: 16px; }
}

@media (max-width: 400px) {
  .home-gallery__carousel { --n: 1.2; }
}

/* Reduced motion: no frame/zoom movement (base.css already shortens transitions). */
@media (prefers-reduced-motion: reduce) {
  .pace-card:hover .pace-card__frame, .pace-card:focus-within .pace-card__frame { transform: translate(-10px, -10px); }
}
