/*!
 * site-extra.css - 360 Adventures supplemental styles
 * Added 2026-09-21; updated 2026-09-21 (mobile tour action bar + blog images).
 *
 * CONTENTS
 * 1. Mobile tour-hero fix (<=768px only)
 * 2. Sticky mobile tour action bar (<=768px only)
 * 3. Mobile blog content images (<=768px only)
 *
 * Desktop (>=769px) is never affected by anything in this file.
 */

/* ------------------------------------------------------------------ *
 * 1. MOBILE TOUR-HERO FIX
 * .tour_hero uses aspect-ratio:16/9 + max-height:70vh + overflow:hidden,
 * with .tour_hero_overlay absolutely positioned (inset:0) and bottom
 * anchored. On narrow phones the 16/9 box is ~220px tall while the title
 * + summary + CTA stack needs more, so the top of the heading overflows
 * and is clipped. Below, let the hero grow with its content instead of
 * forcing the ratio, and put the overlay back in normal flow so it
 * defines the height.
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .tour_hero {
    aspect-ratio: auto;
    min-height: 70vh;
    max-height: none;
    display: flex;
    align-items: flex-end;
  }
  .tour_hero picture {
    position: absolute;
    inset: 0;
  }
  .tour_hero_overlay {
    position: relative;
    inset: auto;
    width: 100%;
    padding-top: 4.5rem;
    padding-bottom: 2rem;
  }
}

/* ------------------------------------------------------------------ *
 * 2. STICKY MOBILE TOUR ACTION BAR
 * The tour module already renders, once per tour page:
 *   <div class="tour_hero_cta">
 *     <span class="tour_price_badge">From $X / person</span>
 *     <a href="#book" class="btn btn_primary">Book This Adventure</a>
 *     <a href="/contact-us/?t_id=NN" class="btn_ghost">Contact Us</a>
 *   </div>
 * The Contact link is hidden everywhere by a template rule:
 *   .tour_hero_cta .btn_ghost{display:none!important}
 * On phones we turn this group into a fixed bottom action bar and reveal
 * the Contact link, so guests always have a visible Book AND Contact
 * path (the header Contact button is desktop-only, >=1024px).
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .tour_hero_cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    margin: 0;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 10px;
  }
  /* the price badge is too wide for the bar; keep the bar to two actions */
  .tour_hero_cta .tour_price_badge {
    display: none;
  }
  .tour_hero_cta .btn {
    justify-content: center;
    text-align: center;
    padding: 12px 12px;
    font-size: 0.9375rem;
    line-height: 1.2;
    white-space: nowrap;
  }
  /* Book gets the wider share; Contact the narrower */
  .tour_hero_cta .btn_primary {
    flex: 1.4 1 0;
  }
  /* reveal the hidden Contact Us link, only in the mobile bar */
  .tour_detail .tour_hero_cta .btn_ghost {
    display: inline-flex !important;
    flex: 1 1 0;
  }

  /* keep page content clear of the fixed bar */
  body.site_body:has(.tour_detail) {
    padding-bottom: 76px;
  }
  /* lift the PWA install button and the SW update toast above the bar */
  body.site_body:has(.tour_detail) #pwa_install_btn {
    bottom: 84px !important;
  }
  body.site_body:has(.tour_detail) #sw_update_toast {
    bottom: 84px !important;
  }
}

/* ------------------------------------------------------------------ *
 * 3. MOBILE BLOG CONTENT IMAGES
 * Two legacy blog posts (pages 712, 713) contain inline-styled images,
 * e.g. style="margin:0 25px;float:left;width:300px;height:224px" - and
 * one at width:500px. The global img{max-width:100%} caps the width, but
 * the inline height and side margins still apply, so on narrow phones
 * the image is distorted and its margin box overflows the text column.
 * Neutralise floated fixed-size images in blog bodies to full-width
 * blocks. Selector targets only images that carry an inline float, so
 * normal responsive images are unaffected.
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .blog_post_body img[style*="float"] {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 1.5rem 0 !important;
  }
}
