/* ==========================================
   ESTÉTICA GENERAL DE MUSEO
   ========================================== */
.gallery-hero {
    text-align: center;
    padding: 40px 20px 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.eyebrow {
    font-size: 0.8rem;
    letter-spacing: 5px;
    color: var(--accent-gold);
    font-weight: 600;
    display: block;
    margin-bottom: 15px;
}

.gallery-main-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--blue-dark);
    margin: 0 0 15px 0;
    line-height: 1.1;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: var(--blue-slate);
    font-weight: 300;
}

/* Filtros */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(128, 150, 181, 0.15);
    padding: 9px 22px;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--blue-slate);
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-gold);
    color: white;
    border-color: var(--accent-gold);
    box-shadow: 0 4px 10px rgba(214, 179, 89, 0.2);
}

/* ==========================================
   MURO MASONRY (TIPO PINTEREST)
   ========================================== */
.masonry-grid {
    column-count: 4;
    column-gap: 20px;
    padding: 0 5%;
    margin-bottom: 80px;
}

@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 800px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transform: translateZ(0);
    /* Fix para Safari */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.masonry-item img {
    width: 100%;
    display: block;
    height: auto;
    transition: transform 0.5s ease;
}

/* Indicador de galería -> NUEVA UBICACIÓN: INFERIOR DERECHA */
.gallery-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(10, 15, 25, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    z-index: 2;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.likes-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(10, 15, 25, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    z-index: 2;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.likes-badge .material-symbols-outlined {
    color: #e74c3c;
    font-variation-settings: 'FILL' 1;
}

.heart-icon.liked {
    color: #e74c3c;
    font-variation-settings: 'FILL' 1;
}

.masonry-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 15, 25, 0.95) 0%, rgba(10, 15, 25, 0) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-text strong {
    display: block;
    color: white;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    margin-bottom: 5px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.overlay-text span {
    color: var(--accent-gold);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    display: block;
    font-weight: 700;
}

/* Efectos de Hover */
.masonry-item:hover img {
    transform: scale(1.03);
}

.masonry-item:hover .masonry-overlay {
    opacity: 1;
}

.masonry-item:hover .overlay-text strong,
.masonry-item:hover .overlay-text span {
    transform: translateY(0);
}


/* ==========================================
   MODAL LIGHTBOX INMERSIVO
   ========================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 18, 0.97);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.lightbox-close-btn {
    position: absolute;
    top: 25px;
    right: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-close-btn .material-symbols-outlined {
    font-size: 1.8rem;
}

.lightbox-close-btn:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
    background: rgba(214, 179, 89, 0.1);
}

.lightbox-content-wrapper {
    display: flex;
    background: #0c1016;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 1300px;
    height: 88vh;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(214, 179, 89, 0.2);
}

.lightbox-image-container {
    flex: 2.2;
    background: #05080c;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Botones de control de galería */
.nav-art-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.nav-art-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-50%) scale(1.1);
}

.nav-art-btn.left {
    left: 20px;
}

.nav-art-btn.right {
    right: 20px;
}

/* Panel derecho de Ficha Técnica */
.lightbox-info {
    flex: 1;
    min-width: 340px;
    max-width: 420px;
    padding: 40px;
    color: white;
    display: flex;
    flex-direction: column;
    background: #0c1016;
}

.artist-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#artist-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 4px 10px rgba(214, 179, 89, 0.3);
}

#artist-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
}

.lightbox-title-area h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: white;
    margin: 0 0 10px 0;
    line-height: 1.1;
}

.lightbox-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(214, 179, 89, 0.08);
    color: var(--accent-gold);
    border: 1px solid rgba(214, 179, 89, 0.3);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    width: max-content;
}

.lightbox-desc-scroll {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 15px;
}

.lightbox-desc-scroll::-webkit-scrollbar {
    width: 4px;
}

.lightbox-desc-scroll::-webkit-scrollbar-thumb {
    background: rgba(214, 179, 89, 0.4);
    border-radius: 4px;
}

.lightbox-desc-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

.lightbox-desc {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
    white-space: pre-wrap;
    margin: 0;
}

/* Footer del Lightbox: Acciones -> NUEVO ESTILO */
.lightbox-footer-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.art-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--blue-muted);
    font-size: 0.85rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.stat-item .material-symbols-outlined {
    font-size: 1.1rem;
    color: rgba(128, 150, 181, 0.5);
}

.art-series-counter {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
}

/* Botón Apreciar (Like) */
.btn-appreciate {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-appreciate:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.heart-icon {
    font-size: 1.3rem;
    transition: color 0.3s ease, transform 0.3s ease;
    color: rgba(255, 255, 255, 0.5);
}

/* Estado del corazón cuando ya le dieron Like */
.heart-icon.liked {
    color: #e74c3c;
    font-variation-settings: 'FILL' 1;
    /* Llenar el ícono si la fuente lo soporta */
}

/* ==========================================
   ANIMACIÓN PULSE-POP PARA EL LIKE
   ========================================== */
.pulse-pop {
    animation: heartPop 0.45s ease-out;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.4);
    }

    30% {
        transform: scale(0.9);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}


/* Responsividad para el modal */
@media (max-width: 900px) {
    .lightbox-content-wrapper {
        flex-direction: column;
        height: 90vh;
        overflow-y: auto;
    }

    .lightbox-info {
        max-width: 100%;
        height: auto;
        padding: 30px;
    }

    .lightbox-image-container {
        min-height: 45vh;
        flex: 1;
    }

    .gallery-main-title {
        font-size: 3rem;
    }

    .nav-art-btn {
        width: 40px;
        height: 40px;
    }

    .lightbox-close-btn {
        top: 15px;
        right: 15px;
    }
}

/* --- Escudo Antirrobo de Imágenes --- */
.protected-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    /* Forzamos a que respete la altura del Lightbox */
    display: flex;
    justify-content: center;
    align-items: center;
}

.protected-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Garantiza que la imagen se escale sin recortarse */
    user-select: none;
    -webkit-user-drag: none;
    /* Bloquea el arrastre en Chrome/Safari */
}

.image-protector {
    position: absolute;
    inset: 0;
    z-index: 5;
    /* Esto coloca tu logo repetido al 2% de opacidad como marca de agua sutil y bloquea clics */
    background-image: url('../recursos/logos/logo.png');
    background-repeat: repeat;
    background-size: 150px;
    opacity: 0.02;
    pointer-events: auto;
    /* Absorbe el clic derecho */
}

/* --- Autor en el Muro (Hover) --- */
.hover-author {
    margin-top: 15px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 8px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.masonry-item:hover .hover-author {
    transform: translateY(0);
}

/* --- Rediseño del Panel Derecho (Lightbox) --- */
.lightbox-info {
    flex: 1;
    min-width: 340px;
    max-width: 420px;
    padding: 35px 40px;
    color: white;
    display: flex;
    flex-direction: column;
    background: #0c1016;
}

.artist-mini-card {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#artist-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(128, 150, 181, 0.3);
}

#artist-name {
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.lightbox-title-area {
    margin-bottom: 25px;
}

.lightbox-title-area h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: white;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.lightbox-desc-scroll {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
}

.lightbox-desc {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
}