/* ==========================================================================
   STYLE.CSS — Feuille de style unique du site
   Bâtiment & Numérique — Offre de prestation
   Toutes les feuilles (accueil, menu, entête, pied de page, fiches mission)
   sont regroupées ici pour simplifier la maintenance et le fonctionnement
   100% local (aucune requête réseau nécessaire, aucun serveur requis).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS — palette, typographie, rythme
   Thème clair par défaut (adapté à une candidature professionnelle).
   Le thème sombre reste disponible via le bouton de bascule (voir §1bis).
   -------------------------------------------------------------------------- */
:root {
  /* Fond & surfaces */
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #eef1f5;
  --surface-3:     #e3e7ee;
  --border:        #d8dde6;
  --border-soft:   #e6e9ef;

  /* Texte */
  --text:          #1b2129;
  --text-muted:    #566072;
  --text-faint:    #808a9b;

  /* Accent neutre / identité de marque (utilisé hors des 3 sections
     métier : entête, accueil, contact, pages légales) */
  --accent:        #92400e;
  --accent-strong: #6b2f0a;
  --accent-ink:    #fff8ec;
  --accent-soft:   rgba(146, 64, 14, 0.10);

  --blue:          #2563eb;

  /* Statuts */
  --danger:        #b91c1c;

  /* Couleurs des 3 grandes sections métier */
  --be:            #1d4ed8;  /* Bureau d'Études — bleu technique/plan */
  --be-strong:     #1e3a8a;
  --be-soft:       rgba(29, 78, 216, 0.08);

  --sante:         #047857;  /* Référent Santé — vert sécurité/santé */
  --sante-strong:  #065f46;
  --sante-soft:    rgba(4, 120, 87, 0.08);

  --info:          #6d28d9;  /* Référent Informatique — violet numérique/IA */
  --info-strong:   #4c1d95;
  --info-soft:     rgba(109, 40, 217, 0.08);

  /* Typo — polices système uniquement (aucun fichier à télécharger,
     aucune dépendance externe : identiques sur tous les appareils courants) */
  --font-display: "Trebuchet MS", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body:    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", Menlo, monospace;

  /* Rythme */
  --radius-s:  6px;
  --radius-m:  10px;
  --radius-l:  16px;
  --shadow-1:  0 1px 2px rgba(16, 24, 40, 0.07);
  --shadow-2:  0 14px 30px rgba(16, 24, 40, 0.14);

  --sidebar-w: 260px;
  --content-max: 1180px;
}

/* --------------------------------------------------------------------------
   1bis. THÈME SOMBRE (bascule manuelle — voir bouton dans le menu)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg:            #0d1016;
  --surface:       #151920;
  --surface-2:     #1b202a;
  --surface-3:     #222834;
  --border:        #2a3140;
  --border-soft:   #1f2530;

  --text:          #eef0f4;
  --text-muted:    #9aa3b4;
  --text-faint:    #6b7484;

  --accent:        #cbb677;
  --accent-strong: #e4d29a;
  --accent-ink:    #171405;
  --accent-soft:   rgba(203, 182, 119, 0.12);

  --blue:          #6fa3c2;
  --danger:        #c47c6b;

  --be:            #60a5fa;
  --be-strong:     #93c5fd;
  --be-soft:       rgba(96, 165, 250, 0.14);

  --sante:         #34d399;
  --sante-strong:  #6ee7b7;
  --sante-soft:    rgba(52, 211, 153, 0.14);

  --info:          #a78bfa;
  --info-strong:   #c4b5fd;
  --info-soft:     rgba(167, 139, 250, 0.14);

  --shadow-1:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-2:  0 12px 30px rgba(0,0,0,0.45);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   1ter. TEINTES PAR SECTION MÉTIER
   Ces classes redéfinissent localement --accent / --accent-strong / --accent-soft.
   Portée sur <body> pour une fiche mission entière (theme-be/sante/info),
   ou sur une <section> de la page d'accueil (section-be/sante/info) pour
   teinter uniquement ce bloc sans affecter le reste de la page.
   -------------------------------------------------------------------------- */
.theme-be, .section-be {
  --accent: var(--be); --accent-strong: var(--be-strong); --accent-soft: var(--be-soft);
}
.theme-sante, .section-sante {
  --accent: var(--sante); --accent-strong: var(--sante-strong); --accent-soft: var(--sante-soft);
}
.theme-info, .section-info {
  --accent: var(--info); --accent-strong: var(--info-strong); --accent-soft: var(--info-soft);
}

/* Petit repère de couleur devant le titre de chaque section teintée */
.section-tinted > h3::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.55rem;
  vertical-align: middle;
}
.section-tinted > h3 { color: var(--accent-strong); }
.section-tinted > h3::after { background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 100%); }

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 90% -10%, rgba(29,78,216,0.045), transparent 60%),
    radial-gradient(900px 400px at -10% 20%, rgba(146,64,14,0.035), transparent 60%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(1200px 500px at 90% -10%, rgba(111,163,194,0.06), transparent 60%),
    radial-gradient(900px 400px at -10% 20%, rgba(203,182,119,0.05), transparent 60%);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

/* Étiquette "planche" façon repère de plan technique — utilisée avec parcimonie */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   3. STRUCTURE GÉNÉRALE
   -------------------------------------------------------------------------- */
.main-container {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  max-width: var(--content-max);
}

/* --------------------------------------------------------------------------
   4. MENU LATÉRAL (sidebar-menu)
   -------------------------------------------------------------------------- */
.sidebar-menu {
  width: var(--sidebar-w);
  background: var(--surface);
  height: 100vh;
  padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--border-soft);
  position: fixed;
  top: 0; left: 0;
  overflow-y: auto;
  z-index: 950;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
  /* sidebar-brand est désormais un lien vers l'accueil : on annule les
     styles de lien par défaut pour conserver exactement le même rendu */
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-s);
  transition: background 0.15s ease;
}
.sidebar-brand:hover { background: var(--surface-2); }

.sidebar-brand .mark {
  width: 34px; height: 34px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--text);
}

.sidebar-brand .name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

.sidebar-menu ul { list-style: none; padding: 0; margin: 0; }

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-s);
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu a:hover {
  background: var(--surface-2);
  color: var(--accent-strong);
}

.sidebar-menu a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 2px 0 0 var(--accent);
}

.menu-section {
  margin-top: 1.35rem;
  margin-bottom: 0.35rem;
  padding: 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.sidebar-menu ul li:first-child .menu-section { margin-top: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
}

.theme-toggle {
  margin-top: 0.85rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }

/* Bouton menu mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: 0.9rem; left: 0.9rem;
  z-index: 1000;
  width: 42px; height: 42px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  content: "";
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.2s ease;
}
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 940;
}

/* --------------------------------------------------------------------------
   5. ENTÊTE (bandeau profil)
   -------------------------------------------------------------------------- */
.main-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-soft);
  /* Défile désormais avec la page (n'occupe plus l'écran en permanence) */
  position: relative;
}

.header-photo {
  /* La photo est désormais le déclencheur de la vidéo de présentation */
  position: relative;
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-m);
}

.header-photo img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  transition: filter 0.2s ease;
}

.header-photo:hover img,
.header-photo:focus-visible img { filter: brightness(0.85); }

/* Badge "voir la vidéo" — volontairement décalé en bas à droite plutôt
   qu'au centre de la photo, mais explicite */
.header-photo-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 18, 24, 0.78);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s ease;
}
.header-photo-badge .play-icon { font-size: 0.6rem; }
.header-photo:hover .header-photo-badge,
.header-photo:focus-visible .header-photo-badge {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.header-content .eyebrow { margin-bottom: 0.4rem; display: inline-block; }

.header-content h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  text-transform: uppercase;
}

.header-content h2 {
  margin: 0.35rem 0 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--accent-strong);
}

.header-text {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-m);
  color: var(--text-muted);
  max-width: 62ch;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.header-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.header-meta span::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 720px) {
  .main-header { grid-template-columns: 88px 1fr; padding-left: 4rem; }
  .header-photo img { height: 88px; border-radius: var(--radius-s); }
  .header-text { display: none; }
}

/* --------------------------------------------------------------------------
   6. SECTIONS & CARTES (fiches techniques)
   -------------------------------------------------------------------------- */
.section-block {
  margin: 2.75rem 0;
}
.section-block:first-of-type { margin-top: 1.5rem; }

.section-block h3 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.section-block h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

.section-block > p.mission-intro { margin-top: 0.4rem; }

.cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.35rem;
  margin-top: 1.35rem;
}

.card {
  position: relative;
  background: var(--surface);
  padding: 1.1rem;
  border-radius: var(--radius-m);
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  /* Largeur uniforme, identique que la rangée compte 2 ou 3 cartes */
  flex: 1 1 300px;
  max-width: 340px;
}

/* Cartes cliquables (menant vers une fiche mission) : affordance d'action */
.card.card--link {
  cursor: pointer;
}
.card.card--link:hover, .card.card--link:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

/* Cartes "finales" (sans lien de navigation) : ouvrent une fiche détaillée
   en superposition au clic — l'affordance d'action est donc restaurée,
   identique aux cartes-liens. */
.card.card--static {
  cursor: pointer;
  /* Hauteur unique, réduite, pour toutes les cartes d'une section :
     juste assez pour le titre + 3 lignes de description */
  height: 400px;
  overflow: hidden;
}
.card.card--static:hover, .card.card--static:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

/* repère façon "planche technique", dérivé du nom de fichier image existant */
.card::before {
  content: attr(data-ref);
  position: absolute;
  top: 0.6rem; right: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.card[data-ref]:hover::before { opacity: 1; transform: translateY(0); }

.card-image {
  border-radius: var(--radius-s);
  overflow: hidden;
  margin-bottom: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  /* Ratio réel des visuels fournis (1536 x 1024 px) : la vignette n'a plus
     besoin de recadrer/zoomer l'image, elle épouse son format d'origine. */
  aspect-ratio: 3 / 2;
  flex: none;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card--link:hover .card-image img,
.card--static:hover .card-image img { transform: scale(1.045); }

.card-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.card-body h4 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
}

/* Sur les cartes statiques, le titre est limité à 2 lignes pour préserver
   la hauteur commune, quel que soit le libellé. */
.card--static .card-body h4 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Texte tronqué avec points de suspension : suggère la suite, consultable
   dans la fiche détaillée ouverte au clic. */
.card--static .card-excerpt {
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  /* Chaque puce (séparée par <br>) reste sur sa propre ligne : si son
     texte est trop long pour la carte, il est simplement masqué plutôt
     que de revenir à la ligne et de "manger" le budget de 3 lignes. */
  white-space: nowrap;
}

.card-more {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.card--static .card-more { margin-top: auto; }
.card-more::after { content: "→"; transition: transform 0.18s ease; }
.card-more--expand::after { content: "⤢"; }
.card--link:hover .card-more::after { transform: translateX(3px); }
.card--static:hover .card-more--expand::after { transform: scale(1.15); }

/* --------------------------------------------------------------------------
   7. INTRO DE PAGE D'ACCUEIL
   -------------------------------------------------------------------------- */
.hero {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 0.5rem;
}

.hero .eyebrow { margin-bottom: 0.6rem; display: block; }

.hero h1 {
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  margin: 0 0 0.75rem;
  max-width: 38ch;
}

.hero p {
  color: var(--text-muted);
  max-width: 62ch;
  font-size: 1.02rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.hero-stats .stat {
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
}

.hero-stats .stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
}

.hero-stats .stat span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   8. HEADER DE FICHE MISSION
   -------------------------------------------------------------------------- */
.mission-header {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 2rem;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  align-items: start;
}

.mission-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--accent-strong);
}

.mission-intro {
  margin-top: 0.6rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 800px;
}

.mission-col-right {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-1);
}

.mission-points-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mission-points-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.mission-points-list li { margin-bottom: 0.4rem; }
.mission-points-list li::marker { color: var(--accent); }

.mission-nav { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-soft); }

.btn-return {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  color: var(--accent-strong);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: background 0.18s ease, color 0.18s ease;
}
.btn-return:hover { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 900px) {
  .mission-header { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   9. PIED DE PAGE
   -------------------------------------------------------------------------- */
.main-footer {
  background: var(--surface);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--border-soft);
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  max-width: var(--content-max);
}

.footer-block h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.footer-block p { color: var(--text-muted); max-width: 40ch; margin: 0; }

.footer-docs { display: flex; gap: 1rem; flex-wrap: wrap; }

.footer-doc {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  padding: 0.9rem;
  border-radius: var(--radius-m);
  width: 160px;
  text-align: center;
  border: 1px solid var(--border-soft);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.footer-doc:hover { border-color: var(--accent); transform: translateY(-2px); }

.footer-doc img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-s);
  margin-bottom: 0.6rem;
  border: 1px solid var(--border-soft);
}

.footer-doc span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.footer-bottom {
  max-width: var(--content-max);
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-legal {
  max-width: var(--content-max);
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.footer-legal a {
  color: var(--text-faint);
  text-decoration: none;
}
.footer-legal a:hover { color: var(--accent-strong); }
.footer-legal span { color: var(--border); }

/* --------------------------------------------------------------------------
   10. BOUTON RETOUR EN HAUT
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 800;
  font-size: 1.1rem;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   11. RESPONSIVE — MENU MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .menu-toggle { display: flex; }

  .sidebar-menu {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-2);
  }
  .sidebar-menu.open { transform: translateX(0); }

  .sidebar-overlay.open { display: block; }

  .main-container { margin-left: 0; }

  .main-header { padding-left: 4rem; }
}

@media (max-width: 520px) {
  .footer-content { flex-direction: column; }
  .footer-docs { width: 100%; }
  .footer-doc { flex: 1; width: auto; }
}

/* --------------------------------------------------------------------------
   12bis. FORMULAIRE DE CONTACT
   -------------------------------------------------------------------------- */
.contact-form {
  max-width: 640px;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
}

.form-field textarea { resize: vertical; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
}

.btn-submit {
  align-self: flex-start;
  font-family: var(--font-mono);
  background: var(--surface-2);
  cursor: pointer;
}
.btn-submit:hover { background: var(--accent); color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   12ter. PAGES LÉGALES
   -------------------------------------------------------------------------- */
.legal-header .mission-col-left { max-width: 70ch; }
.legal-content .section-block h3 { font-size: 1.1rem; }
.legal-content .mission-intro { max-width: 70ch; }
.legal-content .mission-intro a { color: var(--accent); }

/* --------------------------------------------------------------------------
   12quater. FICHE DÉTAILLÉE (modale ouverte depuis une carte "finale")
   -------------------------------------------------------------------------- */
.card-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card-modal-overlay[hidden] { display: none; }
.card-modal-overlay.open { opacity: 1; }

.card-modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto; /* filet de sécurité seulement : la disposition
                        ci-dessous est pensée pour ne pas en avoir besoin */
  box-shadow: var(--shadow-2);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;

  display: grid;
  /* Répartition égale : 1/2 image, 1/2 texte */
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
  padding: 1.85rem 3rem 1.85rem 1.85rem; /* marge droite dégagée pour le bouton fermer */
}
.card-modal-overlay.open .card-modal { transform: translateY(0) scale(1); }

/* Image "encadrée" plutôt que collée au bord de la fiche */
.card-modal-image {
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  /* Ratio réel des visuels (1536 x 1024 px) : l'image est vue en entier,
     en paysage, jamais recadrée en carré. */
  aspect-ratio: 3 / 2;
}
.card-modal-image img { width: 100%; height: 100%; object-fit: cover; }

.card-modal-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-modal-ref {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-modal-title { margin: 0.4rem 0 0.75rem; font-size: 1.35rem; }

/* Bandeau supérieur (à venir) : rappellera le titre de la page sur toute
   la largeur de la fiche ouverte. Prêt côté style — pas encore câblé
   (nécessite une petite touche HTML/JS, voir README). */
.card-modal-banner {
  grid-column: 1 / -1;
  padding: 0.5rem 0.9rem;
  margin: -1.85rem -3rem 1.5rem -1.85rem; /* colle aux bords de la fiche */
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

/* Phrase d'introduction (à venir lors de la réécriture des textes) :
   même style que la liste à puces, se terminera par ":" pour l'annoncer.
   Non utilisée pour le moment — prête à recevoir le texte. */
.card-modal-intro {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.card-modal-text {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  /* Suffisamment de largeur pour limiter les retours à la ligne
     intempestifs dans la liste à puces */
  white-space: normal;
}

.card-modal-actions { margin-top: 1.4rem; display: flex; justify-content: center; }

/* Écrans étroits : on repasse en disposition verticale (image en haut) */
@media (max-width: 720px) {
  .card-modal {
    grid-template-columns: 1fr;
    max-height: 92vh;
    padding: 1.5rem;
  }
  .card-modal-banner {
    margin: -1.5rem -1.5rem 1.25rem -1.5rem;
  }
}

.card-modal-close {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.card-modal-close:hover { border-color: var(--accent); color: var(--accent-strong); }

.card-modal-prev, .card-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  /* Gris intermédiaire fixe : reste bien visible aussi bien en thème
     clair qu'en thème sombre, sans dépendre des couleurs de section */
  background: #6b7280;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.1rem;
  box-shadow: var(--shadow-2);
  z-index: 2;
}
.card-modal-prev:hover, .card-modal-next:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card-modal-prev { left: -18px; }
.card-modal-next { right: -18px; }
.card-modal-prev[hidden], .card-modal-next[hidden] { display: none; }

@media (max-width: 720px) {
  .card-modal-prev { left: 0.5rem; }
  .card-modal-next { right: 0.5rem; }
}

/* --------------------------------------------------------------------------
   12quinquies. STATUT DU FORMULAIRE DE CONTACT
   -------------------------------------------------------------------------- */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.form-status {
  margin: 0;
  font-size: 0.88rem;
  min-height: 1.3em;
}
.form-status--pending { color: var(--text-muted); }
.form-status--success { color: var(--sante); font-weight: 600; }
.form-status--error   { color: var(--danger); }

/* --------------------------------------------------------------------------
   13. ACCESSIBILITÉ — réduction des animations
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Visionneuse vidéo — plein écran, avec le son (déclenchée par un clic
   utilisateur sur la photo d'entête) */
.video-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(6, 8, 12, 0.96);
  z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.video-modal.open { opacity: 1; pointer-events: auto; }
.video-modal-content {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.video-modal-content video {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 0;
}
.video-modal-close {
  position: fixed; top: 1.1rem; right: 1.3rem;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff; font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  z-index: 100001;
}
.video-modal-close:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
