/* ==========================================================================
   1. BASE & UTILITAIRES GLOBAUX
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

/* Couleur de fond par défaut (Cohérence entre les pages) */
body {
  background-color: #0b0f14; /* Couleur 'Ink' du site */
  color: #e5e5e5;
}

/* Focus accessible et stylisé (Harmonisé en OR pour tout le site) */
:focus-visible {
  outline: 2px solid rgba(197, 160, 89, 0.95);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Personnalisation de la barre de défilement (Scrollbar) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #c5a059; /* Mis en Gold pour l'harmonie */
}

/* Bloquer le scroll (utilisé pour les modales/lightbox) */
.no-scroll {
  overflow: hidden;
}

/* ==========================================================================
   2. SECTIONS PAGE D'ACCUEIL (Index)
   ========================================================================== */

/* Gradient spécifique pour le Hero de l'accueil */
.hero-gradient {
  background: linear-gradient(
    to bottom,
    rgba(11, 15, 20, 0.4) 0%,
    rgba(11, 15, 20, 0) 20%,
    rgba(11, 15, 20, 0) 80%,
    rgba(10, 13, 18, 1) 100%
  );
}

/* Styles spécifiques pour les formulaires sombres */
#q-type {
  color: rgba(255, 255, 255, 0.92);
  color-scheme: dark;
}
#q-type option {
  background-color: #ffffff !important;
  color: #0b0f14 !important;
}
#q-type option[value=""] {
  color: #6b7280 !important;
}

/* ==========================================================================
   3. TARTEAUCITRON (Cookies) - Personnalisation Enterview
   ========================================================================== */
#tarteaucitronAlertBig {
  background: rgba(10, 13, 18, 0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.45) !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif !important;
}

#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert {
  color: rgba(255, 255, 255, 0.80) !important;
  line-height: 1.45 !important;
}

#tarteaucitronAlertBig button,
#tarteaucitronAlertBig a {
  border-radius: 999px !important;
  font-weight: 600 !important;
}

#tarteaucitronAlertBig #tarteaucitronAcceptAll {
  background: #c5a059 !important; /* Gold */
  color: #0a0d12 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

#tarteaucitronAlertBig #tarteaucitronDenyAll {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.90) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

#tarteaucitronAlertBig #tarteaucitronPersonalize {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.90) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

#tarteaucitron {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}
#tarteaucitronBack {
  background: rgba(0, 0, 0, 0.55) !important;
}
#tarteaucitronRoot {
  background: rgba(10, 13, 18, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 18px !important;
}

/* ==========================================================================
   4. PAGE PHOTOGRAPHE (Galerie & Lightbox)
   ========================================================================== */

/* IMPORTANT : on remplace la maçonnerie "columns" par une grille stable
   pour garantir l'affichage des vignettes. */
/* CORRECTIF STABILITÉ GRILLE PHOTO */
.gallery-grid {
  column-count: 1;
  column-gap: 1.5rem;
}

@media (min-width: 640px) { .gallery-grid { column-count: 2; } }
@media (min-width: 1024px) { .gallery-grid { column-count: 3; } }

.gallery-item {
  /* Ces 3 lignes sont le secret pour éviter les bugs d'affichage */
  break-inside: avoid;      /* Empêche l'image d'être coupée entre 2 colonnes */
  display: inline-block;    /* Force le bloc à rester entier */
  width: 100%;              /* Prend toute la largeur de la colonne */
  
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #1a1a1a; /* Fond gris en attendant le chargement */
}

.gallery-item img {
  display: block; /* Supprime l'espace vide sous l'image */
  width: 100%;
  height: auto;
}

/* Petite animation "safe" définie ici (optionnelle) */
@keyframes evFadeInUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.gallery-item.ev-animate {
  opacity: 0; /* uniquement si on applique la classe */
  animation: evFadeInUp 0.6s ease-out forwards;
}

/* Styles Lightbox */
#lightbox {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ==========================================================================
   5. PAGE VISITES 360 (Viewer & Animations)
   ========================================================================== */

/* Conteneur du Viewer Responsive */
.viewer-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: #000;
  height: 65vh; /* Mobile */
  min-height: 400px;
}

@media (min-width: 768px) {
  .viewer-container {
    height: 75vh; /* Desktop */
    min-height: 520px;
  }
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Vignettes Galerie 360 */
.active-thumb {
  border: 2px solid #c5a059;
  opacity: 1;
}
.thumb-item {
  transition: all 0.3s ease;
}
.thumb-item:hover {
  transform: translateY(-2px);
}

/* Loader Animation */
.loader {
  width: 48px;
  height: 48px;
  border: 3px solid #FFF;
  border-bottom-color: #c5a059;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animation Rebond (Flèche) */
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
.animate-bounce {
  animation: bounce 1.5s infinite;
}

/* Panneau Info (Sidebar / Bottom Sheet) */
.info-panel {
  position: absolute;
  z-index: 40;
  background: rgba(10, 13, 18, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.info-content {
  padding: 30px;
  overflow-y: auto;
  flex-grow: 1;
}

.info-content h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 300;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 0.5rem;
}

.info-content p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Mobile : Vient du bas */
@media (max-width: 767px) {
  .info-panel {
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 70vh;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
  }
  .info-panel.visible {
    transform: translateY(0);
  }

  .logo-home {
    padding-left: 72px; /* Ajustement logo mobile */
  }
}

/* Desktop : Vient de droite */
@media (min-width: 768px) {
  .info-panel {
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
  }
  .info-panel.visible {
    transform: translateX(0);
  }
}

/* Modales et Backdrops */
.backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#quote-modal input,
#quote-modal select,
#quote-modal textarea {
  font-size: 16px; /* Évite le zoom auto sur iOS */
}

#quote-form {
  -webkit-overflow-scrolling: touch;
}
