/* ScientiaMag.com — Science News Theme */

:root {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --navy: #0f172a;
    --navy-light: #1e293b;
    --accent: #0369a1;
    --accent-hover: #0284c7;
    --accent-light: rgba(3,105,161,0.08);
    --nav-height: 60px;
    --bar-height: 38px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.10);
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── Breaking News Bar ── */
.breaking-bar {
    background: #dc2626;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    height: var(--bar-height);
    display: flex;
    align-items: center;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1001;
}
.breaking-label {
    background: #fff;
    color: #dc2626;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 16px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}
.breaking-scroll {
    display: flex;
    align-items: center;
    animation: breakingScroll 40s linear infinite;
    white-space: nowrap;
}
.breaking-scroll:hover { animation-play-state: paused; }
.breaking-item { padding: 0 32px; border-right: 1px solid rgba(255,255,255,0.3); }
.breaking-item a { color: #fff; }
.breaking-item a:hover { text-decoration: underline; }
@keyframes breakingScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Navigation ── */
.main-nav {
    background: var(--navy);
    height: var(--nav-height);
    border-bottom: 3px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.has-breaking .main-nav {
    top: var(--bar-height);
}
.nav-inner {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-logo {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-logo span { color: #38bdf8; }
.nav-cats {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-cats::-webkit-scrollbar { display: none; }
.nav-cat {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nav-cat:hover, .nav-cat.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-cat.active { color: #7dd3fc; }
.nav-search {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.nav-search input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    width: 180px;
    outline: none;
    transition: all var(--transition);
    font-family: var(--font);
}
.nav-search input::placeholder { color: rgba(255,255,255,0.45); }
.nav-search input:focus { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); width: 220px; }

/* ── Layout ── */
.container { max-width: 1340px; margin: 0 auto; padding: 0 20px; }
.main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    padding: 28px 0 48px;
    align-items: start;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* ── Section Titles ── */
.section-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Hero Article ── */
.hero-article {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    margin-bottom: 24px;
    display: block;
}
.hero-article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.hero-article:hover img { transform: scale(1.02); }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.05) 100%);
}
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px;
}
.hero-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: var(--accent);
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 10px;
}
.hero-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.hero-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Article Grid ── */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 8px;
}
.article-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
    display: block;
}
.article-card:hover { box-shadow: var(--shadow-hover); }
.card-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-surface);
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.article-card:hover .card-img img { transform: scale(1.03); }
.card-body { padding: 14px 16px 16px; }
.card-cat {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 6px;
}
.card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 6px;
}
.card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Sidebar ── */
.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.article-list { display: flex; flex-direction: column; gap: 16px; }
.list-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.list-img {
    width: 72px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-surface);
}
.list-img img { width: 100%; height: 100%; object-fit: cover; }
.list-body { flex: 1; min-width: 0; }
.list-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 3px; }
.list-title { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text); }
.list-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Article Page ── */
#read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 9998;
    width: 0%;
    transition: width 0.1s linear;
}
.article-header {
    padding: 28px 0 0;
}
.badge-breaking {
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 3px;
}
.article-page-title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 16px;
}
.article-page-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}
.cat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.meta-sep { color: var(--border-dark); }
.meta-author { color: var(--accent); font-weight: 600; }
.meta-author:hover { text-decoration: underline; }

/* Share buttons */
.article-share { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.share-btn:hover { background: var(--accent); color: #fff; }
.share-btn.copied { background: #059669; color: #fff; }

/* Article layout */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding: 15px 0 60px;
    align-items: start;
}
.article-main { min-width: 0; }
.article-hero-img {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    max-height: 480px;
    object-fit: cover;
}
.article-excerpt {
    font-size: 22px;
    font-weight: 500;
    color: var(--accent-hover);
    line-height: 1.5;
    margin-bottom: 28px;
}
.article-body {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
}
.article-body p { margin-bottom: 20px; }
.article-body h2 { font-size: 22px; font-weight: 700; margin: 32px 0 14px; letter-spacing: -0.01em; }
.article-body h3 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { font-weight: 700; }
.article-body em { font-style: italic; }
.article-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* In-article related */
.in-article-related {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 16px;
    margin: 28px 0;
    border: 1px solid var(--border);
}
.inr-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}
.inr-row-link { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; }
.in-article-related a { text-decoration: none; }
.inr-img-lg { width: 100px; height: 72px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.inr-body { flex: 1; }
.inr-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 4px; }
.inr-title { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--text); }
.inr-title-lg { font-size: 15px; }
.inr-excerpt { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }

/* Author card */
.author-card {
    display: flex;
    gap: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 40px;
    border: 1px solid var(--border);
}
.author-card-avatar { border-radius: 50%; }
.author-card-body { flex: 1; }
.author-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 3px; }
.author-card-name { font-size: 16px; font-weight: 800; color: var(--text); display: block; }
.author-card-name:hover { color: var(--accent); }
.author-card-title { font-size: 13px; color: var(--text-muted); margin: 2px 0 8px; }
.author-card-bio { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.author-card-more { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 8px; display: inline-block; }
.author-card-more:hover { text-decoration: underline; }

/* ── Category page ── */
.cat-header {
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}
.cat-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.cat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.cat-header h1 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--navy);
    line-height: 1.1;
    margin-bottom: 10px;
}
.cat-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 640px;
}

/* ── Search page ── */
.search-header {
    padding: 32px 0 20px;
}
.search-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font);
    outline: none;
    color: var(--text);
}
.search-form input:focus { border-color: var(--accent); }
.search-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background var(--transition);
}
.search-form button:hover { background: var(--accent-hover); }

/* ── Author page ── */
.author-header {
    padding: 36px 0 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.author-avatar-lg { border-radius: 50%; width: 80px; height: 80px; }
.author-header-body { flex: 1; }
.author-header-name { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.author-header-title { font-size: 14px; color: var(--text-muted); margin: 4px 0 8px; }
.author-header-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.6; max-width: 600px; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 32px 0;
}
.pagination a, .pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.pagination a:hover, .pagination a.active, .pagination .page-btn:hover, .pagination .page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Footer ── */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.7); margin-top: 60px; }

.footer-newsletter {
    background: var(--accent);
    padding: 20px 0;
}
.footer-newsletter-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-newsletter-text { color: #fff; font-size: 14px; }
.footer-newsletter-text strong { font-size: 16px; font-weight: 800; margin-right: 8px; }
.footer-newsletter-form { display: flex; gap: 8px; }
.footer-newsletter-form input {
    padding: 9px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    width: 240px;
    font-family: var(--font);
    outline: none;
}
.footer-newsletter-form button {
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: background var(--transition);
}
.footer-newsletter-form button:hover { background: var(--navy-light); }

.footer-main { padding: 48px 0 32px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 32px;
}
.footer-col h4 {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 14px;
}
.footer-col a {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    transition: color var(--transition);
}
.footer-col a:hover { color: #fff; }
.footer-col-topnews .footer-topnews-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.footer-topnews-num {
    font-size: 18px;
    font-weight: 900;
    color: rgba(255,255,255,0.15);
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
}
.footer-topnews-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
    display: block;
    transition: color var(--transition);
}
.footer-topnews-title:hover { color: #fff; }
.footer-brand-strip {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 28px;
    margin-top: 16px;
}
.footer-brand-logo {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
}
.footer-brand-logo span { color: #38bdf8; }
.footer-brand-tagline { font-size: 13px; color: rgba(255,255,255,0.5); max-width: 560px; line-height: 1.6; }

.footer-bottom {
    background: rgba(0,0,0,0.25);
    padding: 16px 0;
}
.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap;
    gap: 8px;
}
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { color: rgba(255,255,255,0.4); }
.footer-bottom-links a:hover { color: rgba(255,255,255,0.8); }

/* ── Static pages ── */
.static-page {
    max-width: 760px;
    margin: 48px auto;
    padding: 0 20px 60px;
}
.static-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 24px; }
.static-page h2 { font-size: 20px; font-weight: 700; margin: 32px 0 12px; }
.static-page p { font-size: 15px; line-height: 1.75; color: var(--text-secondary); margin-bottom: 16px; }
.static-page a { color: var(--accent); text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .article-layout { grid-template-columns: 1fr; }
    .article-layout .sidebar { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .article-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 20px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-newsletter-inner { flex-direction: column; }
    .footer-newsletter-form { width: 100%; }
    .footer-newsletter-form input { flex: 1; width: auto; }
    .nav-inner { gap: 16px; }
    .nav-search input { width: 130px; }
}
