/* Articles and destination guides use the same immersive sequence as About and Services. */
@layer immersive-pages {
  html body:is([data-page="blog-article"], [data-page="destination"]) {
    background: var(--paper, #f5f5f7) !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) :is(#site, .shell) {
    background: transparent !important;
    background-color: transparent !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .shell {
    position: relative !important;
    isolation: isolate !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .shell::before {
    content: "" !important;
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100lvh !important;
    z-index: -1 !important;
    pointer-events: none !important;
    background-image: var(--guide-continuation-shade, linear-gradient(rgba(0, 0, 0, .48), rgba(0, 0, 0, .48))), var(--immersive-guide-image) !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    filter: var(--guide-continuation-filter, contrast(1.08)) !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) main {
    position: relative !important;
    isolation: auto !important;
    clip-path: none !important;
    background: transparent !important;
    background-image: none !important;
  }

  /* Desktop reveals share the contact exposure. The hero keeps its own treatment. */
  @media (min-width: 960px) {
    html body:is([data-page="blog-article"], [data-page="destination"]) {
      --guide-continuation-shade: linear-gradient(rgba(0, 0, 0, .48), rgba(0, 0, 0, .48));
      --guide-continuation-filter: contrast(1.08);
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) .page-banner::before {
      content: "" !important;
      display: block !important;
      position: absolute !important;
      inset: 0 !important;
      z-index: 0 !important;
      pointer-events: none !important;
      background-image: linear-gradient(rgba(0, 0, 0, .48), rgba(0, 0, 0, .48)), var(--immersive-guide-image) !important;
      background-position: center !important;
      background-size: cover !important;
      background-repeat: no-repeat !important;
      background-attachment: fixed !important;
      filter: contrast(1.08) !important;
    }
  }

  /* Full-screen hero over the page's own image. */
  html body:is([data-page="blog-article"], [data-page="destination"]) .page-banner {
    height: 100vh !important;
    height: 100svh !important;
    min-height: 100svh !important;
    background: transparent !important;
    background-image: none !important;
    isolation: auto !important;
    clip-path: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"])
    :is(.page-banner__image, .page-banner__shade, .page-banner-transition) {
    display: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .page-banner__visible {
    min-height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .page-banner__copy {
    margin-inline: auto !important;
    text-align: center !important;
  }

  /* The reading section is one uninterrupted full-width white panel. */
  html body[data-page="blog-article"] .page-banner-context,
  html body[data-page="blog-article"] .blog-post-layout,
  html body[data-page="destination"] .story-section {
    position: relative !important;
    z-index: 1 !important;
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    clip-path: none !important;
    border-color: transparent !important;
  }
  html body[data-page="blog-article"] .blog-post-layout::before {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 50% !important;
    width: 100vw !important;
    transform: translateX(-50%) !important;
    background: #fff !important;
    pointer-events: none !important;
  }
  html body[data-page="destination"] .story-section::before,
  html body[data-page="destination"] .story-section::after {
    display: none !important;
    content: none !important;
  }

  /* Keep Reading is a clean white continuation of the article. */
  html body[data-page="blog-article"] .related-posts {
    position: relative !important;
    z-index: 1 !important;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
  html body[data-page="blog-article"] .related-posts :is(h2, .eyebrow) {
    color: #173a4f !important;
    -webkit-text-fill-color: #173a4f !important;
  }

  /* Related tours pass over the same fixed image. */
  html body:is([data-page="blog-article"], [data-page="destination"]) section.destination-full-tour-carousel,
  html body[data-page="destination"] :is(.most-booked-tours, .tour-destination-cards-section) {
    position: relative !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    background-attachment: scroll !important;
    box-shadow: none !important;
    border-color: transparent !important;
    border-bottom: 0 !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) section.destination-full-tour-carousel::before,
  html body:is([data-page="blog-article"], [data-page="destination"]) section.destination-full-tour-carousel::after {
    content: none !important;
    display: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) section.destination-full-tour-carousel .section-head :is(.eyebrow, h2, p),
  html body[data-page="destination"] :is(.most-booked-tours, .tour-destination-cards-section) :is(.eyebrow, h2, p) {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) section.destination-full-tour-carousel a.home-tours-all-button {
    background: #fff !important;
    border-color: #fff !important;
    color: #173a4f !important;
    -webkit-text-fill-color: #173a4f !important;
  }

  /* Reviews remain a white panel when present. */
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    background: var(--paper, #f5f5f7) !important;
    background-color: var(--paper, #f5f5f7) !important;
    background-image: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial {
    min-height: 0 !important;
    padding: clamp(32px, 4vw, 56px) 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial::before,
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial::after,
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial > .sk-ww-google-reviews::before,
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial > .sk-ww-google-reviews::after,
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial > .sk-ww-google-reviews > div::before,
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial > .sk-ww-google-reviews > div::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial > .sk-ww-google-reviews,
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial > .sk-ww-google-reviews > div {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial hr {
    display: none !important;
    border: 0 !important;
  }

  /* Contact returns to the same image; navigation and legal footer stay paper. */
  html body:is([data-page="blog-article"], [data-page="destination"]) .mobile-footer-composition {
    background: transparent !important;
    background-image: none !important;
    border-top: 0 !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) section.site-contact-cta {
    position: relative !important;
    z-index: 0 !important;
    border-top: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    background-attachment: scroll !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) section.site-contact-cta::before,
  html body:is([data-page="blog-article"], [data-page="destination"]) section.site-contact-cta::after {
    display: none !important;
    content: none !important;
  }
  html body:is([data-page="blog-article"], [data-page="destination"]) :is(nav.prefooter-nav, footer.site-footer) {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: var(--paper, #f5f5f7) !important;
  }

  @media (max-width: 959px) {
    html body:is([data-page="blog-article"], [data-page="destination"]) .google-reviews-section--editorial {
      padding-block: 28px !important;
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) .mobile-footer-composition {
      border-top-width: 0 !important;
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) section.site-contact-cta {
      border-top-width: 0 !important;
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) .shell::before {
      background-image: linear-gradient(rgba(0, 0, 0, .48), rgba(0, 0, 0, .48)), var(--mobile-guide-image, var(--immersive-guide-image)) !important;
      background-position: 50% 50% !important;
      filter: blur(1.5px) contrast(1.08) !important;
      transform: scale(1.015) !important;
      transform-origin: center center !important;
    }
    html body[data-page="blog-article"] .blog-post-layout,
    html body[data-page="destination"] .story-section {
      padding-block: 48px !important;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    html body:is([data-page="blog-article"], [data-page="destination"]) .shell::before {
      position: absolute !important;
      height: 100% !important;
    }
  }
}

@layer mobile-footer {
  @media (max-width: 959px) {
    html body:is([data-page="blog-article"], [data-page="destination"]) .mobile-footer-composition--with-contact {
      display: grid !important;
      height: auto !important;
      min-height: calc(100svh - (2 * var(--mobile-footer-header-height, 66px))) !important;
      grid-template-rows: minmax(360px, 1fr) auto auto !important;
      overflow: visible !important;
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) .mobile-footer-composition--with-contact > section.site-contact-cta {
      min-height: 360px !important;
      border: 0 !important;
      border-top: 0 !important;
      box-sizing: border-box !important;
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) :is(.mobile-footer-composition, section.site-contact-cta) {
      background: transparent !important;
      background-image: none !important;
    }
    html body:is([data-page="blog-article"], [data-page="destination"]) :is(nav.prefooter-nav, footer.site-footer) {
      position: relative !important;
      height: auto !important;
      max-height: none !important;
      overflow: visible !important;
      display: block !important;
      visibility: visible !important;
      opacity: 1 !important;
      background: var(--paper, #f5f5f7) !important;
    }
  }
}
