/**
 * Gallery Grid Detailed Styles
 * Matches the "Gallery Page" styling from React GalleryPage
 */

.fuziion-gallery-grid-detailed-wrapper {
    width: 100%;
}

.fuziion-gallery-grid-detailed {
    display: grid;
    gap: 24px;
    width: 100%;
}

/* Elementor responsive classes - Desktop (default) */
.elementor-grid-1 .fuziion-gallery-grid-detailed {
    grid-template-columns: repeat(1, 1fr);
}

.elementor-grid-2 .fuziion-gallery-grid-detailed {
    grid-template-columns: repeat(2, 1fr);
}

.elementor-grid-3 .fuziion-gallery-grid-detailed {
    grid-template-columns: repeat(3, 1fr);
}

.elementor-grid-4 .fuziion-gallery-grid-detailed {
    grid-template-columns: repeat(4, 1fr);
}

/* Default grid columns - only apply if no Elementor class is present */
.elementor-widget:not([class*="elementor-grid-"]) .fuziion-gallery-grid-detailed {
    grid-template-columns: repeat(3, 1fr);
}

/* Default responsive behavior - 2 columns on tablet, 1 on mobile */
@media (max-width: 1024px) and (min-width: 769px) {
    .elementor-widget:not([class*="elementor-grid-"]) .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .elementor-widget:not([class*="elementor-grid-"]) .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Elementor responsive classes - Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .elementor-grid-tablet-1 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(1, 1fr);
    }

    .elementor-grid-tablet-2 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(2, 1fr);
    }

    .elementor-grid-tablet-3 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(3, 1fr);
    }

    .elementor-grid-tablet-4 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Elementor responsive classes - Mobile */
@media (max-width: 768px) {
    .elementor-grid-mobile-1 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(1, 1fr);
    }

    .elementor-grid-mobile-2 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(2, 1fr);
    }

    .elementor-grid-mobile-3 .fuziion-gallery-grid-detailed {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Gallery Item Wrapper - Scroll-triggered Animation */
.fuziion-gallery-item-detailed-wrapper {
    width: 100%;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: var(--animation-delay, 0ms);
    will-change: opacity, transform;
}

.fuziion-gallery-item-detailed-wrapper.in-view {
    opacity: 1;
    transform: scale(1);
    will-change: auto; /* Remove will-change after animation */
}

/* If animations are disabled, show items immediately */
[data-animations-enabled="false"] .fuziion-gallery-item-detailed-wrapper {
    opacity: 1;
    transform: scale(1);
    transition: none;
}

/* Show items in Elementor editor */
.elementor-editor-active .fuziion-gallery-item-detailed-wrapper,
.elementor-editor-preview .fuziion-gallery-item-detailed-wrapper {
    opacity: 1;
    transform: scale(1);
    transition: none;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .fuziion-gallery-item-detailed-wrapper {
        opacity: 1;
        transform: scale(1);
        transition: none;
    }
}

.fuziion-gallery-link-detailed {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.fuziion-gallery-link-detailed:hover {
    text-decoration: none;
}

/* Gallery Item - matches React: relative h-80 overflow-hidden rounded-2xl group cursor-pointer shadow-lg */
.fuziion-gallery-item-detailed {
    position: relative;
    height: 320px;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    display: block;
}

/* Gallery Image - matches React: w-full h-full object-cover group-hover:scale-110 transition-transform duration-500 */
.fuziion-gallery-image-detailed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
}

.fuziion-gallery-item-detailed:hover .fuziion-gallery-image-detailed {
    transform: scale(1.1);
}

/* Gradient Overlay - matches React: absolute inset-0 bg-gradient-to-br from-primary/10 to-accent/10 z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-300 */
.fuziion-gallery-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom right,
        rgba(153, 118, 118, 0.1),
        rgba(212, 165, 165, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.fuziion-gallery-item-detailed:hover .fuziion-gallery-gradient-overlay {
    opacity: 1;
}

/* Category Overlay - matches React: absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-6 z-20 */
.fuziion-gallery-category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        transparent 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    pointer-events: none;
    z-index: 20;
}

.fuziion-gallery-item-detailed:hover .fuziion-gallery-category-overlay {
    opacity: 1;
}

/* Category Badge Wrapper - matches React: transform translate-y-4 group-hover:translate-y-0 transition-transform */
.fuziion-gallery-category-badge-wrapper {
    transform: translateY(16px);
    transition: transform 0.3s ease;
}

.fuziion-gallery-item-detailed:hover .fuziion-gallery-category-badge-wrapper {
    transform: translateY(0);
}

/* Category Badge - matches React: text-white px-3 py-1 bg-white/20 backdrop-blur-sm rounded-full text-sm */
.fuziion-gallery-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 9999px;
    font-size: 14px;
    line-height: 1.5;
    color: #ffffff;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fuziion-gallery-grid-detailed {
        gap: 20px;
    }

    .fuziion-gallery-item-detailed {
        height: 280px;
    }

    .fuziion-gallery-category-overlay {
        padding: 20px;
    }

    .fuziion-gallery-category-badge {
        font-size: 13px;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .fuziion-gallery-grid-detailed {
        gap: 16px;
    }

    .fuziion-gallery-item-detailed {
        height: 240px;
        border-radius: 12px;
    }

    .fuziion-gallery-category-overlay {
        padding: 16px;
    }

    .fuziion-gallery-category-badge {
        font-size: 12px;
        padding: 3px 8px;
    }
}

/* Ensure proper spacing */
.fuziion-gallery-grid-detailed-wrapper + * {
    margin-top: 32px;
}

