/* =========================================
   COMPLETE BLOG STYLESHEET
   (Header + Footer + Blog Content)
========================================= */

/* ========== GLOBAL VARIABLES ========== */
:root {
    /* Layout */
    --max: 1200px;
    
    /* Colors - Light Mode */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #7c3aed;
    --accent-color: #06b6d4;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #ffffff;
    --bg-offwhite: #f8fafc;
    --bg-gray: #f1f5f9;
    
    /* Blog-specific light variables */
    --blog-container-bg: #ffffff;
    --blog-container-border: #eae6e0;
    --blog-heading: #2c3e4f;
    --blog-h1: #1d2f3f;
    --blog-h1-border: #d4dadc;
    --blog-h2-border: #cfd9df;
    --blog-subtitle: #4e5c67;
    --blog-table-bg: #fafafa;
    --blog-table-border: #d1d9dc;
    --blog-th-bg: #2c3e4f;
    --blog-th-text: white;
    --blog-td-border: #cbd5d8;
    --blog-td-first-bg: #f4f6f7;
    --blog-formula-bg: #f4f8fa;
    --blog-formula-border: #3a6e8c;
    --blog-example-bg: #fff9f0;
    --blog-example-border: #c18b5e;
    --blog-ref-border: #b1c2c9;
    --blog-ref-text: #3a4e5a;
    --blockquote-bg: #ecf2f5;
    --blockquote-text: #2b4c5e;
    
    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* Misc */
    --border-radius: 1rem;
    --transition: all 0.3s ease;
    --bg-light-rgb: 255, 255, 255;
}

/* Dark Mode Variables */
body.dark-theme {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --text-dark: #f3f4f6;
    --text-light: #9ca3af;
    --bg-light: #111827;
    --bg-offwhite: #1f2937;
    --bg-gray: #374151;
    --bg-light-rgb: 17, 24, 39;
    
    /* Blog-specific dark overrides */
    --blog-container-bg: #1a1a1a;
    --blog-container-border: #2a2a2a;
    --blog-heading: #e0e0e0;
    --blog-h1: #ffffff;
    --blog-h1-border: #3a4a5a;
    --blog-h2-border: #3a4a5a;
    --blog-subtitle: #b0b0b0;
    --blog-table-bg: #1f1f1f;
    --blog-table-border: #3a3a3a;
    --blog-th-bg: #0a1a1f;
    --blog-th-text: #f0f0f0;
    --blog-td-border: #3a3a3a;
    --blog-td-first-bg: #252525;
    --blog-formula-bg: #1a2a30;
    --blog-formula-border: #6a9eb0;
    --blog-example-bg: #2a1e1a;
    --blog-example-border: #b88b6e;
    --blog-ref-border: #4a5a5a;
    --blog-ref-text: #c0c0c0;
    --blockquote-bg: #1a2a2f;
    --blockquote-text: #c8d8dc;
    
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}

/* ========== BASE STYLES ========== */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    color: var(--text-dark);
    background: var(--bg-offwhite);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== HEADER STYLES (from style.css) ========== */
.site-header {
    background: var(--bg-light);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-light-rgb), 0.95);
    transition: background-color 0.4s ease;
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 2rem;
}

.mobile-header-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    padding: 2px;
    background: var(--bg-light);
    transition: border-color 0.4s ease;
}

.site-title {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    gap: 0.75rem;
}

.site-title a {
    text-decoration: none;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: inline-block;
}

/* Navigation */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    font-size: 1rem;
    transition: color 0.4s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-links a.active::after {
    width: 100%;
}

/* Theme Toggle in Menu */
.nav-theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    margin-left: 0.5rem;
}

.nav-theme-toggle:hover {
    background: var(--bg-gray);
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 102;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-dark);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.2s ease, background-color 0.4s ease;
}

/* Menu toggle animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== FOOTER STYLES (from style.css) ========== */
.site-footer {
    background: var(--bg-light);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--bg-gray);
    transition: background-color 0.4s ease, border-color 0.4s ease;
    width: 100%;
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.5rem;
    transition: transform 0.3s ease, filter 0.3s ease;
    color: white !important;
}

.social-icon.researchgate {
    background: #00ccbb;
    box-shadow: 0 4px 10px rgba(0, 204, 187, 0.3);
}

.social-icon.linkedin {
    background: #0077b5;
    box-shadow: 0 4px 10px rgba(0, 119, 181, 0.3);
}

.social-icon:hover {
    transform: translateY(-5px) scale(1.1);
    filter: brightness(1.1);
}

.copyright {
    font-size: 0.9rem;
    color: #666;
}

body.dark-theme .copyright {
    color: #aaa;
}

/* ========== BLOG CONTENT CONTAINER ========== */
.blog-post-content {
    max-width: 900px;
    margin: 2rem auto;
    background-color: var(--blog-container-bg);
    padding: 2.5rem 3rem;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.03);
    border: 1px solid var(--blog-container-border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    line-height: 1.7;
}

body.dark-theme .blog-post-content {
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

/* ========== BLOG TYPOGRAPHY ========== */
.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3 {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-weight: 500;
    line-height: 1.3;
    margin-top: 1.8em;
    margin-bottom: 0.5em;
    color: var(--blog-heading);
    letter-spacing: -0.01em;
    transition: color 0.4s ease;
}

.blog-post-content h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--blog-h1-border);
    padding-bottom: 0.25em;
    margin-top: 0.2em;
    font-weight: 600;
    color: var(--blog-h1);
    background: none;
    -webkit-text-fill-color: initial;
}

.blog-post-content h1 + p {
    margin-top: 0.5em;
    font-style: italic;
    color: var(--blog-subtitle);
}

.blog-post-content h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--blog-h2-border);
    padding-bottom: 0.2em;
    background: none;
    -webkit-text-fill-color: initial;
}

.blog-post-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.2em;
    background: none;
    -webkit-text-fill-color: initial;
}

.blog-post-content p {
    margin-bottom: 1.2em;
    font-size: 1.06rem;
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    line-height: 1.7;
    color: var(--text-dark);
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 1em 0 1.5em 1.8em;
}

.blog-post-content li {
    margin-bottom: 0.45em;
}

/* Article image */
.article-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 20px auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Reading time */
.reading-time {
    text-align: center;
    margin: 5px auto 30px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.reading-time i {
    margin-right: 5px;
}

body.dark-theme .reading-time {
    color: #aaa;
}

/* Blockquote */
.blog-post-content blockquote {
    font-style: italic;
    margin: 1.2em 2em;
    color: var(--blockquote-text);
    background: var(--blockquote-bg);
    padding: 1em 1.5em;
    border-radius: 4px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Table styles */
.blog-post-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 2em 0;
    font-size: 0.98rem;
    background-color: var(--blog-table-bg);
    border: 1px solid var(--blog-table-border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.blog-post-content thead tr {
    background-color: var(--blog-th-bg);
    color: var(--blog-th-text);
}

.blog-post-content th {
    font-weight: 500;
    padding: 12px 8px;
    text-align: left;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.blog-post-content td {
    border: 1px solid var(--blog-td-border);
    padding: 10px 8px;
    vertical-align: top;
    transition: border-color 0.4s ease;
}

.blog-post-content td:first-child {
    font-weight: 550;
    background-color: var(--blog-td-first-bg);
    transition: background-color 0.4s ease;
}

/* Formula block */
.formula-block {
    background: var(--blog-formula-bg);
    padding: 1.2rem 1.5rem;
    margin: 1.8rem 0;
    border-left: 6px solid var(--blog-formula-border);
    border-radius: 0 10px 10px 0;
    overflow-x: auto;
    font-size: 1.1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    transition: background-color 0.4s ease, border-left-color 0.4s ease;
}

body.dark-theme .formula-block {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

/* Example block */
.example {
    background: var(--blog-example-bg);
    padding: 0.8rem 1.5rem;
    border-left: 5px solid var(--blog-example-border);
    margin: 1.5rem 0;
    font-style: normal;
    border-radius: 0 6px 6px 0;
    transition: background-color 0.4s ease, border-left-color 0.4s ease;
}

/* References section */
.ref {
    margin-top: 2.8em;
    padding-top: 1.2em;
    border-top: 2px dashed var(--blog-ref-border);
    font-size: 0.92rem;
    color: var(--blog-ref-text);
    transition: border-color 0.4s ease, color 0.4s ease;
}

.ref p {
    margin-bottom: 0.4em;
}

/* Author credit style */
.author-credit {
    font-variant: small-caps;
    letter-spacing: 0.5px;
}

/* Subtitle */
.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

body.dark-theme .subtitle {
    color: #aaa;
}

/* MathJax dark mode support */
body.dark-theme .MathJax,
body.dark-theme mjx-container {
    color: #f0f0f0 !important;
}

/* Equation container */
.equation-container {
    margin: 0.5rem 0;
}

.equation {
    display: block;
    margin: 0.25rem 0;
}

/* ========== AUTHOR SECTION ========== */
.author-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 25px;
    background-color: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.author-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.author-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    color: var(--text-dark);
    background: none;
    -webkit-text-fill-color: initial;
}

.author-title {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

body.dark-theme .author-title {
    color: #aaa;
}

.author-bio {
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.author-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.author-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.author-link i {
    font-size: 1rem;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    /* Header mobile */
    .header-inner {
        padding: 0 1rem;
    }

    .mobile-header-group {
        width: 100%;
        justify-content: space-between;
    }

    .menu-toggle {
        display: flex;
    }

    .site-title {
        flex: 1;
        justify-content: flex-start;
    }

    .site-title a {
        font-size: 1.2rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-light);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 101;
        gap: 1rem;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links a {
        width: 100%;
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--bg-gray);
    }

    .nav-links a::after {
        display: none;
    }

    .nav-theme-toggle {
        margin: 1rem 0 0;
        padding: 0.75rem;
        width: 100%;
        justify-content: flex-start;
        gap: 1rem;
        border-radius: 8px;
        background: var(--bg-gray);
    }

    .nav-theme-toggle span {
        display: inline-block;
        font-size: 1.1rem;
    }

    /* Blog content mobile */
    .blog-post-content {
        margin: 1.5rem auto;
        padding: 1.5rem;
    }
    
    .blog-post-content h1 {
        font-size: 1.8rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.4rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.2rem;
    }
    
    .blog-post-content p {
        font-size: 1rem;
    }
    
    .blog-post-content blockquote {
        margin: 1em 0.5em;
        padding: 0.8em 1em;
    }
    
    /* Author section mobile */
    .author-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .author-avatar {
        width: 70px;
        height: 70px;
    }
    
    .author-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .blog-post-content {
        padding: 1rem;
    }
    
    .blog-post-content h1 {
        font-size: 1.6rem;
    }
    
    .blog-post-content table {
        font-size: 0.85rem;
    }
    
    .blog-post-content th,
    .blog-post-content td {
        padding: 8px 4px;
    }
}

@media (min-width: 769px) {
    .nav-overlay {
        display: none;
    }
    
    .nav-theme-toggle span {
        display: none;
    }
}

@media (min-width: 1200px) {
    .blog-post-content {
        max-width: 1000px;
    }
}
