/* =========================================================
   dynamic.css — effets partagés par toutes les pages
   (menu fixe, apparition au scroll, progression, retour en haut)
   ========================================================= */
:root { --navy:#262262; }

/* Fondu d'entrée de page */
@keyframes pageIn { from { opacity:0 } to { opacity:1 } }
body { animation: pageIn .5s ease both; }

/* Menu collant */
.mainnav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow .25s ease, background-color .25s ease;
}
.mainnav.is-stuck {
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
}

/* Soulignement animé des liens du menu */
.menu a { position: relative; transition: color .2s ease, background-color .2s ease, transform .2s ease; }
.menu a:not(.active)::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--blue, #26a6d4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.menu a:not(.active):hover::after,
.menu a:not(.active):focus-visible::after { transform: scaleX(1); }
.menu a:hover { transform: translateY(-1px); }

/* Focus clavier visible */
a:focus-visible, button:focus-visible {
  outline: 3px solid #ef6a6a;
  outline-offset: 3px;
}

/* Barre de progression de lecture */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #26a6d4, #ef6a6a);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 100;
  pointer-events: none;
}

/* Bouton retour en haut */
.to-top {
  position: fixed;
  right: 18px; bottom: 18px;
  width: 46px; height: 46px;
  border: 0; border-radius: 50%;
  background: #26a6d4;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background-color .2s ease;
  z-index: 60;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #1e9ac7; }

/* Apparition au défilement (seulement si JS actif) */
@media (scripting: enabled) {
  .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .reveal.in { opacity: 1; transform: none; }
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   Extras par page
   ========================================================= */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* Entrées latérales (Historique) */
@media (scripting: enabled) {
  .reveal-left  { transform: translateX(-44px); }
  .reveal-right { transform: translateX(44px); }
  .reveal-left.in, .reveal-right.in { transform: none; }
}

/* Lien de retour */
.back-link {
  display: inline-block;
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--blue-strong, #1e9ac7);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* Boutons : survol + pulsation douce */
.cta-red, .btn-primary { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.cta-red:hover, .btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.18); }
@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,106,106,.45); }
  50%      { box-shadow: 0 0 0 14px rgba(239,106,106,0); }
}
.btn-primary { animation: pulseSoft 2.4s ease-in-out infinite; }

/* Blocs de contenu : léger relief au survol */
.block, .ins-box, .card {
  transition: transform .25s ease, box-shadow .25s ease;
}
.block:hover, .ins-box:hover, .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,.10);
}

/* Photos de l'historique */
.photo { overflow: hidden; }
.photo img { transition: transform .6s ease; }
.photo:hover img { transform: scale(1.05); }

/* Contact : liens plus vivants */
.contact-list a { transition: color .2s ease, padding-left .2s ease; }
.contact-list a:hover { padding-left: 4px; color: #ef6a6a; }

/* Documents : accordéons */
.acc { transition: box-shadow .25s ease, transform .25s ease; }
.acc:hover { box-shadow: 0 10px 24px rgba(0,0,0,.08); }
@keyframes panelIn { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform:none; } }
.acc[open] .panel { animation: panelIn .35s ease both; }
.doclist br { display: none; }
.doclist li { margin-bottom: 1em; }
.doclist a { transition: color .2s ease, padding-left .2s ease; }
.doclist a:hover { padding-left: 4px; }

/* Recherche de documents */
.doc-search { margin: 0 0 22px; }
.doc-search input {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  border: 2px solid var(--border, #e6e9ee);
  border-radius: 999px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.doc-search input:focus {
  outline: none;
  border-color: #26a6d4;
  box-shadow: 0 0 0 4px rgba(38,166,212,.18);
}
.doc-count { margin: 8px 6px 0; min-height: 1.4em; font-size: .92rem; color: #555; }

[hidden] { display: none !important; }
