/* Vidéos d'aide — BVM Location. Police système, couleurs sobres, aucune dépendance. */

:root {
  --fond: #f5f4f0;
  --surface: #ffffff;
  --texte: #1f2937;
  --texte-secondaire: #4b5563;
  --bordure: #d6d3cd;
  --accent: #2563eb;
  --accent-fonce: #1d4ed8;
  --accent-clair: #e8effd;
  --surlignage: #fde68a;
  --rayon: 8px;
  --largeur-sommaire: 320px;
  --hauteur-entete: 56px;
}

* {
  box-sizing: border-box;
}

html {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent-fonce);
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
}

h1:focus {
  outline: none;
}

mark {
  background: var(--surlignage);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

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

.entete {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--hauteur-entete);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--bordure);
}

.marque {
  font-weight: 600;
  color: var(--texte);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marque:hover {
  color: var(--accent);
}

.bouton-sommaire {
  display: none;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-clair);
  border: 1px solid transparent;
  border-radius: var(--rayon);
  padding: 6px 14px;
  cursor: pointer;
}

/* ---------- Coque : sommaire + contenu ---------- */

.coque {
  display: grid;
  grid-template-columns: var(--largeur-sommaire) minmax(0, 1fr);
  min-height: calc(100vh - var(--hauteur-entete));
}

body:not(.mode-video) .coque {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.mode-video) .sommaire {
  display: none;
}

.sommaire {
  position: sticky;
  top: var(--hauteur-entete);
  align-self: start;
  min-height: calc(100vh - var(--hauteur-entete));
  max-height: calc(100vh - var(--hauteur-entete));
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
  border-right: 1px solid var(--bordure);
}

.contenu {
  width: 100%;
  max-width: 1040px;
  padding: 24px 32px 48px;
  margin: 0 auto;
}

/* ---------- Recherche ---------- */

.recherche label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.recherche input {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
}

.recherche-resultat {
  margin: 6px 0 0;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: var(--texte-secondaire);
}

/* ---------- Sommaire : guides repliables et tâches ---------- */

.sommaire-guides {
  margin-top: 12px;
}

.sommaire details + details {
  margin-top: 6px;
}

.sommaire summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 600;
  border-radius: var(--rayon);
  cursor: pointer;
  list-style: none;
}

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

.sommaire summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left: 7px solid var(--texte-secondaire);
  border-right: 0;
  transition: transform 0.15s;
}

.sommaire details[open] > summary::before {
  transform: rotate(90deg);
}

.sommaire summary:hover {
  background: var(--fond);
}

.guide-titre {
  flex: 1;
}

.guide-compte {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--texte-secondaire);
  background: var(--fond);
  border-radius: 999px;
  padding: 1px 8px;
}

.taches {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0 0 0 10px;
}

.taches li + li {
  margin-top: 2px;
}

.taches a {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.9375rem;
  color: var(--texte);
  text-decoration: none;
  border-radius: var(--rayon);
}

.taches a:hover {
  background: var(--fond);
  color: var(--accent-fonce);
}

.taches a[aria-current="page"] {
  background: var(--accent-clair);
  color: var(--accent-fonce);
  font-weight: 600;
}

.taches .numero {
  flex: none;
  min-width: 1.6em;
  color: var(--texte-secondaire);
  font-variant-numeric: tabular-nums;
}

.taches a[aria-current="page"] .numero {
  color: inherit;
}

.extrait {
  margin: 0 0 4px 10px;
  padding: 0 10px 0 calc(1.6em + 6px);
  font-size: 0.8125rem;
  color: var(--texte-secondaire);
}

.aucun,
.vide,
.chargement {
  color: var(--texte-secondaire);
}

/* ---------- Accueil ---------- */

.message {
  padding: 12px 16px;
  margin: 0 0 20px;
  background: var(--accent-clair);
  border-left: 4px solid var(--accent);
  border-radius: var(--rayon);
}

.contenu h1 {
  font-size: 1.75rem;
}

.intro {
  max-width: 64ch;
  margin: 12px 0 28px;
  color: var(--texte-secondaire);
}

.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.carte {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  color: var(--texte);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
}

.carte:hover {
  border-color: var(--accent);
  color: var(--texte);
}

.carte h2 {
  font-size: 1.125rem;
  color: var(--accent);
}

.carte-public {
  flex: 1;
  margin: 0;
  color: var(--texte-secondaire);
}

.carte-compte {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--texte-secondaire);
}

/* ---------- Page vidéo ---------- */

.fil-ariane {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  color: var(--texte-secondaire);
}

.fil-ariane .separateur {
  color: var(--bordure);
}

.meta {
  margin: 6px 0 16px;
  font-size: 0.875rem;
  color: var(--texte-secondaire);
}

.cadre-lecteur {
  position: relative;
  border-radius: var(--rayon);
  overflow: hidden;
}

.lecteur {
  display: block;
  width: 100%;
  /* Les vidéos sont enregistrées en 1440 × 900 (16:10) : un cadre 16:9 laisse
     deux bandes noires sur les côtés. */
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: var(--rayon);
}

.fin-de-video {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  color: #fff;
  background: rgba(17, 24, 39, 0.8);
}

.fin-de-video[hidden] {
  display: none;
}

.fin-de-video p {
  margin: 0;
}

.bouton-principal {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--rayon);
  padding: 10px 20px;
  cursor: pointer;
}

.bouton-principal:hover {
  background: var(--accent-fonce);
}

.bloc {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
}

.bloc h2 {
  font-size: 1.125rem;
  margin-bottom: 12px;
}

.etapes {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: etape;
}

.etape {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--rayon);
  counter-increment: etape;
}

.etape + .etape {
  margin-top: 2px;
}

.etape::before {
  content: counter(etape);
  min-width: 1.5em;
  color: var(--texte-secondaire);
  font-variant-numeric: tabular-nums;
}

.etape.en-cours {
  background: var(--accent-clair);
}

.etape.en-cours .etape-texte {
  font-weight: 600;
}

.horodatage {
  font: inherit;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 6px;
  padding: 1px 8px;
  cursor: pointer;
}

.horodatage:hover {
  border-color: var(--accent);
  background: var(--accent-clair);
}

.navigation-videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.nav-precedente,
.nav-suivante {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  color: var(--texte);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
}

.nav-suivante {
  text-align: right;
}

.nav-precedente:hover,
.nav-suivante:hover {
  border-color: var(--accent);
  color: var(--texte);
}

.nav-libelle {
  font-weight: 600;
  color: var(--accent);
}

.nav-titre {
  font-size: 0.875rem;
  color: var(--texte-secondaire);
}

/* ---------- Téléphone et petits écrans ---------- */

@media (max-width: 900px) {
  .coque {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mode-video .bouton-sommaire {
    display: inline-block;
  }

  /* Panneau plein écran sous l'en-tête. `align-self: auto` : avec `start`, un
     élément positionné est réduit à son contenu au lieu de remplir top/bottom. */
  .sommaire {
    display: none;
    position: fixed;
    top: var(--hauteur-entete);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    align-self: auto;
    min-height: 0;
    max-height: none;
    border-right: 0;
  }

  body.mode-video.sommaire-ouvert .sommaire {
    display: block;
  }

  .contenu {
    padding: 16px 16px 32px;
  }

  .contenu h1 {
    font-size: 1.375rem;
  }

  .bloc {
    padding: 16px;
  }

  .navigation-videos {
    grid-template-columns: 1fr;
  }

  .nav-suivante {
    text-align: left;
  }
}
