/* Enhanced Gallery Widget - Standalone Version */

/* Container Styles */
.enhanced-gallery-container {
    display: grid;
    width: 100%;
}

.enhanced-gallery-container.layout-grid {
    grid-auto-rows: 1fr;
}

.enhanced-gallery-container.layout-masonry {
    grid-auto-flow: dense;
}

/* Gallery Item */
.enhanced-gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

/* Grid layout aspect ratio */
.layout-grid .enhanced-gallery-item::before {
    content: '';
    display: block;
    padding-bottom: 66%; /* Default aspect ratio */
}

/* Image Styles */
.enhanced-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.enhanced-gallery-item:hover .enhanced-gallery-image {
    transform: scale(1.05);
}

/* Masonry - No aspect ratio enforcement */
.layout-masonry .enhanced-gallery-item::before {
    display: none;
}

.layout-masonry .enhanced-gallery-image {
    position: relative;
    padding-bottom: 75%; /* Default for masonry items */
}

/* Overlay Styles */
.enhanced-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.enhanced-gallery-item:hover .enhanced-gallery-overlay {
    opacity: 1;
}

/* Always show overlay */
.overlay-always .enhanced-gallery-overlay {
    opacity: 1;
}

/* Overlay Content */
.enhanced-gallery-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px;
    text-align: center;
    pointer-events: auto;
    transition: transform 0.3s ease;
}

/* Position Classes */
.overlay-position-top-left .enhanced-gallery-overlay {
    align-items: flex-start;
    justify-content: flex-start;
}

.overlay-position-top-left .enhanced-gallery-content {
    text-align: left;
}

.overlay-position-top-center .enhanced-gallery-overlay {
    align-items: flex-start;
    justify-content: center;
}

.overlay-position-top-center .enhanced-gallery-content {
    text-align: center;
}

.overlay-position-top-right .enhanced-gallery-overlay {
    align-items: flex-start;
    justify-content: flex-end;
}

.overlay-position-top-right .enhanced-gallery-content {
    text-align: right;
}

.overlay-position-center-left .enhanced-gallery-overlay {
    align-items: center;
    justify-content: flex-start;
}

.overlay-position-center-left .enhanced-gallery-content {
    text-align: left;
}

.overlay-position-center-center .enhanced-gallery-overlay {
    align-items: center;
    justify-content: center;
}

.overlay-position-center-center .enhanced-gallery-content {
    text-align: center;
}

.overlay-position-center-right .enhanced-gallery-overlay {
    align-items: center;
    justify-content: flex-end;
}

.overlay-position-center-right .enhanced-gallery-content {
    text-align: right;
}

.overlay-position-bottom-left .enhanced-gallery-overlay {
    align-items: flex-end;
    justify-content: flex-start;
}

.overlay-position-bottom-left .enhanced-gallery-content {
    text-align: left;
}

.overlay-position-bottom-center .enhanced-gallery-overlay {
    align-items: flex-end;
    justify-content: center;
}

.overlay-position-bottom-center .enhanced-gallery-content {
    text-align: center;
}

.overlay-position-bottom-right .enhanced-gallery-overlay {
    align-items: flex-end;
    justify-content: flex-end;
}

.overlay-position-bottom-right .enhanced-gallery-content {
    text-align: right;
}

/* Animation - Fade */
.overlay-animation-fade .enhanced-gallery-overlay {
    opacity: 0;
}

.overlay-animation-fade .enhanced-gallery-item:hover .enhanced-gallery-overlay,
.overlay-animation-fade.overlay-always .enhanced-gallery-overlay {
    opacity: 1;
}

/* Animation - Slide Up */
.overlay-animation-slide-up .enhanced-gallery-content {
    transform: translateY(20px);
}

.overlay-animation-slide-up .enhanced-gallery-item:hover .enhanced-gallery-content,
.overlay-animation-slide-up.overlay-always .enhanced-gallery-content {
    transform: translateY(0);
}

/* Animation - Slide Down */
.overlay-animation-slide-down .enhanced-gallery-content {
    transform: translateY(-20px);
}

.overlay-animation-slide-down .enhanced-gallery-item:hover .enhanced-gallery-content,
.overlay-animation-slide-down.overlay-always .enhanced-gallery-content {
    transform: translateY(0);
}

/* Animation - Slide Left */
.overlay-animation-slide-left .enhanced-gallery-content {
    transform: translateX(20px);
}

.overlay-animation-slide-left .enhanced-gallery-item:hover .enhanced-gallery-content,
.overlay-animation-slide-left.overlay-always .enhanced-gallery-content {
    transform: translateX(0);
}

/* Animation - Slide Right */
.overlay-animation-slide-right .enhanced-gallery-content {
    transform: translateX(-20px);
}

.overlay-animation-slide-right .enhanced-gallery-item:hover .enhanced-gallery-content,
.overlay-animation-slide-right.overlay-always .enhanced-gallery-content {
    transform: translateX(0);
}

/* Animation - Zoom In */
.overlay-animation-zoom-in .enhanced-gallery-content {
    transform: scale(0.8);
}

.overlay-animation-zoom-in .enhanced-gallery-item:hover .enhanced-gallery-content,
.overlay-animation-zoom-in.overlay-always .enhanced-gallery-content {
    transform: scale(1);
}

/* Animation - None */
.overlay-animation-none .enhanced-gallery-overlay {
    transition: none;
}

.overlay-animation-none .enhanced-gallery-content {
    transition: none;
}

/* Title Styles */
.enhanced-gallery-title {
    margin: 0 0 10px;
    padding: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Description Styles */
.enhanced-gallery-description {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .enhanced-gallery-content {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .enhanced-gallery-title {
        font-size: 18px;
    }
    
    .enhanced-gallery-description {
        font-size: 13px;
    }
    
    .enhanced-gallery-content {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .enhanced-gallery-title {
        font-size: 16px;
    }
    
    .enhanced-gallery-description {
        font-size: 12px;
    }
    
    .enhanced-gallery-content {
        padding: 10px;
    }
}

/* Link Styles */
a.enhanced-gallery-item {
    color: inherit;
}

a.enhanced-gallery-item:hover {
    text-decoration: none;
}

/* Editor Styles */
.elementor-editor-active .enhanced-gallery-item {
    cursor: move;
}

.elementor-editor-active a.enhanced-gallery-item {
    pointer-events: none;
}