/**
 * Image Gallery Badge Widget - Simple Styles
 * Uses Elementor's native lightbox
 */

/* Gallery Grid */
.igb-gallery-wrapper {
    width: 100%;
}

.igb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.igb-gallery-grid[data-columns="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.igb-gallery-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.igb-gallery-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.igb-gallery-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.igb-gallery-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.igb-gallery-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .igb-gallery-grid[data-columns="5"],
    .igb-gallery-grid[data-columns="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .igb-gallery-grid[data-columns="3"],
    .igb-gallery-grid[data-columns="4"],
    .igb-gallery-grid[data-columns="5"],
    .igb-gallery-grid[data-columns="6"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .igb-gallery-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Gallery Items */
.igb-gallery-item {
    position: relative;
    overflow: hidden;
}

.igb-gallery-item a,
.igb-gallery-item > div {
    display: block;
    cursor: pointer;
    text-decoration: none;
}

.igb-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Maintain aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.igb-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
}

/* Fallback for images that fail to load */
.igb-image-wrapper img[src=""],
.igb-image-wrapper img:not([src]) {
    opacity: 0;
}

.igb-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    z-index: -1;
}

.igb-gallery-item a:hover .igb-image-wrapper img,
.igb-gallery-item:hover .igb-image-wrapper img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Badge Styles */
.igb-badge {
    position: absolute;
    z-index: 2;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background-color: #ff0000;
    color: #ffffff;
    border-radius: 3px;
    pointer-events: none;
    line-height: 1.2;
}

.igb-badge-top-left {
    top: 10px;
    left: 10px;
}

.igb-badge-top-right {
    top: 10px;
    right: 10px;
}

.igb-badge-bottom-left {
    bottom: 10px;
    left: 10px;
}

.igb-badge-bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Accessibility */
.igb-gallery-item a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .igb-gallery-grid {
        display: block !important;
    }
    
    .igb-gallery-item {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}
