/* =========================================
   1. VARIABLES Y RESET GENERAL
   ========================================= */
* {
    box-sizing: border-box; /* Crucial para que el padding no sume ancho */
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Corta cualquier cosa que intente salirse por la derecha */
    -webkit-font-smoothing: antialiased;
}

:root {
    --primary: #1a237e;
    --accent: #d32f2f;
    --dark: #222;
    --light-bg: #f8f9fa;
}


img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    margin-top: 0;
    color: #111;
}

/* =========================================
   2. HEADER (CABECERA PERIÓDICO)
   ========================================= */
header {
    background: var(--primary);
    color: #fff;
    padding: 40px 0;
    text-align: center;
    border-bottom: 4px solid var(--accent);
}
/* Esta clase hará que el nombre del sitio siempre se vea igual */
.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
}

.site-title a {
    color: white;
    text-decoration: none;
}

/* Ajuste para móvil */
@media (max-width: 768px) {
    .site-title { font-size: 2.2rem; }
}


.tagline {
    font-style: italic;
    opacity: 0.9;
    margin-top: 5px;
}
/* NAV MEJORADO (HORIZONTAL Y ELEGANTE) */
.main-nav {
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Para que en móvil se envuelvan */
    margin: 0;
    padding: 0;
}

.main-nav li a {
    display: block;
    padding: 15px 20px;
    color: var(--dark);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: 0.3s;
}

.main-nav li a:hover {
    color: var(--accent);
    background: #f4f4f4;
}
/* MOBILE FIX */
@media (max-width: 768px) {
    header h1 { font-size: 2.2rem; }
    .main-nav ul { justify-content: flex-start; overflow-x: auto; white-space: nowrap; }
    .main-nav li a { padding: 12px 15px; font-size: 0.8rem; }
}

/* =========================================
   3. LAYOUT GENERAL
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   4. PORTADA (INDEX)
   ========================================= */

/* Títulos de Secciones (Categorías) */
.section-category {
    margin-bottom: 50px;
    position: relative;
}

.cat-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    background: var(--dark);
    color: #fff;
    padding: 8px 20px;
    display: inline-block;
    margin-bottom: 25px;
    text-transform: uppercase;
    position: relative;
}


.cat-title::after {
    content: '';
    position: absolute;
    bottom: 50%;
    left: 100%;
    width: 2000px; /* Línea decorativa larga */
    height: 2px;
    background: #ccc;
    z-index: -1;
}

/* Grid de Artículos */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Un poco más anchos */
    gap: 30px; /* Más espacio entre tarjetas */
}

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px; /* Bordes ligeramente redondeados */
    overflow: hidden; /* Para que la imagen respete el redondeo */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Asegura que el contenido fluya verticalmente */
    height: 100%; /* Igualar alturas en la misma fila */
}

.card:hover {
    transform: translateY(-5px); /* Efecto de elevación al pasar el ratón */
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    border-color: #ccc;
}

/* Imagen de borde a borde */
.card img {
    width: 100%;
    height: 220px; /* Altura fija para uniformidad */
    object-fit: cover; /* Recorta la imagen sin deformarla */
    border-bottom: 1px solid #f4f4f4;
    display: block;
}

/* Contenedor del texto (Aquí está el espacio que pedías) */
.card-content {
    padding: 25px; /* Mucho espacio interno */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Fecha / Meta datos */
.card .meta {
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
/* MOBILE FIX */
@media (max-width: 768px) {
    header h1 { font-size: 2.2rem; }
    .main-nav ul { justify-content: flex-start; overflow-x: auto; white-space: nowrap; }
    .main-nav li a { padding: 12px 15px; font-size: 0.8rem; }
}
/* Título */
.card h3 {
    margin: 0 0 15px 0;
    font-family: 'Georgia', serif; /* Fuente periodística */
    font-size: 1.4rem;
    line-height: 1.3;
    color: #222;
}

.card h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.card h3 a:hover {
    color: var(--primary); /* Azul oscuro definido arriba */
}

/* Extracto (si decides mostrarlo en clusters) */
.card p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}
/* =========================================
   5. ARTÍCULO INDIVIDUAL (PAGE)
   ========================================= */
.article-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr; /* 70% Contenido - 30% Sidebar */
    gap: 40px;
    align-items: start;
}

/* Columna Principal */
.main-article {
    background: var(--bg-paper);
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* Encabezado del Artículo */
.cat-badge {
    background-color: var(--accent);
    color: white;
    padding: 4px 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 15px;
}

.main-article h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-main);
}

.main-article img {
    border-radius: 4px;
    margin-bottom: 30px;
}

/* Cuerpo del texto (Typography) */
.body-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.body-text h2 { margin-top: 40px; font-size: 1.8rem; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.body-text h3 { margin-top: 30px; font-size: 1.5rem; }
.body-text p { margin-bottom: 20px; }
.body-text ul, .body-text ol { margin-bottom: 20px; padding-left: 20px; }
.body-text li { margin-bottom: 10px; }
.body-text blockquote {
    border-left: 4px solid var(--accent);
    margin: 20px 0;
    padding: 10px 20px;
    background: #f9f9f9;
    font-style: italic;
    font-family: var(--font-heading);
}

/* =========================================
   6. SECCIÓN PREGUNTAS FRECUENTES (FAQ)
   ========================================= */
.faq-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 5px solid var(--primary);
    padding: 25px;
    margin-top: 50px;
    border-radius: 4px;
}

.faq-section h3 {
    margin-bottom: 20px;
    color: var(--primary);
}

.faq-item {
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item details {
    padding: 10px 0;
    cursor: pointer;
}

.faq-item summary {
    font-weight: bold;
    font-size: 1.1rem;
    list-style: none; /* Ocultar flecha por defecto */
    position: relative;
    padding-right: 30px;
    color: var(--text-main);
}

/* Icono personalizado para el acordeón */
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: bold;
}

.faq-item details[open] summary::after {
    content: '-';
}

.faq-item p {
    margin-top: 10px;
    color: var(--text-light);
    padding-left: 10px;
    border-left: 2px solid #ddd;
}

/* =========================================
   7. SIDEBAR (DERECHA)
   ========================================= */
.sidebar {
    background: var(--bg-paper);
    padding: 20px;
    border: 1px solid var(--border);
    position: sticky; /* Se queda fijo al hacer scroll */
    top: 20px; 
}

.sidebar h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.related-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.related-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.related-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 2px;
}

.related-item h4 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
    font-family: var(--font-body); /* Títulos sidebar más limpios */
}

.related-item h4 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* =========================================
   8. RESPONSIVE DESIGN (MÓVILES)
   ========================================= */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr; /* Columna única en tablets */
        gap: 30px;
    }
    
    .sidebar {
        position: static; /* Quitar sticky en móvil */
        margin-top: 20px;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr; /* Una columna de artículos */
    }

    .main-article {
        padding: 20px; /* Menos padding en móvil */
    }

    .main-article h1 {
        font-size: 1.8rem;
    }

    .cat-title::after {
        display: none; /* Quitar línea decorativa larga en móvil */
    }
    
    .cat-title {
        width: 100%;
        text-align: center;
        display: block;
    }
}
.btn-view-all {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: white !important;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: 0.3s;
}
.btn-view-all:hover {
    background: var(--accent);
    transform: scale(1.05);
}

