/* -------------------------------------------------
   queriesv3.0.css
   Media queries spécifiques pour rendre ton site responsive
-------------------------------------------------- */

/* Tablettes (≤ 900px) */
@media (max-width: 1024px) {
  /* Pagination */
  .pagination {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }

  .pages {
    justify-content: center;
    gap: 8px;
  }

  .pages a,
  .pagination > a {
    padding: 0.5em 0.8em;
    min-width: 36px;
    font-size: 0.9em;
  }

  .badge-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .playlist-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .menu {
    position: absolute; /* ✅ plus besoin de fixed */
    top: 85px; /* ✅ commence juste sous le header */
    right: -290px; /* ✅ caché hors écran */
    width: 250px; /* ✅ largeur fixe */
    background: linear-gradient(to left, #45daf4, #499eee);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* ✅ occupe toute la largeur */
    border-radius: 0 0 0 8px;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.15);
    transition: right 0.4s ease-in-out;
    z-index: 999;
    max-height: 80vh; /* ✅ limite la hauteur */
    overflow-y: auto; /* ✅ scroll si trop d’éléments */
  }

  #menu-toggle:checked ~ .menu {
    right: -35px; /* ✅ le menu glisse dans l’écran */
  }

  .menu > li {
    padding: 12px 10px;
    text-align: left;
    font-size: 1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .menu > li:last-child {
    border-bottom: none;
  }

  .menu-button-container {
    display: flex; /* ✅ montre le burger en mobile */
  }

  /* Cache la grille desktop */
  .menu {
    display: flex; /* passe en flex pour mobile */
  }
}

/* Mobiles (≤ 768px) */
@media (max-width: 768px) {
  /* Affiche le burger uniquement en mobile */
  .public-burger {
    display: flex;
    position: relative;
  }

  /* Menu public en mode slide */
  .site-nav.public-menu {
    position: absolute;
    top: 95px; /* juste sous le header */
    right: 0;
    background: var(--primary-color);
    width: 250px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -4px 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  .site-nav.public-menu ul {
    flex-direction: column;
    padding: 20px;
    gap: 10px;
    margin: 0;
  }

  .site-nav.public-menu li a {
    display: block;
    width: 100%;
    padding: 12px;
    color: #fff;
    border-radius: 4px;
  }

  .site-nav.public-menu li a:hover {
    background: var(--primary-dark);
  }

  /* Quand la checkbox est activée, affiche le menu */
  #public-menu-toggle:checked + .public-burger + .public-menu {
    transform: translateX(0);
  }

  /* Animation burger → croix */
  .public-burger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
  }

  /* Positionnement initial des barres */
  .public-burger span:nth-child(1) {
    transform: translateY(0);
  }
  .public-burger span:nth-child(2) {
    transform: translateY(0);
  }
  .public-burger span:nth-child(3) {
    transform: translateY(0);
  }

  /* Quand menu ouvert (checkbox checked) */
  #public-menu-toggle:checked + .public-burger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  #public-menu-toggle:checked + .public-burger span:nth-child(2) {
    opacity: 0; /* Barre du milieu disparaît */
  }
  #public-menu-toggle:checked + .public-burger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .intro h2 {
    font-size: 1.5em;
  }

  .search-input-group {
    flex-direction: column;
    gap: 10px;
  }

  .search-input-group input,
  .search-input-group button {
    width: 100%;
  }

  .badge-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .playlist-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .pages a,
  .pagination > a {
    padding: 0.4em 0.7em;
    font-size: 0.85em;
    min-width: 32px;
  }

  .badge-image-container {
    max-width: 100px;
  }

  /* Animation */
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Petits mobiles (≤ 480px) */
@media (max-width: 480px) {
  .intro h2 {
    font-size: 1.2em;
  }

  .pages {
    gap: 6px;
  }

  .pages a,
  .pagination > a {
    padding: 0.3em 0.5em;
    font-size: 0.8em;
    min-width: 28px;
  }

  .badge-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .playlist-grid {
    grid-template-columns: 1fr;
  }

  .badge-image-container {
    max-width: 80px;
  }
}
