/* Nuevos estilos para Resúmenes Ejecutivos (Cards Horizontales) */
.gallery-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    display: flex;
    background-color: rgba(40, 51, 96, 0.6);
    border: 1px solid rgba(0, 255, 209, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    min-height: 160px;
}

.summary-card:hover {
    transform: translateY(-5px);
    border-color: #00ffd1;
    box-shadow: 0 10px 25px rgba(0, 255, 209, 0.15);
    background-color: rgba(40, 51, 96, 0.8);
}

.summary-img {
    width: 160px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.summary-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.summary-card:hover .summary-img img {
    transform: scale(1.1);
}

.image-count-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(2px);
}

.summary-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-title {
    color: #00ffd1;
    font-family: '__Montserrat Thin_5';
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.summary-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.summary-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: auto;
    font-style: italic;
}

/* Estilos para el Hero (Principal) */
.summary-hero {
    border: 1px solid rgba(0, 255, 209, 0.5);
    background: linear-gradient(90deg, rgba(40, 51, 96, 0.9) 0%, rgba(40, 51, 96, 0.6) 100%);
    min-height: 220px;
}

.summary-hero .summary-img {
    width: 280px;
}

.summary-hero .summary-title {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.summary-hero .summary-desc {
    font-size: 1.1rem;
    -webkit-line-clamp: 4;
}

@media (max-width: 768px) {
    .summary-card {
        flex-direction: column;
    }
    
    .summary-img, .summary-hero .summary-img {
        width: 100%;
        height: 180px;
    }
    
    .summary-hero .summary-title {
        font-size: 1.4rem;
    }
}

/* Estilos para el Modal Split View */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    width: 95vw;
    height: 90vh;
    display: flex;
    flex-direction: row;
    background-color: #1a1a2e;
    border: 1px solid #00ffd1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 209, 0.2);
}

/* Panel Izquierdo: Imagen */
.gallery-modal-left-panel {
    flex: 1;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(0, 255, 209, 0.3);
}

.gallery-modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: crosshair;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 209, 0.5);
    background-color: rgba(0, 0, 0, 0.55);
    color: #00ffd1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 110;
}

.gallery-nav-btn:hover,
.gallery-nav-btn:focus {
    background-color: rgba(0, 255, 209, 0.25);
    color: #fff;
    border-color: #00ffd1;
    outline: none;
}

.gallery-nav-prev {
    left: 20px;
}

.gallery-nav-next {
    right: 20px;
}

.gallery-modal-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    display: none;
    z-index: 110;
}

.gallery-modal-image-container img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    display: block;
}

.img-zoom-lens {
    position: absolute;
    border: 1px solid #00ffd1;
    width: 150px; /* Tamaño de la lente */
    height: 150px;
    background-color: rgba(0, 255, 209, 0.1);
    cursor: none;
    display: none; /* Se activa con JS */
    z-index: 100;
}

/* Panel Derecho: Herramientas */
.gallery-modal-right-panel {
    flex: 1.3; /* Más ancho que el panel izquierdo */
    min-width: 400px;
    display: flex;
    flex-direction: column;
    background-color: #16213e;
    padding: 25px;
    overflow: hidden;
    min-height: 0;
}

.gallery-modal-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-modal-title {
    font-family: '__Montserrat Thin_5';
    color: #00ffd1;
    font-size: 1.3rem;
    margin: 0;
    line-height: 1.2;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-modal-actions-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.action-btn {
    color: #fff;
    opacity: 0.7;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    position: relative;
}

.action-btn:hover {
    color: #00ffd1;
    opacity: 1;
    background: rgba(0, 255, 209, 0.2);
}

.gallery-modal-close-btn {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-left: 5px;
}

.gallery-modal-close-btn:hover {
    color: #00ffd1;
}

.action-btn.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.action-btn.is-loading svg {
    visibility: hidden;
}

.action-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #00ffd1;
    border-radius: 50%;
    animation: action-btn-spinner 0.8s linear infinite;
}

@keyframes action-btn-spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.gallery-modal-details {
    flex: 1;
    display: flex;
    gap: 24px;
    align-items: stretch;
    min-height: 0;
}

.gallery-modal-zoom-slot {
    flex: 1 1 66%;
    max-width: 66%;
    min-width: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-height: 100%;
}

/* Zoom Result en Panel Derecho */
.img-zoom-result-panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1; /* Mantener cuadrado */
    position: relative;
    border: 1px solid #00ffd1;
    background-color: #000;
    display: none; /* Se muestra al hacer hover */
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Info */

.gallery-modal-right-panel .gallery-modal-info {
    position: static !important;
    transform: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.85);
    flex: 1 1 34%;
    min-width: 0;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.gallery-modal-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-modal-content {
        flex-direction: column;
        height: 100vh;
        width: 100vw;
        border-radius: 0;
    }

    .gallery-modal-left-panel {
        flex: 1;
        height: 50%;
    }

    .gallery-modal-right-panel {
        flex: 1;
        height: 50%;
        max-width: 100%;
        min-width: auto;
    }

    .gallery-modal-details {
        flex-direction: column;
    }

    .gallery-modal-zoom-slot {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-width: auto;
        height: auto;
    }
    
    .img-zoom-result-panel {
        display: none !important; /* Ocultar zoom en móviles */
    }
    
    .img-zoom-lens {
        display: none !important;
    }

    .gallery-nav-btn {
        top: auto;
        bottom: 10px;
        transform: none;
    }

    .gallery-nav-prev {
        left: 15px;
    }

    .gallery-nav-next {
        right: 15px;
    }

    .gallery-modal-counter {
        bottom: 12px;
    }
}
