/*
Theme Name: Parvinder Tech Blogs
Theme URI: https://parvindersingh.ca
Author: Parvinder Singh
Description: A clean, modern theme for Salesforce & Agentforce technical blogging. Dark-mode friendly, optimized for code snippets, performance-first on e2-micro.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: parvinder-tech
*/

/* ===== CSS RESET & VARIABLES ===== */
:root {
    --color-bg: #0f1117;
    --color-surface: #1a1d2e;
    --color-surface-hover: #232740;
    --color-border: #2a2e45;
    --color-text: #e4e7f1;
    --color-text-muted: #8b92a8;
    --color-text-dim: #5c6380;
    --color-accent: #6c63ff;
    --color-accent-hover: #7f78ff;
    --color-accent-glow: rgba(108, 99, 255, 0.15);
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-code-bg: #131620;
    --color-code-border: #2a2e45;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --max-width: 820px;
    --max-width-wide: 1200px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.1);
    --transition: 0.2s ease;
}

/* Light mode override */
@media (prefers-color-scheme: light) {
    :root {
        --color-bg: #f8f9fc;
        --color-surface: #ffffff;
        --color-surface-hover: #f0f2f8;
        --color-border: #e2e5f0;
        --color-text: #1a1d2e;
        --color-text-muted: #5c6380;
        --color-text-dim: #8b92a8;
        --color-code-bg: #f4f5f9;
        --color-code-border: #e2e5f0;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
        --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
        --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.06);
    }
}

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

/* ===== TYPOGRAPHY ===== */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.625rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }

p {
    margin-bottom: 1.25rem;
    color: var(--color-text-muted);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* ===== HEADER & NAVIGATION ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.875rem 0;
}

@media (prefers-color-scheme: light) {
    .site-header {
        background: rgba(248, 249, 252, 0.9);
    }
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.site-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-accent), #a78bfa);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
}

.site-logo .logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-menu a {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    color: var(--color-text);
    background: var(--color-surface);
}

/* ===== HERO SECTION ===== */
.hero-section {
    padding: 5rem 2rem 3rem;
    text-align: center;
    background: radial-gradient(ellipse at top, var(--color-accent-glow) 0%, transparent 60%);
}

.hero-section h1 {
    font-size: 2.75rem;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-text), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .tagline {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== MAIN CONTENT AREA ===== */
.site-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

.site-content.wide {
    max-width: var(--max-width-wide);
}

/* ===== BLOG POST CARDS (Archive/Home) ===== */
.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #a78bfa);
    opacity: 0;
    transition: opacity var(--transition);
}

.post-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-dim);
}

.post-card .post-meta .category-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--color-accent-glow);
    color: var(--color-accent);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-card h2 {
    font-size: 1.375rem;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.post-card h2 a {
    color: var(--color-text);
    text-decoration: none;
}

.post-card h2 a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.post-card .excerpt {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.post-card .read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent);
    transition: gap var(--transition);
}

.post-card .read-more:hover {
    gap: 0.7rem;
    text-decoration: none;
}

/* ===== SINGLE POST ===== */
.single-post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.single-post-header h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.single-post-header .post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-dim);
}

.single-post-header .author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.single-post-header .author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #a78bfa);
}

/* ===== ARTICLE BODY ===== */
.entry-content h2 {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.entry-content h3 {
    color: var(--color-text);
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.5rem 1.25rem;
    color: var(--color-text-muted);
}

.entry-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.entry-content strong {
    color: var(--color-text);
    font-weight: 600;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

.entry-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-accent-glow);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--color-text-muted);
}

/* ===== CODE BLOCKS ===== */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--color-code-bg);
    border: 1px solid var(--color-code-border);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--color-accent);
}

pre {
    background: var(--color-code-bg);
    border: 1px solid var(--color-code-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: var(--shadow-sm);
}

pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 0.6875rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-dim);
    background: var(--color-surface);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* Syntax coloring for code */
.token.comment { color: #5c6380; font-style: italic; }
.token.keyword { color: #c792ea; }
.token.string { color: #c3e88d; }
.token.number { color: #f78c6c; }
.token.function { color: #82aaff; }
.token.tag { color: #f07178; }
.token.attr-name { color: #ffcb6b; }
.token.attr-value { color: #c3e88d; }

/* ===== TAGS ===== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.post-tags a {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-muted);
    transition: all var(--transition);
}

.post-tags a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-glow);
    text-decoration: none;
}

/* ===== TABLE OF CONTENTS ===== */
.toc-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.toc-container .toc-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-dim);
    margin-bottom: 1rem;
}

.toc-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-container li {
    margin-bottom: 0.4rem;
}

.toc-container a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    padding: 0.3rem 0;
    display: block;
}

.toc-container a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* ===== SIDEBAR ===== */
.widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-dim);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--color-text-dim);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--color-text-dim);
    transition: color var(--transition);
}

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

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.pagination a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.pagination .current {
    background: var(--color-accent);
    color: #fff;
    border: none;
}

/* ===== POST NAVIGATION ===== */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-nav-link {
    display: block;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition);
    min-height: 44px;
}

.post-nav-link:hover {
    border-color: var(--color-accent);
    text-decoration: none;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    display: block;
    margin-bottom: 0.4rem;
}

.post-nav-title {
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 600;
}

/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:hover {
    background: var(--color-surface);
}

.mobile-menu-toggle .bar {
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .bar-1 {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .bar-2 {
    opacity: 0;
}

.mobile-menu-toggle.active .bar-3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Header & Navigation */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 0.75rem 1.25rem 1rem;
        gap: 0;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.nav-open {
        display: flex;
    }

    .nav-menu li {
        list-style: none;
    }

    .nav-menu a {
        display: block;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .header-inner {
        padding: 0 1rem;
        position: relative;
    }

    .site-header {
        position: sticky;
    }

    /* Hero */
    .hero-section {
        padding: 2.5rem 1.25rem 1.75rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-section .tagline {
        font-size: 0.9375rem;
    }

    /* Content */
    .site-content {
        padding: 1.5rem 1rem;
    }

    /* Post Cards */
    .post-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-sm);
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .post-card h2 {
        font-size: 1.125rem;
        line-height: 1.35;
    }

    .post-card .excerpt {
        font-size: 0.875rem;
        line-height: 1.5;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .post-card .read-more {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .post-card:hover {
        transform: none;
    }

    /* Single Post */
    .single-post-header h1 {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .single-post-header .post-meta {
        gap: 0.75rem;
        font-size: 0.8125rem;
    }

    /* Post Navigation */
    .post-navigation {
        grid-template-columns: 1fr !important;
    }

    /* Code Blocks */
    pre {
        padding: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        font-size: 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    pre code {
        font-size: 0.75rem;
        line-height: 1.6;
    }

    pre::before {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 0.625rem;
    }

    code {
        font-size: 0.8em;
        word-break: break-word;
    }

    /* Tags */
    .post-tags a {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    /* Entry content */
    .entry-content h2 {
        font-size: 1.375rem;
        margin: 2rem 0 0.75rem;
    }

    .entry-content h3 {
        font-size: 1.125rem;
    }

    .entry-content ul,
    .entry-content ol {
        padding-left: 1.25rem;
        margin-left: 0;
    }

    .entry-content blockquote {
        margin-left: 0;
        margin-right: 0;
        padding: 0.875rem 1rem;
    }

    /* Footer */
    .site-footer {
        padding: 2rem 1.25rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        justify-content: center;
    }

    /* Comments */
    .comment {
        padding: 1rem;
    }

    .comment-respond .comment-form .submit {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    html { font-size: 15px; }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section {
        padding: 2rem 1rem 1.5rem;
    }

    .site-content {
        padding: 1.25rem 0.75rem;
    }

    .post-card {
        padding: 1rem;
    }

    .post-card .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .post-card h2 {
        font-size: 1.0625rem;
    }

    .single-post-header h1 {
        font-size: 1.375rem;
    }

    .site-logo .logo-text {
        font-size: 0.9375rem;
    }

    pre {
        padding: 0.75rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== COMMENTS SECTION ===== */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.comments-area .comments-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.comment {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment-respond .comment-form input[type="text"],
.comment-respond .comment-form input[type="email"],
.comment-respond .comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    transition: border-color var(--transition);
}

.comment-respond .comment-form input:focus,
.comment-respond .comment-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.comment-respond .comment-form .submit {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

.comment-respond .comment-form .submit:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* ===== SEARCH ===== */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .search-field {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.875rem;
}

.search-form .search-submit {
    padding: 0.6rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ===== SCROLL PROGRESS BAR ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #a78bfa);
    z-index: 9999;
    transition: width 0.1s linear;
}
