/* Section Notre Histoire — timeline éditoriale */

.histoire {
  --histoire-cream: #faf7f2;
  --histoire-ink: #1c2a2a;
  --histoire-muted: #5c6d6d;
  --histoire-teal: #2f7b78;
  --histoire-teal-soft: rgba(47, 123, 120, 0.12);
  --histoire-gold: #c4a962;
  --histoire-card: #ffffff;
  --histoire-shadow: 0 18px 50px rgba(28, 42, 42, 0.08);
  --histoire-radius: 14px;
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--histoire-ink);
  background: var(--histoire-cream);
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}

.histoire::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(47, 123, 120, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 60%, rgba(196, 169, 98, 0.06), transparent 50%);
  pointer-events: none;
}

.histoire__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  position: relative;
  z-index: 1;
}

.histoire__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(3rem, 6vw, 4.5rem);
}

.histoire__eyebrow {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--histoire-teal);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.histoire__title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--histoire-ink);
}

.histoire__lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--histoire-muted);
  font-weight: 400;
}

/* Timeline spine */
.histoire__timeline {
  position: relative;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  background: linear-gradient(
    180deg,
    var(--histoire-teal-soft) 0%,
    var(--histoire-teal) 12%,
    var(--histoire-teal) 88%,
    var(--histoire-teal-soft) 100%
  );
  border-radius: 3px;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  min-height: 1px;
}

/* Scroll reveal (activé par js/fgg.js) */
.timeline__item.js-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline__item.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .timeline__item.js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  background: var(--histoire-card);
  border: 3px solid var(--histoire-teal);
  box-shadow: 0 4px 20px rgba(47, 123, 120, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 0.66rem;
  line-height: 1.1;
  text-align: center;
  color: var(--histoire-teal);
  padding: 0.35rem;
  cursor: default;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.25s ease;
}

.timeline__marker:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 10px 32px rgba(47, 123, 120, 0.35);
  border-color: var(--histoire-gold);
}

.timeline__marker--wide {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.timeline__card {
  background: var(--histoire-card);
  border-radius: var(--histoire-radius);
  box-shadow: var(--histoire-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  min-height: 230px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  border: 1px solid rgba(47, 123, 120, 0.08);
  position: relative;
}

.timeline__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(28, 42, 42, 0.12);
}

.timeline__figure {
  margin: 0;
  position: relative;
  flex: 0 0 44%;
  min-height: 230px;
  background: linear-gradient(145deg, var(--histoire-teal-soft), #e8e4dc);
}

.timeline__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 200px;
}

.timeline__figure--nofile img {
  display: none;
}

.timeline__figure--nofile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
}

.timeline__figure--nofile::before {
  content: "";
  width: 58px;
  height: 58px;
  background: rgba(47, 123, 120, 0.1);
  border: 1px solid rgba(47, 123, 120, 0.25);
  border-radius: 16px;
  opacity: 1;
}

.timeline__figure-placeholder {
  display: none;
  font-size: 0.78rem;
  color: var(--histoire-muted);
  max-width: 200px;
  line-height: 1.4;
}

.timeline__figure--nofile .timeline__figure-placeholder {
  display: block;
}

.timeline__figure-placeholder code {
  font-size: 0.72em;
  background: rgba(47, 123, 120, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.timeline__content {
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.85rem);
  position: relative;
}

.timeline__content::before {
  display: none; /* filigrane trop visible -> retiré */
}

.timeline__step-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--histoire-gold);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.timeline__heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.85rem;
  color: var(--histoire-ink);
}

.timeline__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--histoire-muted);
}

/* Alternance gauche / droite */
.timeline__item--left .timeline__card {
  grid-column: 1;
  flex-direction: row-reverse; /* alternance propre via flex */
}

.timeline__item--left .timeline__figure {
  order: 0; /* neutraliser l'ancien order */
}

.timeline__item--left .timeline__content {
  order: 0; /* neutraliser l'ancien order */
}

.timeline__item--right .timeline__card {
  grid-column: 2;
}

/* Sans année watermark pour certains blocs */
.timeline__content[data-year=""]::before {
  display: none;
}

/* Mobile */
@media (max-width: 900px) {
  .timeline::before {
    left: 1.25rem;
    margin-left: 0;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    padding-left: 3.25rem;
  }

  .timeline__marker {
    left: 1.25rem;
    transform: translate(-50%, -50%);
  }

  .timeline__item--left .timeline__card,
  .timeline__item--right .timeline__card {
    grid-column: 1;
    flex-direction: column;
  }

  .timeline__item--left .timeline__figure,
  .timeline__item--right .timeline__figure {
    flex: 0 0 auto;
    min-height: 180px;
  }

  .timeline__item--left .timeline__content {
    order: 0;
  }

  .timeline__content::before {
    font-size: 3rem;
    top: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline__card {
    transition: none;
  }
  .timeline__card:hover {
    transform: none;
  }
}
