/* CrewHub responsive layer — phones and tablets.
   Site markup is inline-styled, so these overrides use !important deliberately. */

img, video, canvas, figure, svg { max-width: 100%; }

/* ---- Collapsed nav (built by mobile-nav.js) ---- */
.ch-burger, .ch-mnav { display: none; }
@media (max-width: 860px) {
  header.nav { position: relative; flex-wrap: nowrap !important; gap: 12px !important; }
  header.nav > a, header.nav > .nav-dd { display: none !important; }
  header.nav > .nav-brand { display: inline-flex !important; margin-right: auto; }
  .ch-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none; border-radius: 999px; cursor: pointer;
    background: transparent; border: 1px solid var(--color-neutral-300); color: var(--color-text);
  }
  .ch-burger:hover { background: var(--color-accent-100); border-color: var(--color-accent-300); }
  .ch-mnav {
    display: none; position: absolute; top: 100%; left: 12px; right: 12px; z-index: 80;
    flex-direction: column; gap: 2px; padding: 12px;
    background: var(--color-bg); border: 1px solid var(--color-neutral-300);
    border-radius: 16px; box-shadow: var(--shadow-md);
    max-height: 70vh; overflow-y: auto;
  }
  header.nav[data-nav-open="true"] .ch-mnav { display: flex; }
  .ch-mnav a { padding: 11px 12px; border-radius: 10px; text-decoration: none; font-size: 15px; }
  .ch-mnav a:hover { background: var(--color-accent-100); }
  .ch-mnav a.ch-sub { padding-left: 26px; font-size: 14px; opacity: 0.85; }
  .ch-mnav .btn { justify-content: center; margin-top: 6px; }
  .ch-mnav hr { border: none; border-top: 1px solid var(--color-neutral-300); margin: 8px 4px; }
}

/* ---- Tablet: wide fixed grids relax ---- */
@media (max-width: 1024px) {
  main [style*="repeat(4,"], main [style*="repeat(5,"] {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  }
}

/* ---- Tier grid: four equal columns, 2x2 on tablet, stack on phone ---- */
main [data-tier-grid] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
@media (max-width: 900px) {
  main [data-tier-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  main [data-tier-grid] { grid-template-columns: 1fr !important; }
}

/* ---- Phone ---- */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  main [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  main [style*="display: flex"]:not([style*="nowrap"]):not([data-no-wrap]) { flex-wrap: wrap !important; }
  main [style*="position: sticky"] { position: static !important; }
  header [style*="width: clamp"] { width: 100% !important; }
  main [style*="max-width: 400px"] { max-width: 100% !important; }
}
