/* Vision High-Tech — feuille de style accessible
   Contrastes ≥ 7:1 (WCAG AAA), tailles en rem, aucune animation. */

:root {
  /* Palette inspirée du logo : bleu nuit, bleu électrique, violet néon */
  --fond: #ffffff;
  --texte: #14142b;
  --lien: #2a1b9c;          /* violet profond : 11:1 sur blanc */
  --lien-visite: #5b1478;
  --bande: #070b2a;         /* bleu nuit du logo */
  --bande-2: #1c0f52;       /* violet nuit */
  --bande-texte: #ffffff;
  --bande-lien: #ffffff;
  --carte: #f3f1ff;
  --bord: #4b3fa0;
  --focus: #000000;
  --halo: #ffdd00;          /* jaune : focus visible sur tous les fonds */
  --neon: linear-gradient(90deg, #2f7bff, #8a3dff, #c13dff);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0a0c22;
    --texte: #f1f0ff;
    --lien: #b9c8ff;
    --lien-visite: #e2c4ff;
    --bande: #04061a;
    --bande-2: #150a3d;
    --bande-texte: #ffffff;
    --bande-lien: #ffffff;
    --carte: #15183a;
    --bord: #9d93ff;
    --focus: #ffffff;
    --halo: #000000;
  }
}

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

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

.largeur {
  max-width: 75rem;             /* 1200 px ; les paragraphes restent limités à 70 caractères par ligne */
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Liens d'évitement : visibles dès qu'ils reçoivent le focus */
.evitement {
  list-style: none;
  margin: 0;
  padding: 0;
}
.evitement li { margin: 0; }
.evitement a {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--halo);
  color: #000000;
  font-weight: 700;
}
.evitement a:focus { top: 1rem; }

a {
  color: var(--lien);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:visited { color: var(--lien-visite); }
a:hover { text-decoration-thickness: 0.18em; }

/* Focus très visible : double anneau lisible sur fond clair et foncé */
a:focus-visible,
main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--halo);
}
main:focus { outline: none; }

/* En-tête */
.entete {
  position: relative;
  background: linear-gradient(135deg, var(--bande) 0%, var(--bande-2) 100%);
  background-color: var(--bande);
  color: var(--bande-texte);
  padding: 0 0 0.75rem;
}
/* Bannière de la chaîne, pleine largeur en haut de chaque page */
.banniere {
  background: #050a26;          /* bleu nuit des bords de la bannière */
  border-bottom: 1px solid #2a2470;
  margin: 0 0 1rem;
}
.banniere img {
  display: block;
  width: 100%;
  max-width: 100rem;            /* 1600 px : jamais agrandie au-delà de sa taille réelle */
  height: auto;
  margin: 0 auto;
}
/* Sur téléphone : bannière recadrée sur son centre pour garder le titre lisible */
@media (max-width: 40rem) {
  .banniere img {
    height: 6.5rem;
    object-fit: cover;
    object-position: center;
  }
}

/* Liseré néon décoratif, comme la bannière de la chaîne */
.entete::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 5px;
  background: var(--neon);
}
.entete a,
.entete a:visited { color: var(--bande-lien); }
.entete a:focus-visible {
  outline-color: #ffffff;
  box-shadow: 0 0 0 6px #000000;
}

.marque {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}
.marque {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.marque a {
  text-decoration: none;
  display: inline-block;
  padding: 0.25rem 0;
}
.marque img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  box-shadow: 0 0 0.9rem rgba(122, 92, 255, 0.75);
}
.marque a:hover { text-decoration: underline; }
.slogan {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;   /* 44 px : cible tactile confortable */
  padding: 0.25rem 0.6rem;
}
nav a[aria-current="page"] {
  font-weight: 800;
  text-decoration-thickness: 0.2em;
}

/* Contenu */
main { padding: 1.5rem 1.25rem 3rem; }

h1, h2, h3 { line-height: 1.25; margin: 2rem 0 0.75rem; }
h1 { font-size: 2.1rem; margin-top: 0.5rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.25rem; }

p, ul, ol, dl { margin: 0 0 1rem; max-width: 70ch; }
li { margin-bottom: 0.4rem; }

.chapo { font-size: 1.25rem; }

.cartes {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  max-width: none;
}
.cartes li {
  background: var(--carte);
  border: 2px solid var(--bord);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 0;
}
.cartes h3 { margin-top: 0; }
.cartes p { margin: 0; }

.fiche {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}
.fiche dt { font-weight: 700; }
.fiche dd { margin: 0; }
@media (max-width: 30rem) {
  .fiche { grid-template-columns: 1fr; }
  .fiche dd { margin-bottom: 0.5rem; }
}

section { border-top: 2px solid var(--bord); margin-top: 2rem; }

abbr[title] { text-decoration: none; }

/* Vidéos de Donna (format vertical) */
article.video { margin: 2rem 0; }
article.video video {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  aspect-ratio: 9 / 16;
  background: #000000;
  border-radius: 0.6rem;
  border: 2px solid var(--bord);
  margin: 0.5rem 0;
}
article.video video:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--halo);
}
details { margin: 0.5rem 0 1rem; max-width: 70ch; }
summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--lien);
  text-decoration: underline;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}
/* Triangle visible qui indique qu'on peut déplier ; ignoré par les lecteurs d'écran
   (le navigateur annonce déjà « réduit » ou « développé ») */
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "▸";
  content: "▸" / "";
  display: inline-block;
  margin: 0 0.5rem 0 0.25rem;
  font-size: 1.1em;
  text-decoration: none;
  transition: transform 0.15s;
}
details[open] > summary::before { transform: rotate(90deg); }
.histoire { margin-top: 0; }
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--halo);
}

/* Pied de page */
.pied {
  border-top: 5px solid;
  border-image: var(--neon) 1;
  padding: 1.5rem 0 2rem;
  font-size: 1rem;
}

/* Mode contraste élevé de Windows */
@media (forced-colors: active) {
  .entete::after { background: CanvasText; }
  a:focus-visible, main:focus-visible { outline: 3px solid CanvasText; box-shadow: none; }
  .cartes li, section { border-color: CanvasText; }
}

/* Aucune animation, même involontaire */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .evitement, nav { display: none; }
  .entete { background: none; color: #000; border: 0; }
  a { color: #000; }
}

/* Lien d'évitement : toujours noir sur jaune (contraste 15:1) */
.entete .evitement a,
.entete .evitement a:visited {
  background: #ffdd00;
  color: #000000;
}
.entete .evitement a:focus-visible {
  outline: 3px solid #000000;
  box-shadow: 0 0 0 6px #ffffff;
}

/* Texte lu par les lecteurs d'écran mais non affiché */
.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Rubrique Articles ---------- */
.liste-articles { list-style: none; padding: 0; max-width: none; }
.liste-articles > li { border-top: 2px solid var(--bord); padding: 0.5rem 0 1rem; margin: 0; }
.liste-articles h2 { margin-top: 0.75rem; }
.date { font-size: 1rem; }
.article h2, .article h3 { margin-top: 2rem; }
.image-article img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 40rem;            /* une photo en hauteur ne prend pas tout l'écran */
  border-radius: 0.5rem;
  border: 2px solid var(--bord);
}
.jaime {
  border: 3px solid var(--bord);
  border-radius: 0.6rem;
  padding: 0.5rem 1.25rem 1rem;
  margin: 2.5rem 0 1.5rem;
  max-width: 40rem;
}
.jaime h2 { margin-top: 0.75rem; }
.jaime:focus { outline: none; }
.jaime:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.petit { font-size: 1rem; }

/* Boutons et champs (rubrique Articles et espace privé) */
button, .bouton-lien {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.2rem;
  margin: 0.5rem 0.75rem 0.5rem 0;
  border: 2px solid var(--texte);
  border-radius: 0.4rem;
  background: var(--bande);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}
.bouton-lien:visited { color: #ffffff; }
button.secondaire { background: var(--fond); color: var(--texte); }
button.danger { background: #8a0000; border-color: #8a0000; }
.bouton-jaime { font-size: 1.25rem; }
.bouton-jaime[aria-pressed="true"] { background: #6a1fb5; border-color: #6a1fb5; }
.bouton-jaime::before { content: "♡\00a0"; }
.bouton-jaime[aria-pressed="true"]::before { content: "♥\00a0"; }
button:focus-visible, .bouton-lien:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--halo);
}
label { display: block; font-weight: 700; margin: 1.25rem 0 0.25rem; }
label.en-ligne { display: inline; margin: 0 0 0 0.5rem; font-weight: 400; }
input[type="text"], input[type="password"], input[type="file"], textarea {
  font: inherit;
  width: 100%;
  max-width: 44rem;
  padding: 0.6rem;
  border: 2px solid var(--texte);
  border-radius: 0.3rem;
  background: var(--fond);
  color: var(--texte);
}
input[type="checkbox"] { width: 1.5rem; height: 1.5rem; vertical-align: middle; }
textarea { line-height: 1.5; }
fieldset { border: 2px solid var(--bord); border-radius: 0.5rem; margin: 2rem 0; padding: 0.5rem 1.25rem 1rem; }
legend { font-weight: 700; font-size: 1.25rem; padding: 0 0.5rem; }
.aide { font-size: 1rem; margin-top: 0.25rem; }
.erreur { font-weight: 700; color: #a00000; margin: 0.25rem 0 0; }
.erreurs { border: 3px solid #a00000; border-radius: 0.5rem; padding: 0 1rem; margin: 1rem 0; }
.message { border: 3px solid var(--bord); padding: 0.75rem 1rem; border-radius: 0.4rem; }
.image-admin { border-top: 1px solid var(--bord); margin-top: 1rem; }
.image-admin img { display: block; margin: 0.5rem 0; border-radius: 0.3rem; height: auto; }
.suppression { margin-top: 3rem; }
code { font-size: 1rem; background: var(--carte); padding: 0.1rem 0.3rem; border-radius: 0.2rem; }
table { border-collapse: collapse; margin: 0 0 2rem; width: 100%; }
caption { text-align: left; font-weight: 700; font-size: 1.15rem; padding: 0.5rem 0; }
th, td { border: 2px solid var(--bord); padding: 0.5rem 0.75rem; text-align: left; }
thead th { background: var(--carte); }
@media (prefers-color-scheme: dark) {
  .erreur { color: #ffb4b4; }
  .erreurs { border-color: #ffb4b4; }
  button.danger { background: #b00020; border-color: #ffb4b4; }
}

/* Photo de couverture : affichée au-dessus du titre, lue après lui */
.article { display: flex; flex-direction: column; }
.article > * { max-width: 70ch; }
.article > .couverture { order: -1; max-width: 60rem; margin: 1rem 0; }
.couverture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 32rem;
  object-fit: contain;          /* photo entière, jamais recadrée */
  background: #050a26;
  border-radius: 0.6rem;
  border: 2px solid var(--bord);
}
.article > h1 { margin-top: 0.5rem; }

/* Images des articles et leur description détaillée dépliable */
figure.image-article, figure.couverture { margin: 1.5rem 0; }
figure.couverture { margin: 1rem 0; }
.description-longue { margin: 0.5rem 0 0; padding: 0 0 0 1rem; border-left: 4px solid var(--bord); }
.description-longue[open] { padding-bottom: 0.25rem; }
.description-longue p { margin: 0.5rem 0; }

/* Partage d'un article */
.partage { margin: 1.5rem 0; max-width: 40rem; }
.liens-partage { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0; list-style: none; }
.liens-partage a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Carrousel des dernières vidéos YouTube (accueil).
   Petit écran ou zoom fort : simple liste verticale. Écran large : bande qui défile
   avec les boutons, jamais toute seule. */
.carrousel { margin: 2rem 0; }
.carrousel-commandes { display: flex; flex-wrap: wrap; }
.carrousel-commandes[hidden] { display: none; }
.carrousel-precedent::before { content: "‹"; content: "‹" / ""; margin-right: 0.5rem; font-size: 1.4em; line-height: 1; }
.carrousel-suivant::after { content: "›"; content: "›" / ""; margin-left: 0.5rem; font-size: 1.4em; line-height: 1; }
.carrousel button[aria-disabled="true"] { opacity: 0.6; border-style: dashed; cursor: default; }
.liste-videos {
  list-style: none;
  padding: 0.5rem 0.25rem;
  margin: 0 0 1rem;
  max-width: none;
  display: grid;
  gap: 1rem;
}
.liste-videos > li {
  background: var(--carte);
  border: 2px solid var(--bord);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0;
}
.liste-videos a { display: block; font-weight: 700; }
.liste-videos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.35rem;
  margin-bottom: 0.5rem;
}
.liste-videos .date { margin: 0.4rem 0 0; font-size: 1rem; }
@media (min-width: 40em) {
  .liste-videos {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    position: relative;   /* garde les textes cachés « sur YouTube » à l'intérieur de la bande */
    scroll-padding-inline: 0.5rem;
    padding: 0.75rem 0.5rem 1rem;
  }
  .liste-videos > li { flex: 0 0 calc((100% - 1rem) / 2); scroll-snap-align: start; }
}
@media (min-width: 60em) {
  .liste-videos > li { flex-basis: calc((100% - 2rem) / 3); }
}
@media (prefers-reduced-motion: no-preference) {
  .liste-videos { scroll-behavior: smooth; }
}

/* Grands écrans : on profite de la largeur, sans jamais allonger les lignes de texte.
   L'ordre de lecture reste celui du code : de gauche à droite, puis ligne suivante. */
/* En-tête : logo et slogan à gauche, menu à droite, seulement quand le menu tient sur une ligne */
@media (min-width: 72rem) {
  .entete .largeur {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 2rem;
    align-items: center;
  }
  .entete .marque { grid-column: 1; grid-row: 1; }
  .entete .slogan { grid-column: 1; grid-row: 2; }
  .entete nav { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
  .entete nav ul { justify-content: flex-end; }
}
@media (min-width: 60rem) {

  /* Vidéos de Donna et fiches des applications en colonnes */
  .grille-videos, .grille-fiches {
    display: grid;
    gap: 1.5rem;
    align-items: start;
  }
  .grille-fiches { align-items: stretch; }
  .grille-videos { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); }
  .grille-fiches { grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr)); }
  .grille-videos > article.video { margin: 0; }
  .grille-fiches > section {
    margin: 0;
    border: 2px solid var(--bord);
    border-radius: 0.5rem;
    background: var(--carte);
    padding: 0 1.25rem 0.5rem;
  }
  .grille-fiches > section h2 { margin-top: 1rem; }
}
@media (min-width: 75rem) {
  .liste-videos > li { flex-basis: calc((100% - 3rem) / 4); }
}

/* Accueil avec peu de vidéos (3 par défaut) : simple rangée, sans défilement */
.liste-videos.grille-videos-recentes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  overflow: visible;
}

/* Bouton de don : seul le logo officiel PayPal est visible, sur fond blanc (lisible en clair
   comme en sombre). Le lecteur d'écran n'entend qu'un seul élément : le lien « Faire un don avec PayPal »
   (texte caché à l'écran) ; le logo lui-même est décoratif. */
.bouton-paypal {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  margin: 0.5rem 0;
  background: #ffffff;
  border: 2px solid var(--texte);
  border-radius: 0.4rem;
}
.bouton-paypal img { display: block; width: 150px; height: auto; }
/* Survol : seulement sur les appareils à souris, et sans changer la taille du bouton
   (sinon, sur iPhone, le premier toucher ne ferait qu'afficher le survol). */
@media (hover: hover) {
  .bouton-paypal:hover { box-shadow: 0 0 0 2px var(--texte); }
}

/* « Vision High-Tech » en braille 6 points (accueil + signature du pied de page).
   Points en relief : couleur des liens ; positions vides : petits points pâles.
   L'animation (points qui apparaissent un à un) est jouée une seule fois, en 4 secondes ;
   la règle « prefers-reduced-motion » plus haut la supprime : tout s'affiche alors d'un coup. */
.braille { display: block; height: auto; max-width: 100%; }
.braille .vides circle { fill: var(--bord); opacity: 0.5; }
.braille .relief {
  fill: var(--lien);
  transform-box: fill-box;
  transform-origin: center;
  animation: point-braille 0.35s ease-out backwards;
}
@keyframes point-braille {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 1; transform: scale(1); }
}
.braille-titre { width: min(100%, 36rem); margin: 0.25rem 0 1.75rem; }
.braille-signature { width: 15rem; }
.braille-signature .relief { animation: none; }
.pied-haut {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 2rem;
}
@media (forced-colors: active) {
  .braille .relief { fill: CanvasText; }
  .braille .vides circle { fill: GrayText; }
}
