/* Page Histoire & légendes — fond, héros, sommaire repliable, sections */

.page-legendes {
  background-color: #121410;
  background-image:
    radial-gradient(ellipse 85% 45% at 75% -5%, rgba(80, 110, 60, 0.14), transparent 42%),
    radial-gradient(ellipse 50% 35% at 5% 55%, rgba(38, 48, 32, 0.22), transparent 45%),
    radial-gradient(ellipse 40% 30% at 100% 80%, rgba(30, 42, 28, 0.18), transparent 40%);
}

/* ——— Héros ——— */

.leg-hero {
  text-align: center;
  padding: clamp(1.85rem, 4.5vw, 2.85rem) min(1.75rem, 4vw) clamp(1.5rem, 3vw, 2.1rem);
  background: linear-gradient(168deg, #22261e 0%, #1a1d17 48%, #141612 100%);
  border-bottom: 1px solid rgba(167, 224, 122, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 10px 36px rgba(0, 0, 0, 0.32);
}

.leg-hero__eyebrow {
  margin: 0 0 0.45rem;
  font-size: clamp(0.72rem, 0.5vw + 0.55rem, 0.88rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(167, 224, 122, 0.88);
}

.leg-hero__title {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 2vw + 1rem, 2.25rem);
  font-weight: normal;
  line-height: 1.2;
  color: #f4f7e8;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.38);
}

.leg-hero__subtitle {
  margin: 0 auto;
  max-width: 34rem;
  font-size: clamp(0.92rem, 0.35vw + 0.82rem, 1.02rem);
  line-height: 1.55;
  color: rgba(220, 228, 200, 0.78);
}

/* ——— Sommaire repliable (peu de place à l’état replié) ——— */

.leg-toc {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.55rem min(1.25rem, 3vw) 0.65rem;
}

.leg-toc__details {
  border-radius: 10px;
  border: 1px solid rgba(167, 224, 122, 0.12);
  background: rgba(22, 24, 20, 0.75);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: clip;
}

.leg-toc__summary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.55rem 0.85rem 0.55rem 0.65rem;
  cursor: pointer;
  color: #dce6c8;
  user-select: none;
  transition: background 0.15s ease;
}

.leg-toc__summary::-webkit-details-marker {
  display: none;
}

.leg-toc__summary::marker {
  content: "";
}

.leg-toc__summary:hover {
  background: rgba(167, 224, 122, 0.06);
}

.leg-toc__summary:focus-visible {
  outline: 2px solid rgba(167, 224, 122, 0.55);
  outline-offset: -2px;
}

.leg-toc__summary-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 0.15rem 0 0.25rem;
  border-right: 2px solid rgba(167, 224, 122, 0.75);
  border-bottom: 2px solid rgba(167, 224, 122, 0.75);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.leg-toc__details[open] .leg-toc__summary-chevron {
  transform: rotate(45deg);
  margin-top: -0.1rem;
}

.leg-toc__summary-title {
  font-size: 0.82rem;
  font-weight: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(181, 212, 131, 0.92);
}

.leg-toc__summary-hint {
  font-size: 0.78rem;
  color: rgba(200, 210, 180, 0.55);
  flex: 1 1 auto;
  text-align: right;
  min-width: 12rem;
}

@media (max-width: 520px) {
  .leg-toc__summary-hint {
    text-align: left;
    width: 100%;
    min-width: 0;
  }
}

.leg-toc__panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid rgba(167, 224, 122, 0.08);
  background: rgba(0, 0, 0, 0.15);
  max-height: min(42vh, 14rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.leg-toc__chip {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #c8d9a8;
  background: rgba(40, 44, 36, 0.9);
  border: 1px solid rgba(167, 224, 122, 0.14);
  border-radius: 999px;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.leg-toc__chip:hover {
  color: #f0f6e4;
  background: rgba(55, 62, 48, 0.95);
  border-color: rgba(167, 224, 122, 0.28);
  box-shadow: 0 0 0 1px rgba(167, 224, 122, 0.08);
}

.leg-toc__chip:focus-visible {
  outline: 2px solid rgba(167, 224, 122, 0.5);
  outline-offset: 2px;
}

/* ——— Contenu ——— */

.leg-main {
  padding: 0 min(1.35rem, 3.5vw) 3.25rem;
}

.leg-main > .verse-ornament:first-of-type {
  margin-top: 0.15rem;
}

.leg-main > .verse-epigraph {
  margin-bottom: 2.35rem;
}

.leg-section {
  scroll-margin-top: 5.5rem;
}

.leg-section:not(:first-of-type) {
  margin-top: 2.75rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(167, 224, 122, 0.07);
}

.leg-section__title {
  position: relative;
  margin: 0 auto 1.35rem;
  max-width: min(44rem, 94vw);
  padding-bottom: 0.85rem;
  font-size: clamp(1.12rem, 0.85vw + 0.82rem, 1.42rem);
  font-weight: normal;
  text-align: center;
  color: #eef2e4;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.leg-section__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(6rem, 40%);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 224, 122, 0.45) 35%,
    rgba(167, 224, 122, 0.25) 100%
  );
}

/* Bandeaux de section */
.page-legendes .banner-section {
  border-radius: 10px;
  border: 1px solid rgba(228, 236, 204, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

h2.banner-title {
  margin: 2rem auto 1rem;
  font-weight: normal;
}

/* Blocs de texte type « parchemin » */
.page-legendes .mia-style {
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  max-width: min(52rem, 96vw);
  padding: 1.15rem 1.25rem 1.25rem;
  background: linear-gradient(165deg, rgba(34, 36, 32, 0.92) 0%, rgba(26, 28, 24, 0.88) 100%);
  border-radius: 8px;
  border: 1px solid rgba(228, 236, 204, 0.07);
  border-left: 3px solid rgba(167, 224, 122, 0.28);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
}

.page-legendes .mia-style + .mia-style {
  margin-top: 0.85rem;
}

.page-legendes .image-block {
  border-radius: 8px;
  border: 1px solid rgba(228, 236, 204, 0.12);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.35);
}
