/* ============================================
   TRANSPARENCIA - CSS PREMIUM (GRID 4 COLUMNAS)
   ============================================ */

/* Hero Section */
.transparencia-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0a 60%, #7b1d1d 100%);
    padding: 3rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid #dc2626;
    margin-bottom: 3rem;
}

.transparencia-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(220, 38, 38, .18) 0%, transparent 70%);
    pointer-events: none;
}

.transparencia-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: white;
}

.transparencia-hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    color: #e5e5e5;
    max-width: 800px;
    margin: 0 auto;
}

/* --- GRID PRINCIPAL DE 4 COLUMNAS --- */
.transparencia-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columnas Exactas */
    gap: 1.5rem;
    margin-bottom: 4rem;
}

/* Tarjeta de Categoría/Mes */
.category-card {
    background: white;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centrado */
    text-align: center;
    /* Texto centrado */
    height: 100%;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #dc2626;
}

.category-icon {
    width: 64px;
    height: 64px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 50%;
    /* Icono circular */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-content {
    flex-grow: 1;
    width: 100%;
}

.category-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.category-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.category-link:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* --- LISTA DE DOCUMENTOS EN GRID DE 4 --- */

.filters-bar {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}

.year-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.year-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #4b5563;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.year-btn:hover,
.year-btn.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Grid de Documentos (Antes era lista) */
.document-grid-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columnas Exactas */
    gap: 1.5rem;
}

/* Tarjeta de Documento (Antes fila) */
.document-row {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    /* Vertical */
    align-items: center;
    text-align: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    height: 100%;
}

.document-row:hover {
    border-color: #dc2626;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-3px);
}

.doc-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.doc-icon-small {
    color: #ef4444;
    background: #fef2f2;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-icon-small svg {
    width: 24px;
    height: 24px;
}

.doc-meta h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.doc-meta span {
    font-size: 0.85rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.doc-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.btn-icon-action {
    flex: 1;
    /* Botones ocupan espacio igual */
    padding: 0.6rem;
    border-radius: 8px;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-action:hover, .btn-icon-action:active {
    border-color: #dc2626;
    color: white;
    background: #dc2626;
}

/* Links de navegación hacia subsecciones en index.php */
.category-nav-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.category-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    text-align: center;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    min-height: 56px; /* Touch target grande base */
    touch-action: manipulation;
}

.category-nav-link:hover, .category-nav-link:active {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}

/* Touch targets para mejor respuesta móvil */
button, a.btn-icon-action, .category-nav-link {
    touch-action: manipulation;
}

/* Responsive */
@media (max-width: 1200px) {

    .transparencia-grid,
    .document-grid-list {
        grid-template-columns: repeat(3, 1fr);
        /* 3 en pantallas medianas */
    }
}

@media (max-width: 900px) {

    .transparencia-grid,
    .document-grid-list {
        grid-template-columns: repeat(2, 1fr);
        /* 2 en tablets */
    }
}

@media (max-width: 600px) {

    .transparencia-grid,
    .category-nav-list,
    .document-grid-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .category-nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .category-card {
        padding: 1rem 0.5rem;
    }

    .category-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }

    .document-grid-list {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil para reducir scroll */
        gap: 0.75rem; /* Gap ajustado para 2 columnas */
    }

    .document-row {
        padding: 1rem 0.5rem; /* Padding más compacto pero manteniendo legibilidad */
    }

    .doc-icon-small {
        width: 44px; /* Aumento para touch area de 44px */
        height: 44px;
        margin-bottom: 0.5rem; /* Asegurar espacio */
    }

    .doc-icon-small svg {
        width: 22px;
        height: 22px;
    }

    .doc-meta h4 {
        font-size: 0.95rem; /* Título un poco más compacto para 2 columnas */
        margin-bottom: 0.35rem;
        line-height: 1.2;
    }

    .doc-meta span {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .btn-icon-action {
        padding: 0.6rem; /* Ajuste para touch targets recomendados (>=44px) */
        min-height: 44px;
    }
    
    .btn-icon-action svg {
        width: 20px;
        height: 20px;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
}