/* ==========================================================================
   THE CROWN DANCE STUDIO - GALERÍA INMERSIVA & LUXURY EDITORIAL MASONRY
   Inspirado en la dirección visual y cinética de Rachel Neville Studios
   ========================================================================== */

/* --- Contenedor Principal de la Galería --- */
.immersive-gallery-section {
    position: relative;
    background: #000000;
    color: #f5f5f7;
    padding: 120px 4% 100px 4%;
    overflow: hidden;
}

/* Efectos de fondo escénico / Iluminación teatral */
.theatrical-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(circle at 15% 20%, rgba(255, 102, 196, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 85% 60%, rgba(193, 154, 81, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 90%, rgba(255, 102, 196, 0.05) 0%, transparent 40%);
}

.gallery-header-editorial {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px auto;
}

.gallery-overtitle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--dorado, #C19A51);
    margin-bottom: 12px;
}

.gallery-title-luxury {
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-weight: 900;
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    letter-spacing: -1px;
    text-transform: uppercase;
    margin: 0 0 16px 0;
    line-height: 1.05;
    background: linear-gradient(180deg, #FFFFFF 30%, #A0A0A0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-subtitle-luxury {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #8E8E93;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 650px;
}

/* --- BARRA DE FILTROS INTERACTIVA (PILLS) --- */
.filter-pills-container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 auto 55px auto;
    max-width: 1100px;
    padding: 0 10px;
}

.filter-pill {
    background: rgba(22, 22, 26, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #9E9EA7;
    padding: 11px 26px;
    border-radius: 40px;
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    user-select: none;
}

.filter-pill i {
    font-size: 0.85rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.filter-pill:hover {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    background: rgba(32, 32, 38, 0.85);
}

.filter-pill.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(255, 102, 196, 0.3) 0%, rgba(193, 154, 81, 0.25) 100%);
    border-color: var(--rosa-neon, #FF66C4);
    box-shadow: 0 0 25px rgba(255, 102, 196, 0.25), 0 8px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.filter-pill.active.gold {
    border-color: var(--dorado, #C19A51);
    box-shadow: 0 0 25px rgba(193, 154, 81, 0.25), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.filter-pill.active i {
    transform: scale(1.15);
}

/* --- CUADRÍCULA MASONRY ASIMÉTRICA --- */
.masonry-container {
    position: relative;
    z-index: 2;
    max-width: 1440px;
    margin: 0 auto;
    column-count: 3;
    column-gap: 24px;
}

@media (max-width: 1024px) {
    .masonry-container {
        column-count: 2;
        column-gap: 20px;
    }
}

@media (max-width: 640px) {
    .masonry-container {
        column-count: 1;
        column-gap: 0;
    }
}

/* --- TARJETA DE GALERÍA (ITEM) --- */
.gallery-card {
    break-inside: avoid;
    margin-bottom: 24px;
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(18, 18, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: 
        transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
        border-color 0.45s ease,
        opacity 0.4s ease;
    contain: layout;
}

/* Soporte de animaciones de filtrado */
.gallery-card.hidden {
    display: none;
}

.gallery-card.anim-fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.gallery-card.anim-fade-in {
    animation: cardAppear 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Contenedor Multimedia y Ratios */
.card-media-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #08080A;
}

.card-media-wrapper.ratio-4-5 {
    aspect-ratio: 4 / 5;
}

.card-media-wrapper.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.card-media-wrapper.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* Imagen y Video */
.card-media-wrapper img,
.card-media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.75s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
}

/* Hover de Escala Suave Estilo Editorial */
.gallery-card:hover .card-media-wrapper img,
.gallery-card:hover .card-media-wrapper video {
    transform: scale(1.035);
}

.gallery-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 102, 196, 0.35);
    box-shadow: 
        0 22px 50px rgba(0, 0, 0, 0.85),
        0 0 25px rgba(255, 102, 196, 0.18);
}

.gallery-card.gold-border:hover {
    border-color: rgba(193, 154, 81, 0.45);
    box-shadow: 
        0 22px 50px rgba(0, 0, 0, 0.85),
        0 0 25px rgba(193, 154, 81, 0.2);
}

/* --- BADGES Y TAGS TEATRALES --- */
.card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(8, 8, 10, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #F0F0F2;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 4;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-badge.gold {
    border-color: rgba(193, 154, 81, 0.5);
    color: var(--dorado, #C19A51);
}

.card-badge.pink {
    border-color: rgba(255, 102, 196, 0.5);
    color: var(--rosa-neon, #FF66C4);
}

.card-badge.video-badge {
    background: rgba(255, 102, 196, 0.2);
    border-color: var(--rosa-neon, #FF66C4);
    color: #FFF;
}

/* Indicador de Acción (Icono Superior Derecho) */
.card-action-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(8, 8, 10, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 4;
}

.gallery-card:hover .card-action-icon {
    opacity: 1;
    transform: translateY(0);
}

/* --- OVERLAY OSCURO GRADUAL CON TIPOGRAFÍA EMERGENTE --- */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5, 5, 6, 0.95) 0%,
        rgba(5, 5, 6, 0.65) 35%,
        rgba(5, 5, 6, 0.2) 65%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 20px;
    z-index: 3;
    pointer-events: none;
}

.gallery-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay-content {
    transform: translateY(8px);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-card:hover .card-overlay-content {
    transform: translateY(0);
}

.card-discipline {
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dorado, #C19A51);
    margin-bottom: 4px;
}

.card-discipline.pink {
    color: var(--rosa-neon, #FF66C4);
}

.card-piece-title {
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 1.35rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 6px 0;
    line-height: 1.15;
}

.card-meta-info {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.85rem;
    font-weight: 400;
    color: #A0A0A5;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-meta-info span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Indicador de Video en Loop */
.video-playing-indicator {
    position: absolute;
    bottom: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 102, 196, 0.4);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--rosa-neon, #FF66C4);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
    z-index: 4;
}

.video-playing-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rosa-neon, #FF66C4);
    box-shadow: 0 0 8px var(--rosa-neon, #FF66C4);
    animation: pulseDot 1.5s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* --- LIGHTBOX MODAL FULL-SCREEN --- */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 6, 0.96);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content-wrapper {
    position: relative;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-media-container {
    position: relative;
    max-width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #000;
}

.lightbox-media-container img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    user-select: none;
}

.lightbox-media-container video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 16px;
    display: block;
    background: #000;
}

/* Botones de Control Lightbox */
.lightbox-btn-close {
    position: absolute;
    top: 25px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(22, 22, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
}

.lightbox-btn-close:hover {
    background: rgba(255, 102, 196, 0.35);
    border-color: var(--rosa-neon, #FF66C4);
    transform: scale(1.08);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(20, 20, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
}

.lightbox-nav-btn:hover {
    background: var(--dorado, #C19A51);
    color: #000000;
    border-color: var(--dorado, #C19A51);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(193, 154, 81, 0.4);
}

.lightbox-nav-btn.prev {
    left: 30px;
}

.lightbox-nav-btn.next {
    right: 30px;
}

@media (max-width: 768px) {
    .lightbox-nav-btn.prev { left: 10px; }
    .lightbox-nav-btn.next { right: 10px; }
    .lightbox-btn-close { top: 15px; right: 15px; }
}

.lightbox-counter {
    position: absolute;
    top: 30px;
    left: 35px;
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--dorado, #C19A51);
    z-index: 10;
}

.lightbox-caption-panel {
    margin-top: 18px;
    background: rgba(18, 18, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 28px;
    border-radius: 30px;
    text-align: center;
    max-width: 600px;
}

.lightbox-caption-discipline {
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dorado, #C19A51);
}

.lightbox-caption-title {
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 3px 0;
}

.lightbox-caption-desc {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.85rem;
    color: #8E8E93;
}

/* --- BLOQUE CTA DE CONVERSIÓN HACIA WHATSAPP --- */
.gallery-conversion-cta {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 80px auto 0 auto;
    background: linear-gradient(135deg, rgba(24, 24, 28, 0.8) 0%, rgba(38, 18, 32, 0.75) 100%);
    border: 1px solid rgba(255, 102, 196, 0.3);
    border-radius: 35px;
    padding: 55px 40px;
    text-align: center;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.8),
        0 0 35px rgba(255, 102, 196, 0.12);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.cta-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dorado, #C19A51);
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.cta-heading {
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 900;
    color: #FFFFFF;
    margin: 0 0 16px 0;
    line-height: 1.15;
}

.cta-desc {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 1.1rem;
    color: #A0A0A5;
    max-width: 680px;
    margin: 0 auto 35px auto;
    line-height: 1.6;
}

.cta-actions-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.btn-cta-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #FFFFFF;
    padding: 16px 36px;
    border-radius: 35px;
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-cta-whatsapp:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5);
    color: #FFFFFF;
}

.btn-cta-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dorado, #C19A51);
    color: var(--dorado, #C19A51);
    padding: 16px 34px;
    border-radius: 35px;
    font-family: var(--font-heading, 'League Spartan', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-cta-secondary:hover {
    background: var(--dorado, #C19A51);
    color: #000000;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(193, 154, 81, 0.3);
}

@media (max-width: 600px) {
    .gallery-conversion-cta {
        padding: 40px 20px;
        border-radius: 25px;
    }
    .btn-cta-whatsapp, .btn-cta-secondary {
        width: 100%;
        justify-content: center;
    }
}
