/**
 * Combined Galleries Styles
 * 
 * Includes both gallery images meta box styles (admin) 
 * and galleries shortcode styles (frontend)
 * 
 * @package Nexter Child
 * @version 1.0.0
 */

/* ==========================================================================
   ADMIN: GALLERY IMAGES META BOX STYLES
   ========================================================================== */

/* Gallery image lists only - more specific selector */
[id$="gallery_images-list"], [id$="menu_gallery_images-list"] {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    min-height: 60px;
    border: 2px dashed #ddd;
    padding: 15px;
    border-radius: 4px;
}

.gallery-image-item {
    position: relative;
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: move;
}

.gallery-image-item img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.remove-gallery-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-gallery-image:hover {
    background: rgba(255, 0, 0, 1);
}

/* Gallery image lists empty state */
[id$="gallery_images-list"].empty, [id$="menu_gallery_images-list"].empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
}

[id$="gallery_images-list"].empty::before, [id$="menu_gallery_images-list"].empty::before {
    content: "No images selected. Click 'Add Images to Gallery' to get started.";
}

/* Hidden gallery data */
.gallery-data {
    display: none;
}


/* ==========================================================================
   GALLERIES GRID
   ========================================================================== */

.galleries {
    padding: 60px 0;
}

.galleries__header {
    margin-bottom: 40px;
    text-align: center;
}

.galleries__title {
    font-family: var(--font-primary, 'S&S Baldwins Serif', serif);
    font-size: 32px;
    font-weight: 400;
    color: var(--color-primary, #000);
    margin: 0;
    text-transform: uppercase;
}

.galleries__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Responsive Grid */
@media (max-width: 1023px) {
    .galleries__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .galleries__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .galleries {
        padding: 0px 0px 40px 0px;
    }
    
    .galleries__header {
        margin-bottom: 30px;
    }
    
    .galleries__title {
        font-size: 24px;
    }
}

/* ==========================================================================
   GALLERY CARDS
   ========================================================================== */

.galleries__card {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galleries__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.galleries__card-inner {
    position: relative;
    width: 100%;
    height: 306px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.galleries__card-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.galleries__card-image--fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.galleries__card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg, 
        rgba(0, 0, 0, 0) 49.24%, 
        rgba(0, 0, 0, 0.5) 85.93%
    ), linear-gradient(
        90deg, 
        rgba(0, 0, 0, 0.2) 0%, 
        rgba(0, 0, 0, 0.2) 100%
    );
    pointer-events: none;
}

.galleries__card-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    text-align: left;
}

.galleries__card-title {
    font-family: var(--font-primary, 'S&S Baldwins Serif', serif);
    font-size: 20px !important;
    font-weight: 400;
    line-height: 20px;
    color: white !important;
    margin: 0;
    text-transform: uppercase;
}

.galleries__card-category {
    font-family: var(--font-text, 'Interstate', sans-serif);
    font-size: 16px !important;
    font-weight: 400;
    line-height: 20px;
    color: #928787;
    margin: 0;
}

/* Fix Elementor Lightbox Navigation Position */
.elementor-lightbox .elementor-swiper-button {
    position: fixed !important; /* Force them to stay in the viewport */
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10000 !important;
    display: flex !important;
    width: 50px !important;
    height: 50px !important;
    align-items: center;
    justify-content: center;
}

.elementor-lightbox .elementor-swiper-button-prev {
    left: 20px !important;
}

.elementor-lightbox .elementor-swiper-button-next {
    right: 20px !important;
}

/* Ensure the FontAwesome/e-icon is visible inside */
.elementor-lightbox .elementor-swiper-button i {
    font-size: 30px !important;
    color: #ffffff !important;
}