/**
 * Gallery Items Styles
 * 
 * All styles scoped to .gallery-items-wrapper to avoid conflicts
 */

/* ==========================================================================
   Wrapper & Container
   ========================================================================== */

/* Elementor shortcode widget container */
.elementor-widget-shortcode:has(.gallery-items-wrapper) {
    width: 100%;
}

.gallery-items-wrapper {
    --gallery-accent-color: #761414;
    --gallery-accent-hover: #5a0f0f;
    --gallery-text-color: #ffffff;
    --gallery-grid-gap: 20px;
    width: 100%;
    max-width: 100%;
}

/* ==========================================================================
   Filter Buttons
   ========================================================================== */

.gallery-items-wrapper .gallery-items-filters {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.gallery-items-wrapper .gallery-items-filters .filter-btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--gallery-accent-color);
    background-color: var(--gallery-accent-color);
    color: var(--gallery-text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
    line-height: 1.2;
}

.gallery-items-wrapper .gallery-items-filters .filter-btn:hover {
    background-color: var(--gallery-accent-color);
    border-color: var(--gallery-accent-color);
}

.gallery-items-wrapper .gallery-items-filters .filter-btn.active {
    background-color: transparent;
    color: var(--gallery-accent-color);
    border-color: var(--gallery-accent-color);
}

/* ==========================================================================
   Gallery Grid
   ========================================================================== */

.gallery-items-wrapper .gallery-items-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--gallery-grid-gap) !important;
    width: 100%;
}

.gallery-items-wrapper .gallery-item {
    position: relative;
    width: 100% !important;
    aspect-ratio: 1 / 1;
    overflow: hidden !important;
    cursor: pointer;
    animation: galleryItemFadeIn 0.3s ease;
}

.gallery-items-wrapper .gallery-item img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
    max-width: none !important;
}

.gallery-items-wrapper .gallery-item .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    color: #666;
    font-size: 14px;
}

/* Hidden items (for load more) */
.gallery-items-wrapper .gallery-item.hidden {
    display: none !important;
}

/* Filtered out items */
.gallery-items-wrapper .gallery-item.filtered-out {
    display: none !important;
}

/* Smooth fade transition for items */
@keyframes galleryItemFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Hover Overlay
   ========================================================================== */

.gallery-items-wrapper .gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--gallery-accent-color);
    color: var(--gallery-text-color);
    padding: 15px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.gallery-items-wrapper .gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-items-wrapper .gallery-item-overlay .overlay-text {
    display: block;
    font-size: 24px;
    font-weight: 600;
    font-style: italic;
    text-align: center;
}

/* ==========================================================================
   Load More Tile
   ========================================================================== */

.gallery-items-wrapper .gallery-item.load-more-tile {
    background-color: var(--gallery-accent-color);
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.gallery-items-wrapper .gallery-item.load-more-tile:hover {
    background-color: var(--gallery-accent-color);
}

.gallery-items-wrapper .load-more-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-items-wrapper .load-more-text {
    color: var(--gallery-text-color);
    font-size: 24px;
    font-weight: 700;
    font-style: italic;
    text-transform: uppercase;
    line-height: 1.4;
    text-decoration: underline;
}

/* Hide load more when no more items */
.gallery-items-wrapper .gallery-item.load-more-tile.all-loaded {
    display: none !important;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet - 2 columns */
@media (max-width: 1024px) {
    .gallery-items-wrapper .gallery-items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .gallery-items-wrapper .gallery-items-filters .filter-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
    
    .gallery-items-wrapper .gallery-item-overlay .overlay-text {
        font-size: 20px;
    }
}

/* Mobile - 1 column */
@media (max-width: 767px) {
    .gallery-items-wrapper .gallery-items-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .gallery-items-wrapper .gallery-items-filters {
        gap: 10px;
    }
    
    .gallery-items-wrapper .gallery-items-filters .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .gallery-items-wrapper .gallery-item-overlay .overlay-text {
        font-size: 18px;
    }
}
