/* Photo Gallery Custom Styles */

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth transitions for gallery interactions */
.gallery-transition {
    transition: all 0.3s ease-in-out;
}

/* Custom hover effects for gallery items */
.gallery-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive image loading placeholder */
.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Fade in animation for gallery items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Stagger animation for multiple items */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

/* Lightbox — self-contained styles (not dependent on Tailwind purge) */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
    transition: opacity 0.3s ease;
}

.lightbox-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 72rem;
    max-height: 100%;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    width: 100%;
    max-height: calc(100vh - 8rem);
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
    border-radius: 0 0 0.5rem 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
}

.lightbox-caption.is-hidden {
    display: none;
}

.lightbox-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding-bottom: 0.5rem;
}

.lightbox-nav-btn {
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.lightbox-nav-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

.lightbox-nav-btn:active {
    transform: scale(0.95);
}

.lightbox-counter {
    min-width: 5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .gallery-grid {
        gap: 0.75rem;
    }
    
    .gallery-item {
        border-radius: 0.5rem;
    }
}

/* Print styles */
@media print {
    .gallery-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Enhanced gallery styling */
.gallery-section {
    position: relative;
    z-index: 1;
}

/* Removed gray background from gallery section */

/* Improved hover effects */
.gallery-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Better image loading states */
.gallery-image {
    transition: all 0.3s ease;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.gallery-image.loaded {
    background: none;
    animation: none;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Aspect ratio utilities */
.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .gallery-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .gallery-card:active {
        transform: translateY(-2px) scale(0.99);
    }
    
    /* Better mobile grid */
    .gallery-grid-mobile {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1280px) {
    .gallery-grid-xl {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Ensure images don't overflow */
.gallery-image {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Better container constraints */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Gallery content container positioning */
#gallery-content-container {
    position: relative;
}

/* Gallery photos positioning */
.gallery-photos {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    z-index: 20;
}

.gallery-photos.hidden {
    display: none;
}
