/* ==========================================================
   Widget Bloc Histoire
========================================================== */

.we-bh {
  --slide-w: 42vw;
  --peek-pad: 10vw;
  --track-gap: 150px;

  --gap: 0px;
  --radius: 0;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);

  --rail-w: min(900px, 70vw);
  --rail-color: #E5E7EB;
  --bar-color: #0E2E4C;
  --rail-height: 2px;
  --rail-offset-y: 18px;

  --nav-bw: 2px;
  --nav-color: #01234F;
  --nav-bg: transparent;
  --nav-bg-hover: #01234F;
  --nav-icon-hover: #fff;
  --nav-h: 40px;
  --nav-w: 60px;
  --nav-gap: 16px;

  --center-offset: -150px;

  width: 100%;
  max-width: none;
}

/* Viewport / Track */

.we-bh-viewport {
  position: relative;
  overflow: hidden;
  padding-inline: var(--peek-pad);
}

.we-bh-track {
  display: inline-flex;
  gap: var(--track-gap);
  will-change: transform;
}

/* Slides */

.we-bh-slide {
  width: var(--slide-w);
  transition: transform .35s ease, opacity .25s ease, filter .25s ease;
  transform-origin: center;
  opacity: .95;
}

.we-bh-slide.is-active {
  opacity: 1;
}

/* Carte complète : image + texte = un seul bloc */

.we-bh-card,
.we-bh-card--right {
  display: grid;
  align-items: stretch;
  gap: 0;
  grid-template-columns: 50% 50%;
  width: 640px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  border-radius: 0;
  box-sizing: border-box;
}

.we-bh-card--right .we-bh-media {
  order: 1 !important;
}

.we-bh-card--right .we-bh-content {
  order: 2 !important;
}

/* Image */

.we-bh-media {
  width: 100%;
  height: 300px;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: #f2f4f7;
  min-width: 0;
}

.we-bh-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contenu */

.we-bh-content {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 20px;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
}

.we-bh-year {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #0E2E4C;
}

.we-bh-text {
  margin: 0;
  color: #243B53;
}

.we-bh-text p {
  margin: 0 0 .7em;
}

.we-bh-text p:last-child {
  margin-bottom: 0;
}

.we-bh-text ul,
.we-bh-text ol {
  margin: .7em 0;
  padding-left: 1.2em;
}

.we-bh-text strong,
.we-bh-text b {
  font-weight: 700;
}

.we-bh-text em,
.we-bh-text i {
  font-style: italic;
}

.we-bh-text a {
  color: inherit;
  text-decoration: underline;
}

/* Frise */

.we-bh-bottom {
  position: relative;
  display: grid;
  grid-template-columns: 1fr var(--rail-w) 1fr;
  align-items: start;
  margin-top: clamp(20px, 2.4vw, 32px);
}

.we-bh-timeline {
  grid-column: 2;
  width: var(--rail-w);
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 80px;
  padding: var(--rail-offset-y) 0 0;
  margin: 0 auto;
  position: relative;

  overflow-x: auto;
  overflow-y: visible;

  --progress-left: 0px;
  --progress-width: 0px;
}

.we-bh-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--rail-height);
  background: var(--rail-color);
  border-radius: var(--rail-height);
  pointer-events: none;
  z-index: 0;
}

.we-bh-timeline::after {
  content: "";
  position: absolute;
  top: 0;
  left: var(--progress-left, 0px);
  width: var(--progress-width, 0px);
  height: var(--rail-height);
  background: var(--bar-color);
  border-radius: var(--rail-height);
  pointer-events: none;
  z-index: 1;
}

.we-bh-timeline li {
  list-style: none;
  margin-top: 6px;
  padding-top: calc(6px + var(--rail-height));
  color: #64748B;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
}

.we-bh-timeline li.is-active {
  color: #0E2E4C;
}

.we-bh-timeline::-webkit-scrollbar {
  display: none;
}

/* Flèches */

.we-bh-prev,
.we-bh-next {
  position: absolute;
  right: 0;
  top: calc(
    var(--rail-offset-y)
    - (var(--nav-h) / 2)
    + (var(--rail-height) / 2)
  );

  width: var(--nav-w);
  height: var(--nav-h);
  border-radius: 999px;
  border: var(--nav-bw) solid var(--nav-color);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nav-color);
  font-size: 16px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .1s ease, border-color .25s ease;
  padding: 0;
  z-index: 2;
  margin-right: 20px;
}

.we-bh-prev {
  right: calc(var(--nav-w) + var(--nav-gap));
}

.we-bh-nav:hover {
  background: var(--nav-bg-hover);
  color: var(--nav-icon-hover);
}

.we-bh-nav:active {
  transform: scale(.98);
}

.we-bh-nav .we-bh-ico {
  display: inline-block;
  line-height: 1;
}

.we-bh.has-prev-svg .we-bh-prev .we-bh-ico,
.we-bh.has-next-svg .we-bh-next .we-bh-ico {
  width: var(--we-bh-arrow-size, 24px);
  height: var(--we-bh-arrow-size, 24px);
  text-indent: -9999px;
  background: var(--we-bh-arrow-color, currentColor);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.we-bh.has-prev-svg .we-bh-prev .we-bh-ico {
  -webkit-mask-image: var(--we-bh-arrow-prev, none);
  mask-image: var(--we-bh-arrow-prev, none);
}

.we-bh.has-next-svg .we-bh-next .we-bh-ico {
  -webkit-mask-image: var(--we-bh-arrow-next, none);
  mask-image: var(--we-bh-arrow-next, none);
}

/* Mobile */

@media (max-width: 900px) {
  .we-bh {
    --slide-w: 98vw;
    --peek-pad: 2vw;
    --track-gap: 16px;
    --center-offset: 0px;
    --rail-w: min(520px, 86vw);
    --nav-w: 46px;
    --nav-h: 46px;
  }

  .we-bh-bottom {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
  }

  .we-bh-prev,
  .we-bh-next {
    position: static;
    order: 2;
    margin-left: 0;
    margin-right: 0;
    width: var(--nav-w);
    height: var(--nav-h);
    border-radius: 50%;
    font-size: 18px;
    align-self: center;
    top: 0;
  }

  .we-bh-timeline {
    order: 1;
    width: var(--rail-w);
    max-width: 100%;
    gap: 28px;
    font-size: 14px;
    margin-top: 12px;
    margin-bottom: 48px;
  }

  .we-bh-card,
  .we-bh-card--right {
    grid-template-columns: 1fr !important;
    width: 250px;
    max-width: 100%;
    justify-items: stretch;
  }

  .we-bh-media {
    width: 100% !important;
    height: 130px !important;
    margin-inline: auto;
  }

  .we-bh-content {
    width: 100% !important;
    max-width: none !important;
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .we-bh {
    --slide-w: 96vw;
  }

  .we-bh-timeline {
    max-width: 480px;
    gap: 20px;
    font-size: 13px;
  }

  .we-bh-nav {
    width: var(--nav-w);
    font-size: 17px;
  }
}