/* Custom Gallery Styles */
.custom-gallery {
    display: grid;
    gap: 10px;
    width: 100%;
}

/* Layout Grid Regular */
.custom-gallery-layout-grid.custom-gallery-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.custom-gallery-layout-grid.custom-gallery-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.custom-gallery-layout-grid.custom-gallery-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.custom-gallery-layout-grid.custom-gallery-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Layout Masonry */
.custom-gallery-layout-masonry {
    display: block; /* Masonry.js maneja el positioning */
}

.custom-gallery-layout-masonry.custom-gallery-columns-2 .gallery-item {
    width: calc(50% - 5px);
}

.custom-gallery-layout-masonry.custom-gallery-columns-3 .gallery-item {
    width: calc(33.333% - 7px);
}

.custom-gallery-layout-masonry.custom-gallery-columns-4 .gallery-item {
    width: calc(25% - 8px);
}

.custom-gallery-layout-masonry.custom-gallery-columns-5 .gallery-item {
    width: calc(20% - 8px);
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
    margin-bottom: 10px; /* Para masonry */
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item a {
    display: block;
    text-decoration: none;
}

.gallery-item-content {
    position: relative;
    display: block;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Overlay */
.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .custom-gallery-layout-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .custom-gallery-layout-masonry .gallery-item {
        width: calc(50% - 5px) !important;
    }
}

@media (max-width: 400px) {
    .custom-gallery-layout-grid {
        grid-template-columns: 1fr !important;
    }
    
    .custom-gallery-layout-masonry .gallery-item {
        width: 100% !important;
    }
    
    .gallery-item-title {
        font-size: 14px;
    }
}