/* ============================================================
   ABSTENTIONNISTE, sources de la série
   Feuille de style unique, mobile first (95 % des visiteurs
   arrivent par le QR code depuis un téléphone).
   Une seule couleur d'accent : bleu nuit.
   ============================================================ */

:root {
  --accent: #16324f;          /* bleu nuit, couleur d'accent unique */
  --accent-clair: #e8eef4;    /* fond léger dérivé de l'accent */
  --fond: #faf9f7;            /* fond clair, papier documentaire */
  --carte: #ffffff;
  --texte: #22252a;
  --texte-doux: #5c6470;
  --bordure: #dfe3e8;
  --rayon: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.55;
  font-size: 16px;
}

/* Les éléments d'interface (boutons, onglets, pastilles) passent
   en police système sans empattement pour la lisibilité sur mobile */
button, input, .badge, .btn, .compteur, .chapitre summary .nb {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- En-tête ---------- */

.entete {
  background: var(--accent);
  color: #ffffff;
  text-align: center;
  padding: 28px 16px 22px;
}

.entete h1 {
  font-size: 1.7rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.sous-titre {
  font-style: italic;
  margin-top: 6px;
  opacity: 0.92;
}

.promesse {
  margin-top: 10px;
  font-size: 0.95rem;
  opacity: 0.85;
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Logo marque ---------- */

.logo-marque {
  margin-bottom: 10px;
}

.logo-marque svg {
  display: block;
  margin: 0 auto;
}

/* ---------- Bandeau de présentation ---------- */

.bandeau-intro {
  background: var(--accent-clair);
  border-left: 4px solid var(--accent);
  padding: 14px 20px;
}

.bandeau-texte {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--texte);
  font-style: italic;
}

/* ---------- Barre de recherche ---------- */

.recherche {
  margin-top: 18px;
}

#champ-recherche {
  width: 100%;
  max-width: 480px;
  padding: 11px 14px;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--rayon);
  background: rgba(255, 255, 255, 0.96);
  color: var(--texte);
}

#champ-recherche:focus {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

/* ---------- Onglets ---------- */

.onglets {
  display: flex;
  gap: 6px;
  overflow-x: auto;              /* défilement horizontal sur petit écran */
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 0;
  background: var(--fond);
  border-bottom: 1px solid var(--bordure);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* display: flex écraserait l'attribut hidden posé pendant la recherche */
.onglets[hidden] { display: none; }

.onglet {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 0.92rem;
  border: 1px solid var(--bordure);
  border-bottom: none;
  border-radius: var(--rayon) var(--rayon) 0 0;
  background: #f0efec;
  color: var(--texte-doux);
  cursor: pointer;
  white-space: nowrap;
}

.onglet[aria-selected="true"] {
  background: var(--carte);
  color: var(--accent);
  font-weight: 600;
  border-color: var(--bordure);
  box-shadow: 0 2px 0 var(--carte);  /* masque la bordure du bas */
}

/* ---------- Onglets à venir ---------- */

.onglet-verrouille {
  opacity: 0.42;
  font-style: italic;
}

.onglet-verrouille[aria-selected="true"] {
  opacity: 0.65;
}

/* ---------- Panneau à venir ---------- */

.panneau-verrou {
  max-width: 480px;
  margin: 48px auto;
  padding: 0 12px;
  text-align: center;
}

.verrou-titre {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.verrou-desc {
  font-style: italic;
  color: var(--texte);
  line-height: 1.75;
  margin-bottom: 20px;
}

.verrou-mention {
  display: inline-block;
  font-size: 0.78rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-doux);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 4px 14px;
}

/* ---------- Panneaux de livre ---------- */

main, #resultats {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 12px 32px;
}

.panneau[hidden] { display: none; }

.compteur {
  font-size: 0.85rem;
  color: var(--texte-doux);
  margin: 4px 2px 14px;
}

/* ---------- Accordéons de chapitres ---------- */

.chapitre {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  margin-bottom: 10px;
}

.chapitre summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;              /* retire le triangle par défaut */
  min-height: 48px;              /* cible tactile confortable */
}

.chapitre summary::-webkit-details-marker { display: none; }

/* Chevron indiquant l'état ouvert ou fermé */
.chapitre summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.chapitre[open] summary::after { content: "\2212"; } /* signe moins */

.chapitre summary .nb {
  flex: 0 0 auto;
  margin-left: auto;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--texte-doux);
}

/* ---------- Liste de sources ---------- */

.liste-sources {
  list-style: none;
  border-top: 1px solid var(--bordure);
  padding: 4px 14px 10px;
}

.source {
  padding: 12px 0;
  border-bottom: 1px solid var(--bordure);
}

.source:last-child { border-bottom: none; }

.source .texte {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.source .ligne-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Pastille discrète selon le type de source */
.badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-clair);
  color: var(--accent);
  border: 1px solid #cdd9e4;
  letter-spacing: 0.02em;
}

/* Boutons Consulter et Rechercher : même style, nuance discrète */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--rayon);
  text-decoration: none;
  min-height: 36px;
  line-height: 20px;
}

.btn-consulter {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.btn-rechercher {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn:active { opacity: 0.8; }

/* ---------- Résultats de recherche ---------- */

.res-livre {
  font-size: 1.05rem;
  color: var(--accent);
  margin: 18px 2px 4px;
}

.res-chapitre {
  font-size: 0.9rem;
  color: var(--texte-doux);
  font-weight: 600;
  margin: 10px 2px 4px;
}

.res-bloc {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 4px 14px;
}

.res-vide {
  text-align: center;
  color: var(--texte-doux);
  padding: 30px 10px;
}

/* ---------- Pied de page ---------- */

.pied {
  text-align: center;
  font-size: 0.85rem;
  color: var(--texte-doux);
  border-top: 1px solid var(--bordure);
  padding: 22px 12px 30px;
}

.pied a { color: var(--accent); }

/* ---------- Écrans plus larges ---------- */

@media (min-width: 640px) {
  .entete h1 { font-size: 2.1rem; }
  .entete { padding: 40px 16px 28px; }
  .onglets { justify-content: center; }
  .source {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }
  .source .texte { margin-bottom: 0; flex: 1; }
  .source .ligne-actions { flex: 0 0 auto; flex-direction: row-reverse; }
}
