/* Master Article & Editorial Stylesheet */
:root {
    --bg: #0b0d12;
    --card-bg: #111520;
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --heading: #ffffff;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --code-bg: #06080d;
    --code-border: rgba(59, 130, 246, 0.3);
    --code-text: #4ade80;
    --highlight: #60a5fa;
    --author-bg: #131824;
}

/* Light Theme Variables */
html.light-theme, [data-theme="light"] {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text: #334155;
    --text-muted: #64748b;
    --heading: #0f172a;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.1);
    --code-bg: #0f172a;
    --code-border: #334155;
    --code-text: #38bdf8;
    --highlight: #2563eb;
    --author-bg: #ffffff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.page-wrapper {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem 2rem;
}

/* Breadcrumbs Top Bar */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.breadcrumb-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Light / Dark Mode Toggle Button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text);
    padding: 0.45rem 0.95rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

header {
    margin-bottom: 2.2rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}

.category-pill {
    display: inline-block;
    background: var(--accent-glow);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.8rem;
}

/* Keyword Title Highlight */
.title-highlight {
    color: var(--highlight);
    background: var(--accent-glow);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    border-bottom: 2px solid var(--accent);
    display: inline;
}

h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--heading);
    letter-spacing: -0.6px;
    line-height: 1.25;
    margin-bottom: 0.8rem;
}

.meta-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    background: #2563eb;
    transition: background 0.15s ease;
}

.btn:hover { background: #1d4ed8; }

.btn-secondary {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 2-Column Article Container */
.article-container {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .article-container {
        grid-template-columns: 1fr;
    }
}

.article-body {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.article-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--heading);
    margin: 2.2rem 0 0.9rem 0;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.4rem;
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading);
    margin: 1.6rem 0 0.6rem 0;
}

.article-body p {
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.article-body ul, .article-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text);
}

.article-body li {
    margin-bottom: 0.65rem;
    line-height: 1.65;
}

.code-box {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 1.2rem;
    margin: 1.4rem 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.92rem;
    color: var(--code-text);
    word-break: break-all;
    white-space: pre-wrap;
}

.info-callout {
    background: var(--accent-glow);
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text);
}

/* Article Topic Tags */
.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.tag-badge {
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.tag-badge:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* Thumbs Up Helpful Widget Component */
.helpful-widget {
    background: var(--author-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.4rem;
    margin: 2rem 0 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.helpful-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--heading);
}

.thumbs-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--accent-glow);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
    padding: 0.6rem 1.4rem;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.thumbs-up-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
}

.thumbs-up-btn.liked {
    background: #16a34a;
    border-color: #22c55e;
    color: #ffffff;
}

/* About the Author Card Component */
.author-card {
    background: var(--author-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.6rem;
    margin: 2rem 0;
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.author-avatar-img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
    flex-shrink: 0;
}

.author-details h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.author-verified-badge {
    color: #3b82f6;
    font-size: 0.9rem;
}

.author-role {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.author-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Related Articles Component */
.related-articles-section {
    margin: 2.5rem 0 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.related-articles-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 1.2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.related-card {
    background: var(--author-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.1rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.related-card h4 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.related-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Sidebar Widget */
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.sidebar-widget h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sidebar-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.15s ease;
    line-height: 1.4;
}

.sidebar-links a:hover {
    color: var(--accent);
}

footer {
    margin-top: 4rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover { color: var(--heading); }
