
/* ========================================
   CONFIGURATION GENERALE
======================================== */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
}

body {
  background-image: url("landscape.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  user-select: none;
  -webkit-user-select: none;
}

* {
  box-sizing: border-box;
}

/* ========================================
   GALERIE PRINCIPALE
======================================== */

.gallery-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.9);
}

/* ========================================
   ZONE DE LA PHOTO PRINCIPALE
======================================== */

.upper-container {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.upper-component {
  float: none;
  height: 100%;
}

/* Bouton de fermeture */

.close {
  position: fixed;
  z-index: 100;
  top: 2vh;
  right: 3vw;
  color: rgb(180, 180, 180);
  cursor: pointer;
  font-size: 28px;
  text-decoration: none;
  transition: color 0.3s, font-size 0.3s;
}

.close:hover {
  color: white;
  font-size: 36px;
}

/* ========================================
   FLECHES DE NAVIGATION
======================================== */

.previous-container,
.next-container {
  flex: 0 0 8%;
  width: 8%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.previous-button,
.next-button {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(160, 160, 160);
  cursor: pointer;
  font-size: 42px;
  text-decoration: none;
  transition: color 0.3s, font-size 0.3s;
}

.previous-button:hover,
.next-button:hover {
  color: white;
  font-size: 54px;
}

/* ========================================
   PHOTO PRINCIPALE
======================================== */

.slides-container {
  position: relative;
  flex: 1 1 auto;
  width: 84%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.slide-component {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.slide-component img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Nettoyage */

.clearing-component {
  display: none;
}

/* ========================================
   ZONE INFERIEURE
======================================== */

.lower-container {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  padding: 0;
  background-color: #000;
}

/* ========================================
   LEGENDE
======================================== */

.caption-container {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 4px 10px;
  color: white;
  font-family: "Century Gothic", CenturyGothic, sans-serif;
  font-size: calc(2.75vh - 2pt);
  line-height: 1.2;
  text-align: center;
  border: none;
  background-color: #000;
}

.caption-container p {
  margin: 0;
  padding: 0;
}

/* ========================================
   MINIATURES ET BARRE DE DEFILEMENT
======================================== */

.thumbnails-container {
  flex: 0 0 85px;
  width: 100%;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 5px 10px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  background-color: #000;

  /* Firefox */
  scrollbar-width: auto;
  scrollbar-color: #999 #292929;
}

/* Barre de defilement : Chrome, Edge et Safari */

.thumbnails-container::-webkit-scrollbar {
  height: 9px;
}

.thumbnails-container::-webkit-scrollbar-track {
  background: #292929;
  border-radius: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

/* Dimensions des miniatures */

.thumbnail-component {
  flex: 0 0 80px;
  width: 80px;
  height: 55px;
  margin: 0;
  padding: 0;
}

.thumbnail {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  object-fit: contain;
  border: none;
  transition: opacity 0.3s;
}

.thumbnail:hover,
.thumbnail.active,
.active {
  opacity: 1;
}

/* ========================================
   ANIMATION DES PHOTOS
======================================== */

.fade {
  animation-name: fade;
  animation-duration: 0.5s;
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ========================================
   PETITS ECRANS
======================================== */

@media (max-width: 600px) {
  .previous-container,
  .next-container {
    flex-basis: 10%;
    width: 10%;
  }

  .slides-container {
    width: 80%;
  }

  .previous-button,
  .next-button {
    font-size: 28px;
  }

  .thumbnail-component {
    flex-basis: 65px;
    width: 65px;
    height: 45px;
  }

  .thumbnails-container {
    flex-basis: 75px;
    height: 75px;
    justify-content: flex-start;
    padding-bottom: 12px;
  }

  .caption-container {
    font-size: 14px;
  }

  .slide-component img {
    max-width: 100%;
    max-height: 100%;
  }
}
