@import url("https://fonts.googleapis.com/css2?family=Italianno&display=swap");

:root {
  --top: 0;
  --name: cascade;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/************************ HEADER ************************/
.header-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

.image-container img {
  position: absolute;
  filter: sepia(100%);
  width: 12%;
  box-shadow: 1px 3px 15px rgba(0, 0, 0, 0.5);
  animation: var(--name) 3.5s ease-in-out forwards;
  animation-delay: var(--delay);
  animation-fill-mode: both;
  opacity: 0;
  transition: 0.5s ease-in-out;
}

.image-container img:hover {
  transform: scale(1.15);
  filter: sepia(0.01);
}

.image-container img:nth-child(1) { --delay: 3.4s; top: 12%; left: 15%; }
.image-container img:nth-child(2) { --delay: 3.2s; top: 10%; left: 32%; width: 15%; z-index: 2; }
.image-container img:nth-child(3) { --delay: 0.6s; top: 5%; left: 60%; }
.image-container img:nth-child(4) { --delay: 1.6s; top: 43%; left: 20%; width: 15%; z-index: 1; }
.image-container img:nth-child(5) { --delay: 1.5s; top: 25%; left: 41%; width: 11%; z-index: 1; }
.image-container img:nth-child(6) { --delay: 3.5s; top: 35%; left: 66%; width: 15%; z-index: 1; }
.image-container img:nth-child(7) { --delay: 0.5s; bottom: 5%; left: 28%; z-index: 0; }
.image-container img:nth-child(8) { --delay: 1.4s; bottom: 4%; left: 47%; width: 11%; }
.image-container img:nth-child(9) { --delay: 0.7s; bottom: 32%; left: 53%; width: 14%; }
.image-container img:nth-child(10) { --delay: 3.6s; bottom: 5%; left: 66%; }

@media screen and (max-width: 1023px) {
  .image-container img:nth-child(2n + 1) { width: 18%; }
  .image-container img:nth-child(2n) { width: 22%; }
  .image-container img:nth-child(1) { top: 12%; left: 10%; width: 25%; }
  .image-container img:nth-child(2),
  .image-container img:nth-child(4),
  .image-container img:nth-child(6),
  .image-container img:nth-child(7) { display: none; }
  .image-container img:nth-child(3) { top: 12%; left: 60%; width: 18%; }
  .image-container img:nth-child(5) { top: 32%; left: 39%; width: 26%; z-index: 1; }
  .image-container img:nth-child(8) { bottom: 21%; left: 22%; width: 20%; }
  .image-container img:nth-child(9) { bottom: 33%; left: 62%; width: 25%; }
  .image-container img:nth-child(10) { bottom: 7%; left: 39%; width: 18%; }
}

@media screen and (max-width: 767px) {
  .image-container img:nth-child(1) { top: 12%; left: 7%; width: 30%; }
  .image-container img:nth-child(2),
  .image-container img:nth-child(4),
  .image-container img:nth-child(6),
  .image-container img:nth-child(7) { display: none; }
  .image-container img:nth-child(3) { top: 13%; left: 57%; width: 30%; }
  .image-container img:nth-child(5) { top: 33%; left: 22%; width: 30%; z-index: 2; }
  .image-container img:nth-child(8) { bottom: 20%; left: 5%; width: 25%; }
  .image-container img:nth-child(9) { bottom: 35%; left: 50%; width: 35%; z-index: 1; }
  .image-container img:nth-child(10) { bottom: 13%; left: 64%; width: 30%; }
}

@keyframes cascade {
  0% {
    transform: translateY(-100vh);
    opacity: 0;
  }
  100% {
    transform: translateY(var(--top));
    opacity: 1;
  }
}

/* Respect de la préférence système « réduire les animations ».
   opacity: 1 est indispensable : sans animation, les images
   resteraient invisibles (elles sont à opacity: 0 au repos). */
@media (prefers-reduced-motion: reduce) {
  .image-container img {
    animation: none;
    opacity: 1;
  }
}

/******************** CONTENU PRINCIPAL ********************/
/* Section Créations — le <h1> est sorti de la section ;
   c'est .creations-wrapper qui porte la mise en page verticale. */
.creations-wrapper {
  background-color: var(--marron-sombre);
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding-bottom: 250px;
}

.creations-wrapper h1 {
  margin-top: 35px;
  font-family: "Italianno", cursive;
  color: var(--marron-clair);
  text-align: center;
  font-size: 56px;
}

.section-creations {
  width: 100%;
}

.section-creations div {
  display: flex;
  justify-content: space-evenly;
  flex-direction: row;
  align-content: center;
  perspective: 300px;
}

.section-creations .testflex {
  display: flex;
  justify-content: center;
  padding-top: 100px;
  flex-direction: row;
}

.section-creations .testflex img {
  width: 220px;
  height: auto;
  -webkit-box-reflect: below 0 linear-gradient(transparent 50%, rgba(0,0,0,0.3));
  padding-bottom: 20px;
}

/* Quand il y a 1 seule vitrine */
.section-creations .testflex:only-child {
  transform: none !important;
}

.section-creations .testflex:only-child img {
  width: 300px;
}

/* Quand il y a exactement 2 vitrines */
.section-creations .testflex:first-child:nth-last-child(2) {
  transform: rotateY(15deg);
  & img {
    width: 250px;
  }

}

.section-creations .testflex:last-child:nth-child(2) {
  transform: rotateY(-15deg);
  & img {
    width: 250px;
  }
}

/* Quand il y a 3 vitrines */
.section-creations .testflex:first-child:nth-last-child(3) {
  transform: rotateY(35deg);
}

.section-creations .testflex:nth-child(2):nth-last-child(2) img {
  width: 300px;
}

.section-creations .testflex:nth-child(3) {
  transform: rotateY(-35deg);
}

/* Section Actualités (Carrousel) */
.actualites {
  padding-bottom: 20px;
}

.actualites > h2 {
  font-family: "Italianno", cursive;
  text-align: center;
  font-size: 56px;
  color: var(--marron-sombre);
  padding-top: 20px;
}

.actualites > div {
  width: 80%;
  margin: 10px auto;
  border: 3px solid var(--marron-clair-titre);
  background-color: var(--marron-sombre);
  border-radius: 94px;
}

/* min-height plutôt que height : en orientation paysage sur mobile,
   54.5vh est très bas et une hauteur figée rognerait le texte. */
.actualites ._slide {
  display: flex;
  justify-content: center;
  width: 80%;
  min-height: 54.5vh;
  height: auto;
  margin: 0 auto;
}

.actualites ._slide img {
  width: 30%;
  padding: 1%;
  object-fit: scale-down;
}

.actualites ._slide > div {
  margin:auto;
  display: flex;
  flex-direction: column;
  color: var(--marron-clair);
  font-size: 16px;
  padding: 8px 12px;
  width: 60%;
  text-align: center;
}

.actualites ._slide h3 { font-size: 40px; }
.actualites ._slide p { width: 100%; font-size: 1.2rem; }

/* Section Actualités (Manuel) */
.section-actualites-manual {
  display: none;
}

.section-actualites-manual > h2 {
  font-family: "Italianno", cursive;
  text-align: center;
  font-size: 56px;
  color: var(--marron-sombre);
  padding-top: 20px;
}

.section-actualites-manual ._slideManual {
  display: flex;
  justify-content: center;
  width: 80%;
  min-height: 54.5vh;
  height: auto;
  margin: 0 auto;
}

.section-actualites-manual ._slideManual img {
  width: 30%;
  padding: 1%;
  object-fit: scale-down;
}

.section-actualites-manual ._slideManual > div {
  display: flex;
  margin:auto;
  flex-direction: column;
  color: var(--marron-clair);
  font-size: 16px;
  padding: 8px 12px;
  width: 60%;
  text-align: center;
}

.section-actualites-manual ._slideManual h3 { font-size: 40px; }
.section-actualites-manual ._slideManual p { width: 100%; font-size: 1.2rem; }

#text-center {
  width: auto;
  margin: 10px auto;
  border: 0px;
  background-color: transparent;
  border-radius: 0;
  text-align: center;
}

/******************** CARROUSEL DOTS ********************/
._dot {
  cursor: pointer;
  height: 13px;
  width: 13px;
  margin: 0 2px;
  border: 0;
  padding: 0;
  vertical-align: middle;
  background-color: var(--marron-sombre);
  border-radius: 50%;
  display: inline-block;
  transition: background-color 1s ease;
}

._active,
._dot:hover {
  background-color: var(--marron-clair);
  box-shadow: inset 0 0 0 2px var(--marron-sombre);
}

._dot:focus-visible {
  outline: 2px solid var(--marron-sombre);
  outline-offset: 3px;
}

/******************** RESPONSIVE ********************/
@media screen and (max-width: 1024px) {
  /* Réinitialiser tous les rotateY en mobile */
  .section-creations .testflex:only-child { transform: none !important; }
  .section-creations .testflex:first-child:nth-last-child(2) { transform: none !important; }
  .section-creations .testflex:last-child:nth-child(2) { transform: none !important; }
  .section-creations .testflex:first-child:nth-last-child(3) { transform: none !important; }
  .section-creations .testflex:nth-child(3) { transform: none !important; }

  .section-creations .testflex:first-child { transform: none; }
  .section-creations .testflex:nth-child(2) img {width: auto;}
  .section-creations .testflex:nth-child(3) { transform: none; }
  .section-creations .testflex {
    padding-top:50px;
  }
  .section-creations .testflex img {
    width: auto!important;
    height: 300px!important;
    padding-bottom: 50px;
    -webkit-box-reflect: unset;
  }
  .creations-wrapper {
    min-height: unset;
    padding-bottom: 50px;
  }
  .actualites { display: none; }
  .section-actualites-manual { display: block; }
  .section-actualites-manual > div {
    display: flex;
    margin: 10px auto;
    border: 2px solid var(--marron-clair-titre);
    background-color: var(--marron-sombre);
    border-radius: 0px;
    width: 100%;
    counter-reset: item;
    overflow-x: scroll;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .section-actualites-manual > div::-webkit-scrollbar { display: none; }
  .section-actualites-manual ._slideManual {
    flex: 0 0 100%;
    scroll-snap-align: center;
    position: relative;
    width: 100%;
    display: flex;
    counter-increment: item;
  }
  .section-actualites-manual ._slideManual img {
    width: 30%;
    padding: 3%;
    max-height:400px;
    object-fit: contain;
    margin:auto;
  }
  /* Le conteneur du texte est une <div>, pas un <article> :
     ces règles ne s'appliquaient pas avec l'ancien sélecteur. */
  .section-actualites-manual ._slideManual > div h3 { font-size: 36px; }
  .section-actualites-manual ._slideManual > div p { font-size: 1rem; }
}

@media screen and (max-width: 810px) {
  .section-creations div {
    flex-direction: column;
    align-content: center;
  }
  .section-creations .testflex img {
    transform:none;
    -webkit-box-reflect: none;
    width: auto;
    height: 250px;
    padding-bottom: 20px;
  }
  .section-creations .testflex:nth-child(2) img {
    width: 249px;
    height: auto;
  }
}

@media screen and (max-width: 425px) {
  .section-actualites-manual ._slideManual > div{
    width: 100%;
    padding: 0 10px;
    height: auto;
    min-height: 160px;
  }
  .section-actualites-manual ._slideManual {
    min-height: 335px;
    flex-direction: column;
    align-items: center;
  }

  .section-actualites-manual ._slideManual{
    & img, & > div{
      margin:20px;
    }
    & img {
      z-index: 0;
    }
  }
  .section-actualites-manual ._slideManual > div {
    z-index: 1;
  }
  .section-actualites-manual ._slideManual > div p { font-size: 15px; }
}

@media only screen and (max-width: 300px) {
  ._prev, ._next, ._caption { font-size: 11px; }
}
