:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --dark: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.6;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* Header & Nav */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark);
    text-decoration: none;
}

.logo span { color: var(--primary); }

.menu-links { display: flex; gap: 20px; list-style: none; }
.menu-links a { color: var(--text-main); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.menu-links a:hover { color: var(--primary); }

/* Layout Grid */
.layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 850px) {
    .layout { grid-template-columns: 1fr; }
}

/* Anuncios AdSense */
.ad-container {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    padding: 12px;
    text-align: center;
    margin: 20px 0;
    border-radius: 6px;
}
.ad-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; font-weight: 600; letter-spacing: 0.5px; }

/* Grid de Tarjetas en la Portada */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
}

.card-badge {
    align-self: flex-start;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.card h3 { font-size: 1.15rem; color: var(--dark); margin-bottom: 10px; line-height: 1.4; }
.card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 18px; }
.card a { color: var(--primary); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.card a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Artículo Individual */
.article-container {
    background: #ffffff;
    padding: 35px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.article-title { font-size: 2rem; color: var(--dark); margin-bottom: 15px; line-height: 1.3; }
.article-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.article-content h2 { margin: 25px 0 12px; color: var(--dark); font-size: 1.35rem; }
.article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; }
.article-content ul, .article-content ol { padding-left: 20px; }
.article-content li { margin-bottom: 8px; }
.article-content code { background: #f1f5f9; color: #0f172a; padding: 3px 8px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.9em; }
.article-content pre { background: #1e293b; color: #f8fafc; padding: 15px; border-radius: 6px; overflow-x: auto; margin: 15px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.9em; }

/* Sidebar */
.widget {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.widget h3 { font-size: 1.1rem; border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 15px; color: var(--dark); }
.widget-list { list-style: none; }
.widget-list li { margin-bottom: 12px; }
.widget-list a { color: var(--text-main); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.widget-list a:hover { color: var(--primary); }

.footer {
    background: var(--dark);
    color: #94a3b8;
    text-align: center;
    padding: 35px 0;
    margin-top: 60px;
    font-size: 0.85rem;
}
.footer a { color: #ffffff; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
