/* ==========================================================
   Écuries des Pious — style.css
   Palette "prairie" : verts naturels, jaune soleil, brun poney
   ========================================================== */

:root {
  --vert-prairie: #6b8e4e;
  --vert-profond: #3f5930;
  --vert-clair: #e5efd8;
  --jaune-soleil: #e8b93a;
  --brun-poney: #4a3728;
  --creme: #faf6ec;
  --blanc: #ffffff;
  --rouge-alerte: #c0392b;
  --rouge-alerte-fond: #fdecea;
  --ombre: 0 8px 24px rgba(63, 89, 48, 0.12);
  --rayon: 18px;
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--brun-poney);
  background: var(--creme);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--vert-profond); }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--vert-profond); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.btn {
  display: inline-block;
  padding: .75em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
}
.btn--primary { background: var(--vert-prairie); color: var(--blanc); }
.btn--primary:hover { background: var(--vert-profond); }
.btn--ghost { background: transparent; border-color: var(--vert-prairie); color: var(--vert-profond); }

/* ---------- Séparateur "prairie" (élément signature) ---------- */
.meadow-divider {
  height: 42px;
  width: 100%;
  background-repeat: repeat-x;
  background-size: 84px 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='42' viewBox='0 0 84 42'%3E%3Cpath d='M0 42 Q10 10 21 42 T42 42 T63 42 T84 42 V42 H0 Z' fill='%236b8e4e'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.site-header {
  background: var(--blanc);
  box-shadow: var(--ombre);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { border-radius: 50%; }
.logo__text {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--vert-profond);
  font-size: 1.15rem;
}
.main-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  color: var(--brun-poney);
  font-weight: 600;
}
.main-nav a:hover { color: var(--vert-prairie); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--vert-profond);
  border-radius: 3px;
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blanc);
    box-shadow: var(--ombre);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .main-nav.is-open { max-height: 260px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 12px 24px; }
  .main-nav li { border-bottom: 1px solid var(--vert-clair); }
  .main-nav a { display: block; padding: 14px 0; }
}

/* ---------- Hero / Slider ---------- */
.hero-slider {
  position: relative;
  width: 100%;
  height: clamp(260px, 48vw, 560px);
  overflow: hidden;
  background: var(--vert-clair);
}
.hero-slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .6s ease;
}
.hero-slider__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}
.hero-slider__slide img,
.hero-slider__slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slider__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px clamp(16px, 5vw, 48px);
  background: linear-gradient(0deg, rgba(63,89,48,.75), transparent);
  color: var(--blanc);
}
.hero-slider__caption h1 { color: var(--blanc); }
.hero-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.85);
  border: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--vert-profond);
}
.hero-slider__nav--prev { left: 16px; }
.hero-slider__nav--next { right: 16px; }
.hero-slider__dots {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
}
.hero-slider__dots button {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.6); cursor: pointer;
}
.hero-slider__dots button.is-active { background: var(--jaune-soleil); }

/* ---------- Sections génériques ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--vert-clair); }
.section__intro { max-width: 640px; margin-bottom: 32px; }

/* ---------- Cartes activités ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.card {
  background: var(--blanc);
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre);
  text-decoration: none;
  color: inherit;
  display: block;
}
.card img { aspect-ratio: 4/3; object-fit: cover; }
.card__body { padding: 18px; }
.card__body h3 { margin-bottom: 6px; }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.portfolio-grid figure {
  margin: 0;
  border-radius: var(--rayon);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  cursor: pointer;
}
.portfolio-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.portfolio-grid figure:hover img { transform: scale(1.04); }
.portfolio-grid figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(63,89,48,.85), transparent);
  color: var(--blanc);
  font-size: .9rem;
  padding: 28px 14px 12px;
}

@media (max-width: 640px) {
  .portfolio-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 10px;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .portfolio-grid figure {
    flex: 0 0 86%;
    scroll-snap-align: center;
    aspect-ratio: 4/3;
  }
}

/* ---------- Lightbox (agrandissement des photos portfolio) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 25, .92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox__caption {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  text-align: center;
  color: var(--blanc);
  font-size: .95rem;
  padding: 0 24px;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255,255,255,.15);
  color: var(--blanc);
  border: none;
  border-radius: 50%;
  width: 46px; height: 46px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255,255,255,.3); }
.lightbox__close { top: 20px; right: 20px; }
.lightbox__nav--prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox__nav { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--vert-clair);
}
.faq-item__question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--vert-profond);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.faq-item.is-open .faq-item__answer { max-height: 320px; padding-bottom: 18px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-alert {
  background: var(--rouge-alerte-fond);
  border: 2px solid var(--rouge-alerte);
  color: var(--rouge-alerte);
  border-radius: var(--rayon);
  padding: 18px 22px;
  font-weight: 600;
  margin-bottom: 20px;
}
.contact-alert a { color: var(--rouge-alerte); text-decoration: underline; }
.contact-person {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-person img {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--jaune-soleil);
}
.contact-phone {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--vert-profond);
  text-decoration: none;
}

.map-loader {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--vert-clair) url("/assets/images/plan-apercu.jpg") center/cover;
}
.map-loader__btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  cursor: pointer;
  background: rgba(63,89,48,.55);
  color: var(--blanc);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}
.map-loader iframe {
  width: 100%; height: 100%; border: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--vert-profond);
  color: var(--vert-clair);
  padding: 48px 0 20px;
  margin-top: 40px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.site-footer__title {
  color: var(--jaune-soleil);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.site-footer a { color: var(--vert-clair); }
.site-footer__social a { margin-right: 14px; }
.site-footer__legal {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: .85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.site-footer__legal a { color: var(--vert-clair); }

/* ---------- Bandeau cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--blanc);
  box-shadow: 0 -6px 24px rgba(0,0,0,.15);
  z-index: 100;
  padding: 18px 0;
}
.cookie-banner__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner__inner p { margin: 0; max-width: 640px; font-size: .9rem; }
.cookie-banner__actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ---------- Accessibilité / mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
:focus-visible {
  outline: 3px solid var(--jaune-soleil);
  outline-offset: 2px;
}
