html:has(.visionneuse[open]) {
  overflow: hidden;
}

.visionneuse {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background-color: rgba(8, 20, 43, 0.85);
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.3s ease, overlay 0.3s ease allow-discrete, display 0.3s ease allow-discrete;
}

.visionneuse[open] {
  display: block;
  opacity: 1;
}

.visionneuse::backdrop {
  background-color: transparent;
}

.visionneuse .visionneuse__bande {
  transform: scale(0.98);
  transition: transform 0.3s ease;
}

.visionneuse[open] .visionneuse__bande {
  transform: none;
}

@starting-style {
  .visionneuse[open] {
    opacity: 0;
  }

  .visionneuse[open] .visionneuse__bande {
    transform: scale(0.98);
  }
}

.visionneuse__bande {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.visionneuse__bande::-webkit-scrollbar {
  display: none;
}

.visionneuse__bande:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -3px;
}

.visionneuse__diapo {
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: 88px 160px 90px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.visionneuse__cadre {
  --hauteur: max(160px, calc(100dvh - 300px));
  position: relative;
  display: block;
  width: min(100%, calc(var(--hauteur) * var(--proportions)));
  aspect-ratio: var(--proportions);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.06);
}

.visionneuse__image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  user-select: none;
}

.visionneuse__cadre[data-chargement]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  animation: visionneuse-chargement 0.9s linear infinite, visionneuse-apparition 0.2s ease 0.3s forwards;
}

@keyframes visionneuse-chargement {
  to {
    rotate: 360deg;
  }
}

@keyframes visionneuse-apparition {
  to {
    opacity: 1;
  }
}

.visionneuse__legende {
  max-width: 640px;
  margin-top: 20px;
  text-align: center;
}

.visionneuse__description {
  display: block;
  font-size: 1rem;
  line-height: 1.55;
}

.visionneuse__lieu {
  display: block;
  margin-top: 6px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #c5cfe2;
}

.visionneuse__points {
  position: absolute;
  top: calc(100% - 56px);
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 12px;
  pointer-events: none;
  transition: top 0.2s ease;
}

.visionneuse__point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.55);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

.visionneuse__point--courant {
  width: 10px;
  height: 10px;
  background-color: #ffffff;
}

.visionneuse__point--petit {
  width: 6px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.45);
}

.visionneuse__point--minuscule {
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.35);
}

.visionneuse__bouton {
  position: absolute;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background-color: rgba(23, 65, 149, 0.9);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.visionneuse__bouton svg {
  width: 24px;
  height: 24px;
}

.visionneuse__bouton:hover {
  border-color: #ffffff;
  background-color: #5b7a00;
}

.visionneuse__bouton:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.visionneuse__fermer {
  top: 28px;
  right: 32px;
}

.visionneuse__fleche {
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -28px;
}

.visionneuse__fleche svg {
  width: 26px;
  height: 26px;
}

.visionneuse__precedente {
  left: 48px;
}

.visionneuse__suivante {
  right: 48px;
}

@media (hover: hover) and (pointer: fine) {
  .visionneuse__fleche {
    opacity: 0;
  }

  .visionneuse:hover .visionneuse__fleche,
  .visionneuse:has(:focus-visible) .visionneuse__fleche {
    opacity: 1;
  }
}

@media (hover: none), (pointer: coarse) {
  .visionneuse__fleche {
    display: none;
  }
}

@media (max-width: 1150px) {
  .visionneuse__diapo {
    padding: 88px 16px 74px;
  }

  .visionneuse__cadre {
    --hauteur: max(160px, calc(100dvh - 262px));
  }

  .visionneuse__description {
    font-size: 0.9375rem;
  }

  .visionneuse__lieu {
    font-size: 0.8125rem;
  }

  .visionneuse__fermer {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }

  .visionneuse__fleche {
    width: 48px;
    height: 48px;
    margin-top: -24px;
  }

  .visionneuse__precedente {
    left: 16px;
  }

  .visionneuse__suivante {
    right: 16px;
  }
}

@media (max-width: 1150px) and (hover: hover) and (pointer: fine) {
  .visionneuse__diapo {
    padding-inline: 80px;
  }
}
