/* ================================================================
   notre-histoire.css — Page "Notre Histoire"
   Design éditorial : noir / blanc / gris + or (#C4A35A)
   Pas de beige : sections alternées sombre / clair
================================================================ */


/* ── Variables locales ─────────────────────────────────────── */
:root {
  --hist-noir:      #080808;
  --hist-g900:      #101010;
  --hist-g800:      #1A1A1A;
  --hist-g700:      #2A2A2A;
  --hist-g500:      #555555;
  --hist-g400:      #888888;
  --hist-g200:      #D4D4D4;
  --hist-g100:      #F2F2F2;   /* gris très clair — pas de beige */
  --hist-blanc:     #FFFFFF;
  --hist-or:        #C4A35A;   /* = --couleur-accent */
  --hist-or-pale:   #E8D5A0;
}


/* ================================================================
   COMPOSANT : EYEBROW
================================================================ */

.hist-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--police-texte);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--hist-g400);
  margin-bottom: 1.5rem;
}
.hist-eyebrow::before,
.hist-eyebrow::after {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.hist-eyebrow--or        { color: var(--hist-or); opacity: 1; }
.hist-eyebrow--or::before,
.hist-eyebrow--or::after { opacity: 1; }


/* ================================================================
   SECTIONS GÉNÉRIQUES
================================================================ */

.hist-section {
  padding-block: clamp(4.5rem, 10vw, 8rem);
}

.hist-section--clair      { background-color: var(--hist-g100); }
.hist-section--blanc      { background-color: var(--hist-blanc); }
.hist-section--noir       { background-color: var(--hist-g900); }
.hist-section--gris-fonce { background-color: var(--hist-g800); }

/* Conteneur texte étroit centré */
.hist-container-narrow {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: var(--padding-conteneur);
}


/* ================================================================
   1. HERO — fond noir, titre blanc monumental
================================================================ */

.hist-hero {
  position: relative;
  background-color: var(--hist-noir);
  padding-block: clamp(5rem, 14vw, 11rem);
  overflow: hidden;
  text-align: center;
}

/* Image de fond optionnelle (featured image) */
.hist-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  transition: transform 10s ease;
}
.hist-hero--has-image .hist-hero__bg { opacity: 0.3; }

/* Overlay multi-couche */
.hist-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,8,8,0.55)  0%,
    rgba(8,8,8,0.7)   40%,
    rgba(8,8,8,0.92) 100%
  );
}

/* Grain subtil */
.hist-hero__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px;
}

/* Fondu bas vers section suivante */

.hist-hero__inner {
  position: relative;
  z-index: 1;
  animation: hist-fade-in-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hist-hero__title {
  font-family: var(--police-titre);
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 6.5rem);
  letter-spacing: 0.08em;
  color: var(--hist-blanc);
  line-height: 1.05;
  margin-bottom: 2rem;
}

.hist-hero__separator {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hist-or) 30%, var(--hist-or) 70%, transparent);
  margin: 0 auto;
}


/* ================================================================
   2. SECTION TRADITION — témoignage principal
================================================================ */

.hist-temoignage-header {
  margin-bottom: 0.5rem;
}

/* Grand guillemet décoratif ouvrant */
.hist-guillemet {
  font-family: var(--police-titre);
  font-size: clamp(5rem, 12vw, 9rem);
  line-height: 0.6;
  color: var(--hist-or);
  opacity: 0.25;
  margin-bottom: 2rem;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Blockquote générique témoignage */
.hist-temoignage-bloc {
  border: none;
  padding: 0;
  margin: 0;
}

.hist-temoignage-para {
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.9;
  color: var(--hist-g700);
  margin-bottom: 1.8rem;
}
.hist-temoignage-para:last-child { margin-bottom: 0; }

/* Version pour fond sombre */
.hist-temoignage-para--sombre {
  color: rgba(255, 255, 255, 0.62);
}

/* Séparateur [  …  ] entre les paragraphes du témoignage */
.hist-temoignage-ellipsis {
  font-family: var(--police-texte);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--hist-or);
  text-align: center;
  display: block;
  margin: 1.8rem 0;
  opacity: 0.75;
}
.hist-temoignage-ellipsis--sombre { color: rgba(196, 163, 90, 0.6); }

/* Titre de section */
.hist-section-titre {
  font-family: var(--police-titre);
  font-weight: 300;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: 0.05em;
  color: var(--hist-g800);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.hist-section-titre--blanc { color: var(--hist-blanc); }

/* Filet doré sous les titres */
.hist-filet {
  width: 40px;
  height: 1px;
  background: var(--hist-or);
  margin-bottom: 2rem;
}
.hist-filet--center { margin-inline: auto; }


/* ================================================================
   2+3. SECTION TRADITION — split texte + slider photos
================================================================ */

.hist-tradition {
  /* hist-section--clair déjà gérée */
}

/* Wrapper intérieur : centré par défaut, split si galerie */
.hist-tradition-inner {
  max-width: 720px;
  margin-inline: auto;
}

.hist-tradition-inner--split {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

/* ─── Slider de photos ─────────────────────────────────────── */

.hist-tradition-slider {
  display: flex;
  flex-direction: column;
}

.hist-slider {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--hist-g200);
}

.hist-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  margin: 0;
}
.hist-slide.is-active {
  opacity: 1;
}

.hist-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.1) brightness(0.95);
  transition: filter 0.55s ease;
}
.hist-tradition-slider:hover .hist-slide.is-active .hist-slide-img {
  filter: grayscale(50%) contrast(1.1) brightness(1);
}

.hist-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.25rem 1.25rem;
  background: linear-gradient(to top, rgba(8,8,8,0.82) 0%, transparent 100%);
  font-family: var(--police-texte);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* Navigation du slider */
.hist-slider-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.hist-slider-btn {
  background: none;
  border: 1px solid rgba(196, 163, 90, 0.4);
  color: var(--hist-g700);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  transition: background 0.28s ease, color 0.28s ease, border-color 0.28s ease;
  flex-shrink: 0;
}
.hist-slider-btn:hover {
  background: var(--hist-or);
  color: var(--hist-noir);
  border-color: var(--hist-or);
}

.hist-slider-dots {
  display: flex;
  gap: 0.45rem;
}

.hist-slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(196, 163, 90, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.28s ease, transform 0.28s ease;
}
.hist-slider-dot.is-active {
  background: var(--hist-or);
  transform: scale(1.25);
}
.hist-slider-dot:hover {
  background: rgba(196, 163, 90, 0.55);
}


/* ================================================================
   4. SECTION TERROIR — split photo / texte
================================================================ */

.hist-terroir {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 560px;
  padding: 0;           /* pas de padding vertical — les colonnes gèrent */
}

.hist-terroir__photo {
  position: relative;
  height: 100%;
  min-height: 480px;
  overflow: hidden;
  background: var(--hist-g200);
}

.hist-terroir__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* Côté texte */
.hist-terroir__texte {
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
}

/* Variante blockquote sans indentation dans la section terroir */
.hist-temoignage-bloc--inline .hist-temoignage-para {
  font-size: clamp(1rem, 1.9vw, 1.2rem);
}

/* Fallback si pas de photo : texte seul centré */
.hist-terroir--no-photo {
  grid-template-columns: 1fr;
}
.hist-terroir--no-photo .hist-terroir__texte {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}
.hist-terroir--no-photo .hist-filet { margin-inline: auto; }


/* ================================================================
   5. SECTION SAVOIR-FAIRE — fond noir, split ou centré
================================================================ */

.hist-savoirfaire {
  position: relative;
  overflow: hidden;
}

/* Grain de fond discret */
.hist-savoirfaire::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px;
}

/* Wrapper intérieur */
.hist-savoirfaire-inner {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Split : texte gauche + photo droite */
.hist-savoirfaire-inner--split {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  text-align: left;
}

.hist-savoirfaire-inner--split .hist-filet--center {
  margin-left: 0;
  margin-right: auto;
}

/* Photo droite */
.hist-savoirfaire-photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.hist-savoirfaire-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(25%);
  transition: filter 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.hist-savoirfaire-photo:hover .hist-savoirfaire-photo-img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

/* Overlay subtil sur la photo */
.hist-savoirfaire-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, transparent 70%, var(--hist-g900) 100%);
  pointer-events: none;
}

/* Fallback : centrage quand pas de photo (ancienne valeur) */
.hist-savoirfaire .hist-container-narrow {
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Grand chiffre décoratif en fond */
.hist-savoirfaire__deco {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hist-savoirfaire__deco::after {
  content: '✦';
  font-size: clamp(12rem, 30vw, 22rem);
  color: rgba(196, 163, 90, 0.03);
  line-height: 1;
  letter-spacing: -0.05em;
}


/* ================================================================
   6. SECTION INVITATION — signature + CTA
================================================================ */

.hist-invitation {
  position: relative;
}

.hist-invitation .hist-container-narrow {
  text-align: center;
}

.hist-aurevoir {
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--hist-blanc);
  letter-spacing: 0.04em;
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.hist-signature {
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--hist-or-pale);
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
  opacity: 0.75;
}

/* Séparateur fin avant le CTA */
.hist-invitation__sep {
  width: 40px;
  height: 1px;
  background: rgba(196, 163, 90, 0.35);
  margin: 2.5rem auto;
}

.hist-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--police-texte);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hist-noir);
  background: var(--hist-or);
  padding: 1rem 2.2rem;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}
.hist-cta:hover {
  background: var(--hist-or-pale);
  color: var(--hist-noir);
}
.hist-cta::after {
  content: '→';
  font-family: serif;
  font-style: normal;
  transition: transform 0.3s ease;
}
.hist-cta:hover::after {
  transform: translateX(4px);
}


/* ================================================================
   ANIMATIONS
================================================================ */

@keyframes hist-fade-in-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hist-hero__inner,
  .reveal { opacity: 1; transform: none; animation: none; transition: none; }
}


/* ================================================================
   RESPONSIVE
================================================================ */

/* ── Tablette ── */
@media (max-width: 900px) {
  /* Sections split → empilement */
  .hist-tradition-inner--split,
  .hist-savoirfaire-inner--split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Slider : aspect-ratio paysage sur tablette */
  .hist-slider {
    aspect-ratio: 4 / 3;
  }

  /* Savoir-faire : recentrer le texte quand empilé */
  .hist-savoirfaire-inner--split {
    text-align: center;
  }
  .hist-savoirfaire-inner--split .hist-filet--center {
    margin-inline: auto;
  }
  .hist-savoirfaire-inner--split .hist-eyebrow {
    display: inline-flex;
  }

  /* Photo savoir-faire : aspect plus court */
  .hist-savoirfaire-photo {
    aspect-ratio: 16 / 9;
    order: -1; /* photo au-dessus du texte sur tablette */
  }
  .hist-savoirfaire-photo::after {
    background: linear-gradient(to bottom, transparent 70%, var(--hist-g900) 100%);
  }

  /* Section terroir : photo au-dessus, texte dessous */
  .hist-terroir {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hist-terroir__photo {
    min-height: 320px;
    height: 320px;
  }
  .hist-terroir__photo::after {
    background: linear-gradient(to bottom, transparent 70%, var(--hist-blanc) 100%);
  }
  .hist-terroir__texte {
    padding: 2.5rem 1.5rem;
  }
}

/* ── Mobile ── */
@media (max-width: 620px) {
  .hist-hero__title {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }
  .hist-slider {
    aspect-ratio: 3 / 4;
    min-height: 320px; /* fallback si aspect-ratio non supporté */
  }
  /* Garantit que les slides non actives sont bien cachées */
  .hist-slide:not(.is-active) {
    visibility: hidden;
  }
}
