:root {
  --accent: #6a4638;
  --ink: #1f2528;
  --panel: #ffffff;
  --border: rgba(31, 37, 40, 0.14);
  --scene-overlap: clamp(150px, 22vh, 240px);
}

html[data-theme="dark"] {
  --accent: #b58a73;
  --ink: #f1f1f1;
  --panel: #111315;
  --border: rgba(255, 255, 255, 0.14);
}

.publicite1 {
  display: none;
}

.odyssee-slate-page .topnav {
  margin-bottom: 0;
}

.odyssee-slate-page footer {
  margin-top: 0;
}

.odyssee-slate-page #corps.odyssee-slate {
  width: 100%;
  max-width: none;
  margin: 0;
}

html[data-theme="dark"] .odyssee-slate-page {
  background: #070808;
}

.odyssee-map-caption {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  max-width: 680px;
  margin: 1rem auto 0;
  color: #616161;
  font-size: 0.98rem;
  line-height: 1.35;
  text-align: center;
}

.odyssee-map-caption i {
  font-size: 0.92rem;
}

html[data-theme="dark"] .odyssee-map-caption {
  color: #d7d7d7;
}

#episodes-title {
  margin-bottom: 1em;
}

.hero {
  position: relative;
  min-height: clamp(620px, calc(100vh - 118px), 900px);
  display: grid;
  align-items: end;
  margin: 0;
  padding: clamp(54px, 9vh, 100px) clamp(28px, 7vw, 120px) clamp(120px, 20vh, 210px);
  background-image: var(--hero-image);
  background-size: cover;
  background-position: var(--hero-position, center);
}

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.22));
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-position, center);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.hero h1,
.hero h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 980px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 520;
  color: #fff;
}

.odyssee-slate-page #corps .hero h1::after {
  content: none;
  display: none;
}

.hero .hero__number {
  width: clamp(3rem, 4.8vw, 4rem);
  height: clamp(3rem, 4.8vw, 4rem);
  display: inline-grid;
  place-items: center;
  margin: 18px auto 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: #fff;
  font-size: clamp(1.25rem, 1.7vw, 1.55rem);
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.story-block {
  padding: clamp(42px, 6vw, 82px) clamp(26px, 7vw, 110px);
}

.story-block h2,
.story-block h3,
.story-block h4 {
  width: min(900px, 100%);
  max-width: none;
  margin: 48px auto 12px;
  padding: 0;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  color: #4c4c4c;
  font-size: clamp(1.28rem, 1.75vw, 1.6rem);
  font-weight: 620;
  line-height: 1.22;
}

html[data-theme="dark"] .story-block h2,
html[data-theme="dark"] .story-block h3,
html[data-theme="dark"] .story-block h4 {
  color: #f1f1f1;
}

.story-block h2:first-child,
.story-block h3:first-child,
.story-block h4:first-child {
  margin-top: 0;
}

.story-block h2 + p,
.story-block h3 + p,
.story-block h4 + p {
  margin-top: 0;
}

.episode-grid {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.episode-card {
  min-height: 238px;
  border-radius: 8px;
  overflow: hidden;
  background: #ddd;
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.14);
}

html[data-theme="dark"] .episode-card {
  background: #1b1f22;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.episode-card a {
  min-height: 238px;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #fff;
  text-decoration: none;
}

.episode-card a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.72));
}

.episode-card__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-card[data-episode="enfers"] .episode-card__image {
  object-position: 50% 16%;
  transform: scale(1.06);
}

.episode-card[data-episode="circe"] .episode-card__image {
  object-position: 50% 18%;
}

.episode-card[data-episode="cyclope"] .episode-card__image {
  object-position: 50% 26%;
}

.episode-card a,
.episode-card a:visited,
.episode-card__number,
.episode-card__title,
.episode-card__subtitle,
.episode-card__open {
  color: #fff;
}

.episode-card__number {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.episode-card__title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 1.8vw, 1.65rem);
  font-weight: 800;
  line-height: 1.08;
}

.episode-card__subtitle {
  margin-top: 10px;
  padding-right: 30px;
  color: #fff;
}

.episode-card__open {
  position: absolute;
  right: 20px;
  bottom: 18px;
}

.story-block {
  position: relative;
  z-index: 2;
  background: var(--panel);
}

.story-block + .story-block {
  padding-top: clamp(16px, 3vw, 38px);
}

.image-scene + .story-block {
  margin-top: calc(var(--scene-overlap) * -1);
  padding-top: clamp(20px, 3vw, 42px);
}

.story-block__inner {
  max-width: 1040px;
  margin: 0 auto;
}

.story-block p:not(.citation):not(.story-quote) {
  margin: 22px auto 0;
  padding: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.22rem);
  width: min(900px, 100%);
  max-width: none;
}

.story-block ul,
.story-block ol {
  width: min(900px, 100%);
  max-width: none;
  margin: 22px auto 0;
  padding-left: 1.4em;
  font-size: clamp(1.05rem, 1.45vw, 1.22rem);
  line-height: 1.5;
}

.story-block li + li {
  margin-top: 0.45em;
}

html[data-theme="dark"] .story-block p:not(.citation):not(.story-quote),
html[data-theme="dark"] .story-block li {
  color: #d7d7d7;
}

.story-block .story-quote,
.story-block blockquote {
  position: relative;
  width: min(900px, 100%);
  max-width: none;
  margin: 62px auto;
  padding: 0 0 0 clamp(58px, 7vw, 88px);
  border: 0;
  background: transparent;
  color: #403941;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

html[data-theme="dark"] .story-block .story-quote,
html[data-theme="dark"] .story-block blockquote {
  color: #eeeeee;
}

.story-block__inner > .story-quote:first-child {
  margin-top: 0;
}

.story-block:has(> .story-block__inner > .story-quote:last-child):has(+ .image-scene) {
  padding-bottom: clamp(24px, 3vw, 42px);
}

.story-block:has(+ .image-scene) .story-block__inner > .story-quote:last-child {
  margin-bottom: clamp(10px, 1vw, 14px);
}

.story-block .story-quote::before,
.story-block blockquote::before {
  content: "“";
  position: absolute;
  top: -0.08em;
  left: 0;
  color: rgba(106, 70, 56, 0.22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(6rem, 12vw, 9rem);
  line-height: 1;
}

html[data-theme="dark"] .story-block .story-quote::before,
html[data-theme="dark"] .story-block blockquote::before {
  color: rgba(181, 138, 115, 0.34);
}

.story-block img {
  max-width: 100%;
  height: auto;
  margin: 26px 0 0;
  border-radius: 8px;
}

.story-block .tableaux--inline img {
  margin: 26px auto 0;
}

.story-block a:has(img[src*="panneau_enfers.png"]) {
  display: block;
  width: fit-content;
  margin: 16px auto 42px;
}

.story-block a:has(img[src*="panneau_enfers.png"]) img {
  margin-top: 0;
}

.source-status {
  padding: 18px clamp(20px, 6vw, 76px);
  background: #fff8e8;
  color: #5d4a22;
  text-align: center;
  font-weight: 700;
}

html[data-theme="dark"] .source-status {
  background: #1f1b14;
  color: #ead7a8;
}

.image-scene {
  --scene-scale: 1;
  --caption-shift: 0px;
  --scene-height: clamp(1300px, 230vh, 2500px);
  position: relative;
  z-index: 1;
  min-height: var(--scene-height);
  overflow: clip;
  background: #111;
}

.image-scene__sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.image-scene__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-position, center);
  transform: scale(calc(var(--image-scale, 1) * var(--scene-scale)));
  transform-origin: center;
  will-change: transform;
}

.image-scene.is-visible .image-scene__media {
  transform: scale(calc(var(--image-scale, 1) * var(--scene-scale, 1)));
}

.image-scene--plate {
  --scene-scale: 1;
  min-height: auto;
  overflow: visible;
  padding: clamp(42px, 6vw, 82px) clamp(22px, 7vw, 110px);
  background: var(--panel);
}

.image-scene--tight {
  padding-top: clamp(16px, 3vw, 34px);
  padding-bottom: clamp(16px, 3vw, 34px);
}

.image-scene--balanced-spacing {
  padding-top: clamp(24px, 2.5vw, 34px);
  padding-bottom: clamp(24px, 2.5vw, 34px);
}

.story-block:has(+ .image-scene--balanced-spacing) {
  padding-bottom: clamp(24px, 2.5vw, 34px);
}

.image-scene--tight + .story-block {
  padding-top: clamp(16px, 3vw, 34px);
}

.image-scene--balanced-spacing + .story-block {
  padding-top: clamp(24px, 2.5vw, 34px);
}

.image-scene--balanced-spacing + .story-block .story-block__inner > p:first-child {
  margin-top: 0;
}

.image-scene--plate + .story-block {
  margin-top: 0;
}

.image-scene--plate .image-scene__sticky {
  position: static;
  min-height: auto;
  justify-items: center;
  padding: 0;
  background: transparent;
}

.image-scene--plate .image-scene__figure {
  width: fit-content;
  max-width: min(100%, 980px);
  display: grid;
  justify-items: start;
  margin: 0;
}

.image-scene--compact .image-scene__figure {
  max-width: min(100%, 620px);
}

.image-scene--small .image-scene__figure {
  max-width: min(100%, 420px);
  justify-items: center;
}

.image-scene--plate.image-scene--small .image-scene__caption {
  text-align: center;
}

.image-scene--caption-fit .image-scene__figure {
  width: auto;
  max-width: min(100%, 540px);
  justify-items: center;
}

.image-scene--plate .image-scene__media {
  position: relative;
  z-index: 0;
  width: auto;
  height: auto;
  max-width: min(100%, 980px);
  max-height: min(82vh, 780px);
  object-fit: contain;
  border-radius: 8px;
  background: #f7f4ed;
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.12);
  transform: scale(0.985);
}

.image-scene--plate.image-scene--caption-fit .image-scene__media {
  width: min(100%, 540px);
  max-width: min(100%, 540px);
  background: transparent;
  border-radius: 8px;
  box-shadow: none;
}

.image-scene--wide {
  padding-inline: 0;
}

.image-scene--wide .image-scene__figure,
.image-scene--wide .image-scene__media {
  width: 100%;
  max-width: none;
}

.image-scene--wide .image-scene__media,
.image-scene--wide.is-visible .image-scene__media {
  transform: none;
}

.image-scene--no-bg .image-scene__media {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.image-scene--fullwidth {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(42px, 6vw, 82px) 0;
}

.image-scene--fullwidth .image-scene__media {
  display: block;
  max-height: none;
}

html[data-theme="dark"] .image-scene--plate .image-scene__media {
  background: #191919;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .image-scene--no-bg .image-scene__media {
  background: transparent;
  box-shadow: none;
}

.image-scene--compact .image-scene__media {
  max-width: min(100%, 620px);
  max-height: min(72vh, 560px);
}

.image-scene--small .image-scene__media {
  max-width: min(100%, 420px);
  max-height: min(58vh, 420px);
}

.image-scene--portrait-large .image-scene__media {
  max-height: min(110vh, 1120px);
}

.image-scene--plate.image-scene--caption-fit .image-scene__media {
  width: min(100%, 540px);
  height: auto;
  max-width: min(100%, 540px);
  max-height: none;
  border-radius: 8px;
}

.image-pair {
  position: relative;
  z-index: 2;
  padding: clamp(42px, 6vw, 82px) clamp(22px, 7vw, 110px);
  background: var(--panel);
}

.image-pair__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.image-pair__figure {
  margin: 0;
  display: grid;
}

.image-pair__media {
  width: 100%;
  height: 100%;
  max-height: min(72vh, 680px);
  object-fit: contain;
  border-radius: 8px;
  background: #f7f4ed;
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.12);
}

.image-pair--natural .image-pair__inner {
  max-width: 940px;
  align-items: stretch;
}

.image-pair--natural {
  padding-block: clamp(14px, 2vw, 26px);
}

.image-pair--natural .image-pair__figure {
  position: relative;
  height: clamp(260px, 28vw, 340px);
  justify-items: stretch;
  overflow: hidden;
  border-radius: 8px;
}

.image-pair--natural .image-pair__media {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .image-pair__media {
  background: #191919;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .image-pair--natural .image-pair__media {
  background: transparent;
  box-shadow: none;
}

.image-scene--plate .image-scene__caption {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  max-width: none;
  margin: 12px 0 0;
  background: transparent;
  color: #6b7478;
  padding: 0;
  font-size: clamp(0.88rem, 1vw, 0.98rem);
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  opacity: 1;
  transform: none;
  backdrop-filter: none;
}

.image-scene--caption-fit .image-scene__caption {
  box-sizing: border-box;
  width: min(100%, 540px);
  max-width: min(100%, 540px);
  overflow-wrap: break-word;
}

.image-scene--cartouche .image-scene__figure {
  position: relative;
  width: fit-content;
  max-width: min(100%, 980px);
}

.image-scene--wide.image-scene--cartouche .image-scene__figure {
  width: min(100%, 980px);
}

.image-scene--wide.image-scene--cartouche .image-scene__media {
  width: 100%;
}

.image-scene--cartouche .image-scene__caption {
  position: absolute;
  left: clamp(18px, 4vw, 54px);
  bottom: clamp(18px, 4vw, 54px);
  width: auto;
  max-width: min(520px, calc(100% - clamp(36px, 8vw, 108px)));
  margin: 0;
  padding: 14px 18px;
  border-radius: 8px;
  background: rgba(20, 23, 25, 0.68);
  color: #fff;
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] .image-scene--plate .image-scene__caption {
  color: #bfc7c9;
}

html[data-theme="dark"] .image-scene--cartouche .image-scene__caption {
  color: #fff;
}

.image-scene__caption {
  box-sizing: border-box;
  position: absolute;
  top: calc(100vh + 24px);
  left: clamp(28px, 4vw, 68px);
  width: min(560px, calc(100% - 56px));
  max-width: min(560px, calc(100% - 56px));
  margin: 0;
  padding: clamp(22px, 3vw, 34px);
  background: rgba(20, 23, 25, 0.58);
  color: #fff;
  font-size: clamp(1rem, 1.18vw, 1.13rem);
  font-weight: 400;
  line-height: 1.55;
  opacity: 1;
  transform: translate3d(0, var(--caption-shift), 0);
  will-change: transform;
  backdrop-filter: blur(6px);
}

.image-scene__caption--narrow {
  width: min(500px, calc(100% - 56px));
  max-width: min(500px, calc(100% - 56px));
}

.image-scene--caption-right .image-scene__caption {
  right: clamp(28px, 4vw, 68px);
  left: auto;
}

.image-scene--caption-right .image-scene__caption p {
  color: inherit;
}

.image-scene__caption p {
  margin: 0;
  color: inherit;
}

.image-scene__caption p + p {
  margin-top: 0.72em;
}

.image-scene__caption:has(.image-scene__caption-image) {
  width: min(620px, calc(100% - 56px));
  max-width: min(620px, calc(100% - 56px));
  max-height: min(78vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
}

.image-scene__caption-image {
  display: block;
  width: 100vw;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}

.image-scene__caption.is-caption-visible {
  opacity: 1;
}

.image-scene:not(.image-scene--plate) .image-scene__caption.is-caption-visible {
  transform: translate3d(0, var(--caption-shift), 0);
}

.episode-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: clamp(2.5rem, 6vw, 6rem);
  row-gap: 1rem;
  padding: 28px clamp(18px, 5vw, 64px) 42px;
  background: #171c1f;
  margin-bottom: 0;
}

.episode-nav a {
  width: auto;
  max-width: min(360px, 30vw);
  margin: 0;
  padding: 0.8em 0;
  color: #fff;
  text-decoration: none;
}

.episode-nav a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-nav a:first-child {
  justify-self: end;
}

.episode-nav a:nth-child(2) {
  justify-self: center;
}

.episode-nav a:last-child {
  justify-self: start;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

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

.story-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (max-width: 920px) {
  .episode-grid {
    grid-template-columns: 1fr;
  }

  .episode-card,
  .episode-card a {
    min-height: 230px;
  }

  .image-scene + .story-block {
    margin-top: 0;
  }

  .episode-nav {
    grid-template-columns: 1fr;
  }

  .episode-nav a,
  .episode-nav a:last-child {
    max-width: none;
    justify-self: stretch;
    text-align: center;
  }
}

@media (max-width: 700px) {
  .episode-nav span {
    font-size: 0.95rem;
  }

  .hero {
    min-height: 420px;
  }

  /* Sur petit écran, les scènes immersives (object-fit: cover sur 100vh)
     ne montrent qu'une tranche des tableaux : on les affiche entiers. */
  .image-scene:not(.image-scene--plate) {
    min-height: auto;
    overflow: visible;
  }

  .image-scene:not(.image-scene--plate) .image-scene__sticky {
    position: static;
    display: block;
    min-height: auto;
  }

  .image-scene:not(.image-scene--plate) .image-scene__media,
  .image-scene:not(.image-scene--plate).is-visible .image-scene__media {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: none;
  }

  .image-scene:not(.image-scene--plate) .image-scene__caption {
    position: static;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px 16px;
    transform: none;
  }

  .image-scene:not(.image-scene--plate) .image-scene__caption.is-caption-visible {
    transform: none;
  }

  .image-pair__inner {
    grid-template-columns: 1fr;
  }

  .image-pair__media {
    height: auto;
    max-height: none;
  }

  .image-pair--natural .image-pair__figure {
    height: auto;
  }

  .image-pair--natural .image-pair__media {
    position: static;
    height: auto;
    object-fit: contain;
  }

  .image-scene--plate .image-scene__sticky {
    min-height: auto;
    padding: 0;
  }

  .image-scene--plate .image-scene__media {
    max-height: none;
  }

  /* Les très grands portraits restent contenus en hauteur,
     plutôt que d'occuper toute la largeur de l'écran. */
  .image-scene--plate.image-scene--portrait-large .image-scene__media {
    width: auto;
    max-height: min(82vh, 660px);
  }

  .image-scene--plate .image-scene__caption {
    width: 100%;
    margin: 10px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .story-reveal {
    opacity: 1;
    transform: none;
  }

  .image-scene {
    --scene-scale: 1;
    --caption-shift: 0px;
  }
}
