/* Gallery Widget Styles - 4 Column Layout */
.gallery-widget-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Gallery Grid - Fixed 4 Column Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Aspect Ratio Control */
.gallery-grid.aspect-square .gallery-item-inner {
    aspect-ratio: 1 / 1;
}

.gallery-grid.aspect-landscape .gallery-item-inner {
    aspect-ratio: 4 / 3;
}

.gallery-grid.aspect-portrait .gallery-item-inner {
    aspect-ratio: 3 / 4;
}

.gallery-grid.aspect-wide .gallery-item-inner {
    aspect-ratio: 16 / 9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.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(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-content {
    text-align: center;
    padding: 15px;
    transform: translateY(15px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-content {
    transform: translateY(0);
}

.gallery-item-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.gallery-item-description {
    color: #cccccc;
    font-size: 12px;
    line-height: 1.4;
    margin: 0 0 12px 0;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-zoom-btn {
    background: #A3A83F !important;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-zoom-btn:hover {
    transform: scale(1.1);
}

/* Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.gallery-lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #A3A83F !important;
    color: white;
    border: none;
    font-size: 20px;
    padding: 12px 16px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    border-radius: 50% !important;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-image-container {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    max-height: 600px;
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.lightbox-info {
    padding: 20px;
    background: white;
}

.lightbox-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
}

.lightbox-description {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading Animation */
.gallery-item img {
    opacity: 0;
    animation: imageLoad 0.5s ease forwards;
}

@keyframes imageLoad {
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .gallery-item-title {
        font-size: 15px;
    }
    
    .gallery-item-description {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .gallery-widget-container {
        padding: 15px 10px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery-item-title {
        font-size: 14px;
    }
    
    .gallery-item-description {
        font-size: 10px;
        -webkit-line-clamp: 1;
    }
    
    .gallery-zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 18px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .gallery-widget-container {
        padding: 10px 5px;
    }
    
    .gallery-item-content {
        padding: 10px;
    }
    
    .gallery-item-title {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .gallery-item-description {
        display: none; /* Hide description on very small screens */
    }
    
    .gallery-zoom-btn {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
}

@media (max-width: 320px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Hover Effects for Different Devices */
@media (hover: hover) {
    .gallery-item:hover {
        transform: translateY(-5px) scale(1.02);
    }
}

@media (hover: none) {
    .gallery-item-overlay {
        opacity: 0.8;
    }
    
    .gallery-item-content {
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .gallery-item-overlay,
    .gallery-zoom-btn {
        display: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}