/* ER Explained - Modern Medical Editorial Theme */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700&family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --navy: #0f1d2f;
    --navy-light: #1a2d45;
    --teal: #0d9488;
    --teal-light: #14b8a6;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --amber: #f59e0b;
    --text: #1e293b;
    --text-light: #475569;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --bg-warm: #fafaf9;
    --white: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-lg: 16px;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Source Serif 4', Georgia, serif;
    --max-w: 1200px;
    --max-w-sm: 780px;
}

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

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-light); }
img { max-width: 100%; height: auto; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: var(--max-w-sm); margin: 0 auto; padding: 0 24px; }

/* ========== HEADER ========== */
.site-header {
    background: var(--navy);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-logo:hover { color: var(--teal-light); }
.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--red);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -1px;
    color: white;
}

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}
.site-nav a:hover { color: white; background: rgba(255,255,255,0.08); }
.site-nav a.active { color: white; background: rgba(255,255,255,0.12); }

.lang-toggle {
    display: flex;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
    margin-left: 8px;
}
.lang-toggle a {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    border-radius: 0;
}
.lang-toggle a:hover { background: rgba(255,255,255,0.06); color: white; }
.lang-toggle a.active { background: var(--teal); color: white; }

.mobile-menu-btn { display: none; background: none; border: none; color: white; font-size: 24px; cursor: pointer; }

/* ========== HERO ========== */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(13,148,136,0.15) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(220,38,38,0.08) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
}
.hero p { font-size: 17px; color: rgba(255,255,255,0.75); max-width: 600px; margin: 0 auto 28px; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 24px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ========== SECTIONS ========== */
.section { padding: 48px 0; }
.section-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}
.section-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

/* ========== CATEGORY GRID ========== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }
.cat-card-img {
    height: 140px;
    background: linear-gradient(135deg, var(--navy-light), var(--navy));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: rgba(255,255,255,0.3);
    overflow: hidden;
}
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-body { padding: 16px; flex: 1; }
.cat-card-body h3 { font-family: var(--font-heading); font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.cat-card-body p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.cat-card-footer {
    padding: 0 16px 14px;
    font-size: 12px;
    color: var(--teal);
    font-weight: 600;
}

/* ========== POST CARDS ========== */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card-img {
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teal);
    margin-bottom: 8px;
}
.post-card-body h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}
.post-card-body h3 a { color: var(--text); }
.post-card-body h3 a:hover { color: var(--teal); }
.post-card-excerpt { font-size: 13px; color: var(--text-light); line-height: 1.6; flex: 1; margin-bottom: 12px; }
.post-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--border-light); }

/* ========== SINGLE POST ========== */
.article-header { padding: 40px 0 0; }
.article-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.article-meta .cat-badge {
    background: var(--teal);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
}
.article-featured-img {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.article-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text);
}
.article-content h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin: 36px 0 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.article-content h3 { font-family: var(--font-heading); font-size: 20px; margin: 28px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: var(--radius); margin: 20px 0; box-shadow: var(--shadow-sm); }
.article-content blockquote {
    border-left: 4px solid var(--teal);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--border-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-light);
}
.article-content ul, .article-content ol { margin-bottom: 16px; padding-left: 24px; }
.article-content li { margin-bottom: 6px; }
.article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.article-content table th, .article-content table td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.article-content table th { background: var(--border-light); font-weight: 600; }

/* ========== BREADCRUMB ========== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--teal); }
.breadcrumb .sep { margin: 0 4px; color: var(--border); }

/* ========== CTA ========== */
.cta-box {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: white;
    padding: 36px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 40px 0;
}
.cta-box h3 { font-family: var(--font-heading); font-size: 22px; margin-bottom: 10px; color: white; }
.cta-box p { color: rgba(255,255,255,0.7); margin-bottom: 20px; font-size: 14px; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-teal { background: var(--teal); color: white; }
.btn-teal:hover { background: var(--teal-light); color: white; }
.btn-white { background: white; color: var(--navy); }
.btn-white:hover { background: rgba(255,255,255,0.9); color: var(--navy); }
.btn-outline-white { border: 2px solid rgba(255,255,255,0.3); color: white; background: transparent; }
.btn-outline-white:hover { border-color: white; background: rgba(255,255,255,0.05); color: white; }

/* ========== DISCLAIMER ========== */
.disclaimer {
    background: var(--red-soft);
    border-top: 3px solid var(--red);
    padding: 28px 0;
}
.disclaimer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.disclaimer-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}
.disclaimer h4 { font-size: 14px; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.disclaimer p { font-size: 13px; color: #7f1d1d; line-height: 1.6; margin: 0; }

/* ========== FOOTER ========== */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.6);
    padding: 48px 0 0;
}
.footer-grid {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}
.footer-grid h3 { color: white; font-family: var(--font-heading); font-size: 16px; margin-bottom: 14px; }
.footer-grid p { font-size: 13px; line-height: 1.7; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul a { color: rgba(255,255,255,0.5); font-size: 13px; }
.footer-grid ul a:hover { color: var(--teal-light); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

/* ========== SEARCH ========== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto 32px;
}
.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}
.search-form input:focus { outline: none; border-color: var(--teal); }

/* ========== ARCHIVE FILTER ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.filter-btn {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.filter-btn:hover, .filter-btn.active { background: var(--teal); color: white; border-color: var(--teal); }

/* ========== 404 ========== */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 { font-family: var(--font-heading); font-size: 80px; color: var(--teal); font-weight: 700; }
.page-404 p { font-size: 18px; color: var(--text-muted); margin-bottom: 24px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header-inner { height: 56px; }
    .site-nav { display: none; position: fixed; top: 56px; left: 0; right: 0; background: var(--navy); flex-direction: column; padding: 16px; gap: 4px; z-index: 99; }
    .site-nav.open { display: flex; }
    .mobile-menu-btn { display: block; }
    .lang-toggle { margin-left: 0; width: 100%; justify-content: center; }
    .hero { padding: 40px 0; }
    .cat-grid { grid-template-columns: 1fr 1fr; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .disclaimer-inner { flex-direction: column; }
    .article-content { font-size: 15px; }
}
@media (max-width: 480px) {
    .cat-grid { grid-template-columns: 1fr; }
}
