/* ==========================================================================
   Food Arcade — Responsive layer
   Mobile-first adjustments layered on top of style.css.
   Breakpoints: 1080 / 900 / 720 / 560 / 400
   ========================================================================== */

/* ---------- Large desktop ---------- */
@media (min-width: 1400px) {
  :root {
    --fa-container: 1280px;
  }
}

/* ---------- Small desktop / large tablet ---------- */
@media (max-width: 1080px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .footer-about {
    grid-column: 1 / -1;
  }

  .layout-sidebar {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--fa-sp-5);
  }
}

/* ---------- The header CTA is the first thing to go ---------- */
@media (max-width: 1399px) {
  .nav-cta {
    display: none;
  }
}

/* ---------- Collapse navigation before it can wrap ----------
   Ten primary links plus the brand need roughly 1150px; below that the
   menu button is used instead of letting the row break onto two lines. */
@media (max-width: 1199px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--fa-surface);
    border-bottom: 1px solid var(--fa-line);
    box-shadow: var(--fa-shadow-lg);
    max-height: calc(100vh - var(--fa-header-h));
    overflow-y: auto;
    display: none;
    margin-left: 0;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--fa-sp-3) var(--fa-sp-4) var(--fa-sp-4);
  }

  .main-nav li {
    border-bottom: 1px solid var(--fa-line);
  }

  .main-nav li:last-child {
    border-bottom: 0;
  }

  .main-nav a {
    padding: 0.85rem 0.5rem;
    font-size: 1rem;
    border-radius: var(--fa-radius-sm);
  }

  .site-header {
    position: sticky;
  }

  .header-inner {
    position: relative;
    flex-wrap: nowrap;
  }
}

/* ---------- Tablet portrait ---------- */
@media (max-width: 900px) {
  .layout-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .ad-slot--sidebar {
    min-height: 250px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    order: -1;
    aspect-ratio: 16 / 9;
    max-height: 280px;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-side {
    position: static;
  }
}

/* ---------- Large phone ---------- */
@media (max-width: 720px) {
  :root {
    --fa-sp-7: 2.25rem;
    --fa-sp-8: 3rem;
  }

  .section {
    padding-block: var(--fa-sp-6);
  }

  .grid--games {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: var(--fa-sp-3);
  }

  .grid--cats,
  .grid--guides {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-stats {
    gap: var(--fa-sp-4);
  }

  .btn-row .btn {
    flex: 1 1 auto;
  }

  .article-body {
    font-size: 1rem;
  }

  .toc {
    position: static;
  }
}

/* ---------- Small phone ---------- */
@media (max-width: 560px) {
  .brand-text span:last-child {
    display: none;
  }

  .filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    padding: var(--fa-sp-3);
  }

  .hero {
    padding-block: var(--fa-sp-6);
  }

  .card-body {
    padding: var(--fa-sp-3);
  }

  .thumb-glyph {
    font-size: 2rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-toolbar {
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Very small phone ---------- */
@media (max-width: 400px) {
  .grid--games {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--fa-sp-3);
  }
}

/* ---------- Landscape phones: keep the canvas usable ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .site-header {
    position: static;
  }

  .game-stage {
    max-height: 78vh;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .game-toolbar,
  .touch-controls,
  .nav-toggle,
  .btn-row {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .article-body a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}
