/**
 * ACF Elegant Lightbox Gallery - CSS
 * Smooth animations, thin lines, modern aesthetics
 * Version: 1.0.0
 */

/* ============================================
   GALLERY GRID
   ============================================ */

.acf-elegant-gallery {
    display: grid;
    gap: var(--gallery-gap, 20px);
    grid-template-columns: repeat(var(--gallery-columns, 4), 1fr);
    margin: 2rem 0;
}

.acf-elegant-gallery[data-columns="2"] {
    --gallery-columns: 2;
}

.acf-elegant-gallery[data-columns="3"] {
    --gallery-columns: 3;
}

.acf-elegant-gallery[data-columns="4"] {
    --gallery-columns: 4;
}

.acf-elegant-gallery[data-columns="5"] {
    --gallery-columns: 5;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .acf-elegant-gallery {
        --gallery-columns: 3 !important;
    }
}

@media (max-width: 768px) {
    .acf-elegant-gallery {
        --gallery-columns: 2 !important;
    }
}

@media (max-width: 480px) {
    .acf-elegant-gallery {
        --gallery-columns: 1 !important;
    }
}

/* Gallery Items */
.acf-gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acf-gallery-item:hover {
    transform: translateY(-4px);
}

.acf-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.acf-gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay on hover */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(28, 39, 99, 0.85) 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acf-gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.zoom-icon {
    width: 48px;
    height: 48px;
    color: #ffffff;
    stroke-width: 1.5;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acf-gallery-item:hover .zoom-icon {
    transform: scale(1);
}

/* Empty state */
.acf-gallery-empty {
    padding: 3rem;
    text-align: center;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
}

/* ============================================
   LIGHTBOX MODAL
   ============================================ */

.elegant-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.elegant-lightbox.is-opening {
    display: flex;
    opacity: 0;
}

.elegant-lightbox.is-open {
    display: flex;
    opacity: 1;
}

.elegant-lightbox.is-closing {
    opacity: 0;
}

/* Overlay */
.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

/* Content Container */
.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 140px;
    z-index: 1;
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
    stroke-width: 1.5;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ============================================
   NAVIGATION ARROWS
   ============================================ */

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.elegant-lightbox.is-open .lightbox-nav {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
    stroke-width: 1.5;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-nav:disabled:hover {
    transform: translateY(-50%) scale(1);
}

/* ============================================
   IMAGE CONTAINER
   ============================================ */

.lightbox-image-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.lightbox-image.is-changing {
    opacity: 0;
    transform: scale(0.95);
}

/* Loading Spinner */
.lightbox-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lightbox-loading.is-hidden {
    opacity: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #FFC107;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   INFO BAR (Caption + CTA)
   ============================================ */

.lightbox-info-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.elegant-lightbox.is-open .lightbox-info-bar {
    transform: translateY(0);
}

/* Caption */
.lightbox-caption-wrapper {
    flex: 1;
    min-width: 0;
}

.lightbox-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.lightbox-caption {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
}

.lightbox-counter {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.lightbox-counter .current {
    color: #FFC107;
    font-weight: 600;
}

/* CTA Button */
.lightbox-cta {
    flex-shrink: 0;
}

.lightbox-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    color: #1C2763;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.lightbox-cta-button svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.lightbox-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.lightbox-cta-button:active {
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .lightbox-content {
        padding: 60px 15px 160px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-info-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 20px;
    }
    
    .lightbox-title {
        font-size: 16px;
    }
    
    .lightbox-caption {
        font-size: 13px;
    }
    
    .lightbox-cta-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .lightbox-image-wrapper {
        max-width: 95vw;
        max-height: calc(100vh - 240px);
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.elegant-lightbox:focus {
    outline: none;
}

.lightbox-close:focus,
.lightbox-nav:focus,
.lightbox-cta-button:focus {
    outline: 2px solid #FFC107;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .elegant-lightbox,
    .lightbox-image,
    .lightbox-info-bar,
    .lightbox-close,
    .lightbox-nav,
    .lightbox-cta-button,
    .acf-gallery-item,
    .gallery-item-overlay {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.no-scroll {
    overflow: hidden !important;
}
