/* ==========================================================================
   Overlay Histoire — panneau latéral droit
   ========================================================================== */

.overlay-histoire {
  position: fixed;
  top: 0;
  left: 0;
  width: 60vw;
  height: 100vh;
  background: #fff;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5vh 3.5vw;
}

.overlay-histoire.is-open {
  transform: translateX(0);
}

/* Croix de fermeture */
.overlay-histoire__close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  left: auto;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #222221;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.3s, transform 0.3s;
}

.overlay-histoire__close:hover {
  color: #E6105D;
  transform: rotate(90deg);
}

/* Titre */
.overlay-histoire__title {
  font-family: 'Autumn Chant', cursive;
  font-size: clamp(1.2rem, 3vh, 2rem);
  color: #E6105D;
  font-weight: 400;
  margin: 0 0 1.5vh;
  line-height: 1.2;
  flex-shrink: 0;
}

/* Grille 2 colonnes */
.overlay-histoire__grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 2.5vw;
}

/* Séparateur vertical */
.overlay-histoire__grid::before {
  content: '';
  grid-column: 2;
  grid-row: 1;
  background: rgba(0, 0, 0, 0.1);
}

.overlay-histoire__col:first-child {
  grid-column: 1;
}

.overlay-histoire__col:last-child {
  grid-column: 3;
}

/* Paragraphes */
.overlay-histoire__grid p {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.75rem, 1.8vh, 1.05rem);
  line-height: 1.5;
  color: #333;
  margin: 0 0 1.2vh;
}

.overlay-histoire__grid p:last-child {
  margin-bottom: 0;
}

.overlay-histoire__grid em {
  font-style: italic;
  color: #E6105D;
}

/* Backdrop */
.overlay-histoire-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay-histoire-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ──────────────────────────────────────────────
   Accordéon mobile
   ────────────────────────────────────────────── */

.overlay-histoire__mobile {
  display: none;
}

.overlay-histoire__section {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.overlay-histoire__section summary {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(0.95rem, 2.5vh, 1.3rem);
  color: #222221;
  padding: 1.2em 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overlay-histoire__section summary::after {
  content: '+';
  font-size: 1.4em;
  color: #E6105D;
  transition: transform 0.3s;
}

.overlay-histoire__section[open] summary::after {
  content: '−';
}

.overlay-histoire__section summary::-webkit-details-marker {
  display: none;
}

.overlay-histoire__section p {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.8rem, 2vh, 1rem);
  line-height: 1.6;
  color: #333;
  margin: 0 0 1em;
  padding: 0 0 0.5em;
}

/* Responsive */
@media (max-width: 900px) {
  .overlay-histoire__desktop {
    display: none;
  }

  .overlay-histoire__mobile {
    display: block;
  }

  .overlay-histoire {
    width: 95vw;
    padding: 3rem 6vw;
    justify-content: flex-start;
  }
}
