/* Main container for the gallery */
.igc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1; /* Ensure gallery is below carousel when open */
}

/* Gallery grid */
.igc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.igc-gallery-item {
    cursor: pointer;
    position: relative;
    z-index: 2; /* Ensure clickable above other elements */
    pointer-events: auto; /* Ensure clickability */
}

.igc-gallery-item img,
.igc-gallery-item video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

/* Carousel modal - full page */
#igc-carousel {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important; /* Override theme constraints */
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer; /* Indicate background is clickable */
}

#igc-carousel.show {
    display: flex !important; /* Show when .show class is added */
}

/* Inner carousel content */
.igc-carousel-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important; /* Override theme constraints */
    padding: 30px 50px; /* Space for buttons */
    box-sizing: border-box;
    cursor: default; /* Prevent inner content from triggering close */
}

/* Image and video styling */
.igc-carousel-inner img,
.igc-carousel-inner video {
    width: 100vw !important;
    height: auto;
    max-height: 85vh !important; /* Reserve space for description and buttons */
    max-width: none !important; /* Override theme constraints */
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Description text */
#igc-carousel-description {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    max-width: 90%;
    text-align: center;
    z-index: 1001;
    cursor: default; /* Prevent description from triggering close */
}

/* Navigation buttons */
.igc-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1002;
    padding: 15px;
    border-radius: 50%;
}

/* Previous button */
#igc-prev {
    left: 20px;
}

/* Next button */
#igc-next {
    right: 20px;
}

/* Close button */
#igc-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1002;
    padding: 10px;
    border-radius: 50%;
    display: block !important; /* Ensure visibility */
}

/* Category dropdown */
#igc-category-filter {
    margin-bottom: 20px;
    padding: 10px;
    font-size: 16px;
}