/* ==================================================================
   JURISOURCE — feuille de style unique
   Charte : atelier feutré facon claude.ai (crème, encre, terracotta).
   Aucune police distante (RGPD) : pile système + Georgia pour les titres.
   ================================================================== */

:root {
  --fond:        #faf9f5;
  --fond-creuse: #f0eee6;
  --carte:       #ffffff;
  --encre:       #141413;
  --encre-douce: #6b6960;
  --bordure:     #e6e3da;
  --accent:      #c96442;
  --accent-clair:#f3e4dd;
  --vert:        #2f6b4f;
  --vert-clair:  #e3efe8;
  --ambre:       #8a6410;
  --ambre-clair: #f6ecd4;
  --rouge:       #9a3324;
  --rouge-clair: #f6e0dc;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
           Roboto, "Helvetica Neue", Arial, sans-serif;

  --rayon:    12px;
  --rayon-xl: 20px;
  --rail:     264px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

/* ---------- Accessibilite ---------- */
.visuellement-cache {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lien-evitement {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: var(--encre);
  color: var(--fond);
  border-radius: 0 0 var(--rayon) 0;
}
.lien-evitement:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Champ leurre anti-bot : masque sans display:none inline (regle 7) */
.leurre {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ==================================================================
   STRUCTURE
   ================================================================== */
.appli {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
}

/* ---------- Colonne gauche ---------- */
.rail {
  background: var(--fond-creuse);
  border-right: 1px solid var(--bordure);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail__haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.1rem;
}
.marque__pastille {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.marque__nom { font-weight: 400; letter-spacing: -0.01em; }

.rail__fermer {
  display: none;
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--encre-douce);
  cursor: pointer;
}

.bouton-neuf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  text-decoration: none;
  font-size: 0.94rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bouton-neuf:hover { border-color: var(--accent); transform: translateY(-1px); }

.rail__titre {
  margin: 6px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

.rail__liste { list-style: none; margin: 0; padding: 0; }

.rail__item {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--encre);
  transition: background 0.15s ease;
}
.rail__item:hover { background: rgba(20, 20, 19, 0.05); }
.rail__item.est-actif { background: var(--accent-clair); }

.rail__item-texte {
  display: block;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rail__item-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--encre-douce);
}
.rail__vide { font-size: 0.85rem; color: var(--encre-douce); padding: 6px 10px; }

.rail-voile { display: none; }

/* ---------- Colonne principale ---------- */
.principal {
  padding: 48px 32px 64px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.barre-mobile { display: none; }

/* ==================================================================
   ACCUEIL
   ================================================================== */
.accueil { text-align: center; margin-bottom: 32px; }

.accueil__titre {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 24px 0 12px;
}
.accueil__titre em { color: var(--accent); font-style: italic; }

.accueil__sous-titre {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--encre-douce);
  font-size: 1rem;
}

/* ==================================================================
   COMPOSER
   ================================================================== */
.composer {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-xl);
  padding: 14px 14px 12px;
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.04), 0 8px 24px rgba(20, 20, 19, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer:focus-within {
  border-color: #d6d1c4;
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.05), 0 12px 32px rgba(20, 20, 19, 0.07);
}

.composer__champ {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 76px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--encre);
  background: transparent;
}
.composer__champ:focus { outline: none; }
.composer__champ::placeholder { color: #a8a49a; }

.composer__pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.composer__filtres { display: flex; gap: 8px; flex-wrap: wrap; }

.puce-select {
  appearance: none;
  background: var(--fond-creuse);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.83rem;
  color: var(--encre);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.puce-select:hover { border-color: #d6d1c4; }

.composer__envoyer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.composer__envoyer:hover { background: #b4573a; transform: translateY(-1px); }
.composer__envoyer[disabled] { opacity: 0.55; cursor: progress; transform: none; }

.composer__note {
  margin: 10px 2px 0;
  font-size: 0.8rem;
  color: var(--encre-douce);
}

.alerte {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--rayon);
  background: var(--rouge-clair);
  border: 1px solid #e8c4bd;
  color: var(--rouge);
  font-size: 0.92rem;
}

/* ==================================================================
   CHARGEMENT
   ================================================================== */
.chargement {
  margin-top: 28px;
  padding: 22px;
  text-align: center;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-xl);
}
.chargement__points { display: inline-flex; gap: 6px; margin-bottom: 10px; }
.chargement__points span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite ease-in-out;
}
.chargement__points span:nth-child(2) { animation-delay: 0.18s; }
.chargement__points span:nth-child(3) { animation-delay: 0.36s; }
.chargement__texte { margin: 0; color: var(--encre-douce); font-size: 0.92rem; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40%           { opacity: 1;    transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .chargement__points span { animation: none; opacity: 0.7; }
}

/* ==================================================================
   SYNTHESE
   ================================================================== */
.synthese {
  margin-top: 36px;
  padding: 24px 26px;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-xl);
}
.synthese__titre {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
}
.synthese__texte { margin: 0 0 18px; }

.synthese__compteurs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
}
.synthese__compteurs li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--fond-creuse);
  color: var(--encre-douce);
}
.synthese__compteurs .est-verifie { background: var(--vert-clair);  color: var(--vert); }
.synthese__compteurs .est-doute   { background: var(--ambre-clair); color: var(--ambre); }
.synthese__compteurs .est-mort    { background: var(--rouge-clair); color: var(--rouge); }

/* ==================================================================
   FILTRES DE LA LISTE
   ================================================================== */
.filtres { margin-top: 28px; }
.filtres__ligne { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.filtres__recherche {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 8px 14px;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: var(--carte);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--encre);
}

.filtres__compte {
  margin: 10px 2px 0;
  font-size: 0.8rem;
  color: var(--encre-douce);
}

/* ==================================================================
   DECISIONS
   ================================================================== */
.decisions { list-style: none; margin: 16px 0 0; padding: 0; }

.decision {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-xl);
  padding: 22px 24px;
  margin-bottom: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.decision:hover {
  border-color: #d9d4c7;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(20, 20, 19, 0.06);
}
.decision[hidden] { display: none; }

.decision__entete {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.decision__juridiction { margin: 0; font-size: 0.88rem; font-weight: 600; }
.decision__date { margin: 2px 0 0; font-size: 0.82rem; color: var(--encre-douce); }

.badge {
  flex: 0 0 auto;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
/* L'information ne repose jamais sur la seule couleur : chaque badge porte
   un libelle explicite (« Source vérifiée », « À confirmer », « Lien mort »). */
.badge--verifie     { background: var(--vert-clair);  color: var(--vert); }
.badge--a_confirmer { background: var(--ambre-clair); color: var(--ambre); }
.badge--introuvable { background: var(--rouge-clair); color: var(--rouge); }
.badge--non_verifie { background: var(--fond-creuse); color: var(--encre-douce); }

.decision__titre {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.16rem;
  line-height: 1.35;
}
.decision__resume { margin: 0 0 14px; font-size: 0.95rem; }

.decision__etiquettes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.decision__etiquettes li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--fond-creuse);
  font-size: 0.74rem;
  color: var(--encre-douce);
}

.decision__verif {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 2px solid var(--bordure);
  font-size: 0.8rem;
  color: var(--encre-douce);
}

.decision__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.lien-source {
  font-size: 0.86rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.lien-source:hover { border-bottom-color: var(--accent); }

.bouton-fin {
  padding: 5px 12px;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--encre-douce);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.bouton-fin:hover { border-color: var(--accent); color: var(--accent); }
.bouton-fin[disabled] { opacity: 0.5; cursor: progress; }

.vide {
  margin-top: 24px;
  padding: 20px;
  border: 1px dashed var(--bordure);
  border-radius: var(--rayon);
  color: var(--encre-douce);
  text-align: center;
}

/* ==================================================================
   PAGES EDITORIALES + PIED
   ================================================================== */
.page-texte { max-width: 720px; margin: 0 auto; padding: 48px 24px 64px; }
.page-texte h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: -0.02em;
}
.page-texte h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  margin-top: 32px;
}

.page-texte table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.9rem;
}
.page-texte th,
.page-texte td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bordure);
  vertical-align: top;
}
.page-texte th { font-weight: 600; }

.pied {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 32px 40px;
  border-top: 1px solid var(--bordure);
  color: var(--encre-douce);
  font-size: 0.82rem;
}
.pied nav { display: flex; gap: 16px; margin-top: 8px; }
.pied a { color: var(--encre-douce); }

/* ==================================================================
   RESPONSIVE — mobile first en pratique : le rail se replie
   ================================================================== */
@media (max-width: 900px) {
  .appli { grid-template-columns: 1fr; }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 84%;
    max-width: var(--rail);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .rail.est-ouvert { transform: translateX(0); }
  .rail__fermer { display: block; }

  .rail-voile {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(20, 20, 19, 0.35);
  }
  .rail-voile[hidden] { display: none; }

  .barre-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -16px -16px 20px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bordure);
  }
  .barre-mobile__bouton {
    background: none;
    border: 0;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--encre);
  }
  .barre-mobile__titre { font-family: var(--serif); }

  .principal { padding: 16px 16px 48px; }
  .pied { padding: 24px 16px 32px; }
}

@media (max-width: 560px) {
  .composer__pied { flex-direction: column; align-items: stretch; }
  .composer__envoyer { justify-content: center; }
  .decision { padding: 18px 16px; }
  .decision__entete { flex-direction: column; }
}

/* Exemple de reference cite dans la note sous le composer */
.composer__exemple {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--encre);
}
