/* 🖼️ GALLERY MODAL - Immersive Case Study Lightbox
   Mantiene identidad MATA AI: negro, minimalismo, glassmorphism, cinematográfico */

/* ============================
   BADGES ON CARDS
   ============================ */

.gallery-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    pointer-events: none;
}

.frames-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 3;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.frames-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.frames-badge svg { opacity: 0.8; }

/* ============================
   MODAL OVERLAY
   ============================ */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg, #0A0A0A);
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
}

.gallery-modal.active {
    display: block;
    animation: galleryFadeIn 0.35s ease;
}

@keyframes galleryFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar - sutil */
.gallery-modal::-webkit-scrollbar { width: 3px; }
.gallery-modal::-webkit-scrollbar-track { background: transparent; }
.gallery-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ============================
   CLOSE BUTTON - Glassmorphism
   ============================ */

.gallery-close {
    position: fixed;
    top: 24px;
    right: 28px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10001;
}

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

/* ============================
   CASE STUDY CONTENT
   ============================ */

.gallery-case-study {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 40px 100px;
}

/* HEADER */
.gallery-header {
    text-align: center;
    margin-bottom: 48px;
    padding-top: 20px;
}

.gallery-year {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--mute, #C5C5C5);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0.6;
}

.gallery-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.gallery-desc {
    color: var(--mute, #C5C5C5);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 20px;
    opacity: 0.7;
}

.gallery-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-tag {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 4px 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================
   CREDITS SECTION
   ============================ */

.gallery-credits {
    max-width: 700px;
    margin: 0 auto 48px;
    padding: 28px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.credits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
}

.credit-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.credit-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.credit-value {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

.credit-item--link {
    display: flex;
    align-items: flex-end;
}

/* ============================
   CTA BUTTONS - After video
   ============================ */

.gallery-cta-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 32px 0 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.gallery-cta {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 12px 28px;
    transition: all 0.3s ease;
    display: inline-block;
    letter-spacing: 0.3px;
    background: rgba(255,255,255,0.05);
}

.gallery-cta:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

.gallery-cta--secondary {
    background: transparent;
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}

.gallery-cta--secondary:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.25);
}

/* ============================
   IMAGE LAYOUTS
   ============================ */

/* Hero: primera imagen full width */
.gallery-hero-img {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.gallery-hero-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* Grid de 2 columnas */
.gallery-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Grid de 3 columnas */
.gallery-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Imagen individual full width */
.gallery-single {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.gallery-single img {
    width: 100%;
    height: auto;
    display: block;
}

/* Items del grid */
.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* VIDEO dentro del case study */
.gallery-video {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #000;
    aspect-ratio: 16/9;
    position: relative;
    cursor: pointer;
}

.gallery-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* DIVIDER sutil */
.gallery-divider {
    width: 60px;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 40px auto;
}

/* FOOTER / Disclaimer */
.gallery-footer {
    text-align: center;
    margin-top: 48px;
}

.gallery-footer p {
    color: rgba(255,255,255,0.2);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    line-height: 1.5;
    max-width: 480px;
    margin: 0 auto;
}

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

@media (max-width: 768px) {
    .gallery-case-study {
        padding: 70px 20px 80px;
    }

    .gallery-header h2 {
        font-size: 32px;
    }

    .gallery-desc {
        font-size: 14px;
    }

    .gallery-row {
        grid-template-columns: 1fr;
    }

    .gallery-row--3 {
        grid-template-columns: 1fr;
    }

    .gallery-hero-img,
    .gallery-single,
    .gallery-item {
        border-radius: 8px;
    }

    .gallery-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    .credits-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .credit-value {
        font-size: 13px;
    }

    .frames-badge {
        bottom: 8px;
        left: 8px;
        font-size: 11px;
        padding: 4px 10px;
    }

    .gallery-badge {
        bottom: 8px;
        right: 8px;
        font-size: 11px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .gallery-header h2 {
        font-size: 26px;
    }

    .gallery-tags {
        gap: 6px;
    }

    .gallery-tag {
        font-size: 10px;
    }
}
