/* ============================================================
   catalogue.css — Page catalogue (panneau de filtres + liste)
   Les couleurs viennent de theme.css (variables --couleur-*).
   ============================================================ */

:root { --encre: #1f1a0b; --encre-douce: #5a4a18; }

body {
  margin: 0;
  padding: 0 1rem 3rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- En-tête ---------- */
.entete {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo {
  width: auto; height: 64px;
  object-fit: contain;
  flex: none;
}
.entete h1 { margin: 0; font-size: 2.6rem; line-height: 1; letter-spacing: -0.02em; font-weight: 800; }
.sous-titre { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--encre-douce); }

/* ---------- Mise en page ---------- */
.mise-en-page {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}
.contenu-principal { flex: 1 1 0; min-width: 0; }

/* ---------- Panneau de filtres ---------- */
.panneau-filtres {
  flex: 0 0 280px;
  box-sizing: border-box;
  background: var(--couleur-carte);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 2px 0 rgba(31, 26, 11, 0.12);
  position: sticky;
  top: 1rem;
}
.panneau-filtres summary { display: none; list-style: none; cursor: pointer; font-weight: 800; font-size: 1.05rem; }
.panneau-filtres summary::-webkit-details-marker { display: none; }
.filtres-contenu { display: flex; flex-direction: column; gap: 1.3rem; }

.titre-groupe {
  display: block;
  padding: 0;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-douce);
}
.groupe { border: 0; margin: 0; padding: 0; min-width: 0; }

.panneau-filtres input[type="search"],
.panneau-filtres input[type="number"] {
  box-sizing: border-box;
  height: 44px;
  border: 2px solid var(--couleur-bordure);
  border-radius: 10px;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--encre);
}
.panneau-filtres input[type="search"] { width: 100%; }

.groupe-toggles { display: flex; flex-direction: column; gap: 0.6rem; }
.filtre-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--couleur-fond);
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer;
}
.filtre-toggle input { width: 20px; height: 20px; accent-color: var(--encre); }

.filtre-niveaux { display: flex; flex-direction: column; gap: 0.15rem; }
.filtre-niveaux label { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.1rem; font-size: 0.95rem; cursor: pointer; }
.filtre-niveaux input { width: 18px; height: 18px; accent-color: var(--encre); }

.ligne-age { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.ligne-age input[type="number"] { width: 4rem; height: 40px; padding: 0 0.5rem; }

.lien-reinit {
  align-self: flex-start;
  background: none !important;
  border: 0; padding: 0;
  color: var(--encre-douce);
  font: inherit; font-size: 0.9rem; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
.lien-reinit:hover { color: var(--encre); }

/* ---------- Liste ---------- */
.compteur { margin: 0 0 0.9rem; font-size: 0.95rem; font-weight: 600; color: var(--encre-douce); }
.liste-jeux { display: flex; flex-direction: column; gap: 0.9rem; }

.carte-jeu {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 1.1rem;
  align-items: center;
  padding: 0.85rem;
  border-radius: 16px;
  box-shadow: 0 2px 0 rgba(31, 26, 11, 0.12);
}
.vignette {
  width: 112px; height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #f3e3b0, #e8c773);
  display: flex; align-items: center; justify-content: center;
}
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette .sigle { font-weight: 800; font-size: 2rem; color: rgba(31, 26, 11, 0.4); }

.corps { min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.titre-ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem; }
.carte-jeu h3 { margin: 0; font-size: 1.15rem; line-height: 1.25; }

.badge-niveau, .badge-nouveau {
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-niveau { background: var(--encre); color: var(--couleur-fond); }
.badge-nouveau { background: #2196f3; color: #fff; }

.infos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.9rem; color: #3a3112; }
.infos li { display: flex; align-items: center; gap: 0.4rem; }
.infos svg { color: #7a5200; flex: none; }
.infos a { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--encre); text-decoration: underline; text-underline-offset: 2px; }
.infos a:hover { color: #7a5200; }

.carte-jeu .pastille-statut {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.carte-jeu .pastille-statut::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.carte-jeu .pastille-statut.disponible       { background: #ddf3e3; color: #14532d; }
.carte-jeu .pastille-statut.disponible::before { background: #1f8a4c; }
.carte-jeu .pastille-statut.emprunte         { background: #ffe1cf; color: #7a2e0a; }
.carte-jeu .pastille-statut.emprunte::before   { background: #d9531e; }
.carte-jeu .pastille-statut.non-empruntable  { background: #ece7da; color: #4a4433; }
.carte-jeu .pastille-statut.non-empruntable::before { background: #8a8372; }

.etat-vide, .chargement { text-align: center; padding: 3rem 1rem; color: var(--encre-douce); }

:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }

/* ---------- Téléphone / tablette étroite ---------- */
@media (max-width: 860px) {
  .mise-en-page { flex-direction: column; gap: 1.1rem; }
  .panneau-filtres { flex: none; width: 100%; position: static; padding: 1rem 1.1rem; }
  .panneau-filtres summary { display: block; }
  .panneau-filtres[open] summary { margin-bottom: 1rem; }
  .entete h1 { font-size: 2.1rem; }
}
@media (max-width: 560px) {
  .carte-jeu { grid-template-columns: 88px 1fr; gap: 0.8rem; }
  .vignette { width: 88px; height: 88px; }
  .statut-colonne { grid-column: 1 / -1; }
}