/* Tuiles */

.tuile-container {
  display: flex;
  justify-content: flex-start;  /* ← aligne à gauche pour bien voir tout */
  align-items: flex-end;
  gap: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 !important;
  
  width: 100%;
  box-sizing: border-box;
  scroll-snap-type: x mandatory;
}

.tuile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: none;
  border-radius: 0;
  margin: 0;
  margin-bottom:0;
  box-shadow: none;
  position: relative;
  overflow: visible;
  padding: 0;
  border: none;
  color: white;
  font-size: 18px;
  min-width: 840px;
  width: auto;
  height:500px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.tuile picture {
  display: block;
  width: 100%;
  height: 100%;
}

.tuile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  border-radius: 10px;
  background: transparent;
}

.tuile .hover-label {
  display: none;
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  color: #ffd700;
  font-size: 1.6em;
  font-weight: bold;
  pointer-events: none;
  text-shadow: 2px 2px 4px #000;
  z-index: 13;
}

.tuile:hover .hover-label {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.lampe {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  scroll-snap-align: start;
  height: 500px; /* même hauteur que .tuile : source unique de vérité */
}

.lampadaire {
  width: auto;
  height: 100%;
  display: block;
  margin: 0;
  object-fit: contain;
  object-position: bottom;
}

@media screen and (min-width: 769px) and (max-width: 1600px) and (orientation: portrait) {
  .tuile {
    min-width: 350px;
    max-width: 490px;
    height: 700px;
  }

  .lampe {
    height: 700px;
  }
}

/* PC/laptop (toutes largeurs ≥769px) : taille basée sur la hauteur d'écran (vh),
   pour rester stable même en cas de zoom navigateur (Ctrl +/-), au lieu d'une
   hauteur fixe en pixels qui ne tenait que par coïncidence à 100% de zoom */
@media screen and (min-width: 769px) and (orientation: landscape) {
  .tuile {
    height: 500px;
    width: auto;
    min-width: 0;
    aspect-ratio: 840 / 500;
  }

  .lampe {
    height: 500px;
  }
}

/* Plaque au-dessus de chaque garage (nom de la tuile).
   Cachée par défaut ; affichée seulement PC/laptop paysage, voir plus bas.
   L'image est mise en ligne dans index.html (style="background-image:...") :
   pour changer le nom d'un garage, on change juste ce fichier-là. */
.tuile .plaque {
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20%;            /* taille de la plaque : à ajuster ici si besoin */
  aspect-ratio: 3 / 2;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
  pointer-events: none;  /* le clic et le survol restent ceux de la tuile */
  z-index: 5;
}

@media screen and (min-width: 769px) and (orientation: landscape) {
  .tuile .plaque {
    display: block;
  }
}

@media (max-width: 768px) {
  .lampe {
    display: none !important;
  }

  .tuile-container {
    gap: 10px;
    padding: 0 10px;
  }

  .tuile {
    height: 85vh;
    width: auto;
    min-width: 0;
    max-width: 92vw;
    aspect-ratio: 603 / 1171; /* proportion réelle des portes élégantes */
  }

  #route {
    display: none !important;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .tuile-container {
    justify-content: center; /* pas de débordement en paysage, donc pas de risque sur le scroll */
  }

  .lampe {
    display: flex !important;
    height: 65vh !important;
  }

  .tuile {
    height: 65vh; /* écran court en paysage : on laisse la place au footer sans scroll */
  }

/* Barre de scroll personnalisée */
.tuile-container::-webkit-scrollbar {
  height: 8px;
}
.tuile-container::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 10px;
}
.tuile-container::-webkit-scrollbar-thumb {
  background: #D4AF37;
  border-radius: 10px;
}