/* ==========================================================================
   Single beach page (/beach/{slug}/)
   Gallery hero under the transparent header, details column + sticky booking
   sidebar, amenities / facilities / included / availability, more beaches,
   and the mobile "Book Now" bar. The booking widget and availability calendar
   themselves are styled in booking.css.
   ========================================================================== */

/* ----- Gallery hero ----- */
.beach-hero { position: relative; background: var(--c-dark); }
.beach-hero::before { /* keeps the white header legible over bright photos (adds to the header's own scrim) */
  content: ""; position: absolute; inset: 0 0 auto; z-index: 3; height: 260px; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36) 0%, rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0) 100%);
}
.beach-hero .carousel { --per-view: 3; --gap: 4px; }
.beach-hero__slide { position: relative; height: clamp(420px, 44vw, 640px); overflow: hidden; background: var(--c-dark-line); }
.beach-hero__slide picture, .beach-hero__slide img { width: 100%; height: 100%; object-fit: cover; }
.beach-hero__slide img { animation: bp-hero-zoom 2.4s var(--ease-out) backwards; transition: transform 1.2s var(--ease-out); }
.beach-hero__slide:hover img { transform: scale(1.03); }
.beach-hero .carousel__btn { z-index: 5; width: 54px; height: 54px; margin-top: -27px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18); }
.beach-hero .carousel__btn--prev { left: 40px; }
.beach-hero .carousel__btn--next { right: 40px; }
.beach-hero .carousel__dots { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 4; margin: 0; }
.beach-hero .carousel__dot::before { box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); }

/* ----- Layout: details column + sticky booking sidebar ----- */
.beach-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 410px);
  grid-template-rows: auto 1fr;
  grid-template-areas: "intro aside" "details aside";
  column-gap: clamp(40px, 5vw, 80px);
  padding-top: clamp(48px, 5vw, 76px);
  padding-bottom: clamp(80px, 8vw, 120px);
}
.beach-layout__intro { grid-area: intro; min-width: 0; }
.beach-layout__aside { grid-area: aside; min-width: 0; }
.beach-layout__details { grid-area: details; min-width: 0; }
/* Sticky sidebar, only on screens tall enough for the whole widget (~890-960px): below the sticky header
   (110px) and above the back-to-top button (96px reserved at the bottom), so the date field never sticks
   out of view and nothing covers the card. Shorter screens: the widget simply scrolls with the page.
   --bp-widget-h is a safe estimate; booking.js sets the measured height on .beach-aside. */
@media (min-width: 1025px) and (min-height: 1100px) {
  .beach-aside { position: sticky; top: min(110px, calc(100vh - var(--bp-widget-h, 960px) - 96px)); }
}

/* ----- Intro ----- */
.beach-breadcrumb ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 18px; padding: 0; list-style: none;
  font-size: 13px; line-height: 1.5; letter-spacing: 0.03em; color: var(--c-muted);
}
.beach-breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--c-driftwood); }
.beach-breadcrumb a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color var(--t-fast), text-decoration-color var(--t-fast); }
.beach-breadcrumb a:hover { color: var(--c-lagoon); text-decoration-color: currentColor; }
.beach-breadcrumb [aria-current] { color: var(--c-text); }

.beach-title { font-size: clamp(32px, 3vw, 42px); line-height: 1.2; text-wrap: balance; }
.beach-layout__intro > .beach-tags { margin-top: 10px; }
.beach-access { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 22px; }
.beach-access__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.beach-access__day-badge {
  padding: 9px 18px 9px 14px; gap: 9px; border-radius: 0;
  font-size: 14px; letter-spacing: 0.02em; box-shadow: inset 0 0 0 1px var(--a);
}
.beach-access__day-badge .icon { width: 18px; height: 18px; }
.beach-description { margin-top: 30px; font-size: 18px; line-height: 1.75; color: var(--c-text); }
.beach-description p + p { margin-top: 1.1em; }

/* ----- Details blocks ----- */
.beach-layout__details > * { margin-top: clamp(56px, 5.5vw, 80px); }
.beach-layout__details > :first-child { margin-top: clamp(44px, 4vw, 56px); }
.beach-block__title { margin-bottom: 28px; font-size: clamp(26px, 2.2vw, 30px); line-height: 1.3; }

/* Photo carousel inside the column */
.beach-gallery .carousel { --per-view: 2; --gap: 20px; }
.beach-gallery__photo { aspect-ratio: 4 / 5; }
.beach-gallery__photo picture { width: 100%; height: 100%; }
.beach-gallery__photo:hover img { transform: scale(1.03); }
.beach-gallery .carousel__dots { margin-top: 26px; }

/* Amenities: cream tiles */
.amenity-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.amenity-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  min-height: 168px; padding: 32px 16px 28px; background: var(--c-cream); text-align: center;
}
.amenity-tile__icon { width: 30px; height: 30px; color: var(--c-sand); stroke-width: 1.3; }
.amenity-tile__label { font-family: var(--ff-heading); font-size: 15px; line-height: 1.4; color: var(--c-ink); }

/* Facilities: two-column icon list */
.facility-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; margin: 0; padding: 0; list-style: none; }
.facility-list li { display: flex; align-items: center; gap: 14px; font-family: var(--ff-heading); font-size: 16px; line-height: 1.45; color: var(--c-ink); }
.facility-list__icon { width: 22px; height: 22px; color: var(--c-sand); stroke-width: 1.4; }

/* What's included */
.included-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.included-list li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.6; color: var(--c-text); }
.included-list li::before {
  content: ""; position: absolute; left: 2px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-lagoon);
}

/* Availability (calendar comes from partials/availability; weekly pattern is the fallback) */
.beach-availability { scroll-margin-top: 110px; }
.beach-availability__text { max-width: 640px; margin-bottom: 22px; font-size: 16px; line-height: 1.6; color: var(--c-muted); }
.beach-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.beach-week__day {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 12px;
  background: var(--a-bg, var(--access-family-bg)); color: var(--a, var(--access-family)); text-align: center;
}
.beach-week__name { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ink); }
.beach-week__icon { width: 20px; height: 20px; }
.beach-week__type { font-size: 12px; line-height: 1.3; }

/* Fallback booking box (only while partials/booking-widget.php is missing) */
.beach-book-fallback { display: flex; flex-direction: column; gap: 14px; padding: 34px 30px; background: var(--c-olive); color: var(--c-white); scroll-margin-top: 110px; }
.beach-book-fallback__price { font-size: 15px; }
.beach-book-fallback__price strong { font-family: var(--ff-heading); font-size: 30px; font-weight: 400; }
.beach-book-fallback__title { color: var(--c-white); font-size: 26px; line-height: 1.3; }
.beach-book-fallback__text { font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); }
.beach-book-fallback .btn { margin-top: 6px; }

/* ----- More beaches ----- */
.beach-more { border-top: 1px solid var(--c-line); }
.beach-more__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px; margin-bottom: clamp(36px, 4vw, 56px); }
.beach-more .carousel { --per-view: 3; --gap: clamp(24px, 3vw, 40px); container-type: inline-size; }
@supports (width: 1cqw) {
  /* centre the arrows on the square photos rather than the whole card */
  .beach-more .carousel { --btn-top: calc((100cqw - var(--gap) * (var(--per-view) - 1)) / var(--per-view) / 2); }
}
.beach-more .beach-card__media { overflow: hidden; }
.beach-card__link { position: absolute; inset: 0; display: block; }
.beach-card__link picture { width: 100%; height: 100%; }
.beach-card__title a { transition: color var(--t) var(--ease); }
.beach-card__access { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.beach-card__access .access-badge { font-size: 12px; padding: 4px 10px 4px 8px; }
.beach-card .link-more { align-self: flex-start; }

/* ----- Mobile "Book Now" bar ----- */
.beach-cta-bar { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .beach-hero .carousel__btn--prev { left: 24px; }
  .beach-hero .carousel__btn--next { right: 24px; }
}
@media (max-width: 1024px) {
  .beach-hero .carousel { --per-view: 2; }
  .beach-hero .carousel__btn--prev { left: 16px; }
  .beach-hero .carousel__btn--next { right: 16px; }

  .beach-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "intro" "aside" "details"; }
  .beach-layout__aside { margin-top: 44px; }
  .beach-aside { max-width: 620px; margin-inline: auto; }
  .beach-more .carousel { --per-view: 2; }
  .beach-gallery .carousel__btn--prev { left: 12px; }
  .beach-gallery .carousel__btn--next { right: 12px; }

  /* Fixed bottom bar linking to the booking widget */
  .beach-cta-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 850;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--c-white); border-top: 1px solid var(--c-line); box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.07);
  }
  .beach-cta-bar__price { font-size: 14px; line-height: 1.3; color: var(--c-muted); }
  .beach-cta-bar__price strong { font-family: var(--ff-heading); font-size: 22px; font-weight: 400; color: var(--c-ink); }
  .beach-cta-bar__btn { flex: none; }
  /* keep page furniture clear of the bar */
  .site-footer { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .to-top { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 767px) {
  .beach-hero .carousel { --per-view: 1; --gap: 0px; }
  .beach-hero__slide { height: 420px; }
  .beach-hero::before { height: 200px; }
  .beach-hero .carousel__dots { bottom: 14px; padding: 0 16px; flex-wrap: wrap; }

  .beach-description { font-size: 16px; }
  .beach-gallery .carousel { --per-view: 1.15; --gap: 12px; }
  .amenity-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .amenity-tile { min-height: 140px; padding: 26px 12px 22px; }
  .facility-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .included-list li { font-size: 16px; }
  .beach-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .beach-more .carousel { --per-view: 1.15; --gap: 16px; }
  .beach-more__all { width: 100%; }
}

/* Hide the bar while the booking widget itself is on screen (scroll-driven; browsers without support keep it visible). */
@supports (animation-timeline: view()) {
  .beach-page { timeline-scope: --bp-book; }
  .beach-layout__aside { view-timeline: --bp-book block; }
  @media (max-width: 1024px) {
    .beach-cta-bar { animation: bp-cta-away linear both; animation-timeline: --bp-book; animation-range: cover; }
  }
}
@keyframes bp-cta-away {
  0%, 100% { opacity: 1; transform: none; visibility: visible; }
  12%, 88% { opacity: 0; transform: translateY(110%); visibility: hidden; }
}
