/* Westerns — feuille de style. Contrastes vérifiés RGAA 4.5:1 (texte) / 3:1 (composants). */
:root {
  --fond: #f6f1e8;
  --surface: #fffdf8;
  --surface-2: #efe7da;
  --texte: #231d16;
  --texte-2: #5c5247;
  --accent: #8a3b12;
  --accent-texte: #ffffff;
  --bordure: #cfc3b1;
  --focus: #0b4f8a;
  --ombre: 0 1px 2px rgba(35, 29, 22, .08), 0 6px 18px rgba(35, 29, 22, .08);
  --rayon: 10px;
  --largeur: 1280px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15120f;
    --surface: #1f1a15;
    --surface-2: #2a231c;
    --texte: #efe7da;
    --texte-2: #bfb3a0;
    --accent: #e8ad63;
    --accent-texte: #1a120a;
    --bordure: #46392d;
    --focus: #8fc7ff;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Lien d'évitement */
.evitement { position: absolute; left: -999px; top: 0; padding: .6rem 1rem; background: var(--accent); color: var(--accent-texte); z-index: 10; }
.evitement:focus { left: 1rem; top: 1rem; }

/* En-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--bordure); }
.entete__inner { max-width: var(--largeur); margin: 0 auto; padding: 1.1rem 1rem; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.entete__titre { margin: 0; font-size: 1.9rem; letter-spacing: .01em; }
.entete__titre a { color: var(--texte); text-decoration: none; }
.entete__titre a:hover { color: var(--accent); }
.entete__compteur { margin: 0; color: var(--texte-2); }

/* Mise en page */
.page { max-width: var(--largeur); margin: 0 auto; padding: 1.25rem 1rem 2rem; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .page { grid-template-columns: 1fr; } }

/* Filtres */
.filtres { position: sticky; top: 1rem; }
@media (max-width: 820px) { .filtres { position: static; } }
.filtres__pli { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.filtres__summary { cursor: pointer; padding: .9rem 1rem; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.filtres__summary::-webkit-details-marker { display: none; }
.filtres__summary::after { content: "▾"; color: var(--texte-2); transition: transform .15s; }
.filtres__pli[open] > .filtres__summary::after { transform: rotate(180deg); }
.filtres__h2 { margin: 0; font-size: 1.05rem; }
.filtres__form { padding: 0 1rem 1rem; }
.champ { margin: 0 0 1rem; }
.champ label { display: block; font-weight: 600; margin-bottom: .3rem; }
.champ input, .champ select { width: 100%; padding: .55rem .65rem; border: 1px solid var(--texte-2); border-radius: 6px; background: var(--fond); }
.aide { display: block; font-size: .875rem; color: var(--texte-2); margin-top: .25rem; }
.famille { border: 0; padding: 0; margin: 0 0 .5rem; }
.famille summary { cursor: pointer; font-weight: 600; padding: .45rem 0; }
.famille summary::marker { color: var(--texte-2); }
.famille legend { font-weight: 600; padding: .45rem 0; }
.famille__liste { list-style: none; margin: 0 0 .5rem; padding: 0 0 0 .25rem; max-height: 17rem; overflow: auto; }
.famille__liste li { display: flex; align-items: flex-start; gap: .5rem; padding: .2rem 0; }
.famille__liste input { margin: .35rem 0 0; width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--accent); }
.famille__liste label { flex: 1; }
.famille__nb { color: var(--texte-2); font-size: .875rem; }
.filtres__actions { margin: .5rem 0 0; }

.bouton { display: inline-block; padding: .55rem .9rem; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--accent); color: var(--accent-texte); font-weight: 600; }
.bouton--secondaire { background: transparent; color: var(--accent); border-color: var(--accent); }
.bouton--secondaire:hover { background: var(--surface-2); }
.lien { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Résultats */
.contenu { min-width: 0; }
.resultats__entete { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.resultats__titre { margin: 0; font-size: 1.35rem; }
.resultats__compteur { margin: 0; color: var(--texte-2); }
.actifs { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.actifs:empty { display: none; }
.puce { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .4rem .3rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); font-size: .9rem; }
.puce button { border: 0; background: var(--surface); color: var(--texte); border-radius: 999px; width: 1.6rem; height: 1.6rem; cursor: pointer; line-height: 1; }
.puce button:hover { background: var(--accent); color: var(--accent-texte); }

.grille { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem; }
.carte__lien { display: block; text-decoration: none; color: inherit; border-radius: var(--rayon); }
.carte__affiche { display: block; position: relative; aspect-ratio: 2 / 3; border-radius: var(--rayon); overflow: hidden; background: var(--surface-2); box-shadow: var(--ombre); transition: transform .15s; }
.carte__lien:hover .carte__affiche, .carte__lien:focus-visible .carte__affiche { transform: translateY(-3px); }
.carte__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carte__sans-affiche { position: absolute; inset: 0; display: grid; place-items: center; color: var(--texte-2); font-size: .9rem; }
.carte__img[src] + .carte__sans-affiche { display: none; }
.carte__titre { display: block; margin-top: .55rem; font-weight: 600; line-height: 1.3; }
.carte__lien:hover .carte__titre { text-decoration: underline; }
.carte__annee { display: block; color: var(--texte-2); font-size: .9rem; }
.vide { padding: 2rem 1rem; text-align: center; color: var(--texte-2); background: var(--surface); border: 1px dashed var(--bordure); border-radius: var(--rayon); }
.erreur { padding: 1rem; background: var(--surface); border-left: 4px solid var(--accent); }

/* Fiche */
.fiche__retour { margin: 0 0 1rem; }
.fiche__corps { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 640px) { .fiche__corps { grid-template-columns: 1fr; } .fiche__affiche { max-width: 240px; } }
.fiche__affiche { position: relative; margin: 0; border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); background: var(--surface-2); aspect-ratio: 2 / 3; }
.fiche__affiche img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fiche__titre { margin: 0 0 .25rem; font-size: 1.75rem; line-height: 1.2; }
.fiche__original { margin: 0 0 1rem; color: var(--texte-2); font-style: italic; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1.25rem; }
.meta dt { font-weight: 600; color: var(--texte-2); }
.meta dd { margin: 0; }
@media (max-width: 420px) { .meta { grid-template-columns: 1fr; } .meta dd { margin-bottom: .4rem; } }
.fiche h3 { margin: 1.25rem 0 .5rem; font-size: 1.05rem; }
.fiche__synopsis p { margin: 0 0 .75rem; }
.fiche__source { color: var(--texte-2); font-size: .875rem; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.tag { display: inline-block; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); color: var(--texte); text-decoration: none; font-size: .925rem; }
.tag:hover, .tag:focus-visible { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.liens { margin: 0; padding-left: 1.2rem; }
.liens li { margin: .2rem 0; }

/* Pied */
.pied { border-top: 1px solid var(--bordure); background: var(--surface); color: var(--texte-2); font-size: .9rem; }
.pied__inner { max-width: var(--largeur); margin: 0 auto; padding: 1.25rem 1rem; }
.pied p { margin: .25rem 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .filtres, .evitement, .fiche__retour, .pied { display: none; }
  .page { display: block; }
  a { color: inherit; }
}
.liste-simple { margin: 0; padding-left: 1.1rem; }
