/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Modern Animated Background */
    background: linear-gradient(-45deg, #f5f7fa, #c3cfe2, #e2ebf0, #fdfbfb);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #333;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 300;
    margin: 60px 0 40px;
    letter-spacing: 4px;
    color: #333;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    text-transform: uppercase;
    animation: slideDown 0.8s ease-out;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: #333;
    margin: 15px auto 0;
    transition: width 0.3s ease;
}

.section-title:hover::after {
    width: 100px;
}

/* Navigation Tabs */
.nav-container {
    padding: 20px 20px 40px;
    text-align: center;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

.nav-tabs {
    display: inline-flex;
    gap: 15px;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.nav-item {
    cursor: pointer;
    padding: 8px 20px;
    color: #666;
    transition: all 0.3s ease;
    font-size: 15px;
    position: relative;
    border-radius: 20px;
}

.nav-item:hover {
    color: #333;
    background: rgba(255,255,255,0.8);
}

.nav-item.active {
    color: #fff;
    background: #333;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Gallery Grid (Mosaic Layout) */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-grid {
    column-count: 3;
    column-gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: transparent;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    break-inside: avoid;
    margin-bottom: 15px;
}

/* Staggered Animation Delay for first 12 items */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(10) { animation-delay: 0.55s; }
.gallery-item:nth-child(11) { animation-delay: 0.6s; }
.gallery-item:nth-child(12) { animation-delay: 0.65s; }

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
    border-radius: 8px;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Grid Spans - Default (Mobile First approach or general sizing) */
/* Define classes for different sizes */

/* Span classes kept for compatibility with masonry layout */
.span-full, .span-half, .span-third, .span-quarter, .span-tall, .span-large {
    display: block;
}

@media (min-width: 768px) {
    .gallery-container {
        padding: 20px;
    }
    
    .gallery-grid {
        column-count: 3;
        column-gap: 15px;
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 10px;
    }
    
    .gallery-item {
        margin-bottom: 10px;
    }
}

/* Photo Grid Specifics */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.video-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered Animation for Videos */
.video-item:nth-child(1) { animation-delay: 0.1s; }
.video-item:nth-child(2) { animation-delay: 0.2s; }
.video-item:nth-child(3) { animation-delay: 0.3s; }
.video-item:nth-child(4) { animation-delay: 0.4s; }

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.video-desc {
    font-size: 13px;
    color: #888;
}

/* Text Grid */
.text-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding-bottom: 60px;
}

.text-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered Animation for Text Cards */
.text-card:nth-child(1) { animation-delay: 0.1s; }
.text-card:nth-child(2) { animation-delay: 0.2s; }
.text-card:nth-child(3) { animation-delay: 0.3s; }
.text-card:nth-child(4) { animation-delay: 0.4s; }
.text-card:nth-child(5) { animation-delay: 0.5s; }
.text-card:nth-child(6) { animation-delay: 0.6s; }

.text-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    border-color: #ddd;
}

.text-category {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.text-title {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
    line-height: 1.4;
}

.text-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.text-meta {
    font-size: 12px;
    color: #999;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.open {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    object-fit: contain;
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    color: #333;
    font-size: 40px;
    font-weight: 300;
    transition: opacity 0.3s;
    user-select: none;
}

.lightbox-btn:hover {
    opacity: 0.6;
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 40px;
    cursor: pointer;
    color: #333;
    background: none;
    border: none;
    z-index: 1001;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Media Queries */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    .text-grid {
        grid-template-columns: 1fr;
    }
}

/* Back Button */
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 10px 20px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.back-home:hover {
    background: #333;
    color: #fff;
}
