/*
 * Politique de confidentialité (tâche D10 du dossier Play) : identité « Fanous » de Himaya (ADR 0011), mêmes jetons que la
 * page du garant (web/sanad/sanad.css, repris de ui/design/tokens.json 1.0.0). Aucun visuel ajouté : couleurs, polices et
 * halo des jetons. Contrastes (ui/.../HimayaColors.kt) : texte 14,6:1 (sombre) et 13,7:1 (clair) ; texte secondaire et
 * liens ≥ 4,5:1 ; en thème clair, l'ambre (2,1:1) ne sert jamais de texte. Aucune ressource externe (polices locales).
 */

@font-face {
  font-family: "Reem Kufi";
  src: url("polices/reem-kufi.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Geologica";
  src: url("polices/geologica.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  /* thème sombre (jetons « dark ») */
  --fond: #1A1511;
  --surface: #26201A;
  --surface-variante: #332A22;
  --contour: #3A3028;
  --texte: #F0E6D2;
  --texte-second: #CBBFA8;
  --ambre: #F0B445;
  --sur-ambre: #1A1511;
  --ambre-texte: #F0B445;
  --laiton: #B78D47;
  --laiton-texte: #B78D47;   /* 6,0:1 sur le fond */
  --halo: 240, 180, 69;
  --focus: #F0B445;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --fond: #F5EFE3;
    --surface: #FBF7EF;
    --surface-variante: #EFE6D6;
    --contour: #E3D9C6;
    --texte: #2A2219;
    --texte-second: #5E5343;
    --ambre: #D99A2B;
    --sur-ambre: #2A2219;
    --ambre-texte: #80612B;
    --laiton: #B78D47;
    --laiton-texte: #80612B;   /* 5,0:1 ; le laiton n'atteint que 2,7:1 en clair */
    --halo: 217, 154, 43;
    --focus: #80612B;
    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--fond);
  /* un seul halo, derrière le titre (jeton motifs.halo) */
  background-image: radial-gradient(circle 260px at 50% 60px, rgba(var(--halo), 0.20) 0%, rgba(var(--halo), 0.05) 40%, rgba(var(--halo), 0) 70%);
  background-repeat: no-repeat;
  color: var(--texte);
  font-family: "Geologica", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.evitement {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--texte);
  border: 2px solid var(--focus);
  border-radius: 0.5rem;
  z-index: 1;
}

.evitement:focus {
  top: 1rem;
}

.entete,
main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.entete {
  padding-top: 2rem;
}

.marque {
  margin: 0;
  font-family: "Reem Kufi", "Geologica", sans-serif;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  color: var(--laiton-texte);
}

main {
  padding-bottom: 4rem;
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  font-family: "Reem Kufi", "Geologica", sans-serif;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin: 0.5rem 0 1.5rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--contour);
}

h3 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.75rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.4rem;
}

strong {
  font-weight: 600;
}

a {
  color: var(--ambre-texte);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

code {
  font-family: ui-monospace, "DejaVu Sans Mono", monospace;
  font-size: 0.875em;
  background: var(--surface-variante);
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
  overflow-wrap: anywhere;
}

mark.a-remplir {
  background: var(--ambre);
  color: var(--sur-ambre);
  padding: 0 0.2em;
  border-radius: 0.2rem;
}

.brouillon {
  padding: 0.75rem 1rem;
  border: 2px solid var(--laiton);
  border-radius: 0.75rem;
  background: var(--surface);
}

.sommaire {
  background: var(--surface);
  border: 1px solid var(--contour);
  border-radius: 1rem;
  padding: 0.5rem 1.25rem 0.75rem;
  margin: 2rem 0;
}

.sommaire h2 {
  border-top: 0;
  margin: 0.5rem 0;
  padding-top: 0;
  font-size: 1.2rem;
}

.sommaire ol {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--contour);
  margin: 2rem 0;
}

blockquote {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--laiton);
  color: var(--texte-second);
}

/* Tableaux : grille sur grand écran ; sur petit écran, chaque ligne devient une carte, avec le titre de colonne devant
   chaque cellule. Les rôles ARIA posés dans le HTML gardent la sémantique de tableau malgré le changement d'affichage. */
.tableau {
  margin: 0 0 1.5rem;
  border-radius: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--contour);
}

thead th {
  background: var(--surface-variante);
}

tbody th {
  background: var(--surface);
  font-weight: 600;
}

@media (max-width: 40rem) {
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  table,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  tr {
    margin: 0 0 1rem;
    border: 1px solid var(--contour);
    border-radius: 0.75rem;
    background: var(--surface);
    overflow: hidden;
  }

  th,
  td {
    border: 0;
  }

  tbody th {
    background: var(--surface-variante);
  }

  td::before {
    content: attr(data-colonne);
    display: block;
    font-weight: 600;
    color: var(--texte-second);
    font-size: 0.85rem;
  }
}

@media print {
  body {
    background: none;
  }

  .evitement,
  .sommaire {
    display: none;
  }
}
