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

:root {
    --bg: #ffffff;
    --bg-card: #f8fafc;
    --border: #e2e8f0;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --text: #0f172a;
    --text-muted: #64748b;
    --radius: 12px;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    text-decoration: none;
}

.navbar-links { display: flex; gap: 1.5rem; list-style: none; }
.navbar-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.navbar-links a:hover { color: var(--accent); }

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.8rem; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-muted); max-width: 500px; margin: 0 auto; }

.container { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border-color: var(--accent);
}

.subject-card .icon { font-size: 2rem; margin-bottom: 1rem; }
.subject-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.subject-card p { color: var(--text-muted); font-size: 0.88rem; }

.subject-link { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin-top: 1rem; display: inline-block; }
.subject-link::after { content: ' →'; }

.loading-blog { text-align: center; padding: 3rem; color: var(--text-muted); grid-column: 1/-1; }

/* ── CONTACTO INSTITUCIONAL ── */
.contact-institutional {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
}

.contact-institutional h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.contact-institutional p { color: var(--text-muted); margin-bottom: 1.5rem; }

.contact-emails {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.contact-emails a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.contact-emails a:hover { text-decoration: underline; }

footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* ── PÁGINA MATERIA — ACORDEÓN ── */
.posts-list { display: flex; flex-direction: column; gap: 0.8rem; }

.post-accordion {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.post-accordion:hover { border-color: var(--accent); }

.post-accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.post-accordion-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.accordion-arrow {
    color: var(--accent);
    font-size: 0.8rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.post-accordion-body {
    padding: 0 1.5rem 1.5rem;
}

.post-accordion-body img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.post-content { color: var(--text); font-size: 0.95rem; line-height: 1.7; }
.post-content p { margin-bottom: 1rem; }
.post-content p:last-child { margin-bottom: 0; }

.post-date { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.3rem; }

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.pro-locked {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.pro-locked .icon { font-size: 2rem; margin-bottom: 0.8rem; }
.pro-locked p { color: #92400e; margin-bottom: 1rem; }

.empty-state-blog { text-align: center; padding: 3rem; color: var(--text-muted); }

@media (max-width: 768px) {
    .navbar-links { display: none; }
    .subjects-grid { grid-template-columns: 1fr; }
}