/* =====================================================================
   Espace membres — Baronnie de Liège
   Feuille de style unique. Aucune règle « inline » (politique de sécurité CSP).
   Sommaire : 1 polices · 2 variables · 3 base · 4 structure et navigation · 5 composants
              6 écrans membres · 7 carte de membre · 8 galerie · 9 liseuse · 10 administration
   ===================================================================== */

/* 1. Polices (hébergées sur le serveur : aucun appel à Google) ------------- */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url('../fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-display: swap; src: url('../fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-display: swap; src: url('../fonts/eb-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-display: swap; src: url('../fonts/eb-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 600; font-display: swap; src: url('../fonts/eb-garamond-latin-600-normal.woff2') format('woff2'); }

/* 2. Variables ------------------------------------------------------------- */
:root {
  --bordeaux: #7B1E2B;
  --bordeaux-fonce: #5C1520;
  --bordeaux-pale: #F3E6E7;
  --or: #9A7430;
  --or-texte: #6F5219;
  --or-pale: #F6EEDC;
  --or-clair: #E9CF97;
  --creme: #F7F4EF;
  --creme-chaud: #FBF6EC;
  --blanc: #FFFFFF;
  --texte: #221B18;
  --texte-2: #4A403B;
  --texte-3: #6B605A;
  --bord: #ECE5DD;
  --bord-fort: #DCD3C9;
  --vert: #2F6B45;
  --vert-pale: #E6F1EA;
  --ambre: #7A4E0B;
  --ambre-pale: #FBEFD9;
  --rouge: #B3261E;
  --carte-vert: #C0DD94;
  --carte-titre: #2B2B2B;
  --carte-rouge: #9E2A22;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --rayon: 14px;
  --rayon-grand: 18px;
  --ombre: 0 8px 24px rgba(34, 27, 24, .08);
  --nav-hauteur: 68px;
  --marge: 20px;
  color-scheme: light;
}

/* 3. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--texte);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--bordeaux); text-underline-offset: 2px; }
a:hover { color: var(--bordeaux-fonce); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #C9A45C; outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
.etat-badge .ic { width: 14px; height: 14px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lien-evitement { position: absolute; left: -999px; top: 8px; background: var(--blanc); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.lien-evitement:focus { left: 8px; }
.noscript { padding: 24px; text-align: center; }

.titre-page { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.1; }
.titre-section {
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--texte-3);
  font-weight: 600; margin: 0 0 8px;
}
.serif { font-family: var(--serif); font-weight: 700; }
.muted { color: var(--texte-3); }
.petit { font-size: 13px; }
.tres-petit { font-size: 12px; }
.gras { font-weight: 600; }
.centre { text-align: center; }
.pile { display: flex; flex-direction: column; gap: 16px; }
.pile-serree { display: flex; flex-direction: column; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ligne-entre { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.tronque { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Écran de démarrage */
.demarrage { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--texte-3); }
.demarrage img { width: 96px; height: 96px; border-radius: 24px; }

/* 4. Structure et navigation ---------------------------------------------- */
.coquille { min-height: 100vh; }
.contenu {
  max-width: 1200px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) var(--marge) calc(var(--nav-hauteur) + 28px + env(safe-area-inset-bottom));
}
.contenu-etroit { max-width: 640px; }

/* Smartphone : barre d'onglets en bas */
.nav-principale {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--blanc); border-top: 1px solid var(--bord);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-principale .nav-marque, .nav-principale .nav-profil { display: none; }
.nav-liens { display: flex; flex: 1; }
.nav-lien {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 52px; padding-top: 6px; border-radius: 12px;
  font-size: 11px; font-weight: 500; color: var(--texte-3); text-decoration: none;
}
.nav-lien svg { width: 24px; height: 24px; }
.nav-lien[aria-current="page"] { color: var(--bordeaux); font-weight: 600; }
.nav-lien:hover { color: var(--bordeaux); }

/* Tablette : rail vertical à gauche */
@media (min-width: 760px) {
  :root { --marge: 32px; }
  .coquille { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
  .nav-principale {
    position: sticky; top: 0; height: 100vh; bottom: auto; flex-direction: column; align-items: center;
    gap: 6px; padding: 18px 0; border-top: 0; border-right: 1px solid var(--bord);
  }
  .nav-principale .nav-marque { display: block; margin-bottom: 14px; }
  .nav-marque img { width: 56px; height: 56px; border-radius: 16px; }
  .nav-liens { flex-direction: column; flex: 0; gap: 4px; }
  .nav-lien { width: 78px; flex: none; min-height: 62px; justify-content: center; padding-top: 0; }
  .nav-lien[aria-current="page"] { background: var(--bordeaux-pale); }
  .nav-principale .nav-profil { display: flex; margin-top: auto; }
  .contenu { padding: 28px var(--marge) 40px; }
}

/* Ordinateur : barre horizontale en haut */
@media (min-width: 1100px) {
  .coquille { display: block; }
  .nav-principale {
    position: sticky; top: 0; height: auto; flex-direction: row; justify-content: flex-start;
    padding: 0 max(24px, calc((100vw - 1200px) / 2 + 24px)); min-height: 72px; gap: 28px;
    background: var(--bordeaux); border: 0; color: var(--blanc);
  }
  .nav-principale .nav-marque { display: flex; align-items: center; gap: 12px; margin: 0; text-decoration: none; color: var(--blanc); }
  .nav-marque img { width: 44px; height: 44px; border-radius: 12px; background: var(--blanc); }
  .nav-marque-texte { display: flex; flex-direction: column; }
  .nav-marque-texte strong { font-family: var(--serif); font-size: 22px; line-height: 1; }
  .nav-marque-texte span { font-size: 11.5px; color: #F1DFC0; }
  .nav-liens { flex-direction: row; flex: 1; gap: 4px; }
  .nav-lien {
    width: auto; min-height: 40px; flex-direction: row; gap: 8px; padding: 0 14px;
    color: #F6E9E6; font-size: 14px; font-weight: 500;
  }
  .nav-lien svg { width: 18px; height: 18px; }
  .nav-lien:hover { color: var(--blanc); background: rgba(255, 255, 255, .1); }
  .nav-lien[aria-current="page"] { background: rgba(255, 255, 255, .16); color: var(--blanc); }
  .nav-principale .nav-profil { margin: 0; }
  .nav-marque-texte { display: flex; }
}
@media (max-width: 1099px) { .nav-marque-texte { display: none; } }

.en-tete-page { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.en-tete-page .titre-page { flex: 1; }

/* 5. Composants ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--bord-fort); background: var(--blanc); color: var(--texte);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--creme-chaud); color: var(--texte); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primaire { background: var(--bordeaux); border-color: var(--bordeaux); color: var(--blanc); }
.btn-primaire:hover { background: var(--bordeaux-fonce); color: var(--blanc); }
.btn-lien { border-color: transparent; background: transparent; color: var(--bordeaux); padding: 0 8px; }
.btn-lien:hover { background: var(--bordeaux-pale); color: var(--bordeaux-fonce); }
.btn-danger { color: var(--bordeaux); border-color: #E3C9CC; }
.btn-large { width: 100%; min-height: 50px; font-size: 15.5px; border-radius: 14px; }
.btn-petit { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-icone {
  width: 44px; height: 44px; padding: 0; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blanc); border: 1px solid var(--bord); color: var(--texte);
}
.btn-icone svg { width: 20px; height: 20px; }
.btn-icone:hover { background: var(--creme-chaud); }

.bloc { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon-grand); padding: 16px; }
.bloc-ombre { box-shadow: var(--ombre); border-color: transparent; }
.bloc-sable { background: var(--creme-chaud); border-color: #E9DCC1; }
.bloc-alerte { background: var(--ambre-pale); border-color: #EAD3A8; }
.bloc-succes { background: var(--vert-pale); border-color: #CFE3D6; }

.liste { background: var(--blanc); border: 1px solid var(--bord); border-radius: 16px; overflow: hidden; }
.liste > * + * { border-top: 1px solid #F0EAE3; }
.liste-ligne {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%;
  color: var(--texte); text-decoration: none; background: transparent; border: 0; text-align: left; font-size: 15px;
}
a.liste-ligne:hover, button.liste-ligne:hover { background: #FCFAF7; color: var(--texte); }
.liste-ligne .chevron { color: var(--texte-3); width: 16px; height: 16px; flex: none; }
.liste-ligne .sous { display: block; font-size: 12.5px; color: var(--texte-3); }

/* Formulaires */
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ > label, .champ > .libelle { font-size: 13px; font-weight: 600; }
.champ .aide { font-size: 12px; color: var(--texte-3); }
.saisie, .champ input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .champ select, .champ textarea {
  min-height: 46px; width: 100%; border-radius: 12px; border: 1px solid var(--bord-fort);
  padding: 0 14px; background: var(--blanc); font-size: 15px;
}
.champ textarea { padding: 10px 14px; min-height: 90px; resize: vertical; }
.saisie:focus, .champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid #C9A45C; outline-offset: 0; border-color: #C9A45C; }
.champ-groupe { display: flex; align-items: center; border: 1px solid var(--bord-fort); border-radius: 12px; background: var(--blanc); padding-right: 4px; }
.champ-groupe input { border: 0 !important; outline: none !important; flex: 1; }
.champ-groupe .btn-icone { border: 0; width: 40px; height: 40px; }
.case { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--texte-2); }
.case input { width: 20px; height: 20px; accent-color: var(--bordeaux); flex: none; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.erreur-form { color: var(--rouge); font-size: 13.5px; font-weight: 500; }
.recherche { display: flex; align-items: center; gap: 8px; min-height: 46px; border-radius: 14px; background: var(--blanc); border: 1px solid var(--bord-fort); padding: 0 12px; }
.recherche svg { width: 18px; height: 18px; color: var(--texte-3); flex: none; }
.recherche input { flex: 1; border: 0; outline: none; background: transparent; font-size: 15px; min-height: 44px; }

/* Interrupteur */
.interrupteur {
  width: 50px; height: 30px; border-radius: 15px; border: 0; padding: 3px; flex: none;
  background: #CFC5BA; display: inline-flex; align-items: center; transition: background .15s;
}
.interrupteur::after { content: ''; width: 24px; height: 24px; border-radius: 12px; background: var(--blanc); transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.interrupteur[aria-checked="true"] { background: var(--bordeaux); }
.interrupteur[aria-checked="true"]::after { transform: translateX(20px); }

/* Puces de filtre et badges */
.puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.puce {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--bord-fort); background: var(--blanc); font-size: 13px; font-weight: 600;
}
.puce[aria-pressed="true"] { background: var(--bordeaux); border-color: var(--bordeaux); color: var(--blanc); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 9px; white-space: nowrap; }
.badge-officier, .badge-commandeur { background: var(--bordeaux-pale); color: var(--bordeaux); }
.badge-chevalier { background: var(--or-pale); color: var(--or-texte); }
.badge-cotisant { background: var(--vert-pale); color: var(--vert); }
.badge-neutre { background: #F0EDEA; color: var(--texte-3); }
.badge-alerte { background: var(--ambre-pale); color: var(--ambre); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* Avatar */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--or); color: var(--blanc); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-officier, .avatar-commandeur { background: var(--bordeaux); }
.avatar-defunt { background: #8C827C; }
.avatar-grand { width: 88px; height: 88px; font-family: var(--serif); font-size: 32px; font-weight: 700; }

/* Notifications à l'écran, boîtes de dialogue */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-hauteur) + 24px); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 760px) { .toasts { bottom: 24px; } }
.toast { background: var(--texte); color: var(--blanc); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--ombre); }
.toast-erreur { background: var(--bordeaux); }
dialog.dialogue { border: 0; border-radius: 18px; padding: 22px; max-width: min(92vw, 460px); width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.25); color: var(--texte); }
dialog.dialogue::backdrop { background: rgba(34, 27, 24, .45); }
.dialogue h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 10px; }
.dialogue-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.vide { padding: 32px 16px; text-align: center; color: var(--texte-3); }
.chargement { padding: 40px 0; display: flex; justify-content: center; }
.chargement::after { content: ''; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--bord); border-top-color: var(--bordeaux); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
progress { width: 100%; height: 8px; border-radius: 4px; overflow: hidden; appearance: none; border: 0; background: #EFE8E0; }
progress::-webkit-progress-bar { background: #EFE8E0; }
progress::-webkit-progress-value { background: var(--bordeaux); }
progress::-moz-progress-bar { background: var(--bordeaux); }

/* 6. Écrans membres --------------------------------------------------------- */
/* Connexion */
.ecran-connexion { min-height: 100vh; display: flex; flex-direction: column; }
.connexion-bandeau {
  background: var(--bordeaux); color: var(--blanc); text-align: center;
  padding: calc(40px + env(safe-area-inset-top)) 24px 70px; border-radius: 0 0 32px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.connexion-bandeau img { width: 104px; height: 104px; border-radius: 26px; background: var(--blanc); }
.connexion-bandeau h1 { font-family: var(--serif); font-size: 34px; margin-top: 12px; }
.connexion-bandeau p { font-size: 13px; color: #F1DFC0; letter-spacing: .4px; }
.connexion-boite { width: min(100% - 40px, 440px); margin: -40px auto 0; display: flex; flex-direction: column; gap: 14px; }
.connexion-pied { margin-top: auto; padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); text-align: center; font-size: 12.5px; color: var(--texte-3); display: flex; flex-direction: column; gap: 8px; }
.raccourci-carte {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--creme-chaud); border: 1px solid #E9DCC1; text-decoration: none; color: var(--texte);
}
.raccourci-carte svg { width: 28px; height: 28px; color: var(--or-texte); flex: none; }
.etapes { display: flex; gap: 6px; }
.etapes span { flex: 1; height: 4px; border-radius: 4px; background: var(--bord); }
.etapes span.faite { background: var(--bordeaux); }
.force-mdp { display: flex; gap: 4px; }
.force-mdp span { flex: 1; height: 4px; border-radius: 4px; background: var(--bord); }
.force-mdp[data-force="1"] span:nth-child(-n+1) { background: var(--rouge); }
.force-mdp[data-force="2"] span:nth-child(-n+2) { background: #C27C0E; }
.force-mdp[data-force="3"] span:nth-child(-n+3) { background: var(--vert); }
.force-mdp[data-force="4"] span { background: var(--vert); }

/* Accueil */
.accueil-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.accueil-tete img { width: 52px; height: 42px; object-fit: contain; }
.bandeau-carte {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px;
  background: var(--bordeaux); color: var(--blanc); text-decoration: none;
}
.bandeau-carte:hover { color: var(--blanc); background: var(--bordeaux-fonce); }
.bandeau-carte .mini-carte { width: 64px; height: 40px; border-radius: 6px; background: var(--carte-vert); flex: none; padding: 3px; }
.bandeau-carte .mini-carte img { width: 100%; height: 100%; object-fit: contain; }
.bandeau-carte .sur-titre { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--or-clair); }
.bandeau-carte.inactif { background: var(--blanc); color: var(--texte); border: 1px solid var(--bord); }
.bandeau-carte.inactif .sur-titre { color: var(--texte-3); }
.date-bloc { width: 58px; height: 62px; border-radius: 12px; background: var(--or-pale); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.date-bloc .mois { font-size: 11px; font-weight: 600; color: var(--or-texte); text-transform: uppercase; }
.date-bloc .jour { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1; }
.grille-accueil { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .grille-accueil { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nouveaute { display: flex; gap: 12px; align-items: center; background: var(--blanc); border: 1px solid var(--bord); border-radius: 16px; padding: 10px; text-decoration: none; color: var(--texte); }
.nouveaute:hover { color: var(--texte); border-color: var(--bord-fort); }
.nouveaute-visuel { width: 64px; height: 64px; border-radius: 12px; background: #D9C6B3; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--bordeaux); }
.nouveaute-visuel img { width: 100%; height: 100%; object-fit: cover; }
.nouveaute-visuel svg { width: 26px; height: 26px; }
.nouveaute .type { font-size: 11.5px; font-weight: 600; color: var(--bordeaux); text-transform: uppercase; letter-spacing: .5px; }
.stat { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--bordeaux); line-height: 1; }

/* Annuaire */
.annuaire { display: grid; gap: 20px; }
.annuaire-liste { display: flex; flex-direction: column; gap: 8px; }
.membre-ligne { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px; text-decoration: none; color: var(--texte); }
.membre-ligne:hover { border-color: var(--bord-fort); color: var(--texte); }
.membre-ligne[aria-current="true"] { border-color: var(--bordeaux); box-shadow: 0 0 0 1px var(--bordeaux); }
.membre-ligne.defunt { opacity: .78; }
.membre-ligne .nom { font-weight: 600; font-size: 15px; }
.membre-ligne .sous { font-size: 12.5px; color: var(--texte-3); }
.membre-ligne .badges { flex-direction: column; align-items: flex-end; }
.fiche-panneau { display: none; }
@media (min-width: 980px) {
  .annuaire { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
  .annuaire-liste { max-height: calc(100vh - 260px); overflow-y: auto; padding-right: 6px; }
  .fiche-panneau { display: block; position: sticky; top: 96px; }
}
.fiche-tete { display: flex; align-items: center; gap: 16px; }
.fiche-tete h1, .fiche-tete h2 { font-family: var(--serif); font-size: 32px; line-height: 1.05; }
.parcours { display: flex; flex-direction: column; gap: 14px; }
.parcours-etape { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; }
.parcours-etape::before { content: ''; width: 12px; height: 12px; border-radius: 6px; background: var(--or); margin-top: 5px; }
.parcours-etape.officier::before, .parcours-etape.commandeur::before { background: var(--bordeaux); }
.grille-vignettes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 760px) { .grille-vignettes { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grille-vignettes a { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #D9C6B3; display: block; }
.grille-vignettes img { width: 100%; height: 100%; object-fit: cover; }
.photo-bandeau { height: 190px; border-radius: 18px; background: #D9C6B3; overflow: hidden; }
.photo-bandeau img { width: 100%; height: 100%; object-fit: cover; }
.puces-liens { display: flex; gap: 8px; flex-wrap: wrap; }
.puces-liens a { min-height: 36px; padding: 0 12px; border-radius: 18px; background: var(--blanc); border: 1px solid var(--bord-fort); display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--texte); }

/* Documents */
.icone-fichier { width: 38px; height: 44px; border-radius: 8px; color: var(--blanc); font-size: 10px; font-weight: 700; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; flex: none; background: #6B605A; text-transform: uppercase; }
.icone-fichier[data-ext="pdf"] { background: #B3261E; }
.icone-fichier[data-ext^="doc"], .icone-fichier[data-ext="odt"] { background: #2B5797; }
.icone-fichier[data-ext^="xls"], .icone-fichier[data-ext="ods"], .icone-fichier[data-ext="csv"] { background: #1E7145; }
.icone-fichier[data-ext^="ppt"], .icone-fichier[data-ext="odp"] { background: #C4501B; }
.icone-dossier { width: 28px; height: 28px; color: var(--or); flex: none; }
.fil-ariane { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--texte-3); }
.fil-ariane a { color: var(--texte-3); }

/* Magazine */
.kiosque-une { display: flex; gap: 16px; }
.couverture { width: 118px; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--bordeaux); box-shadow: 0 10px 22px rgba(34,27,24,.22); overflow: hidden; flex: none; position: relative; }
.couverture img { width: 100%; height: 100%; object-fit: cover; }
.couverture .cadenas { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 13px; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; color: var(--bordeaux); }
.couverture .cadenas svg { width: 13px; height: 13px; }
.grille-numeros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 760px) { .grille-numeros { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.grille-numeros .couverture { width: 100%; }
.numero { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--texte); font-size: 12.5px; }

/* 7. Carte de membre (selon le modèle officiel) ------------------------------ */
.ecran-carte { min-height: 100vh; padding: calc(20px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; max-width: 520px; margin: 0 auto; }
.carte-membre {
  width: 100%; max-width: 440px; aspect-ratio: 1.6; border-radius: 14px; background: var(--carte-vert);
  box-shadow: 0 14px 30px rgba(34, 27, 24, .22); padding: 3.4% 4.5% 4%; display: flex; flex-direction: column;
  font-family: 'EB Garamond', Garamond, Georgia, serif; container-type: inline-size; align-self: center;
}
.carte-haut { display: flex; align-items: flex-start; gap: 2.5cqw; }
.carte-blason { width: 30cqw; height: auto; margin-left: -1.5cqw; flex: none; }
.carte-titres { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 3.5cqw; text-align: center; color: var(--carte-titre); }
.carte-titres .l1, .carte-titres .l2 { font-size: 5.4cqw; line-height: 1.12; letter-spacing: .1cqw; white-space: nowrap; }
.carte-titres .l3 { font-size: 2.6cqw; color: #3E4A2A; margin-top: 1.4cqw; }
.carte-milieu { display: flex; flex-direction: column; align-items: center; margin-top: .6cqw; color: var(--carte-rouge); }
.carte-milieu .l1 { font-size: 8.6cqw; line-height: 1; font-weight: 500; }
.carte-milieu .l2 { font-size: 4.9cqw; line-height: 1.2; font-weight: 600; margin-top: .8cqw; }
.carte-nom {
  margin: auto 10cqw 0 8.5cqw; min-height: 8cqw; background: var(--blanc); display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600; font-size: 3.9cqw; color: var(--texte); padding: 0 2cqw; text-align: center;
}
.carte-infos { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.carte-infos > div { display: flex; justify-content: space-between; gap: 10px; }
.etat-ok { color: var(--vert); font-weight: 600; }
.etat-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--vert); background: var(--vert-pale); padding: 6px 10px; border-radius: 20px; font-weight: 500; }
/* Téléphone à l'horizontale : la carte prend tout l'écran. */
@media (orientation: landscape) and (max-height: 520px) {
  .ecran-carte { max-width: none; flex-direction: row; align-items: center; justify-content: center; min-height: 100vh; }
  .ecran-carte > :not(.carte-membre) { display: none; }
  .carte-membre { max-width: none; width: min(92vw, calc((100vh - 40px) * 1.6)); }
}

/* 8. Galerie ------------------------------------------------------------------ */
.grille-albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 760px) { .grille-albums { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; } }
.album-carte { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--texte); }
.album-visuel { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #D9C6B3; }
.album-visuel img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.album-carte:hover .album-visuel img { transform: scale(1.03); }
.album-visuel .compte { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.92); padding: 3px 7px; border-radius: 8px; }
.album-visuel .cadenas { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 14px; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; color: var(--bordeaux); }
.album-visuel .cadenas svg { width: 14px; height: 14px; }
.album-carte .titre { font-weight: 600; font-size: 14px; line-height: 1.25; }
.grille-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin: 0 calc(var(--marge) * -1 + 2px); }
@media (min-width: 760px) { .grille-photos { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 0; } }
.grille-photos button { aspect-ratio: 1; border: 0; padding: 0; background: #D9C6B3; overflow: hidden; border-radius: 0; }
@media (min-width: 760px) { .grille-photos button { border-radius: 8px; } }
.grille-photos img { width: 100%; height: 100%; object-fit: cover; }

.visionneuse { position: fixed; inset: 0; z-index: 50; background: #120A0B; color: var(--blanc); display: flex; flex-direction: column; }
.visionneuse-barre { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; gap: 10px; }
.visionneuse .btn-icone { background: rgba(255,255,255,.12); border: 0; color: var(--blanc); border-radius: 22px; }
.visionneuse-scene { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; touch-action: pan-y pinch-zoom; }
.visionneuse-scene img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.visionneuse-scene .prec, .visionneuse-scene .suiv { position: absolute; top: 50%; transform: translateY(-50%); }
.visionneuse-scene .prec { left: 10px; }
.visionneuse-scene .suiv { right: 10px; }
.visionneuse-pied { padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); font-size: 13px; color: #D9C9C3; display: flex; flex-direction: column; gap: 10px; }
.visionneuse-pied .btn { background: transparent; color: var(--blanc); border-color: rgba(255,255,255,.3); }

/* 9. Liseuse du magazine --------------------------------------------------------- */
.liseuse { position: fixed; inset: 0; z-index: 50; background: #1E1716; color: var(--blanc); display: flex; flex-direction: column; }
.liseuse-barre { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 10px; }
.liseuse .btn-icone { background: rgba(255,255,255,.08); border: 0; color: var(--blanc); }
.liseuse-scene { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; position: relative; }
.liseuse-scene img { max-height: 100%; max-width: 100%; object-fit: contain; background: #FBF8F3; box-shadow: 0 16px 40px rgba(0,0,0,.5); user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.liseuse-scene.zoom { align-items: flex-start; justify-content: flex-start; }
.liseuse-scene.zoom img { max-height: none; max-width: none; width: 200%; }
.liseuse-scene.double img { max-width: calc(50% - 4px); }
.liseuse-pied { padding: 10px 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.liseuse-pied .btn { background: transparent; color: var(--blanc); border-color: rgba(255,255,255,.22); }
.liseuse-pied .btn-primaire { background: var(--blanc); color: var(--texte); border-color: var(--blanc); }
.liseuse-pied input[type="range"] { width: 100%; accent-color: var(--or-clair); }
.liseuse-recherche { position: absolute; top: calc(64px + env(safe-area-inset-top)); right: 12px; left: 12px; max-width: 420px; margin-left: auto; z-index: 2; background: var(--blanc); color: var(--texte); border-radius: 14px; padding: 12px; box-shadow: var(--ombre); max-height: 60vh; overflow: auto; }

/* 10. Administration (ordinateur) ----------------------------------------------- */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-menu { background: var(--blanc); border-right: 1px solid var(--bord); padding: 20px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-marque { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; text-decoration: none; color: var(--texte); }
.admin-marque img { width: 40px; height: 40px; border-radius: 10px; }
.admin-marque strong { font-family: var(--serif); font-size: 19px; display: block; line-height: 1; }
.admin-menu a.entree { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 10px; border-radius: 10px; text-decoration: none; color: var(--texte); font-size: 14px; font-weight: 500; }
.admin-menu a.entree:hover { background: var(--creme); }
.admin-menu a.entree[aria-current="page"] { background: var(--bordeaux-pale); color: var(--bordeaux); font-weight: 600; }
.admin-menu .compteur { font-size: 11px; font-weight: 700; color: var(--bordeaux); }
.admin-menu .sep { height: 1px; background: var(--bord); margin: 10px 6px; }
.admin-contenu { padding: 26px 30px 48px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.admin-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-tete h1 { font-family: var(--serif); font-size: 34px; }
.admin-tete p { color: var(--texte-3); font-size: 14px; margin-top: 2px; }
.barre-outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.barre-outils .recherche { flex: 1 1 260px; }
.barre-outils select, .barre-outils input[type="number"] { min-height: 40px; border-radius: 10px; border: 1px solid var(--bord-fort); background: var(--blanc); padding: 0 10px; }
.tableau-boite { background: var(--blanc); border: 1px solid var(--bord); border-radius: 16px; overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; color: var(--texte-3); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--bord); white-space: nowrap; background: var(--blanc); position: sticky; top: 0; }
.tableau td { padding: 10px 14px; border-bottom: 1px solid #F3EEE8; vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: #FCFAF7; }
.tableau .actions { text-align: right; white-space: nowrap; }
.cartes-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.carte-stat { background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--texte); display: flex; flex-direction: column; gap: 4px; }
.carte-stat .valeur { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--bordeaux); line-height: 1; }
.carte-stat.alerte { background: var(--ambre-pale); border-color: #EAD3A8; }
.carte-stat.alerte .valeur { color: var(--ambre); }
.colonnes-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.zone-depot { border: 2px dashed #D3C5B5; border-radius: 14px; padding: 22px; text-align: center; background: #FCFAF7; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.zone-depot.survol { border-color: var(--bordeaux); background: var(--bordeaux-pale); }
.grille-admin-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.admin-photo { position: relative; border-radius: 10px; overflow: hidden; background: #D9C6B3; aspect-ratio: 1; border: 2px solid transparent; padding: 0; }
.admin-photo img { width: 100%; height: 100%; object-fit: cover; }
.admin-photo[aria-pressed="true"] { border-color: var(--bordeaux); }
.admin-photo .etiquette { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(255,255,255,.92); padding: 2px 6px; border-radius: 6px; }
.panneau-lateral { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--blanc); box-shadow: -10px 0 40px rgba(0,0,0,.15); z-index: 40; padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.liste-cases { max-height: 260px; overflow-y: auto; border: 1px solid var(--bord); border-radius: 12px; padding: 6px 10px; }
.liste-cases .case { padding: 6px 0; }
.ecran-centre, .ecran-trop-petit { min-height: 100vh; display: grid; place-content: center; gap: 12px; text-align: center; padding: 24px; max-width: 420px; margin: 0 auto; }
@media (max-width: 1023px) {
  .admin { display: none; }
}
@media (min-width: 1024px) {
  .ecran-trop-petit { display: none; }
}

/* Compléments */
.bandeau-carte .bandeau-texte, .bandeau-carte .sur-titre { display: block; }
.ecran-centre img, .ecran-trop-petit img { margin: 0 auto; border-radius: 24px; }
.membre-ligne .nom, .membre-ligne .sous { display: block; }
.icone-inline { width: 13px; height: 13px; vertical-align: -2px; display: inline-block; }
.sans-defilement { overflow: hidden; }
.lien-clair { color: #F1DFC0; }
.lien-clair:hover { color: var(--blanc); }
.liste-ligne .flex-1 > .gras, .liste-ligne .flex-1 > .tronque { display: block; }
.retrait-0 { width: 0; }
.retrait-1 { width: 18px; flex: none; }
.retrait-2 { width: 36px; flex: none; }
.retrait-3 { width: 54px; flex: none; }
.liste-ligne[aria-current="true"] { background: var(--bordeaux-pale); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #F3EEE8; padding: 1px 6px; border-radius: 6px; }
.panneau-lateral img { border-radius: 10px; }
.champ.tres-petit { font-size: 11px; color: var(--texte-3); gap: 2px; }
.ligne > .saisie { width: auto; flex: 1 1 200px; }
#contenu:focus { outline: none; }
