/* Weball : identité propre. Papier chaud, encre marine, une couleur par groupe de la matrice.
   Titres en Fraunces (serif éditorial), texte en Instrument Sans. */
:root {
  --papier: #f6f2ea; --carte: #fffdf8; --encre: #14213d; --doux: #5c6275; --ligne: #e3dccd;
  --accent: #e8590c; --c: var(--encre);
  --serif: "Fraunces", Georgia, serif; --sans: "Instrument Sans", system-ui, sans-serif;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--sans); background: var(--papier); color: var(--encre); }
a { color: inherit; text-underline-offset: .18em; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; letter-spacing: -.01em; line-height: 1.12; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 1rem; top: 1rem; background: var(--carte); padding: .5rem 1rem; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* En-tête */
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: .9rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--ligne); background: color-mix(in srgb, var(--papier) 88%, white); position: sticky; top: 0; z-index: 5; }
.logo { display: flex; align-items: center; gap: .55rem; text-decoration: none; font: 800 1.45rem var(--serif); }
.recherche { flex: 1 1 16rem; max-width: 30rem; }
.recherche input, .hero-recherche input { width: 100%; font: inherit; color: inherit; background: var(--carte);
  border: 1.5px solid var(--ligne); border-radius: 999px; padding: .55rem 1.1rem; }
.recherche input:focus, .hero-recherche input:focus { border-color: var(--encre); outline: none; }
.groupes-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.groupes-nav a { display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none; font-weight: 600; font-size: .92rem; padding: .3rem .75rem; border-radius: 999px;
  border: 1.5px solid transparent; }
.groupes-nav a::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); margin-right: .4rem; }
.groupes-nav a:hover, .groupes-nav a[aria-current] { border-color: var(--c); }

main { max-width: 76rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 4rem; }

/* Accueil */
.hero { text-align: center; padding: clamp(2.5rem, 7vw, 5rem) 0 2.5rem; }
.hero-symbole { animation: tourne 60s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-symbole { animation: none; } }
.surtitre { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--c); margin: 0 0 .4rem; }
.hero .surtitre { color: var(--accent); margin-top: 1rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: .2rem 0 .8rem; }
.hero h1 em { font-style: italic; color: var(--accent); }
.chapo { color: var(--doux); font-size: 1.1rem; max-width: 40rem; }
.hero .chapo { margin: 0 auto 1.8rem; }
.hero-recherche { display: flex; gap: .5rem; max-width: 36rem; margin: 0 auto; }
.hero-recherche input { padding: .85rem 1.3rem; font-size: 1.05rem; }
.hero-recherche button { font: 600 1rem var(--sans); border: 0; border-radius: 999px; padding: 0 1.5rem;
  background: var(--encre); color: var(--papier); cursor: pointer; }
.hero-recherche button:hover { background: var(--accent); }

.matrice { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin: 1rem 0 3.5rem; }
.matrice-col { display: flex; flex-direction: column; gap: .4rem; }
.matrice-tete { display: flex; flex-direction: column; text-decoration: none; padding: 1rem; border-radius: var(--rayon);
  background: var(--c); color: #fff; min-height: 8.2rem; }
.matrice-num { font: 800 .85rem var(--serif); opacity: .7; }
.matrice-tete strong { font: 800 1.35rem var(--serif); margin: .15rem 0 .3rem; }
.matrice-tete small { font-size: .86rem; opacity: .9; line-height: 1.35; }
.matrice-case { display: flex; justify-content: space-between; align-items: center; gap: .5rem; text-decoration: none;
  padding: .6rem .9rem; border-radius: 10px; background: var(--carte); border: 1px solid var(--ligne); font-weight: 500; }
.matrice-case b { font-weight: 600; font-size: .82rem; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white);
  border-radius: 999px; padding: .05rem .55rem; }
.matrice-case:hover { border-color: var(--c); }
.matrice-case.vide { color: var(--doux); }
.matrice-case.vide b { color: var(--doux); background: transparent; }

.titre-bloc { font-size: 1.7rem; margin: 0 0 1.2rem; }

/* Pages intérieures */
.page { padding-top: 1.5rem; }
.ariane { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .88rem; color: var(--doux); }
.ariane a + a::before, .ariane a + span::before { content: "/"; margin-right: .4rem; color: var(--ligne); }
.ariane a { text-decoration: none; }
.ariane a:hover { color: var(--encre); text-decoration: underline; }
.tete-page { margin: 1.5rem 0 2rem; padding-left: 1.1rem; border-left: 6px solid var(--c); }
.tete-page h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 .5rem; }
.tete-page .chapo { margin: 0; }
.compteur { white-space: nowrap; font-size: .9rem; font-weight: 600; color: var(--c); margin-left: .4rem; }

.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.type { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; padding: 1.3rem; background: var(--carte);
  border: 1px solid var(--ligne); border-top: 5px solid var(--c); border-radius: var(--rayon); }
.type:hover { box-shadow: 0 8px 24px -12px rgb(20 33 61 / .35); }
.type-nom { font: 800 1.3rem var(--serif); }
.type-desc { color: var(--doux); font-size: .95rem; flex: 1; }
.type-compte { font-weight: 600; font-size: .88rem; color: var(--c); }
.type.vide .type-compte { color: var(--doux); }

.liste { display: grid; grid-template-columns: 15rem 1fr; gap: 2rem; align-items: start; }
.liste.sans-filtres { grid-template-columns: 1fr; }
.filtres { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow: auto; font-size: .93rem;
  background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; }
.filtres-titre { font: 800 1.05rem var(--serif); margin: 0 0 .6rem; }
.filtres a { text-decoration: none; }
.filtres a:hover { text-decoration: underline; }
.filtre-tout { display: block; margin-bottom: .4rem; }
.filtres summary { cursor: pointer; padding: .15rem 0; }
.filtres ul { list-style: none; margin: .2rem 0 .5rem; padding-left: 1rem; border-left: 2px solid var(--ligne); }
.filtres li { padding: .1rem 0; color: var(--doux); }
[aria-current="page"] { font-weight: 700; color: var(--c); }

.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1.1rem; }
.carte { display: flex; flex-direction: column; text-decoration: none; background: var(--carte); border: 1px solid var(--ligne);
  border-radius: var(--rayon); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.carte:hover { transform: translateY(-3px); box-shadow: 0 10px 28px -14px rgb(20 33 61 / .45); }
.carte-visuel { aspect-ratio: 4 / 4.4; background: color-mix(in srgb, var(--c) 10%, var(--papier)); display: grid; place-items: center; overflow: hidden; position: relative; }
.carte-visuel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.initiale { font: 800 3rem var(--serif); color: color-mix(in srgb, var(--c) 55%, white); }
.carte-titre { font-weight: 600; padding: .7rem .9rem 0; line-height: 1.3; }
.carte-sous-titre { font-size: .85rem; color: var(--doux); padding: .15rem .9rem .9rem; }
.carte-titre:last-child { padding-bottom: .9rem; }
.pages { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.pages a { text-decoration: none; min-width: 2.4rem; text-align: center; padding: .35rem .6rem; border-radius: 8px;
  border: 1px solid var(--ligne); background: var(--carte); }
.vide-message { background: var(--carte); border: 1.5px dashed var(--ligne); border-radius: var(--rayon); padding: 2rem; color: var(--doux); }

/* Fiche */
.fiche-tete { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: end; margin: 1.5rem 0 2.5rem; }
.fiche-image { width: clamp(9rem, 22vw, 15rem); aspect-ratio: 4 / 4.6; object-fit: cover; border-radius: var(--rayon);
  border: 6px solid var(--carte); box-shadow: 0 14px 40px -18px rgb(20 33 61 / .5); background: var(--carte); }
.fiche-tete h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 0 0 .4rem; }
.termes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 0; }
.termes a { text-decoration: none; font-size: .86rem; font-weight: 500; padding: .2rem .75rem; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, white); color: var(--encre); }
.termes a:hover { background: var(--c); color: #fff; }
.fiche-corps { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 3rem; align-items: start; }
.fiche-texte > p { font-size: 1.08rem; max-width: 44rem; }
.fiche-texte > p:first-child::first-letter { font: 800 3.3em/.8 var(--serif); float: left; margin: .08em .1em 0 0; color: var(--c); }
.fiche-section { margin-top: 2.2rem; }
.fiche-section h2 { font-size: 1.35rem; margin: 0 0 .7rem; padding-bottom: .35rem; border-bottom: 2px solid color-mix(in srgb, var(--c) 30%, transparent); }
.fiche-section ul { padding-left: 1.1rem; margin: 0; }
.fiche-section li { margin: .35rem 0; }
.fiche-section li::marker { color: var(--c); }
.quand { display: inline-block; min-width: 4.5rem; font: 800 1rem var(--serif); color: var(--c); }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .6rem; }
.galerie img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.detail { display: block; color: var(--doux); font-size: .92rem; }
.sous { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .8rem; margin: 0; }
.sous dt { color: var(--doux); }
.sous dd { margin: 0; }
.faits { position: sticky; top: 5.5rem; background: var(--carte); border: 1px solid var(--ligne); border-top: 5px solid var(--c);
  border-radius: var(--rayon); padding: 1.2rem 1.3rem; }
.faits h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.faits dl { margin: 0; }
.faits dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); margin-top: .7rem; }
.faits dd { margin: .1rem 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* Pied */
.pied { border-top: 1px solid var(--ligne); background: var(--encre); color: #e9e4d8; padding: 3rem clamp(1rem, 4vw, 3rem) 2rem; }
.pied-matrice { max-width: 76rem; margin: 0 auto 2rem; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.pied h2 { font-size: 1.05rem; margin: 0 0 .5rem; padding-left: .6rem; border-left: 4px solid var(--c); }
.pied h2 a { text-decoration: none; }
.pied ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.pied li a { text-decoration: none; opacity: .8; }
.pied li a:hover { opacity: 1; text-decoration: underline; }
.pied > p { max-width: 76rem; margin: 0 auto; font-size: .88rem; opacity: .75; display: flex; align-items: center; gap: .5rem; }
.pied > p img { filter: invert(1); }

@media (max-width: 960px) {
  .matrice, .pied-matrice { grid-template-columns: repeat(2, 1fr); }
  .fiche-corps { grid-template-columns: 1fr; }
  .faits { position: static; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .entete { position: static; }
  .groupes-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .matrice, .pied-matrice { grid-template-columns: 1fr; }
  .matrice-tete { min-height: 0; }
  .liste { grid-template-columns: 1fr; }
  .filtres { position: static; max-height: none; }
  .fiche-tete { grid-template-columns: 1fr; align-items: start; gap: 1.2rem; }
  .hero-recherche { flex-direction: column; }
  .hero-recherche button { padding: .8rem; }
  .cartes { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
}
