/* Dive HYD — mobile responsive overrides.
   Loaded after styles.css. Targets the site's inline-styled grids/nav.
   React serializes inline styles verbatim (e.g. "repeat(3, 1fr)"), so the
   attribute selectors below match reliably. */

/* Never let anything cause horizontal scroll on small screens */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; }

  /* Header: logo left, Get Certified + hamburger right; links collapse
     into a dropdown panel toggled by the burger */
  header > div { flex-wrap: nowrap; gap: 12px !important; }
  .dh-burger { display: flex !important; }
  .dh-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch !important;
    gap: 0 !important;
    background: rgba(6,62,95,.97); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--dh-line);
    padding: 6px 0 10px; margin: 0;
    max-height: 0; overflow: hidden;
    box-shadow: 0 16px 30px rgba(3,16,30,.4);
  }
  .dh-nav[data-open="true"] { max-height: 60vh; overflow: auto; }
  .dh-nav[data-open="false"] { display: none; }
  .dh-nav a {
    padding: 14px 7vw; font-size: 16px !important;
    border-top: 1px solid rgba(255,255,255,.06);
  }
  header { position: sticky; }

  /* Stack the multi-column and ratio grids into a single column */
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(2, 1fr)"],
  [style*="grid-template-columns: 0.9fr 1.1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1.6fr 1fr 1fr"],
  [style*="grid-template-columns: 1.5fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Poster / tile grids: keep a compact 2-up rather than stacking huge */
  [style*="grid-template-columns: repeat(6, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* The Destinations "Plan a group trip" button uses a big top margin to
     align with the heading on desktop — remove it once the row wraps */
  [style*="margin-top: 66px"] { margin-top: 8px !important; }
}

@media (max-width: 480px) {
  header img { height: 40px !important; }
}
