/* Stile per la griglia delle testimonianze */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.testimonial-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.testimonial-item:hover {
    transform: translateY(-5px);
}

.testimonial-title {
    padding: 15px;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
}

.testimonial-preview {
    padding: 10px;
    text-align: center;
}

.preview-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.preview-image:hover {
    opacity: 0.9;
}

/* Stile per il Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox:target {
    display: block;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.lightbox-content img {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    background-color: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.lightbox-close:hover {
    color: #fff;
    background-color: rgba(255, 0, 0, 0.7);
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.lightbox-instructions {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 16px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
}

/* Crea un'area più grande per chiudere il lightbox */
.lightbox::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* Responsive */
@media (max-width: 768px) {
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
    
    .lightbox-content img {
        max-width: 95%;
        margin-bottom: 70px; /* Spazio per il pulsante di chiusura */
    }
    
    .lightbox-close {
        top: auto;
        right: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 60px;
        line-height: 60px;
        font-size: 36px;
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    .lightbox-instructions {
        display: none;
    }
}