/* ============================================================
   Site-wide mobile responsiveness.
   Linked in every page + SiteHeader + SiteFooter (de-duped by URL).
   Overrides inline styles via !important. Selectors match the
   browser-serialized inline style attribute (colon + space).
   ============================================================ */

@media (max-width: 820px) {

  /* ---- Sections: tighten padding (Hero has no "40px" so is skipped) ---- */
  section[style*=" 40px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  /* ---- Collapse every multi-column grid to one column ---- */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  /* Stat rows (4-col + centered) read better as a 2×2 */
  [style*="grid-template-columns: repeat(4"][style*="text-align: center"] {
    grid-template-columns: 1fr 1fr !important;
  }
  /* Footer link columns → 2 across */
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
  }

  /* ---- Footer chrome ---- */
  footer { padding-left: 24px !important; padding-right: 24px !important; }
  footer [style*="justify-content: space-between"][style*="flex-wrap: wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* ---- Shared SiteHeader ---- */
  header > div:first-child { padding-left: 16px !important; padding-right: 16px !important; gap: 10px !important; }
  header > div:first-child a, header > div:first-child span { font-size: 11px !important; }
  header nav { padding-left: 18px !important; padding-right: 18px !important; }
  header [data-desktop-nav] { display: none !important; }
  header [data-mobile-nav-toggle] { display: inline-flex !important; }

  /* ---- Home hero: top bar, nav, oversized headline ---- */
  [data-screen-label="Hero"] [style*="height: 40px"][style*="z-index: 3"] {
    padding-left: 14px !important; padding-right: 14px !important;
  }
  [data-screen-label="Hero"] [style*="height: 40px"][style*="z-index: 3"] a,
  [data-screen-label="Hero"] [style*="height: 40px"][style*="z-index: 3"] { font-size: 11px !important; }
  [data-screen-label="Hero"] nav { padding-left: 18px !important; padding-right: 18px !important; height: 68px !important; }
  [data-screen-label="Hero"] [data-desktop-nav] { display: none !important; }
  [data-screen-label="Hero"] [data-mobile-nav-toggle] { display: inline-flex !important; }
  [data-screen-label="Hero"] span[style*="font-size: 82px"] { font-size: clamp(34px, 10vw, 64px) !important; }
  /* shrink the logo chip a touch so the bar isn't crowded */
  [data-screen-label="Hero"] nav > a[href="/"] { width: 124px !important; height: 56px !important; padding: 8px 12px !important; }
  [data-screen-label="Hero"] nav > a[href="/"] img { height: 44px !important; }

  /* ---- Cruise search pill → stacked card ---- */
  [style*="18px 50px"] {
    flex-direction: column !important;
    align-items: stretch !important;
    border-radius: 20px !important;
    padding: 10px !important;
  }
  [style*="18px 50px"] > span[style*="align-self: stretch"] { display: none !important; }
  [style*="18px 50px"] > div { padding-top: 12px !important; padding-bottom: 12px !important; }
  [style*="18px 50px"] > button {
    height: 52px !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 6px !important;
    border-radius: 14px !important;
    justify-content: center !important;
  }
  /* the segmented Natural / Scuba toggle can wrap */
  [style*="border-radius: 999px"][style*="padding: 5px"] { flex-wrap: wrap !important; }

  /* ---- Gallery carousel → native swipe ---- */
  [data-screen-label="Gallery intro"] [style*="width: 1100px"] { width: 100% !important; }
  [data-screen-label="Gallery intro"] [style*="overflow: hidden"][style*="width: 100%"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  [data-screen-label="Gallery intro"] [style*="transition: transform"] { transform: none !important; }
  [data-screen-label="Gallery intro"] [style*="flex: 0 0 356px"] { flex: 0 0 80% !important; scroll-snap-align: center; }
  [data-screen-label="Gallery intro"] button[aria-label="Previous"],
  [data-screen-label="Gallery intro"] button[aria-label="Next"] { display: none !important; }

  /* ---- Location map: shorter on mobile ---- */
  [data-screen-label="Location"] [style*="height: 460px"] { height: 320px !important; }
}

/* min-width guard: never show the mobile dropdown on desktop */
@media (min-width: 821px) {
  [data-mobile-nav-panel] { display: none !important; }
}

/* ============ Small phones (≤520px) ============ */
@media (max-width: 520px) {
  footer [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  header > div:first-child a, header > div:first-child span { font-size: 10px !important; }
  section[style*=" 40px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
}
