.no-scroll {
    overflow: hidden;
}

.about-gallery-section {
    margin-top: 60px;
    margin-bottom: 80px;
}

/* Gallery section in sidebar */
.about-sidebar .about-gallery-section {
    margin-top: 0;
    margin-bottom: 0;
}

.about-gallery-header h3 {
    margin-bottom: 0.5rem;
}

.about-gallery-subtitle {
    color: #666;
    margin-bottom: 1.25rem;
}

.about-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Gallery in sidebar - two columns layout */
.about-sidebar .about-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gallery-thumb {
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000;
}

.gallery-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Smaller images in sidebar */
.about-sidebar .gallery-thumb img {
    height: 140px;
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.gallery-thumb:hover img,
.gallery-thumb:focus-visible img {
    transform: scale(1.05);
}

.about-gallery-modal[aria-hidden="false"] {
    display: block;
}

.about-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none; /* Nascosta di default */
}

.about-gallery-modal[hidden],
.about-gallery-modal[style*="display: none"] {
    display: none !important;
}

/* Assicura che il backdrop sia nascosto quando la modale è nascosta */
.about-gallery-modal[hidden] .gallery-modal-backdrop,
.about-gallery-modal[style*="display: none"] .gallery-modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 26, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.about-gallery-modal[aria-hidden="false"] .gallery-modal-backdrop {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-dialog {
    position: absolute;
    inset: 40px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-figure {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 20px;
    overflow: visible;
    background: #000;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.gallery-modal-figure img {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    background: #000;
    margin: 0 auto;
}

.gallery-modal-figure figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;    
    color: #fff;
    font-size: 1rem;
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 2;
}

.gallery-modal-close:hover,
.gallery-modal-close:focus-visible {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gallery-modal-nav:hover,
.gallery-modal-nav:focus-visible {
    background: rgba(0, 0, 0, 0.75);
}

.gallery-modal-prev {
    left: 10px;
}

.gallery-modal-next {
    right: 10px;
}

@media (max-width: 768px) {
    .gallery-thumb img {
        height: 150px;
    }
    
    /* Sidebar gallery torna a colonna singola su mobile */
    .about-sidebar .about-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .about-sidebar .gallery-thumb img {
        height: 180px;
    }
    
    .gallery-modal-dialog {
        inset: 20px;
    }
    
    .gallery-modal-nav {
        width: 42px;
        height: 42px;
    }
    
    .gallery-modal-figure figcaption {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
}

