/* Homepage Museo - Stili specifici */

/* Homepage specific styles - only for pianta interattiva */

/* Assicura che la pagina sia sempre scrollabile */
html, body {
  min-height: 100vh;
  overflow-x: hidden; /* Evita scroll orizzontale */
  overflow-y: auto;   /* Permette scroll verticale quando necessario */
}

.page-main {
  min-height: 100vh;
  padding-bottom: 40px; /* Spazio extra in fondo */
}

/* Rendi il pulsante HOME invisibile ma mantieni lo spazio */
.home-btn {
  visibility: hidden !important;
  pointer-events: none !important;
}

.pianta-container {
  position: relative;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  padding: 20px;
  width: 100%; /* Usa tutta la larghezza disponibile */
  max-width: 100%;
  /* Rimosso max-height e overflow: hidden per permettere scroll */
  margin: 0 auto;
  display: block; /* Cambiato da flex a block per riempire tutto */
}

.pianta-wrapper {
  position: relative;
  width: 100%; /* Riempie tutto lo spazio disponibile */
  display: block; /* Cambiato da inline-block a block */
}

.pianta-image {
  max-width: 100%;
  width: 100%; /* Assicura che riempia sempre la larghezza */
  height: auto; /* Mantiene le proporzioni */
  border-radius: 10px;
  display: block;
}

.group-link {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ff6b6b;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  z-index: 10;
  transform: translate(-50%, -50%);
}

.group-link:hover {
  background: #ff5252;
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.group-link.has-articles {
  background: #4ecdc4;
}

.group-link.has-articles:hover {
  background: #26a69a;
}

.group-tooltip {
  position: absolute;
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate(-50%, -120%);
}

.group-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0,0,0,0.9);
}

/* Tooltip hover solo per dispositivi non-touch */
@media (hover: hover) {
  .group-link:hover .group-tooltip {
    opacity: 1;
  }
}

.legend {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 0.9rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}

.legend-dot.has-articles {
  background: #4ecdc4;
}

.legend-dot.no-articles {
  background: #ff6b6b;
}

.error-message {
  background: rgba(255,255,255,0.9);
  color: #d32f2f;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 500px;
}

.loading {
  color: white;
  text-align: center;
  font-size: 1.2rem;
}

/* Rimuovi padding per tutte le risoluzioni nella homepage */
.section {
  padding: 0 !important;
}

/* Responsive design */
@media (max-width: 768px) {
  /* Riduci spaziatura su mobile */
  .section-wrapper.with-margin {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
  
  .title-desc {
    margin-bottom: 20px !important;
  }
  
  .pianta-container {
    padding: 15px;
    margin: 0 10px;
    width: calc(100% - 20px); /* Sottrae i margini laterali */
  }
  
  .legend {
    gap: 15px;
    margin-top: 15px;
  }
  
  .legend-item {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  /* Ulteriore riduzione spaziatura per schermi molto piccoli */
  .section-wrapper.with-margin {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
  }
  
  .title-desc {
    margin-bottom: 15px !important;
  }
  
  .title-desc h2 {
    font-size: 1.8rem !important;
  }
  
  .pianta-container {
    padding: 10px;
    margin: 0 5px;
    width: calc(100% - 10px); /* Sottrae i margini laterali */
  }
  
  .group-link {
    width: 16px;
    height: 16px;
  }
  
  .legend {
    margin-top: 10px;
  }
}