/* =============================================
   INDEX.CSS — Estilos base del sitio.
   Aplica a index.html y sirve de base para
   todas las páginas mediante variables.
   ============================================= */

/* --- Variables de tema --- */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --header-bg: #ffffff;
    --hero-bg-gradient: linear-gradient(135deg, #1a4da1 0%, #0dccf2 100%);
    --card-bg: #f8f9fa;
    --accent-color: #0dccf2;
    --secondary-text: #666666;
    --nav-hover: #1a4da1;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Newsreader', serif;
}

[data-theme='dark'] {
    --bg-color: #05070a;
    --text-color: #f1f5f9;
    --header-bg: #0a0f1d;
    --hero-bg-gradient: linear-gradient(135deg, #05070a 0%, #1e3a8a 100%);
    --card-bg: #111827;
    --secondary-text: #94a3b8;
    --accent-color: #38bdf8;
}

/* --- Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Base --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Header --- */
header {
    background-color: var(--header-bg);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

/* --- Logo --- */
.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a4da1;
    transition: color 0.3s;
}

[data-theme='dark'] .logo {
    color: var(--accent-color);
}

/* --- Navegación --- */
nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--nav-hover);
}

/* --- Controles (theme toggle, etc.) --- */
.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#theme-toggle:hover {
    background-color: var(--accent-color);
    color: white;
}

/* --- Hero (index.html únicamente) --- */
.index-hero {
    height: 60vh;
    background: var(--hero-bg-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10%;
    color: white;
    position: relative;
    overflow: hidden;
}

.index-hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    max-width: 600px;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.index-hero p {
    font-size: 1.2rem;
    max-width: 700px;
    opacity: 0.9;
}

/* --- Artículos Destacados (index.html) --- */
.featured-section {
    padding: 4rem 10%;
}

.featured-section h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-img {
    height: 200px;
    background-color: #e2e8f0;
    width: 100%;
}

.article-content {
    padding: 1.5rem;
}

.article-content h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

.article-content p {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .index-hero h1 {
        font-size: 2.5rem;
    }
}