section .elementor-element
{
    h3, h4, h5, h6
    {
        margin-top:10px;
        margin-bottom:10px;
        font-size:20px!important;
        font-family:Poppins, sans-serif;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 4px;
    }
    
    p
    {
        margin-bottom:5px!important;
        margin-top:0px!important;
    }
}


.text-white-shadow 
{
    .post--heading a,
    .elementor-widget-container p,
    .elementor-widget-container h3,
    .elementor-widget-container h2,
    .elementor-widget-container h1
    {
    	letter-spacing:1px;
    	color: white;
        text-transform:lowercase;
        text-shadow: 
            -1px -1px 0 black,  
             1px -1px 0 black,
            -1px  1px 0 black,
             1px  1px 0 black,
             0px  0px 10px rgba(0, 0, 0, 0.8);
    }
    
   
    
}


.justify-center-funny 
{
    .row
    {
        justify-content: center;
    }
    
    .row > div:nth-child(4n+1) { transform: rotate(-4deg); }
    .row > div:nth-child(4n+2) { transform: rotate(3deg); }
    .row > div:nth-child(4n+3) { transform: rotate(-2deg); }
    .row > div:nth-child(4n+4) { transform: rotate(5deg); }
}














.cpt-video
{
    position:relative;
    width:100%;
}

.cpt-video div
{
    text-align:center;
}

.cpt-video div iframe
{
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius:10px;
}

.cpt-gallery {
    display: flex;
    flex-wrap: wrap;          /* Permette agli elementi di andare a capo */
    justify-content: center;  /* Centra gli elementi orizzontalmente */
    gap: 16px;                /* Spazio tra le immagini */
    margin: 0px;
}



.cpt-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
  padding: 30px 10px;

  /* Stile base tipo Polaroid/Foto stampata per accentuare l'effetto */
  .gallery-item {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                z-index 0s;
    background: #fff;
    padding: 10px 10px 25px 10px; /* Bordo inferiore più alto stile Polaroid */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    z-index: 1;

    img {
      display: block;
      border-radius: 2px;
    }

    /* EFFETTO FUNNY HOVER: La foto risalta, si raddrizza e fa un piccolo "pop" */
    &:hover {
      transform: scale(1.15) rotate(0deg) translateY(-10px) !important;
      box-shadow: 0 20px 30px rgba(0, 0, 0, 0.25);
      z-index: 99;
    }

    /* EFFETTO CLICK: Rimpicciolisce leggermente come se venisse premuta */
    &:active {
      transform: scale(1.05) rotate(1deg) translateY(-5px) !important;
    }
  }

  /* Disposizione irregolare (Rotazione + Traslazione casuale) */
  .gallery-item-1  { transform: rotate(-6deg) translate(-4px, 2px); }
  .gallery-item-2  { transform: rotate(8deg)  translate(3px, -5px); }
  .gallery-item-3  { transform: rotate(-3deg) translate(-2px, 6px); }
  .gallery-item-4  { transform: rotate(11deg) translate(5px, 3px); }
  .gallery-item-5  { transform: rotate(-9deg) translate(-6px, -4px); }
  .gallery-item-6  { transform: rotate(5deg)  translate(2px, -8px); }
  .gallery-item-7  { transform: rotate(-12deg) translate(-3px, 4px); }
  .gallery-item-8  { transform: rotate(7deg)  translate(4px, 2px); }
  .gallery-item-9  { transform: rotate(-4deg) translate(-5px, -3px); }
  .gallery-item-10 { transform: rotate(10deg) translate(3px, 5px); }
}

.gallery-item {
    /* Imposta la larghezza di ciascuna scheda.
       flex: flex-grow | flex-shrink | flex-basis */
    flex: 0 1 220px;          /* Dimensione base 220px, non cresce a dismisura, ma si rimpicciolisce su mobile */
    max-width: 100%;          /* Evita overflow su schermi piccolissimi */
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 180px;            /* Altezza fissa uniforme per la griglia */
    object-fit: cover;        /* Mantiene le proporzioni ritagliando se necessario */
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
}



.glightbox-clean .gslide-description
{
    display:none!important;
}

/* --- REGOLA PER MOBILE (Smartphone) --- */
@media screen and (max-width: 767px) {

  /* 1. Annulla i margini e i padding del contenitore della galleria */
  .cpt-gallery {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* 2. Forziamo ogni elemento a occupare il 100% della larghezza disponibile */
  .cpt-gallery .gallery-item {
    width: 100% !important;
    max-width: 100% !important;
    
    
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    
    /* Riduciamo le rotazioni su mobile per evitare che l'immagine esca dallo schermo */
  }

  /* 3. Assicuriamo che l'immagine al suo interno riempia tutto lo spazio */
  .cpt-gallery .gallery-item img {
    width: 100% !important;
    height: auto !important;
    
    max-width: 100% !important;
  }
}
