/* KernelReport Design - Professional Tech Journalism */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #c62828;
    --primary-dark: #b71c1c;
    --text: #111;
    --muted: #444;
    --text-light: #666;
    --bg: #fff;
    --bg-gray: #fafafa;
    --border: #e6e6e6;
    --shadow: 0 8px 24px rgba(0,0,0,0.05);
    --radius: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; }
h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; }
a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* Container */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 40px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 40px;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.85rem;
}

nav ul li a:hover {
    color: var(--primary-dark);
}

/* Categories Bar */
.categories-bar {
    background: #fafafa;
    border-top: 1px solid var(--border);
    padding: 12px 0;
}

.categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.categories a {
    padding: 6px 12px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid transparent;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.categories a.active,
.categories a:hover {
    background: var(--primary);
    color: #fff;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    padding: 50px 0;
    border-bottom: 1px solid var(--border);
}

.featured {
    position: relative;
    height: 460px;
    background: var(--muted);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    color: #fff;
    overflow: hidden;
}

.featured img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.8));
    z-index: 1;
}

.featured-content {
    position: relative;
    z-index: 2;
}

.featured h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.1;
}

.featured .meta {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Side Stories */
.side-stories {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.side-item img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border);
}

.side-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* Blog Cards Grid */
.blogs-section,
.featured-section {
    padding: 50px 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary);
}

.grid,
.blogs-grid,
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

/* Card Styles */
.card,
.blog-card,
.featured-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease;
    overflow: hidden;
}

.card:hover,
.blog-card:hover,
.featured-card:hover {
    transform: translateY(-4px);
}

.card-image-wrapper {
    position: relative;
    height: 200px;
    background: var(--border);
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-header {
    padding: 20px;
    background: var(--muted);
    display: flex;
    align-items: flex-end;
    height: 160px;
    background-size: cover;
    background-position: center;
    color: #fff;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.card-header h2 {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    font-weight: 800;
    max-width: 90%;
    line-height: 1.2;
}

.card-content,
.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.card-category,
.category {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
}

.card-description {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-meta,
.meta {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: auto;
}

.card-date {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.card-reading-time {
    color: var(--muted);
    font-size: 0.85rem;
}

.card-read-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Widgets & Sidebar */
.widget {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    color: var(--text);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.post-list {
    list-style: none;
}

.post-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list a {
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.post-list a:hover {
    color: var(--primary);
}

.post-list .post-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* Blog Sidebar Layout */
.container-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 800px 350px 1fr;
    max-width: 1920px;
    margin: 0 auto;
    gap: 30px;
}

.blog-main {
    grid-column: 2 / 3;
    padding: 40px 0;
}

.blog-sidebar {
    grid-column: 3 / 4;
    padding: 40px 0;
    background: var(--bg-gray);
}

.sidebar-ad {
    margin-bottom: 1.5rem;
}

/* Ads */
.ad-block,
.ad-section {
    background: #f4f4f4;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 40px;
    font-size: 0.9rem;
    color: #777;
    margin: 40px 0;
}

.ad-container {
    max-width: 728px;
    margin: 0 auto;
}

.ad-placeholder {
    padding: 20px;
    background: var(--bg-gray);
    border: 1px dashed var(--border);
    color: var(--muted);
    font-weight: 600;
}

/* Blog Detail Page */
.blog-article {
    background: var(--bg);
}

.blog-header {
    padding: 40px 0 30px;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.blog-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    color: var(--text);
}

.blog-subtitle {
    font-size: 1.4rem;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 20px;
}

.blog-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: var(--text);
}

.blog-date,
.reading-time,
.view-count {
    font-weight: 600;
}

.blog-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.blog-cover-image {
    margin: 30px 0;
}

.blog-cover-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    padding: 40px 0;
}

.blog-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 800;
}

.blog-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 700;
}

.blog-content p {
    margin-bottom: 20px;
}

.blog-content ul,
.blog-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.blog-content li {
    margin-bottom: 10px;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--muted);
}

.blog-content pre {
    background: #f5f5f5;
    border: 1px solid var(--border);
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.blog-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.content-image {
    margin: 30px 0;
}

.content-image img {
    width: 100%;
    height: auto;
}

.content-image figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 10px;
    font-style: italic;
}

.content-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 40px 0;
}

.cta-block {
    background: var(--bg-gray);
    border: 1px solid var(--border);
    padding: 30px;
    margin: 40px 0;
    text-align: center;
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 30px;
    font-weight: 700;
    margin-top: 15px;
}

.cta-button:hover {
    background: var(--primary-dark);
    color: #fff;
}

.share-section {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.share-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.share-btn {
    padding: 10px 20px;
    background: var(--muted);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.share-btn:hover {
    background: var(--text);
    color: #fff;
}

.share-btn.twitter { background: #1DA1F2; }
.share-btn.twitter:hover { background: #1a8cd8; }
.share-btn.facebook { background: #1877F2; }
.share-btn.facebook:hover { background: #166fe5; }
.share-btn.linkedin { background: #0A66C2; }
.share-btn.linkedin:hover { background: #004182; }

/* Ads */
.ad-box {
    background: #f4f4f4;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 40px;
    font-size: 0.9rem;
    color: #595959;
    margin: 20px 0;
}

.ad-block {
    background: var(--bg-gray);
    border: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.ad-placeholder {
    background: var(--bg);
    border: 1px dashed var(--border);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-light);
}

.sidebar-ad {
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: #111;
    color: #bbb;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-cols h4 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-cols p {
    line-height: 1.6;
    color: #aaa;
    font-size: 0.95rem;
}

.footer-cols ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-cols ul li {
    color: #aaa;
    margin-bottom: 8px;
    cursor: pointer;
}

.footer-cols ul li:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    border-top: 1px solid #222;
    padding-top: 20px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .container-with-sidebar {
        grid-template-columns: 0 1fr 350px 0;
    }
}

@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
    }
    
    .featured {
        height: 400px;
    }
    
    .side-stories {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .side-item {
        min-width: 250px;
    }
    
    .footer-cols {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .blog-main,
    .blog-sidebar {
        grid-column: auto;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .container,
    .container-narrow {
        padding: 20px;
    }
    
    nav ul {
        display: none;
    }
    
    .categories {
        gap: 10px;
    }
    
    .hero {
        padding: 30px 0;
    }
    
    .featured {
        height: 350px;
        padding: 30px 20px;
    }
    
    .featured h1 {
        font-size: 1.8rem;
    }
    
    .blogs-section,
    .featured-section {
        padding: 30px 0;
    }
    
    .grid,
    .blogs-grid,
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .blog-subtitle {
        font-size: 1.2rem;
    }
    
    .footer-cols {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }
    
    .featured h1 {
        font-size: 1.5rem;
    }
    
    .blog-title {
        font-size: 1.8rem;
    }
    
    .card-header h2 {
        font-size: 1rem;
    }
}
