@font-face {
  font-family: "Excalifont";
  src: url("../fonts/Excalifont-Regular.ttf?v=1792340597") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --fond: #ffffff;
  --encre: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #121212;
    --encre: #f0f0f0;
  }
}

:root[data-theme="dark"] {
  --fond: #121212;
  --encre: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bouton-menu img,
  :root:not([data-theme="light"]) .lien-instagram img,
  :root:not([data-theme="light"]) .lien-rss img,
  :root:not([data-theme="light"]) .fleche-gauche img,
  :root:not([data-theme="light"]) .fleche-droite img,
  :root:not([data-theme="light"]) .marqueur-fragment-actuel,
  :root:not([data-theme="light"]) .bouton-theme img {
    filter: invert(1);
  }
}

:root[data-theme="dark"] .bouton-menu img,
:root[data-theme="dark"] .lien-instagram img,
:root[data-theme="dark"] .lien-rss img,
:root[data-theme="dark"] .fleche-gauche img,
:root[data-theme="dark"] .fleche-droite img,
:root[data-theme="dark"] .marqueur-fragment-actuel,
:root[data-theme="dark"] .bouton-theme img {
  filter: invert(1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.fragment {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#titre {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: var(--fond);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#titre.masque {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.sans-titre #titre {
  display: none;
}

.fragment--page {
  justify-content: center;
  gap: 1.5rem;
}

h1 {
  font-family: "Excalifont", sans-serif;
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: normal;
  line-height: 1.2;
  text-align: center;
  padding: 0 1rem;
  margin: 0;
}

.bouton-commencer {
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  margin-top: 1.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  background: var(--encre);
  color: var(--fond);
  cursor: pointer;
}

.bouton-commencer:hover {
  opacity: 0.85;
}

.bouton-secondaire {
  font-family: "Excalifont", sans-serif;
  font-size: 0.95rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.8rem;
  border: none;
  background: none;
  color: var(--encre);
  text-decoration: underline;
  cursor: pointer;
}

.bouton-secondaire:hover {
  opacity: 0.7;
}

.fleche-gauche,
.fleche-droite {
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.fleche-gauche img,
.fleche-droite img {
  display: block;
  width: 25px;
  height: auto;
}

.fleche-gauche {
  transform: rotate(180deg);
}

.fleche-gauche:disabled,
.fleche-droite:disabled {
  opacity: 0.3;
  cursor: default;
}

.pages-horizontales {
  width: 100%;
  padding: 0 max(2rem, calc(50% - 300px));
}

.pages-horizontales .swiper-wrapper {
  align-items: center;
}

.pages-horizontales .swiper-slide {
  width: auto;
  height: auto;
  position: relative;
}

.pages-horizontales .swiper-slide > img {
  display: block;
  width: min(600px, 90vw, 75dvh);
  height: min(600px, 90vw, 75dvh);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

@media (max-width: 600px) {
  .pages-horizontales {
    padding: 0;
  }

  .pages-horizontales .swiper-slide > img {
    width: min(100vw, 75dvh);
    height: min(100vw, 75dvh);
  }
}

.pages-horizontales .swiper-slide-active > img {
  cursor: default;
}

.pages-horizontales .swiper-slide:not(.swiper-slide-active) > img {
  opacity: 0.35;
}

.pages-horizontales .swiper-slide-active > img[data-cases="4"] {
  cursor: zoom-in;
}

@keyframes pulse-zoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.pulse-zoom-case {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background-size: 200% 200%;
  background-position: 0 0;
  pointer-events: none;
  animation: pulse-zoom 650ms ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-zoom-case {
    animation: none;
  }
}

.indice-zoom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 1.25rem 1.5rem;
  background: var(--encre);
  color: var(--fond);
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  transform: translateY(100%);
  pointer-events: none;
  transition: transform 0.4s ease;
}

.indice-zoom-texte {
  margin: 0;
}

.indice-zoom-ok {
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: var(--fond);
  color: var(--encre);
  cursor: pointer;
}

.indice-zoom.visible {
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .indice-zoom {
    transition-duration: 1ms;
  }
}

.zoom-case {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 280ms ease-out,
    background-color 280ms ease-out;
}

.zoom-case.ouvert {
  opacity: 1;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: auto;
}

.zoom-case-cadre {
  width: min(84vw, 84vh);
  height: min(84vw, 84vh);
  overflow: visible;
  position: relative;
  transform: scale(0.01);
  transform-origin: var(--zoom-origin-x, 50%) var(--zoom-origin-y, 50%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.zoom-case.ouvert .zoom-case-cadre {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .zoom-case,
  .zoom-case-cadre {
    transition-duration: 1ms;
  }
}

.zoom-case .swiper-slide {
  position: relative;
  overflow: hidden;
}

.zoom-case .swiper-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  max-width: none;
  max-height: none;
}

.zoom-case .swiper-slide:nth-child(2) img,
.zoom-case .swiper-slide:nth-child(4) img {
  transform: translateX(-50%);
}

.zoom-case .swiper-slide:nth-child(3) img {
  transform: translateY(-50%);
}

.zoom-case .swiper-slide:nth-child(4) img {
  transform: translate(-50%, -50%);
}

.navigation-zoom-case {
  position: absolute;
  left: 50%;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: #fff;
}

.navigation-zoom-case button {
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.navigation-zoom-case img {
  display: block;
  width: 25px;
  height: auto;
  filter: invert(1);
}

.zoom-case-precedente {
  transform: rotate(180deg);
}

.navigation-zoom-case button:disabled {
  opacity: 0.3;
  cursor: default;
}

.zoom-case-points {
  min-width: 3ch;
  font-family: "Excalifont", sans-serif;
  font-size: 1rem;
  text-align: center;
}

.navigation-carrousel {
  position: fixed;
  left: 50%;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.points {
  min-width: 1.5ch;
  font-family: "Excalifont", sans-serif;
  font-size: 1rem;
  text-align: center;
  color: var(--encre);
}

.bouton-menu {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 30;
  display: none;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

body.hors-titre .bouton-menu {
  display: block;
}

.bouton-menu img {
  display: block;
  width: 32px;
  height: auto;
}

.fond-menu {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.panneau-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 25;
  width: min(320px, 80vw);
  background: var(--fond);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  align-items: flex-start;
  padding: 4.5rem 2rem 2rem;
  overflow-y: auto;
}

body.menu-ouvert .fond-menu {
  opacity: 1;
  pointer-events: auto;
}

body.menu-ouvert .panneau-menu {
  transform: translateX(0);
}

.credits {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bouton-theme {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.bouton-theme img {
  display: block;
  width: 28px;
  height: auto;
}

.panneau-menu p {
  font-family: "Excalifont", sans-serif;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}

.panneau-menu p strong {
  font-size: 1.25rem;
}

.navigation-fragments {
  width: 100%;
}

.navigation-fragments h3 {
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.liste-fragments {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.liste-fragments button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  font-family: "Excalifont", sans-serif;
  font-size: 1rem;
  padding: 0.25rem 0;
  border: none;
  background: none;
  color: var(--encre);
  cursor: pointer;
}

.liste-fragments .marqueur-fragment-actuel {
  display: block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.liste-fragments .texte-fragment {
  display: flex;
  flex-direction: column;
}

.liste-fragments .date-fragment {
  font-size: 0.8rem;
  opacity: 0.65;
}

.liste-fragments button:hover {
  text-decoration: underline;
}

.liens-sociaux {
  display: flex;
  gap: 1rem;
}

.lien-instagram,
.lien-rss {
  display: block;
  width: 40px;
}

.lien-instagram img,
.lien-rss img {
  display: block;
  width: 100%;
  height: auto;
}

.formulaire-newsletter {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.mention-licence a {
  color: var(--encre);
  text-decoration: underline;
}

.formulaire-newsletter input[type="email"],
.formulaire-newsletter input[type="text"] {
  font-family: "Excalifont", sans-serif;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--encre);
  border-radius: 4px;
  background: var(--fond);
  color: var(--encre);
}

.case-liste {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.formulaire-newsletter button {
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 4px;
  background: var(--encre);
  color: var(--fond);
  cursor: pointer;
}

.formulaire-newsletter button:hover {
  opacity: 0.85;
}

@media (max-width: 600px) {
  .fleche-gauche,
  .fleche-droite {
    padding: 0.75rem;
  }

  .fleche-gauche img,
  .fleche-droite img {
    width: 34px;
  }

  .points {
    font-size: 1.2rem;
  }

  .bouton-menu {
    padding: 0.6rem;
    top: 1.2rem;
    left: 1.2rem;
  }

  .bouton-menu img {
    width: 40px;
  }

  .liste-fragments button {
    padding: 0.5rem 0;
  }
}

.banniere-newsletter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 1.25rem 1.5rem;
  background: var(--encre);
  color: var(--fond);
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.banniere-newsletter[hidden] {
  display: none;
}

.banniere-newsletter.visible {
  transform: translateY(0);
}

.banniere-newsletter-texte {
  margin: 0;
}

.banniere-newsletter-actions {
  display: flex;
  gap: 0.75rem;
}

.banniere-newsletter-actions button {
  font-family: "Excalifont", sans-serif;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background: var(--fond);
  color: var(--encre);
  cursor: pointer;
}

.modale-newsletter {
  position: fixed;
  width: min(28rem, calc(100% - 2rem));
  padding: 1.5rem;
  border: 1px solid var(--encre);
  border-radius: 6px;
  background: var(--fond);
  color: var(--encre);
  font-family: "Excalifont", sans-serif;
}

.modale-newsletter-fermer {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  border: none;
  background: none;
  color: var(--encre);
  font-family: "Excalifont", sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modale-newsletter::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.modale-newsletter h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: normal;
}

.modale-newsletter-message {
  margin: 0.75rem 0 0;
}

.modale-newsletter-message:empty {
  display: none;
}

.modale-newsletter.envoye .formulaire-modale {
  display: none;
}

@media (max-width: 600px) {
  .indice-zoom,
  .banniere-newsletter {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .banniere-newsletter {
    transition: none;
  }
}
