/* =======================
   VARIABLES (thème)
   ======================= */
:root{
  --check-icon-url: url('ressources/home/vu.png');

  /* Couleurs de marque */
  --leaf-950:#0b2b19;
  --leaf-900:#0e3a22;
  --leaf-800:#1a6b3a; /* primaire */
  --leaf-700:#2a7f45; /* hover */
  --leaf-500:#6fbd5f; /* accent */

  /* Neutres/texte */
  --ink-900:#102a19;
  --ink-700:#3d5a4a;
  --ink-600:#5e7a6b;

  /* Fonds */
  --bg-100:#ffffff;   /* blanc */
  --bg-200:#f4fbf6;
  --bg-300:#ecf7f1;
  --paper:#f0f0f0;    /* gris clair */

  --radius-12:12px;
  --radius-16:16px;
  --shadow-sm:0 3px 10px rgba(16,42,25,.08);
  --shadow-md:0 10px 26px rgba(16,42,25,.10);

  /* Bootstrap overrides */
  --bs-primary: var(--leaf-800);
  --bs-primary-rgb: 26,107,58;
  --bs-link-color: var(--leaf-800);
  --bs-link-hover-color: var(--leaf-700);
  --bs-body-color: var(--ink-900);
  --bs-body-bg: var(--paper);
}

html { scroll-behavior: smooth; }
body { color: var(--ink-900); background: var(--paper); font-feature-settings: "liga" 1, "kern" 1; }
.container-xl { max-width: 1120px; padding-left: 16px; padding-right: 16px; }

/* =======================
   TYPOGRAPHIE
   ======================= */
h1, .h1{font-size:clamp(30px,3.4vw,46px);font-weight:800;line-height:1.12;color:var(--leaf-900);letter-spacing:-.01em;margin:0 0 .5rem}
h2, .h2{font-size:clamp(24px,2.6vw,34px);font-weight:800;line-height:1.15;color:var(--leaf-900);margin:0 0 .5rem}
h3, .h3{font-size:clamp(18px,2vw,22px);font-weight:700;color:var(--leaf-900);margin:0 0 .5rem}
.lead{font-size:clamp(16px,1.2vw,18px);color:var(--ink-900);opacity:.95;max-width:65ch}
p{line-height:1.7;margin-bottom:1rem}

.u-accent{ color: var(--leaf-500); font-weight:800; }
.divider{width:88px;height:6px;border-radius:999px;background:linear-gradient(90deg,var(--leaf-800),var(--leaf-500))}

/* =======================
   ACCESSIBILITÉ
   ======================= */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{position:fixed;left:16px;top:16px;z-index:10000;width:auto;height:auto;padding:.5rem .75rem;background:var(--bg-100);border:2px solid rgba(26,107,58,.35);border-radius:var(--radius-12);box-shadow:var(--shadow-sm)}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
a:focus-visible, button:focus-visible{outline:3px solid rgba(26,107,58,.45);outline-offset:2px;border-radius:10px}
@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto!important;animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important}
}

/* =======================
   LAYOUT & RYTHME
   ======================= */
main.page{ background: var(--paper); }
.section{ padding: clamp(40px, 6vw, 56px) 0; }
.section--alt{ background: var(--bg-100); } /* blanc */
.section__header{ margin-bottom: clamp(16px, 3vw, 24px); }
.readable{ max-width: 860px; }

/* =======================
   HERO
   ======================= */
.hero{padding: clamp(56px, 8vw, 80px) 0 clamp(32px, 6vw, 56px); background: var(--bg-100); border-bottom:1px solid rgba(0,0,0,.06)}
.hero .lead { max-width: 60ch; }

/* =======================
   BOUTONS
   ======================= */
.btn{border-radius: var(--radius-12);font-weight:800;letter-spacing:.2px}
.btn-lg { font-size: clamp(1rem, 2.8vw, 1.125rem); padding: .9rem 1.2rem; }
@media (max-width: 575.98px){ .btn { min-height: 48px; } }

.btn-primary{box-shadow: var(--shadow-sm);background:var(--leaf-800)!important;border-color:var(--leaf-800)!important;color:#fff!important}
.btn-primary:hover,.btn-primary:focus,.btn-primary:focus-visible,.btn-primary:active,
.btn-primary:visited,.btn-primary.disabled,.btn-primary:disabled,
.btn-check:checked + .btn-primary,.btn-check:active + .btn-primary,
.show > .btn-primary.dropdown-toggle{
  background:var(--leaf-700)!important;border-color:var(--leaf-700)!important;color:#fff!important;
}
.btn-primary, .btn-primary *{ color:#fff!important }
.btn-primary svg, .btn-primary [fill]{ fill: currentColor !important }

.btn-outline-primary{background:var(--bg-100);border-color:var(--leaf-800);color:var(--leaf-800)!important}
.btn-outline-primary:hover,.btn-outline-primary:focus-visible{background:#f3faf6;border-color:var(--leaf-700);color:var(--leaf-700)!important}

/* =======================
   METRICS
   ======================= */
.metrics{
  display:grid;grid-template-columns:repeat(3,1fr);
  gap: clamp(8px, 2vw, 16px);
  background:var(--bg-100);border:1px solid rgba(0,0,0,.06);
  border-radius:var(--radius-16);padding: clamp(14px, 2.8vw, 20px);
  box-shadow:var(--shadow-md)
}
.metric{text-align:center;padding:8px}
.metric__value{font-weight:900;font-size:clamp(20px,5vw,28px);color:var(--leaf-800);display:block}
.metric__label{font-size:clamp(.85rem, 2.4vw, .95rem);color:var(--ink-600)}
@media (max-width: 768px){ .metrics{grid-template-columns:1fr 1fr} }
@media (max-width: 480px){ .metrics{grid-template-columns:1fr} }

/* =======================
   LISTES
   ======================= */
.list{list-style:none;padding-left:0;margin:0}
.list--check li{
  position:relative;padding:.65rem .9rem .65rem 2.1rem;
  background:var(--bg-100);border:1px solid rgba(0,0,0,.06);
  border-radius:var(--radius-12);margin-bottom:10px;color:var(--ink-900);
  box-shadow:var(--shadow-sm)
}
.list--check li::before{
  content:"";position:absolute;left:.8rem;top:50%;transform:translateY(-50%);
  width:1rem;height:1rem;background-image:var(--check-icon-url);
  background-repeat:no-repeat;background-position:center;background-size:contain
}

/* =======================
   CTA CARD
   ======================= */
.card-cta{
  background:linear-gradient(135deg,var(--bg-200) 0%,var(--bg-300) 100%);
  border:1px solid rgba(26,107,58,.18);border-radius:var(--radius-16);
  padding:24px;box-shadow:var(--shadow-md)
}

/* =======================
   VIDÉO 16:9
   ======================= */
.video-embed{
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  background: var(--bg-100);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.video-embed iframe{
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: inherit;
}
.video-embed--tight{ padding-top: 56.25%; }

/* =======================
   ANTI-BLEU – verts Bootstrap
   ======================= */
:root{
  --bs-blue: var(--leaf-800);
  --bs-indigo: var(--leaf-800);
  --bs-cyan: var(--leaf-800);
  --bs-info: var(--leaf-800);
  --bs-primary: var(--leaf-800);
  --bs-primary-rgb: 26,107,58;
  --bs-primary-text-emphasis:#123b22;
  --bs-primary-bg-subtle:#e6f4ea;
  --bs-primary-border-subtle:#cfead9;
  --bs-link-color: var(--leaf-800);
  --bs-link-hover-color: var(--leaf-700);
  --bs-focus-ring-color: rgba(26,107,58,.25);
}
a, .link-primary, .btn-link, .text-primary{color:var(--leaf-800)!important}
a:hover, a:focus, .link-primary:hover, .btn-link:hover{color:var(--leaf-700)!important}
a:visited{color:var(--leaf-800)!important}

/* Sélection de texte */
::selection{background:rgba(26,107,58,.18);color:var(--ink-900)}

/* =========================================================
   MOBILE SAFETY
   ========================================================= */
html, body { max-width: 100%; overflow-x: hidden; }

/* =========================================================
   MÉTRIQUES — mobile "pills"
   ========================================================= */
.metric__icon{ display:none; }
@media (max-width: 575.98px){
  .metrics{ display:flex; gap:10px; padding:10px 12px; margin:0 8px 0 10px; background:transparent; border:0; box-shadow:none; }
  .metric{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px 10px; background:var(--bg-100); border:1px solid rgba(0,0,0,.06); border-radius:14px; box-shadow:var(--shadow-sm); text-align:center; }
  .metric__icon{ display:inline-flex; width:28px; height:28px; border-radius:999px; background: linear-gradient(180deg,#f2fbf5,#e8f6ee); color:var(--leaf-800); box-shadow: inset 0 0 0 1px rgba(26,107,58,.12); }
  .metric__value{ font-size:clamp(18px, 6.2vw, 22px); font-weight:900; line-height:1; margin:0; color:var(--leaf-900); }
  .metric__label{ font-size:12.5px; line-height:1.2; letter-spacing:.15px; color:var(--ink-700); margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
}
@media (min-width: 576px) and (max-width: 767.98px){
  .metrics{ display:flex; gap:12px; padding:14px 16px; margin:0 10px; background:transparent; border:0; box-shadow:none; }
  .metric{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 12px; background:var(--bg-100); border:1px solid rgba(0,0,0,.06); border-radius:16px; box-shadow:var(--shadow-sm); text-align:center; }
  .metric__icon{ display:inline-flex; width:30px; height:30px; }
  .metric__value{ font-size:clamp(20px, 4.8vw, 24px); }
  .metric__label{ font-size:13px; }
}
@media (min-width: 768px){ .metric__icon{ display:none; } }

/* Navbar & mobile spacing */
@media (max-width: 575.98px){
  .navbar{ padding-block: .25rem; }
  .navbar .navbar-brand{ padding-block: .25rem; }
  .navbar .nav-link{ padding-block: .35rem; }
  .navbar.fixed-top + main.page,
  .navbar.sticky-top + main.page{ margin-top: 8px !important; }
  .hero{ padding-top: 32px; }
}

/* Mobile justification */
@media (max-width: 575.98px){
  .lead, p, .section p, .card-cta p, .modal-body p, .modal-body li, .list--check li {
    text-align: justify; text-justify: inter-word; hyphens: auto;
  }
  .modal-body ul, .modal-body ol { padding-left: 1.1rem; }
}

/* Bouton "En savoir plus" */
.btn-outline-primary{
  background-color: #fff !important;
  color: var(--leaf-800) !important;
  border-color: var(--leaf-800) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible{
  background-color: #fff !important;
  color: var(--leaf-700) !important;
  border-color: var(--leaf-700) !important;
}

/* =======================
   SECTION MEDIA (carrousel + vidéo)
   ======================= */
#media .row > [class*="col"]{ display:flex; }
#media .carousel-qualites,
#media .video-embed{ width:100%; }

/* =======================
   CARROUSEL — 16:9 strict, compact
   ======================= */
.carousel-qualites{
  max-width: 980px;
  margin-inline: auto;
}
.carousel-qualites .carousel-inner{
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
/* Ratio fixé sur le slide (comme la vidéo) */
.carousel-qualites .carousel-item{
  aspect-ratio: 16 / 9;
  max-height: clamp(220px, 26vw, 320px);
}
.carousel-qualites .carousel-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Flèches très visibles */
.carousel-qualites .carousel-control-prev,
.carousel-qualites .carousel-control-next{
  width: auto;
  opacity: 1 !important;
}
.carousel-qualites .carousel-control-prev-icon,
.carousel-qualites .carousel-control-next-icon{
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background-size: 60% 60%;
  background-color: rgba(0,0,0,.65);
  box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 2px rgba(255,255,255,.35) inset;
  filter: none;
}
.carousel-qualites .carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-qualites .carousel-control-next:hover .carousel-control-next-icon{
  background-color: rgba(0,0,0,.78);
  box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 0 0 2px rgba(255,255,255,.45) inset;
}

/* Indicateurs */
.carousel-indicators [data-bs-target]{
  width: 8px; height: 8px; border-radius: 999px;
  background-color: rgba(16,42,25,.35);
}
.carousel-indicators .active{ background-color: var(--leaf-800); }

/* Mobile : un peu plus de hauteur */
@media (max-width: 575.98px){
  .carousel-qualites .carousel-item{ max-height: 240px; }
}
