/* ==========================================================================
   site-responsive.css — Responsive transversal (GameZone, accueil, listes…)
   Complète style.css ; JoL = style-jol.css (déjà traité).
   ========================================================================== */

/* Colonne contenu = largeur header (évite le rétrécissement flex body) */
@media (max-width: 768px) {
  html,
  body {
    align-items: stretch;
    width: 100%;
  }

  header.site-header,
  .gamezone-categories-menu,
  .gz-cat-menu-wrap,
  .gamezone-main,
  .gamezone-topbar,
  .gamezone-charte-wrapper,
  .jol-page,
  .footer-wrapper footer {
    max-width: none;
    width: 100%;
  }

  .gamezone-categories-menu,
  .gamezone-topbar {
    border-radius: 0;
  }

  .gamezone-charte-wrapper {
    padding-left: 0;
    padding-right: 0;
  }

  .gamezone-main {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  main {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

/* ── Topbar GameZone (aligné JoL) ───────────────────────────────────────── */
@media (max-width: 768px) {
  .gamezone-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.55rem 0.5rem;
    margin-top: 0;
    border-radius: 0;
  }

  .gamezone-topbar-breadcrumb {
    font-size: 0.92em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gamezone-topbar-breadcrumb .bc-root,
  .gamezone-topbar-breadcrumb .bc-sep-first {
    display: none;
  }

  .gamezone-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4em;
    width: 100%;
  }

  .gamezone-topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: stretch;
  }

  .gamezone-topbar-search-form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .gamezone-topbar-search-form input[type="text"] {
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    font-size: 0.95em;
  }

  .gamezone-topbar-search-form button {
    flex-shrink: 0;
    width: 48px;
    height: 36px;
    font-size: 0.95em;
  }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-wrapper footer {
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 0.85rem 0.65rem 1rem;
    text-align: center;
  }

  .footer-wrapper footer > span,
  .footer-wrapper footer .footer-link {
    display: inline-block;
    margin: 0.25rem 0.35rem !important;
  }
}

/* ── GameZone accueil — carrousel légendaires (complément gamezone.php) ── */
@media (max-width: 768px) {
  .gamezone2-carousel-nav {
    display: flex;
    align-items: center;
  }

  .gamezone2-carousel-viewport {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ── Fiche jeu GameZone (jeu.php inline classes) ────────────────────────── */
@media (max-width: 768px) {
  .fiche-jeu-layout {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .fiche-jeu-col-left,
  .fiche-jeu-col-right {
    min-width: 0 !important;
    width: 100% !important;
  }

  .fiche-jeu-titre-principal {
    font-size: 1.35rem !important;
  }

  .gamezone-player-wrap iframe,
  .gamezone-player-wrap,
  .fiche-jeu-col-left .ruffle-wrapper iframe,
  .fiche-jeu-col-left .ruffle-wrapper,
  #game-area iframe {
    min-height: 240px;
    max-width: 100% !important;
    height: min(56vw, 420px) !important;
  }
}

@media (max-width: 600px) {
  .fiche-suggestions-grid,
  .fiche-jeu-suggestions-cadre {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
    justify-content: stretch;
  }

  .fiche-jeu-suggestion-card {
    width: 100%;
    max-width: 140px;
    margin: 0 auto;
  }
}

/* ── Listes / recherche / favoris ───────────────────────────────────────── */
@media (max-width: 768px) {
  .liste-jeux-grid,
  .search-results-grid,
  .favoris-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .liste-jeux-nav {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
  }

  .liste-jeux-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 480px) {
  .liste-jeux-grid,
  .search-results-grid,
  .favoris-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr)) !important;
  }
}

/* ── Contact ────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form input[type="url"],
  .contact-form select,
  .contact-form textarea {
    max-width: 100% !important;
    width: 100%;
  }

  .contact-form button,
  .contact-form input[type="submit"] {
    width: 100%;
  }
}

/* ── Accueil index.php (.index2) ────────────────────────────────────────── */
@media (max-width: 768px) {
  .index2 .more-info__layout {
    grid-template-columns: 1fr;
  }

  .index2 .more-info {
    padding: 1rem 0.65rem;
  }
}
