/* =====================================================================
   Nature et Liberté — feuille de style du site public
   ===================================================================== */

:root {
  --vert-profond:  #24402c;
  --vert:          #3d6b45;
  --vert-clair:    #6d9b6a;
  --vert-pale:     #e6efe3;
  --mousse:        #8aa07a;
  --terre:         #8c6b46;
  --ocre:          #c08a3e;
  --creme:         #faf7f0;
  --papier:        #ffffff;
  --encre:         #23281f;
  --encre-douce:   #55604f;
  --bord:          #dcd8cc;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --rayon:   14px;
  --rayon-s: 8px;
  --ombre:   0 1px 2px rgba(35, 40, 31, .06), 0 8px 24px -12px rgba(35, 40, 31, .18);
  --ombre-h: 0 2px 4px rgba(35, 40, 31, .08), 0 18px 40px -16px rgba(35, 40, 31, .28);
  --largeur: 1140px;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--encre);
  background: var(--creme);
}

img, svg, video, audio { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--vert); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--vert-profond); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.2;
  color: var(--vert-profond);
  margin: 0 0 .6em;
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: .35em; }

.wrap { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--vert-profond); color: #fff; padding: .7em 1.2em;
}
.skip:focus { left: .5rem; top: .5rem; }

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

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

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 247, 240, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--bord);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 74px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--vert-profond); }
.brand-mark { color: var(--vert-clair); display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; }
.brand-text small { font-size: .74rem; color: var(--encre-douce); letter-spacing: .02em; }

.site-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .5rem .8rem; border-radius: 999px;
  text-decoration: none; color: var(--encre-douce);
  font-size: .95rem; font-weight: 500; white-space: nowrap;
  transition: background .18s, color .18s;
}
.site-nav a:hover { background: var(--vert-pale); color: var(--vert-profond); }
.site-nav a[aria-current="page"] { background: var(--vert-profond); color: #fff; }

/* La case du menu mobile est retirée du flux sans être retirée de l'ordre
   de tabulation : le focus reste visible sur le bouton grâce au sélecteur
   .nav-toggle:focus-visible + .nav-button ci-dessous. */
.nav-toggle {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip-path: inset(50%);
}
.nav-button { display: none; }

@media (max-width: 880px) {
  .nav-button {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 10px; cursor: pointer;
    border: 1px solid var(--bord); border-radius: var(--rayon-s); background: var(--papier);
  }
  .nav-button span { display: block; height: 2px; background: var(--vert-profond); border-radius: 2px; }
  .nav-toggle:focus-visible + .nav-button { outline: 3px solid var(--ocre); outline-offset: 2px; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--creme); border-bottom: 1px solid var(--bord);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .site-nav ul { flex-direction: column; padding: .5rem clamp(1rem, 4vw, 2rem) 1rem; gap: 0; }
  .site-nav a { padding: .8rem .4rem; border-radius: var(--rayon-s); }
  .nav-toggle:checked ~ .site-nav { max-height: 60vh; overflow: auto; }
  .header-inner { position: relative; }
}

/* --- Messages -------------------------------------------------------- */

.flashes { padding-top: 1.2rem; }
.flash {
  margin: 0 0 .6rem; padding: .85rem 1.1rem; border-radius: var(--rayon-s);
  border-left: 4px solid; font-size: .95rem;
}
.flash-success { background: #eaf5e8; border-color: var(--vert-clair); color: #2b4d2f; }
.flash-error   { background: #fceceb; border-color: #c0533e; color: #7d2b1c; }
.flash-info    { background: #eef2f7; border-color: #6d8aa8; color: #2f4459; }

/* --- Bannière -------------------------------------------------------- */

.hero { position: relative; overflow: hidden; background: var(--vert-profond); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,32,22,.35) 0%, rgba(20,32,22,.72) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  padding: clamp(3.5rem, 11vw, 7.5rem) 0 clamp(3rem, 9vw, 6rem);
  max-width: 780px; color: #fff;
}
.hero h1 { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.hero-lead {
  font-size: clamp(1.02rem, 1.8vw, 1.22rem);
  color: rgba(255,255,255,.93); max-width: 620px; margin-bottom: 1.8rem;
}
.hero-caption {
  position: relative; z-index: 2; padding-bottom: 2rem;
  font-family: var(--serif); font-style: italic;
  color: rgba(255,255,255,.8); font-size: .95rem;
}

/* --- Boutons --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.5rem; border-radius: 999px;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
}
.btn:hover { transform: translateY(-1px); }
/* Sur fond clair : vert foncé et texte blanc. Contraste 6,2:1, au-delà du
   minimum de 4,5:1 exigé pour du texte de cette taille. */
.btn-primary { background: var(--vert); color: #fff; box-shadow: var(--ombre); }
.btn-primary:hover { background: var(--vert-profond); color: #fff; box-shadow: var(--ombre-h); }

/* Sur fond sombre (bannière, bandeau de contact), l'ocre ressort mieux que
   le vert. Le texte y reste sombre : du blanc sur cet ocre ne donnerait que
   2,6:1, soit illisible. */
.hero .btn-primary,
.cta .btn-primary {
  background: var(--ocre); color: #241a08;
}
.hero .btn-primary:hover,
.cta .btn-primary:hover { background: #d09a4c; color: #241a08; }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-outline { border-color: var(--vert); color: var(--vert); background: transparent; }
.btn-outline:hover { background: var(--vert); color: #fff; }
.btn-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* --- Sections -------------------------------------------------------- */

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-paper { background: var(--papier); }
.section-head { max-width: 680px; margin-bottom: 2.4rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--encre-douce); font-size: 1.05rem; margin-bottom: 0; }

.eyebrow {
  display: inline-block; margin-bottom: .8rem;
  font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--terre);
}

/* --- Piliers --------------------------------------------------------- */

.pillars { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pillar {
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 1.7rem 1.6rem;
}
.pillar-num {
  display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 1rem;
  border-radius: 50%; background: var(--vert-pale); color: var(--vert);
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
}
.pillar h3 { margin-bottom: .4rem; }
.pillar p { margin: 0; color: var(--encre-douce); font-size: .97rem; }

/* --- Cartes d'ateliers ---------------------------------------------- */

.cards { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card {
  display: flex; flex-direction: column;
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--ombre-h); border-color: var(--vert-clair); }
.card-media { aspect-ratio: 3 / 2; background: var(--vert-pale); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: .4rem; font-size: 1.18rem; }
.card-sub { color: var(--terre); font-family: var(--serif); font-style: italic; font-size: .97rem; margin-bottom: .7rem; }
.card-text { color: var(--encre-douce); font-size: .95rem; flex: 1; }
.card-more { font-weight: 600; color: var(--vert); font-size: .95rem; margin: 0; }
.card:hover .card-more { color: var(--vert-profond); }

.card-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.tag {
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  padding: .22em .7em; border-radius: 999px;
  background: var(--vert-pale); color: var(--vert);
}
.tag-audio { background: #f6ecd9; color: #7d5a1e; }

/* --- Fiche d'atelier ------------------------------------------------ */

.page-head { padding: clamp(2.2rem, 5vw, 3.4rem) 0 0; }
/* Une section qui suit directement le chapeau n'a pas besoin de tout
   l'espace d'une section autonome : le titre fait déjà la respiration. */
.page-head + .section { padding-top: clamp(1.4rem, 3vw, 2rem); }
/* Bloc, sinon il se place sur la même ligne que l'accroche qui le suit. */
.back-link { display: block; width: fit-content; margin-bottom: 1.2rem; font-size: .93rem; color: var(--encre-douce); text-decoration: none; }
.back-link:hover { color: var(--vert-profond); }
.page-head h1 { margin-bottom: .3rem; }
.page-sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--terre); margin-bottom: 0; }

.atelier-grid {
  display: grid; gap: clamp(1.6rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  align-items: start; padding: clamp(2rem, 5vw, 3rem) 0;
}
@media (max-width: 900px) { .atelier-grid { grid-template-columns: 1fr; } }

.prose { font-size: 1.03rem; }
.prose h3 { margin-top: 1.8em; }
.prose .lead {
  font-family: var(--serif); font-size: 1.2rem; font-style: italic;
  color: var(--vert); border-left: 3px solid var(--vert-clair);
  padding-left: 1.1rem; margin: 1.4em 0;
}
.prose img { border-radius: var(--rayon-s); margin: 1.4em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; }
.prose td, .prose th { border-bottom: 1px solid var(--bord); padding: .6rem .4rem; text-align: left; }
.prose blockquote {
  margin: 1.4em 0; padding: 1rem 1.3rem; background: var(--vert-pale);
  border-radius: var(--rayon-s); font-style: italic;
}

.aside-card {
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 1.5rem; margin-bottom: 1.4rem;
}
.aside-card h3 { font-size: 1.08rem; margin-bottom: 1rem; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; flex-direction: column; padding: .7rem 0; border-top: 1px solid var(--bord); }
.facts li:first-child { border-top: 0; padding-top: 0; }
.facts dt, .facts .k {
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--encre-douce); margin-bottom: .2rem;
}
.facts .v { font-size: .98rem; }

/* --- Galerie --------------------------------------------------------- */

.gallery { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.gallery a { display: block; border-radius: var(--rayon-s); overflow: hidden; background: var(--vert-pale); }
.gallery img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; transition: transform .4s, filter .3s; }
.gallery a:hover img { transform: scale(1.05); filter: brightness(1.05); }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: .82rem; color: var(--encre-douce); padding: .4rem .1rem 0; }

/* Visionneuse plein écran, sans dépendance externe */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(18, 24, 18, .93); padding: 2rem;
  place-items: center;
}
.lightbox[open], .lightbox.is-open { display: grid; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--rayon-s); }
.lightbox-caption { color: #e8e4d8; text-align: center; margin-top: 1rem; font-size: .95rem; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.4rem;
  background: none; border: 0; color: #fff; font-size: 2.2rem;
  line-height: 1; cursor: pointer; padding: .2rem .5rem;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: 0; color: #fff;
  font-size: 2rem; width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
}
.lightbox-prev { left: 1rem; } .lightbox-next { right: 1rem; }

/* --- Formulaires ----------------------------------------------------- */

.form-card {
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: clamp(1.5rem, 4vw, 2.2rem);
}
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .38rem; }
.field .hint { font-size: .84rem; color: var(--encre-douce); margin: .3rem 0 0; }
.field input, .field select, .field textarea {
  width: 100%; padding: .72rem .9rem; font: inherit; font-size: .98rem;
  color: var(--encre); background: var(--creme);
  border: 1.5px solid var(--bord); border-radius: var(--rayon-s);
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--vert-clair);
  box-shadow: 0 0 0 3px rgba(109, 155, 106, .2);
}
.field textarea { min-height: 130px; resize: vertical; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c0533e; }
.field-error { color: #a83f2a; font-size: .86rem; margin: .35rem 0 0; font-weight: 500; }
.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.required { color: #a83f2a; }
.optional { color: var(--encre-douce); font-weight: 400; font-size: .88em; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Ressources ------------------------------------------------------ */

.book-list { display: grid; gap: 1.2rem; }
.book {
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 1.4rem 1.6rem;
}
.book h3 { margin-bottom: .25rem; font-size: 1.16rem; }
.book-meta { color: var(--encre-douce); font-size: .93rem; margin-bottom: .9rem; }
.book-price {
  display: inline-block; margin-left: .5rem; padding: .1em .6em;
  background: var(--vert-pale); color: var(--vert); border-radius: 999px;
  font-size: .82rem; font-weight: 600;
}
.pro-con { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); font-size: .94rem; }
.pro-con div { padding-left: 1rem; border-left: 3px solid var(--bord); }
.pro-con .pros { border-left-color: var(--vert-clair); }
.pro-con .cons { border-left-color: var(--ocre); }
.pro-con .k { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-douce); }
.pro-con p { margin: .2rem 0 0; }

.video-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.video-frame {
  aspect-ratio: 16 / 9; background: #1a1f19;
  border-radius: var(--rayon); overflow: hidden; position: relative;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-poster { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.video-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
}
.video-play span {
  display: grid; place-items: center; width: 68px; height: 68px;
  border-radius: 50%; background: rgba(250, 247, 240, .92); color: var(--vert-profond);
  font-size: 1.5rem; padding-left: .2rem; box-shadow: var(--ombre-h);
  transition: transform .18s;
}
.video-play:hover span { transform: scale(1.08); }

/* --- Parcours sonore ------------------------------------------------- */

.player {
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: clamp(1.4rem, 4vw, 2rem);
  box-shadow: var(--ombre);
}
.player-figure { text-align: center; margin: 0 0 1.2rem; }
.player-figure img {
  margin: 0 auto; border-radius: var(--rayon-s);
  max-height: 340px; width: auto; object-fit: contain;
}
.player-era { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--terre); }
.player h2 { margin: .3rem 0 .4rem; }
.player-teaser { font-family: var(--serif); font-style: italic; color: var(--encre-douce); }
.player audio { width: 100%; margin: 1.2rem 0; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; }
.player-controls button {
  padding: .6rem 1.1rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--bord); background: var(--creme);
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--vert-profond);
}
.player-controls button:hover:not(:disabled) { border-color: var(--vert-clair); background: var(--vert-pale); }
.player-controls button:disabled { opacity: .4; cursor: not-allowed; }
.player-count { font-size: .9rem; color: var(--encre-douce); }

.conte-strip { display: flex; gap: .6rem; overflow-x: auto; padding: 1.2rem .2rem .4rem; scroll-snap-type: x proximity; }
.conte-chip {
  flex: 0 0 auto; width: 92px; scroll-snap-align: start;
  border: 2px solid transparent; border-radius: var(--rayon-s);
  background: none; padding: 0; cursor: pointer; text-align: center;
}
.conte-chip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.conte-chip span { display: block; font-size: .74rem; color: var(--encre-douce); padding: .3rem 2px 0; line-height: 1.25; }
.conte-chip[aria-current="true"] { border-color: var(--ocre); }
.conte-chip[aria-current="true"] span { color: var(--vert-profond); font-weight: 600; }

/* --- Bandeau d'appel ------------------------------------------------- */

.cta {
  background: var(--vert-profond); color: #fff;
  padding: clamp(2.6rem, 6vw, 4rem) 0;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.85); max-width: 560px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-facts { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; gap: 1.8rem; flex-wrap: wrap; font-size: .95rem; }
.cta-facts a { color: #fff; }

/* --- Pied de page ---------------------------------------------------- */

.site-footer { background: #1b2a1e; color: rgba(255,255,255,.78); margin-top: 0; }
.footer-grid {
  display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr;
  padding-top: clamp(2.4rem, 5vw, 3.4rem); padding-bottom: 2rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }
.footer-title { font-family: var(--serif); font-size: 1.05rem; color: #fff; margin-bottom: .7rem; }
.footer-text { font-size: .94rem; max-width: 44ch; margin: 0; }
.footer-list { list-style: none; margin: 0; padding: 0; font-size: .94rem; }
.footer-list li { margin-bottom: .45rem; }
.footer-list a { color: rgba(255,255,255,.8); text-decoration: none; }
.footer-list a:hover { color: #fff; text-decoration: underline; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.2rem; padding-bottom: 1.6rem;
  font-size: .85rem; color: rgba(255,255,255,.55);
}
.footer-legal p { margin: 0; }

.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 30;
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--papier); color: var(--vert-profond);
  border: 1px solid var(--bord); box-shadow: var(--ombre);
  text-decoration: none; font-size: 1.1rem;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* --- Page d'erreur --------------------------------------------------- */

.error-page { padding: clamp(4rem, 12vw, 8rem) 0; text-align: center; }
.error-code { font-family: var(--serif); font-size: clamp(4rem, 14vw, 8rem); color: var(--vert-pale); line-height: .9; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .site-header, .site-footer, .to-top, .cta, form { display: none !important; }
  body { background: #fff; font-size: 12pt; }
}


/* =====================================================================
   Fenêtre de confirmation d'envoi
   ===================================================================== */

.modal {
  position: fixed; inset: 0; z-index: 95;
  display: none; place-items: center;
  padding: 1.2rem;
  background: rgba(24, 32, 24, .58);
  backdrop-filter: blur(3px);
}
.modal.is-open { display: grid; }

.modal-box {
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  background: var(--papier); border-radius: var(--rayon);
  padding: clamp(1.4rem, 4vw, 2rem);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5);
}
.modal-box h2 { margin-bottom: .3em; font-size: 1.4rem; }
.modal-lead { color: var(--encre-douce); font-size: .96rem; margin-bottom: 1.2rem; }

.modal-recap { margin: 0 0 1.5rem; font-size: .95rem; }
.modal-recap > div {
  display: flex; gap: .9rem; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px solid var(--bord);
}
.modal-recap > div:last-child { border-bottom: 0; }
.modal-recap dt {
  flex: 0 0 8.5rem; margin: 0;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--encre-douce);
}
.modal-recap dd { margin: 0; flex: 1; word-break: break-word; }
.modal-recap .is-long { white-space: pre-wrap; }

.modal-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; justify-content: center; }

/* =====================================================================
   Dictée vocale
   ===================================================================== */

.field-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .8rem; margin-bottom: .38rem;
}
.field-head label { margin-bottom: 0; }

.dictate {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--bord); background: var(--papier);
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--encre-douce);
  white-space: nowrap; transition: background .16s, border-color .16s, color .16s;
}
.dictate:hover { border-color: var(--vert-clair); color: var(--vert-profond); }
.dictate-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--mousse); flex: 0 0 auto;
}
.dictate.is-listening {
  border-color: #c0533e; color: #a83f2a; background: #fdf1ef;
}
.dictate.is-listening .dictate-dot { background: #c0533e; animation: dictate-pulse 1.1s infinite; }

@keyframes dictate-pulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .35; transform: scale(1.35); }
}

.dictate-status {
  font-size: .84rem; color: var(--encre-douce); margin: .35rem 0 0;
}
.dictate-status:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .dictate.is-listening .dictate-dot { animation: none; }
}

/* =====================================================================
   Application installable
   ===================================================================== */

.app-state {
  background: var(--vert-pale); border-left: 4px solid var(--vert-clair);
  border-radius: var(--rayon-s); padding: .9rem 1.1rem; margin-bottom: 1.6rem;
}
.app-state-text { margin: 0; font-size: .95rem; color: #2b4d2f; }

/* --- Barre de progression du téléchargement -------------------------- */

.progress { margin-top: 1rem; }
.progress-bar {
  height: 7px; border-radius: 999px; overflow: hidden;
  background: var(--bord);
}
.progress-bar > span {
  display: block; height: 100%; width: 0;
  background: var(--vert-clair);
  transition: width .3s ease;
}
.progress-text {
  margin: .5rem 0 0; font-size: .86rem; color: var(--encre-douce);
}

/* --- Encart « hors connexion » sur la page du parcours --------------- */

.offline-card {
  background: var(--papier); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 1.3rem 1.4rem; margin-top: 1.6rem;
}
.offline-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.offline-card p { font-size: .94rem; color: var(--encre-douce); }
.offline-card p:last-of-type { margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .progress-bar > span { transition: none; }
}
