/* Regole globali per tutti i dispositivi */
html, body {
  padding-top: 0;
  min-height: 100vh;
  position: relative;
  margin: 0;
  padding: 0;
  background-image: url('/assets/img/sfondo.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat; 
  /*background-attachment: fixed;  color: #222;*/
  font-size: 16px;
}

/*-- Bottoni (Globali per tutti i dispositivi) */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;         /* più alto */
  width: 100%;
  margin: 8px 0;            /* margine sopra e sotto */
  padding: 15px 20px;          /* spazio ai lati */
  font-size: 1.2rem;        /* testo più grande */
  font-family: 'Atma', system-ui;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15); /* ombra morbida */
  color: #fff;              /* testo bianco */ 
  text-decoration: none;    /* rimuove sottolineatura */ 
  border-radius: 15px; 
  box-sizing: border-box;
  gap: 12px; /* spazio tra icona e testo */
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.button:active {
  transform: translateY(0);
}

.button i {
  font-size: 1.5em;           /* icona più grande */
  margin-right: 0;
  vertical-align: middle;
  display: flex;
  align-items: center;
}

.button i {
  font-size: 1.5em;           /* icona più grande */
  margin-right: 0;
  vertical-align: middle;
  display: flex;
  align-items: center;
}

/* Colori specifici dei pulsanti */
.gallery-button { 
  background: linear-gradient(135deg, #e9ad2d 0%, #f4c430 100%);
}

.contact-button { 
  background: linear-gradient(135deg, #af1fda 0%, #c945e5 100%);
}

.social-button.fb { 
  background: linear-gradient(135deg, #4267B2 0%, #5578cc 100%);
}

.social-button.ig { 
  background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%);
}

.social-button.wa { 
  background: linear-gradient(135deg, #25D366 0%, #2be373 100%);
}

/* Logo principale */
.logo-gio {
  max-width: 150px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto;
}

.logo-gio:hover {
  transform: scale(1.05);
}

/* Layout e centraggio */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 30px;
}

.name-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

@media (max-width: 700px) {
  /* Regole specifiche per mobile, se necessarie */

  .h2-gallery {
  font-size: 1.3rem;
  margin-top: 10%;
  margin-bottom: 3vh;
  color: #1a3a5d;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
}
h1 {  
   
  font-size: 2rem;
  margin-bottom: 3vh;
  color: #1a3a5d;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center; }

h2 {  
  font-size: 1.3rem;
  margin-top: 0px;
  margin-bottom: 3vh;
  color: #1a3a5d;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center; }


/* Layout */
  .main-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
  }
  .header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
  }
.wrapper {
    max-width: 400px;
    width: 100%;
    padding: 0;
  }
  .footer {
      margin-top: auto;
    padding: 20px;
    text-align: center;
    opacity: 0.7;
  }

  .footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
  }

  .footer a {
    color: #1a3a5d;
    text-decoration: none;
  }

  .footer a:hover {
    text-decoration: underline;
  }
  /* Elementi Grafici */

} /* Chiusura @media (max-width: 700px) */

/* Pagina Galleria - Layout migliorato */

/* Main container per la galleria */
.main-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 10px;
  box-sizing: border-box;
}

/* Sezioni della galleria */
.gallery-section {
  width: 100%;
  max-width: 1000px;
  margin-bottom: 60px;
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  text-align: center;
}

.gallery-section:last-of-type {
  margin-bottom: 100px; /* Spazio extra per l'ultimo elemento */
}

/* Titoli delle sezioni */
.h2-gallery {
  font-size: 1.8rem;
  margin: 0 0 30px 0;
  color: #1a3a5d;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  position: relative;
  font-family: 'Atma', system-ui;
}

.h2-gallery::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, #e9ad2d 0%, #f4c430 100%);
  border-radius: 2px;
}

/* Layout per le immagini - compatibile con Masonry */
.gallery, .grid {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  min-height: 200px; /* Altezza minima per debug */
  background: rgba(255,255,255,0.02); /* Sfondo leggero per debug */
  /* Rimosso display: grid per compatibilità con Masonry */
}

.gallery a {
  display: block;
  width: 100%;
  margin-bottom: 16px;
}

/* Link torna alla home - migliorato */
.back-home-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 30px 0;
  position: sticky;
  top: 20px;
  z-index: 100;
}

.back-home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3a5d 0%, #2c5aa0 100%);
  color: #fff;
  border-radius: 20px;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(26, 58, 93, 0.3);
  backdrop-filter: blur(10px);
}

.back-home-icon:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 25px rgba(26, 58, 93, 0.4);
  background: linear-gradient(135deg, #2c5aa0 0%, #1a3a5d 100%);
}

/* Pulsante scroll to top migliorato */
#scrollTopBtn {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 55px;
  height: 55px;
  padding: 0;
  background: linear-gradient(135deg, #e9ad2d 0%, #f4c430 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  display: none;
  box-shadow: 0 6px 20px rgba(233, 173, 45, 0.4);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

#scrollTopBtn:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 8px 25px rgba(233, 173, 45, 0.5);
  background: linear-gradient(135deg, #f4c430 0%, #e9ad2d 100%);
}

#scrollTopBtn.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lightbox2: nascondi numerazione */
.lb-number { display: none !important; }

/* Footer */
.footer {
  max-width: 900px;
  margin: 0px auto 0 auto;
  padding-bottom: 0;
  color: #333;
  text-align: center;
  border-radius: 8px;
}


/* Elementi della griglia - layout Masonry */
.grid-sizer, .grid-item {
  width: calc(33.333% - 10px); /* 3 colonne su desktop */
  margin-bottom: 15px;
  /* Rimosso float per compatibilità Masonry */
}

.grid-sizer {
  height: 0; /* Grid sizer non deve avere altezza visibile */
}

.grid-item {
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  background: #f8f8f8;
  display: block; /* Assicura che sia visibile */
}

.grid-item img {
  width: 100%;
  height: auto; /* Altezza automatica per mantenere proporzioni */
  min-height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  background: #eee;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Effetto hover migliorato per le immagini */
.grid-item:hover img {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.grid-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(233, 173, 45, 0.2) 0%, rgba(244, 196, 48, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 15px;
  pointer-events: none;
}

.grid-item:hover::before {
  opacity: 1;
}

/* Ottimizzazione animazioni per mobile */
/* Nascondi elementi prima dell'animazione */
.animate__animated {
  visibility: hidden;
  animation-fill-mode: both;
}

/* Elementi con delay - nascosti fino all'animazione */
.animate__delay-1s,
.animate__delay-2s,
.animate__delay-3s,
.animate__delay-4s,
.animate__delay-5s {
  opacity: 0;
  visibility: hidden;
}

/* Responsive design per la galleria - layout Masonry */
@media (max-width: 768px) {
  .main-center {
    padding: 5px;
  }
  
  .gallery-section {
    margin-bottom: 40px;
    padding: 15px 10px;
    border-radius: 15px;
  }
  
  .h2-gallery {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
  
  .grid-sizer, .grid-item {
    width: calc(50% - 8px); /* 2 colonne su tablet */
  }
  
  .grid-item img {
    min-height: 120px;
  }
  
  .back-home-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  #scrollTopBtn {
    right: 15px;
    bottom: 15px;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .gallery-section {
    margin-bottom: 30px;
    padding: 12px 8px;
  }
  
  .h2-gallery {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .grid-sizer, .grid-item {
    width: calc(50% - 6px); /* 2 colonne anche su mobile */
  }
  
  .grid-item img {
    min-height: 100px;
  }
}

/* Animazioni personalizzate per mobile */
@media (max-width: 700px) {
  /* Riduci durata animazioni su mobile per fluidità */
  .animate__animated {
    animation-duration: 0.8s;
  }
  
  /* Animazioni più veloci per elementi con delay */
  .animate__delay-1s { animation-delay: 0.3s; }
  .animate__delay-2s { animation-delay: 0.6s; }
  .animate__delay-3s { animation-delay: 0.9s; }
  .animate__delay-4s { animation-delay: 1.2s; }
  .animate__delay-5s { animation-delay: 1.5s; }
  
  /* Layout Masonry su mobile */
  .grid-sizer, .grid-item {
    width: calc(50% - 6px); /* 2 colonne su mobile */
    margin-bottom: 10px;
  }
  
  .gallery-section {
    margin-bottom: 40px;
  }
}

/* Mostra elementi quando l'animazione è attiva */
.animate__animated.animate__fadeIn,
.animate__animated.animate__fadeInDown,
.animate__animated.animate__fadeInUp,
.animate__animated.animate__slideInLeft,
.animate__animated.animate__slideInRight,
.animate__animated.animate__slideInUp,
.animate__animated.animate__zoomIn {
  visibility: visible;
  opacity: 1;
}

/* Elementi per il nome e il ruolo */
.name-container {
  text-align: center;
  margin: 20px 0;
}

.name {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a3a5d;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  display: block;
  margin-bottom: 10px;
  font-family: 'Atma', system-ui;
}

.role {
  font-size: 1.2rem;
  color: #666;
  font-weight: 400;
  display: block;
  font-style: italic;
  animation: bounce 2s infinite;
}

.role i {
  margin: 0 8px;
  color: #e9ad2d;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Debug styles per verificare caricamento */
.no-images {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  margin: 20px 0;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #e74c3c;
  font-weight: bold;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 10px;
  margin: 20px 0;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Loading state per immagini */
.grid-item img[src=""] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Assicura che gli elementi siano visibili durante il debug */
.gallery-section {
  outline: 1px dashed rgba(255,255,255,0.1); /* Debug outline */
}

.gallery.grid {
  outline: 1px dashed rgba(0,255,0,0.2); /* Debug outline verde */
}

.grid-item {
  outline: 1px dashed rgba(255,0,0,0.2); /* Debug outline rosso */
}

/* ========================================
   RESPONSIVE DESIGN - DESKTOP
   ======================================== */

/* Tablet e Desktop */
@media (min-width: 701px) {
  /* Container principale più largo su desktop */
  .main-center {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 30px;
  }
  
  /* Header più grande su desktop */
  .header-center {
    margin-bottom: 50px;
  }
    .logo-gio {
    max-width: 200px;
    width: 200px;
    height: 200px;
    object-fit: cover;
  }
  
  .name {
    font-size: 3.5rem;
  }
  
  .role {
    font-size: 1.8rem;
  }
  /* Bottoni in layout flessibile su desktop */
  .wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .button {
    min-height: 70px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
  }
  
  .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }
}

/* Desktop grandi */
@media (min-width: 1024px) {
  .main-center {
    max-width: 1000px;
    padding: 60px 40px;
  }
    .logo-gio {
    max-width: 250px;
    width: 250px;
    height: 250px;
    object-fit: cover;
  }
  
  .name {
    font-size: 4rem;
  }
  
  .role {
    font-size: 2rem;
  }
  /* Layout in colonna anche per schermi molto grandi */
  .wrapper {
    flex-direction: column;
    max-width: 800px;
  }
}

/* Ultra-wide desktop */
@media (min-width: 1440px) {
  .main-center {
    max-width: 1200px;
  }
  
  .header-center {
    margin-bottom: 80px;
  }
}
