/* Contenedor principal de la galería agrupada */
.nm-entries-group-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Grid de categorías */
.nm-group-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Tarjeta de categoría */
.nm-group-category {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.nm-group-category:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.nm-group-category.active {
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.25);
    border: 3px solid #2563eb;
    transform: translateY(-5px);
}

.nm-group-category.inactive {
    opacity: 0.5;
    filter: grayscale(60%);
}

.nm-group-category.inactive:hover {
    opacity: 0.7;
    filter: grayscale(40%);
}

/* Imagen de categoría */
.nm-category-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nm-category-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    pointer-events: none;
}

.nm-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nm-group-category:hover .nm-category-image img {
    transform: scale(1.08);
}

/* Placeholder para categorías sin imagen */
.nm-category-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nm-category-placeholder span {
    font-size: 72px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

/* Contenido de categoría */
.nm-category-content {
    padding: 20px;
    background: #fff;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

/* Título de categoría */
.nm-category-title {
    margin: 0 0 12px 0;
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
    line-height: 1.3;
}

.nm-group-category.active .nm-category-title {
    color: #2563eb;
}

/* Descripción de categoría */
.nm-category-description {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.nm-category-description:empty {
    display: none;
}

.nm-group-category.active .nm-category-content {
    background: #eff6ff;
}

/* Contenedor de entradas filtradas */
.nm-group-entries-container {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header de entradas */
.nm-group-entries-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.nm-group-current-category {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Grid de entradas (reutiliza estilos de entries-list.css) */
.nm-entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Mensaje cuando no hay entradas */
.nm-no-entries {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.nm-no-entries p {
    font-size: 18px;
    color: #6b7280;
    margin: 0;
}

/* Paginación */
.nm-entries-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.nm-page-link {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nm-page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.nm-page-link.nm-current {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    cursor: default;
}

.nm-page-link.nm-prev,
.nm-page-link.nm-next {
    padding: 8px 16px;
    font-weight: 600;
}

.nm-page-dots {
    padding: 0 8px;
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .nm-group-categories {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 20px;
    }

    .nm-category-image {
        height: 180px;
    }

    .nm-category-placeholder span {
        font-size: 48px;
    }

    .nm-category-content {
        padding: 16px;
    }

    .nm-category-title {
        font-size: 16px;
    }

    .nm-category-description {
        font-size: 13px;
    }

    .nm-group-current-category {
        font-size: 22px;
    }

    .nm-entries-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .nm-entries-group-container {
        padding: 15px;
    }

    .nm-group-categories {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nm-category-image {
        height: 160px;
    }

    .nm-category-placeholder span {
        font-size: 42px;
    }

    .nm-category-content {
        padding: 15px;
    }

    .nm-category-title {
        font-size: 15px;
    }

    .nm-category-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

/* Estados de carga */
.nm-loading {
    position: relative;
    pointer-events: none;
}

.nm-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f4f6;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
