/* VYRION — public/css/legal.css
 * Style des pages légales : typographie lisible, article structuré, sommaire,
 * tableau RGPD, mise en valeur des [A_REMPLIR].
 * S'appuie sur les variables CSS de style.css (--font-b, --accent, etc.).
 */

/* ---------- HERO LEGAL ---------- */
.hero--legal {
  min-height: 50vh !important;
  padding-block: calc(80px + var(--safe-top, 0px)) 4rem !important;
}
@media (min-width: 640px) {
  .hero--legal { padding-block: calc(80px + var(--safe-top, 0px)) 5rem !important; }
}
@media (min-width: 880px) {
  .hero--legal { min-height: 45vh !important; padding-block: calc(80px + var(--safe-top, 0px)) 6rem !important; }
}

/* ---------- BLOC ARTICLE ---------- */
.legal {
  padding-block: 4rem 6rem;
}
@media (min-width: 640px) {
  .legal { padding-block: 5rem 7rem; }
}
@media (min-width: 880px) {
  .legal { padding-block: 6.5rem 9rem; }
}

.legal__article {
  max-width: 760px;
  margin-inline: auto;
  color: var(--white, #fff);
  font-family: var(--font-b, 'Rajdhani', sans-serif);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.75;
}

/* Date de mise à jour */
.legal__updated {
  font-family: var(--font-b);
  font-weight: 600;
  font-size: .85rem;
  color: var(--muted, #999);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 3rem;
  padding: .65rem 1rem;
  border-left: 3px solid var(--accent, #ff5e1f);
  background: rgba(255, 255, 255, .03);
  border-radius: 0 4px 4px 0;
}

/* Titres de section */
.legal__h2 {
  font-family: var(--font-a, 'Unbounded', sans-serif);
  font-weight: 800;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: -.01em;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1.5rem;
  color: var(--white, #fff);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.legal__h2:first-of-type {
  margin-top: 2rem;
}

.legal p {
  margin-bottom: 1.25rem;
}

/* Listes */
.legal__list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.5rem;
}
.legal__list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: .75rem;
  line-height: 1.7;
}
.legal__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .75rem;
  width: 8px;
  height: 2px;
  background: var(--accent, #ff5e1f);
}

/* Liens internes / externes */
.legal a {
  color: var(--accent, #ff5e1f);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .2s, text-decoration-thickness .2s;
}
.legal a:hover,
.legal a:focus-visible {
  color: var(--white, #fff);
  text-decoration-thickness: 2px;
}

/* Tableau RGPD */
.legal__table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
}
.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  font-family: var(--font-b, 'Rajdhani', sans-serif);
}
.legal__table th,
.legal__table td {
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  vertical-align: top;
  line-height: 1.5;
}
.legal__table thead th {
  background: rgba(255, 94, 31, .12);
  font-family: var(--font-a, 'Unbounded', sans-serif);
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--white, #fff);
}
.legal__table tbody tr:hover {
  background: rgba(255, 255, 255, .02);
}
.legal__table tbody td:first-child {
  font-weight: 600;
  color: var(--white, #fff);
}

/* Sommaire (TOC) */
.legal__toc {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid var(--accent, #ff5e1f);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 3rem;
}
.legal__toc-title {
  font-family: var(--font-a, 'Unbounded', sans-serif);
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--white, #fff);
  margin-bottom: .85rem;
}
.legal__toc-list {
  list-style: decimal inside;
  padding-left: 0;
  margin: 0;
  columns: 1;
}
@media (min-width: 640px) {
  .legal__toc-list { columns: 2; column-gap: 2rem; }
}
@media (min-width: 880px) {
  .legal__toc-list { columns: 2; column-gap: 3rem; }
}
.legal__toc-list li {
  margin-bottom: .45rem;
  font-size: .9rem;
  padding-left: 0;
}
.legal__toc-list li::before { display: none; }
.legal__toc-list a {
  font-weight: 600;
}

/* Encadré d'information (avertissement juridique) */
.legal__notice {
  margin-top: 4rem;
  padding: 1.5rem 1.75rem;
  background: rgba(255, 94, 31, .08);
  border: 1px solid rgba(255, 94, 31, .25);
  border-radius: 6px;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--white, #fff);
}
.legal__notice strong {
  color: var(--accent, #ff5e1f);
  font-family: var(--font-b, 'Rajdhani', sans-serif);
  font-weight: 700;
}

/* Mise en valeur des [A_REMPLIR] (pour les repérer lors du remplissage) */
.legal__article strong,
.legal p strong {
  color: var(--white, #fff);
  font-weight: 700;
}

/* Bandeau informationnel : rendre les placeholders [A_REMPLIR] TRÈS visibles */
.legal__list li strong + * ,
.legal p strong + * {
  /* pour les cas "libellé : valeur" */
}

/* Ciblage précis : la chaîne littérale [A_REMPLIR — ...] doit ressortir.  *
 * Ce n'est pas une vraie classe — on scanne le texte à l'exécution via JS,
 * mais ici on prépare un fallback CSS au cas où (color invert)
 * → trop coûteux en CSS, on laisse au JS le soin de baliser ces zones.
 */
.legal__placeholder {
  display: inline-block;
  background: rgba(255, 94, 31, .18);
  border: 1px dashed var(--accent, #ff5e1f);
  padding: .1rem .45rem;
  border-radius: 3px;
  font-weight: 700;
  color: var(--accent, #ff5e1f);
  white-space: nowrap;
  cursor: help;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .legal { padding-block: 3rem 5rem; }
  .legal__article { font-size: .95rem; }
  .legal__h2 { margin-top: 2.75rem; padding-top: 1rem; }
  .legal__table th, .legal__table td { padding: .65rem .75rem; font-size: .82rem; }
  .legal__notice { padding: 1.1rem 1.25rem; font-size: .85rem; }
}

/* Très petits écrans */
@media (max-width: 360px) {
  .legal__article { font-size: .88rem; line-height: 1.7; }
  .legal__toc { padding: 1rem 1.1rem; }
  .legal__table-wrap { margin-inline: -.5rem; }
}

/* Respect du safe-area iPhone X+ sur mobile */
.legal { padding-bottom: max(6rem, env(safe-area-inset-bottom)); }
.legal__notice { margin-bottom: max(1rem, env(safe-area-inset-bottom)); }

/* Focus accessibilité */
.legal a:focus-visible {
  outline: 2px solid var(--accent, #ff5e1f);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
 * CHAMPS À COMPLÉTER IMPÉRATIVEMENT — signal fort pour l'éditeur
 * Encadré orange pétant + bordure pointillée, impossible à manquer
 * pendant la relecture finale avant mise en production.
 * ============================================================ */
.legal__todo {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 2px;
  background: rgba(255, 94, 31, .15);
  border: 1px dashed rgba(255, 94, 31, .65);
  border-radius: 4px;
  color: #c44a14;
  font-size: .85em;
  font-weight: 600;
  font-style: normal;
  white-space: nowrap;
  cursor: help;
}
[data-theme="light"] .legal__todo {
  background: rgba(255, 94, 31, .12);
  border-color: rgba(255, 94, 31, .55);
  color: #b8420f;
}
[data-theme="dark"] .legal__todo {
  background: rgba(255, 138, 51, .18);
  border-color: rgba(255, 138, 51, .55);
  color: #ff9f5a;
}

/* HYPOTHÈSES PLAUSIBLES — info complémentaire à vérifier
 * (par ex. hébergeur proposé par défaut, DPO non désigné, micro-entreprise).
 * Italique discret, ne saute pas aux yeux comme un .legal__todo.
 */
.legal__hint {
  font-style: italic;
  opacity: .8;
  font-size: .94em;
}
[data-theme="light"] .legal__hint { color: #4a4a4a; }
[data-theme="dark"]  .legal__hint { color: #c4c4c4; }
