/* === CSS PARA LA PÁGINA PRINCIPAL (index.html) === */

/* --- Reseteo Básico y Fuentes Globales --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    background-color: #f8f9fa;
    color: #343a40;
    margin: 0;
    padding: 0;
}

h1, h2, h3 {
    font-family: "Georgia", "Times New Roman", Times, serif;
    font-weight: bold;
    color: #212529;
    line-height: 1.3;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* --- Encabezado del Blog (Hero) --- */
.site-header {
    background-color: #343a40;
    color: #ffffff;
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 40px;
}
.site-header h1 {
    color: #ffffff;
    font-size: 3.5rem;
    margin: 0;
}
.site-header .subtitle {
    font-size: 1.3rem;
    color: #ced4da;
    margin: 10px 0 0 0;
}

/* --- Layout Principal (Grid de 2 Columnas) --- */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr; 
    gap: 30px;
    max-width: 1200px; 
    margin: 20px auto;
    padding: 0 20px;
}

/* === Estilos del Menú Lateral (Sidebar) === */
.sidebar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 20px; 
}

.sidebar-nav h3 {
    font-size: 1.4rem;
    margin-top: 0;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Estilos para <details> y <summary> */
.sidebar-nav details {
    margin-bottom: 5px;
}

.sidebar-nav summary {
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    padding: 10px 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.sidebar-nav summary:hover {
    background-color: #f8f9fa;
}

/* Flecha personalizada (►) */
.sidebar-nav summary::before {
    content: '►';
    font-size: 0.8em;
    margin-right: 10px;
    display: inline-block;
    transition: transform 0.2s;
}

/* Gira la flecha cuando el menú está abierto */
.sidebar-nav details[open] > summary::before {
    transform: rotate(90deg);
}

/* Nivel 1 (Patrones de Diseño) */
.nav-level-1 > summary {
    font-size: 1.1rem;
}

/* Contenedor de sub-niveles */
.sidebar-nav ul {
    list-style: none;
    padding-left: 25px;
    margin-top: 5px;
    margin-bottom: 5px;
}
.sidebar-nav li {
    margin-bottom: 2px;
}

/* Nivel 2 (Comportamiento) */
.nav-level-2 > summary {
    font-size: 1rem;
    font-weight: 600;
    color: #343a40;
    padding-left: 10px;
}

/* Nivel 3 (Artículos) */
.nav-level-2 > ul {
    padding-left: 15px;
}
.sidebar-nav li a {
    font-weight: 400;
    font-size: 0.95rem;
    display: block;
    padding: 6px 10px;
    border-radius: 5px;
    color: #495057;
}
.sidebar-nav li a:hover {
    background-color: #f8f9fa;
    color: #007bff;
    text-decoration: none;
}
.sidebar-nav li a.disabled {
    color: #adb5bd;
    pointer-events: none;
    font-style: italic;
}

/* --- Lista de Artículos (Tarjetas) --- */
.article-list {
    display: grid;
    gap: 30px;
}

.article-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.article-card .card-content { 
    padding: 30px; 
}
.article-card .card-meta { 
    font-size: 0.9rem; 
    color: #6c757d; 
    margin-bottom: 10px; 
    display: block; 
}
.article-card h2 { 
    font-size: 1.8rem; 
    margin-top: 0; 
    margin-bottom: 15px; 
    color: #212529; 
}
.article-card p { 
    font-size: 1.05rem; 
    color: #495057; 
    margin-bottom: 20px; 
}
.article-card .card-link { 
    font-weight: bold; 
    font-size: 1.05rem; 
}
.article-card .card-link.disabled { 
    color: #adb5bd; 
    pointer-events: none; 
}

/* === FOOTER === */
.site-footer {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #6c757d;
    background-color: #fff;
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr; 
    }
    .sidebar {
        position: static;
        margin-bottom: 30px;
    }
    .site-header h1 { 
        font-size: 2.5rem; 
    }
    .site-header .subtitle { 
        font-size: 1.1rem; 
    }
}