*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #1e293b;
    background: #f1f5f9;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

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

/* ===== TOP BAR ===== */
.top-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
    font-size: .75rem;
    padding: 6px 0;
    color: #94a3b8;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar .date { color: #94a3b8; }
.tagline {
    color: #f59e0b;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: .65rem;
    background: rgba(245, 158, 11, .12);
    padding: 2px 10px;
    border-radius: 3px;
}

/* ===== HEADER MAIN ===== */
.header-main {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 3px solid #2563eb;
    padding: 14px 0;
}
.header-main .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.site-logo span { color: #f59e0b; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #cbd5e1; }
.header-right { display: flex; align-items: center; gap: 12px; }

/* ===== NAV BAR ===== */
.nav-bar {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-list {
    list-style: none;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.nav-list li { flex-shrink: 0; }
.nav-list a {
    display: block;
    padding: 10px 16px;
    font-size: .8rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid transparent;
    transition: all .15s;
    white-space: nowrap;
}
.nav-list a:hover { color: #f59e0b; border-bottom-color: #f59e0b; }
.nav-list a[href="/"] { color: #60a5fa; }
.nav-list a[href="/"]:hover { color: #f59e0b; }

/* ===== HEADLINE SECTION ===== */
.headline-section { background: #fff; border-bottom: 1px solid #e2e8f0; }
.headline-wrapper { display: grid; grid-template-columns: 2fr 1fr; gap: 0; min-height: 420px; }
.headline-main { position: relative; overflow: hidden; }
.headline-link { display: block; height: 100%; }
.headline-image {
    height: 100%;
    min-height: 420px;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    display: flex;
    align-items: flex-end;
    position: relative;
}
.headline-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,.92) 0%, rgba(15,23,42,.45) 40%, rgba(15,23,42,.15) 70%, transparent 100%);
}
.headline-text { position: relative; z-index: 1; padding: 40px 30px; color: #fff; }
.headline-category {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fbbf24;
    background: rgba(251, 191, 36, .15);
    padding: 2px 10px;
    border-radius: 3px;
    margin-bottom: 10px;
}
.headline-title {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}
.headline-title:hover { text-decoration: underline; text-decoration-color: #f59e0b; text-underline-offset: 4px; }
.headline-excerpt { font-size: .9rem; color: #cbd5e1; margin-bottom: 10px; line-height: 1.5; }
.headline-date { font-size: .78rem; color: #64748b; }

/* Headline side column */
.headline-side { display: flex; flex-direction: column; }
.headline-side-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: background .15s;
}
.headline-side-item:hover { background: #f8fafc; }
.headline-side-item:last-child { border-bottom: none; }
.headline-side-image {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
}
.headline-side-text { padding: 16px 20px; }
.headline-side-text .headline-category {
    color: #2563eb;
    background: rgba(37, 99, 235, .1);
    margin-bottom: 6px;
}
.headline-side-text h3 {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1e293b;
}
.headline-side-text h3:hover { color: #2563eb; }

/* ===== SECTION HEADER ===== */
.latest-section { padding: 28px 0; }
.section-header {
    margin-bottom: 20px;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-header::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #2563eb, #f59e0b);
    border-radius: 2px;
}
.section-title {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ===== CONTENT LAYOUT ===== */
.content-wrapper { display: grid; grid-template-columns: 1fr 300px; gap: 30px; }
.content-main { min-width: 0; }

/* ===== CATEGORY COLORS ===== */
.article-category[data-category="AI"],
.article-category[data-category="ai"] { background: #818cf8; }
.article-category[data-category="IoT"],
.article-category[data-category="iot"] { background: #34d399; }
.article-category[data-category="Battery Tech"],
.article-category[data-category="battery-tech"] { background: #f472b6; }
.article-category[data-category="Technology"],
.article-category[data-category="technology"] { background: #60a5fa; }
.article-category[data-category="Science"],
.article-category[data-category="science"] { background: #a78bfa; }
.article-category[data-category="Business"],
.article-category[data-category="business"] { background: #f59e0b; }
.article-category[data-category="Health"],
.article-category[data-category="health"] { background: #34d399; }
.article-category[data-category="Sports"],
.article-category[data-category="sports"] { background: #f87171; }
.article-category[data-category="Entertainment"],
.article-category[data-category="entertainment"] { background: #f472b6; }
.article-category[data-category="Politics"],
.article-category[data-category="politics"] { background: #fb923c; }
.article-category[data-category="World"],
.article-category[data-category="world"] { background: #38bdf8; }

/* ===== ARTICLE ROW ===== */
.article-row {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    transition: box-shadow .2s, transform .15s;
}
.article-row:hover {
    box-shadow: 0 4px 12px rgba(15,23,42,.08);
    transform: translateY(-1px);
}
.article-row:last-child { margin-bottom: 0; }
.article-row-image {
    width: 220px;
    min-height: 140px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
    border-radius: 6px;
}
.article-row-body { flex: 1; min-width: 0; }
.article-row-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.article-category {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    background: #2563eb;
}
.article-date { font-size: .75rem; color: #94a3b8; }
.article-row-title {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
}
.article-row-title a { color: #1e293b; transition: color .15s; }
.article-row-title a:hover { color: #2563eb; }
.article-row-excerpt { font-size: .88rem; color: #64748b; line-height: 1.55; margin-bottom: 8px; }
.article-creator {
    font-size: .78rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.article-creator::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #e2e8f0;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-size: contain;
}

/* ===== SIDEBAR ===== */
.sidebar { min-width: 0; }
.sidebar-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-title {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #2563eb, #f59e0b) 1;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Popular list */
.popular-list { list-style: none; counter-reset: popular; }
.popular-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
}
.popular-item:last-child { border-bottom: none; }
.popular-number {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 30px;
    line-height: 1;
}
.popular-category { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: #94a3b8; letter-spacing: .5px; display: block; margin-bottom: 3px; }
.popular-title { font-size: .85rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.popular-title:hover { color: #2563eb; }

/* Related posts in sidebar */
.related-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; transition: background .15s; border-radius: 4px; }
.related-item:hover { background: #f8fafc; padding: 12px 8px; margin: 0 -8px; }
.related-item:last-child { border-bottom: none; }
.related-image { width: 80px; height: 60px; flex-shrink: 0; background-size: cover; background-position: center; background-color: #e2e8f0; border-radius: 4px; }
.related-body { flex: 1; min-width: 0; }
.related-category { font-size: .62rem; font-weight: 600; text-transform: uppercase; color: #2563eb; letter-spacing: .5px; display: block; margin-bottom: 3px; }
.related-body h4 { font-size: .8rem; font-weight: 600; line-height: 1.35; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #1e293b; }
.related-body h4:hover { color: #2563eb; }
.related-date { font-size: .7rem; color: #94a3b8; }

/* ===== SINGLE POST ===== */
.post-article { background: #fff; padding: 30px 0; }
.post-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; }
.post-main { min-width: 0; }
.post-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.post-category {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
    background: #2563eb;
    padding: 3px 10px;
    border-radius: 3px;
}
.post-category:hover { background: #1d4ed8; }
.post-date { font-size: .8rem; color: #94a3b8; }
.post-title {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    color: #0f172a;
}
.post-author { font-size: .85rem; color: #64748b; margin-bottom: 24px; }
.post-author strong { color: #1e293b; }
.post-figure { margin: 0 0 24px; border-radius: 8px; overflow: hidden; }
.post-featured-image { width: 100%; max-height: 500px; object-fit: cover; }

.post-body {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
}
.post-body h2 {
    font-size: 1.5rem;
    margin: 2rem 0 .75rem;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}
.post-body h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; font-weight: 600; color: #1e293b; }
.post-body p { margin-bottom: 1rem; }
.post-body ul, .post-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.post-body li { margin-bottom: .25rem; }
.post-body blockquote {
    border-left: 4px solid #2563eb;
    padding: 16px 24px;
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    font-style: italic;
    color: #475569;
    border-radius: 0 6px 6px 0;
}
.post-body a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: #1d4ed8; }
.post-body img { max-width: 100%; border-radius: 6px; margin: 1.5rem 0; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.post-body code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: .88em;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #e11d48;
}
.post-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid #1e293b;
}
.post-body pre code { background: none; padding: 0; color: inherit; }

/* Tags */
.post-tags { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e2e8f0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tags-label { font-size: .85rem; font-weight: 600; color: #64748b; }
.tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .78rem;
    transition: all .15s;
    border: 1px solid #e2e8f0;
}
.tag:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

.post-back { margin-top: 30px; }
.post-back a {
    color: #2563eb;
    font-weight: 500;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.post-back a:hover { text-decoration: underline; }

/* ===== FOOTER ===== */
.site-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #94a3b8;
    padding: 48px 0 0;
    border-top: 3px solid #2563eb;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-brand h3 {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 8px;
}
.footer-brand h3 span { color: #f59e0b; }
.footer-brand p { font-size: .85rem; color: #64748b; line-height: 1.6; }
.footer-links h4, .footer-categories h4 {
    font-size: .82rem;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 14px;
    position: relative;
    padding-bottom: 8px;
}
.footer-links h4::after, .footer-categories h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #f59e0b;
    border-radius: 1px;
}
.footer-links ul, .footer-categories ul { list-style: none; }
.footer-links li, .footer-categories li { margin-bottom: 8px; }
.footer-links a, .footer-categories a { font-size: .82rem; color: #64748b; transition: color .15s; }
.footer-links a:hover, .footer-categories a:hover { color: #f59e0b; }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 18px 0;
    text-align: center;
    font-size: .8rem;
    color: #475569;
}
.footer-bottom a { color: #60a5fa; }
.footer-bottom a:hover { color: #f59e0b; text-decoration: underline; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 28px 0; }
.page-link {
    padding: 8px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 500;
    transition: all .15s;
    background: #fff;
    color: #475569;
}
.page-link:hover { border-color: #2563eb; color: #2563eb; background: #f8fafc; }
.page-info { font-size: .85rem; color: #94a3b8; }

/* ===== 404 ===== */
.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 2rem; margin-bottom: 12px; color: #0f172a; }
.error-page p { color: #64748b; }
.error-page a { color: #2563eb; text-decoration: underline; }
.error-page a:hover { color: #1d4ed8; }

/* ===== EMPTY STATE ===== */
.empty { color: #94a3b8; padding: 60px 0; text-align: center; font-size: 1rem; }

/* ===== LEGAL PAGES (Privacy & Terms) ===== */
.page-legal { background: #fff; padding: 48px 0; min-height: 60vh; }
.page-legal .container { max-width: 800px; }
.page-legal h1 { font-family: 'Noto Serif', Georgia, serif; font-size: 1.8rem; margin-bottom: 8px; color: #0f172a; }
.legal-update { font-size: .85rem; color: #94a3b8; margin-bottom: 28px; }
.page-legal h2 { font-size: 1.15rem; margin: 28px 0 12px; color: #1e293b; }
.page-legal p { font-size: .95rem; line-height: 1.7; color: #475569; margin-bottom: 12px; }
.page-legal ul { margin-bottom: 16px; padding-left: 20px; }
.page-legal li { font-size: .92rem; line-height: 1.6; color: #475569; margin-bottom: 6px; }
.page-legal a { color: #2563eb; text-decoration: underline; }
.page-legal a:hover { color: #1d4ed8; }

/* ===== COOKIE CONSENT ===== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #cbd5e1;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: .85rem;
    z-index: 9999;
    box-shadow: 0 -4px 12px rgba(15,23,42,.2);
    flex-wrap: wrap;
    border-top: 2px solid #2563eb;
}
.cookie-consent p { margin: 0; }
.cookie-consent a { color: #60a5fa; text-decoration: underline; }
.cookie-consent a:hover { color: #f59e0b; }
.cookie-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    padding: 8px 22px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.cookie-btn:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); }

@media (max-width: 640px) {
    .cookie-consent { flex-direction: column; text-align: center; padding: 12px 16px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .headline-wrapper { grid-template-columns: 1fr; }
    .headline-side { display: none; }
    .content-wrapper { grid-template-columns: 1fr; }
    .post-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .menu-toggle { display: block; }
    .nav-list { display: none; flex-direction: column; }
    .nav-bar.open .nav-list { display: flex; }
    .article-row { flex-direction: column; }
    .article-row-image { width: 100%; height: 180px; }
    .headline-title { font-size: 1.2rem; }
    .headline-image { min-height: 280px; }
    .post-title { font-size: 1.4rem; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ===== DOCS ===== */
.docs-content {
    max-width: 800px;
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.8;
}
.docs-content h1 { font-size: 1.8rem; margin: 1.5em 0 .5em; font-family: 'Inter', sans-serif; }
.docs-content h2 { font-size: 1.4rem; margin: 1.5em 0 .5em; font-family: 'Inter', sans-serif; border-bottom: 1px solid #e2e8f0; padding-bottom: .3em; }
.docs-content h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; font-family: 'Inter', sans-serif; }
.docs-content p { margin-bottom: 1em; }
.docs-content ul, .docs-content ol { margin-bottom: 1em; padding-left: 1.5em; }
.docs-content li { margin-bottom: .3em; }
.docs-content code {
    background: #f1f5f9;
    padding: .15em .4em;
    border-radius: 3px;
    font-size: .9em;
    font-family: 'Fira Code', 'Consolas', monospace;
}
.docs-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
    font-size: .85rem;
}
.docs-content pre code { background: none; padding: 0; color: inherit; }
.docs-content table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.docs-content th, .docs-content td { border: 1px solid #e2e8f0; padding: .5em .75em; text-align: left; }
.docs-content th { background: #f8fafc; font-weight: 600; }
.docs-content blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1em;
    margin: 1em 0;
    color: #475569;
    font-style: italic;
}
.docs-content a { color: #2563eb; text-decoration: underline; }
.docs-content a:hover { color: #1d4ed8; }
.docs-content hr { border: none; border-top: 1px solid #e2e8f0; margin: 2em 0; }
}