/* Masonry Gallery for SafeDown Documentation Examples */

.masonry-gallery {
    width: 100%;
    margin: 0 auto;
    max-width: 1200px;
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: white;
    padding: 15px;
    transition: all 0.3s ease;
    opacity: 0;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

.gallery-caption h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.gallery-caption p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.gallery-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 15px;
}

.gallery-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .masonry-gallery {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .masonry-gallery {
        column-count: 1;
    }
    
    .gallery-caption {
        opacity: 1;
        background: rgba(0, 0, 0, 0.6);
    }
}
