/* ============================================================
   HORSALIA, couche visuelle
   Direction : moderne, clair, nature.
   Grotesque droit, aucune italique, aucun serif.
   Blancs lumineux, verts vegetaux, lignes fines, air genereux.
   Polices auto-hebergees, aucun CDN.
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/spacegrotesk-latin.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-latin.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
/* Metriques du repli, evite le decalage au chargement */
@font-face {
  font-family: 'Manrope-fallback';
  src: local('Helvetica Neue'), local('Arial');
  size-adjust: 100%;
  ascent-override: 104%;
  descent-override: 28%;
  line-gap-override: 0%;
}

:root {
  /* Clair et lumineux */
  --bg:        #fbfcfb;
  --bg-2:      #f4f7f4;
  --surface:   #ffffff;

  --ink:       #0e1512;
  --ink-2:     #4b5852;
  --ink-3:     #8a958f;

  /* Nature, franc et moderne */
  --green:     #17795029;
  --leaf:      #157a51;
  --leaf-lit:  #1a8f5f;
  --leaf-soft: #e8f3ed;
  --sky:       #eef4f1;

  --line:      #e4e9e5;
  --line-2:    #eef1ef;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body:    'Manrope', 'Manrope-fallback', system-ui, sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.1, 1);
  --wrap: 1200px;
  --r:    14px;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.6;
  font-weight: 400;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Aucune italique nulle part */
i, em, .serif-em { font-style: normal; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 26px; }
a { color: inherit; }

/* ============================================================
   Navigation, barre nette
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(251, 252, 251, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(251, 252, 251, 0.94);
}
.nav-island {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  height: 68px;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.logo em { color: var(--leaf); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.nav-links a:hover { background: var(--bg-2); color: var(--ink); }

/* Boutons nets */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--leaf);
  color: #fff;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
  box-shadow: 0 1px 2px rgba(14, 21, 18, 0.06);
}
.btn:hover { background: var(--leaf-lit); box-shadow: 0 4px 14px -6px rgba(21, 122, 81, 0.55); }
.btn:active { transform: translateY(1px); }

.btn-ico { display: grid; place-items: center; transition: transform 0.3s var(--ease); }
.btn:hover .btn-ico { transform: translateX(3px); }
.btn-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--bg-2); border-color: #d5ddd8; box-shadow: none; }

/* ============================================================
   Typographie, droite et serree
   ============================================================ */

h1, h2, h3 {
  font-family: var(--display);
  font-style: normal;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6.4vw, 78px); font-weight: 600; }
h2 { font-size: clamp(27px, 3.6vw, 42px); font-weight: 600; letter-spacing: -0.032em; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.022em;
     font-family: var(--body); }

.accent { color: var(--leaf); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 2px;
  background: var(--leaf);
}

.lead { font-size: clamp(16.5px, 1.5vw, 19px); color: var(--ink-2);
        max-width: 60ch; margin: 0; line-height: 1.6; }
.muted { color: var(--ink-3); font-size: 14px; }

/* ============================================================
   Hero
   ============================================================ */

main { display: block; }

/* --------------------------------------------------------
   Hero avec photo en fond.
   Pour changer la photo : deposer le fichier dans assets/img/
   et mettre a jour --hero-img ci-dessous. Rien d'autre a toucher.
   Format conseille : paysage, 2400x1350 minimum, sujet a droite,
   partie gauche calme (c'est la que se pose le texte).
   -------------------------------------------------------- */
.hero {
  --hero-img: url('/assets/img/hero-cheval.webp');
  position: relative;
  padding: clamp(80px, 12vw, 168px) 0 clamp(76px, 10vw, 132px);
  overflow: hidden;
  isolation: isolate;
}
/* La photo. Elle deborde legerement pour que le mouvement
   ne laisse jamais apparaitre de bord vide. */
.hero::before {
  content: '';
  position: absolute;
  inset: -3%;
  z-index: -2;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: 68% center;
  pointer-events: none;
  transform-origin: 72% 55%;
  /* Entree en douceur, puis respiration lente et continue */
  animation:
    hero-in 1.8s var(--ease) both,
    hero-drift 34s ease-in-out 1.8s infinite alternate;
  will-change: transform;
}

@keyframes hero-in {
  from { transform: scale(1.09); opacity: 0; }
  to   { transform: scale(1.03); opacity: 1; }
}
/* Respiration : zoom tres lent et derive laterale, imperceptible mais vivante */
@keyframes hero-drift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to   { transform: scale(1.11) translate3d(-1.4%, -0.8%, 0); }
}
/* Voile clair : le texte reste lisible a gauche, la photo respire a droite */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Un seul voile horizontal : opaque sous le texte, totalement transparent
     sur les chevaux. Le voile vertical d'avant se cumulait a celui-ci et
     delavait la photo, il ne reste qu'un raccord discret en bas de section. */
  background:
    linear-gradient(94deg,
      rgba(251, 252, 251, 0.96) 0%,
      rgba(251, 252, 251, 0.92) 28%,
      rgba(251, 252, 251, 0.68) 44%,
      rgba(251, 252, 251, 0.22) 62%,
      rgba(251, 252, 251, 0.00) 80%),
    linear-gradient(to bottom,
      rgba(251, 252, 251, 0.00) 78%,
      rgba(251, 252, 251, 0.55) 100%);
}
.hero > * { position: relative; }

/* Le texte occupe la gauche, la photo garde la droite entierement libre.
   Rien ne doit venir se poser sur les chevaux. */
.hero-text { max-width: 56%; }
.hero h1 { margin: 20px 0 0; }
.hero .lead { margin-top: 22px; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* Chiffres, bandeau sous la photo */
.stats-band { padding: 0; margin-top: -1px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  transform: translateY(-28px);
  box-shadow: 0 12px 30px -22px rgba(14, 21, 18, 0.3);
}
.stat { padding: 20px 24px; border-right: 1px solid var(--line-2); }
.stat:last-child { border-right: 0; }
.stat b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 13.5px; color: var(--ink-3); }

/* ============================================================
   Sections
   ============================================================ */

.section { padding: clamp(48px, 6.5vw, 88px) 0; }
.section-head { max-width: 62ch; margin-bottom: clamp(26px, 3.4vw, 42px); }
.section-head h2 { margin: 14px 0 12px; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.shell { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.shell > .core { border-radius: var(--r); }

/* Grille de fiches */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
              transform 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  border-color: #cfdbd4;
  box-shadow: 0 8px 24px -14px rgba(14, 21, 18, 0.22);
}
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card:hover h3 { color: var(--leaf); }
.card h3 { transition: color 0.3s var(--ease); }
.card .meta {
  display: flex; align-items: center; gap: 7px;
  margin: 0; font-size: 13.5px; color: var(--ink-3);
}
.card .meta svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.9; }

.badge {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--leaf-soft);
  color: var(--leaf);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em;
}
.badge svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* Tuiles departements et communes */
.tile-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px;
}
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
              transform 0.3s var(--ease);
}
.tile:hover {
  transform: translateY(-2px);
  border-color: #cfdbd4;
  box-shadow: 0 8px 22px -14px rgba(14, 21, 18, 0.2);
}
.tile-name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; }
.tile-n {
  font-family: var(--display); font-weight: 600; font-size: 15px;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--ease);
}
.tile:hover .tile-n { color: var(--leaf); }

/* Fil d'ariane */
.breadcrumb ol {
  list-style: none; padding: 0; margin: 0 0 20px;
  display: flex; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--ink-3);
}
.breadcrumb li + li::before { content: '/'; margin-right: 8px; color: #c3ccc7; }
.breadcrumb a { text-decoration: none; transition: color 0.3s var(--ease); }
.breadcrumb a:hover { color: var(--leaf); }

.page-head { padding: clamp(24px, 3.4vw, 40px) 0 clamp(22px, 2.6vw, 32px); }
.page-head h1 { margin: 12px 0 14px; font-size: clamp(34px, 4.6vw, 56px); }

/* Encart d'information */
.notice {
  display: flex; gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--leaf);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14.5px; color: var(--ink-2);
}
.notice svg { flex: none; width: 17px; height: 17px; margin-top: 2px;
  stroke: var(--leaf); fill: none; stroke-width: 1.9; }
.notice a { color: var(--leaf); font-weight: 600; }

/* Fiche */
.estab-head { padding: clamp(22px, 3.4vw, 40px) 0 26px; }
.infos {
  display: grid; grid-template-columns: 150px 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden; margin: 24px 0 0;
}
.infos dt { padding: 13px 18px; font-size: 13.5px; color: var(--ink-3);
  background: var(--bg-2); border-bottom: 1px solid var(--line-2); }
.infos dd { padding: 13px 18px; margin: 0; border-bottom: 1px solid var(--line-2); }

/* Formulaire */
.form-card { margin-top: clamp(30px, 4vw, 50px); max-width: 620px; }
.form-card .core { padding: clamp(24px, 3vw, 34px); }
.form-card h2 { font-size: clamp(23px, 2.6vw, 30px); margin-bottom: 6px; }
.field { display: block; margin-top: 18px; }
.field span { display: block; font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font: inherit; font-size: 15.5px; color: var(--ink);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; background: var(--surface);
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(21, 122, 81, 0.13);
}
.field textarea { resize: vertical; min-height: 108px; }
.form-card .btn { margin-top: 22px; }

/* Pied de page */
.site-footer {
  margin-top: clamp(52px, 7vw, 96px);
  padding: clamp(36px, 4.4vw, 56px) 0 38px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 22px; align-items: baseline; }
.footer-claim {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(19px, 2.2vw, 26px); letter-spacing: -0.03em;
  max-width: 24ch; line-height: 1.2; margin: 0;
}
.footer-legal { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.footer-legal p { margin: 0 0 5px; font-size: 12.5px; color: var(--ink-3); max-width: 80ch; }

/* ============================================================
   Revelations, uniquement si le JS est actif
   ============================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: transform, opacity;
}
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 0.05s; }
.js .reveal.d2 { transition-delay: 0.1s; }
.js .reveal.d3 { transition-delay: 0.15s; }
.js .reveal.d4 { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  /* La photo reste fixe pour qui demande moins de mouvement */
  .hero::before { animation: none; transform: scale(1.03); opacity: 1; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 900px) {
  .hero-text { max-width: 100%; }
  /* Le voile devient vertical : le texte passe au-dessus de la photo,
     qui reste lisible en bas de section. */
  .hero::after {
    background:
      linear-gradient(to bottom,
        rgba(251, 252, 251, 0.96) 0%,
        rgba(251, 252, 251, 0.90) 42%,
        rgba(251, 252, 251, 0.42) 68%,
        rgba(251, 252, 251, 0.30) 100%);
  }
  .hero::before { background-position: 62% center; }
}
@media (max-width: 768px) {
  /* Version allegee de la photo sur telephone */
  .hero { --hero-img: url('/assets/img/hero-cheval-mobile.webp'); }
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .nav-links { display: none; }
  .hero-stats { grid-template-columns: 1fr; transform: translateY(-18px); }
  .stat { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .stat:last-child { border-bottom: 0; }
  .infos { grid-template-columns: 1fr; }
  .infos dt { border-bottom: 0; padding-bottom: 4px; }
  .grid, .tile-list { grid-template-columns: 1fr; }
  .section { padding: 46px 0; }
}
