/* Peak Great Falls — Mobile Responsive Overrides
   Injected into every page via <helmet> link.
   Fixes inline-style grids with no media queries. */

/* Move action links into a usable dropdown before the desktop header crowds. */
@media (max-width: 1390px) {
  [data-header-action] { display: none !important; }
  [data-quick-links] { display: block !important; }
}

/* On phones, the three actions sit at the top of the full-screen menu. */
@media (max-width: 640px) {
  [data-quick-links] { display: none !important; }
}

@media (max-width: 560px) {
  [data-mobile-actions] { flex-direction: column; }
  [data-mobile-actions] a { flex: none !important; }
}

@media (max-width: 767px) {

  /* ── Root overflow: allow horizontal scroll for comparison table ── */
  [style*="overflow-x:clip"] {
    overflow-x: visible !important;
  }

  /* ── Section horizontal padding: tighten on small screens ── */
  section[style*="padding:"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ── 3-column grids → single column ───────────────────── */
  [style*="repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* ── 4-column card grids → 2 columns ─────────────────── */
  [style*="repeat(4,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ── 5-column schedule image grids → 2 columns ────────── */
  [style*="repeat(5,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ── Two-col hero / split-panel layouts → stack ──────── */
  [style*="1.05fr .95fr"],
  [style*=".9fr 1.1fr"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* ── Membership comparison table: scroll horizontally ─── */
  [style*="1.6fr 1fr 1fr 1fr"] {
    grid-template-columns: minmax(130px,1.4fr) minmax(100px,1fr) minmax(100px,1fr) minmax(100px,1fr) !important;
    min-width: 460px;
  }
  /* Scrollable wrapper (the border-radius+overflow:hidden card) */
  [style*="border-radius:22px"][style*="overflow:hidden"][style*="background:var(--surface-2)"] {
    overflow-x: auto !important;
  }

  /* ── Class schedule item rows: stack thumb + info ─────── */
  [style*="118px 1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    padding: 14px 16px !important;
  }

  /* ── Simple 1fr 1fr grids → single column ─────────────── */
  /* Exclude the 4-col membership table which also contains "1fr 1fr" */
  [style*="grid-template-columns:1fr 1fr"]:not([style*="1.6fr"]) {
    grid-template-columns: 1fr !important;
  }

  /* ── Large gaps between stacked sections ──────────────── */
  [style*="gap:64px"] { gap: 28px !important; }
  [style*="gap:60px"]  { gap: 28px !important; }
  [style*="gap:50px"]  { gap: 24px !important; }

  /* ── Reduce oversized card padding on mobile ──────────── */
  [style*="padding:38px"] { padding: 22px !important; }
  [style*="padding:36px"] { padding: 20px !important; }
  [style*="padding:34px 30px"] { padding: 20px 18px !important; }
  [style*="padding:34px"] { padding: 20px !important; }

  /* ── Wrap nowrap buttons so they don't overflow ─────────  */
  [style*="white-space:nowrap"] {
    white-space: normal !important;
  }

  /* ── Header logo: slightly smaller on mobile ─────────── */
  [data-logo-light],
  [data-logo-dark] {
    height: 44px !important;
  }

  /* ── Hero logo under headline: keep compact ──────────── */
  [data-hero-logo] {
    width: 200px !important;
    margin-top: 22px !important;
  }

  /* ── Hero altitude gauge: hide on mobile ─────────────── */
  [data-hero-gauge] {
    display: none !important;
  }

  /* ── Marquee / scroll strips: don't clip at edge ─────── */
  [style*="peakMarq"] {
    width: max-content;
  }

  /* ── Amenity tile grid: stay 2-col (chips are small) ─── */
  [style*="grid-template-columns:1fr 1fr"][style*="gap:12px"] {
    grid-template-columns: 1fr 1fr !important;
  }
}
