/* ==========================================================================
   Design System & Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --color-bg: hsl(155, 24%, 96%);          /* Soft Mint Background */
    --color-surface: hsl(0, 0%, 100%);        /* Pure White Card Background */
    --color-card-bg: hsl(155, 25%, 90%);     /* Pastel Teal Card Background */
    --color-text-primary: hsl(155, 45%, 9%);  /* Deep Slate Text */
    --color-text-secondary: hsl(155, 12%, 35%); /* Medium Slate Text */
    --color-primary: hsl(155, 40%, 25%);      /* Darker Teal Accent */
    --color-accent: hsl(11, 95%, 60%);        /* Red-Orange Primary Action */
    --color-accent-hover: hsl(11, 95%, 52%);  /* Darker Red-Orange */
    --color-mint-light: hsl(155, 35%, 94%);   /* Very light mint */
    --color-border: hsl(155, 20%, 88%);       /* Subtle borders */
    
    /* Layout & Spacing */
    --container-width: 1200px;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    --box-shadow-soft: 0 10px 30px -10px hsla(155, 45%, 9%, 0.06);
    --box-shadow-hover: 0 20px 40px -15px hsla(155, 45%, 9%, 0.12);
}

/* ==========================================================================
   Global Resets
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    line-height: 1.15;
    font-weight: 700;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

section {
    padding: 80px 0;
    position: relative;
}

/* Badges */
.badge-container {
    margin-bottom: 20px;
}

.badge {
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 16px;
    border-radius: 100px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--color-border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-surface);
    box-shadow: 0 6px 20px rgba(255, 90, 54, 0.25);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 90, 54, 0.35);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-primary);
    border: 1.5px solid var(--color-text-primary);
}

.btn-secondary:hover {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
    transform: translateY(-2px);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.demo-banner {
    display: none !important;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: hsla(155, 24%, 96%, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition-smooth);
}

.header.scrolled {
    box-shadow: var(--box-shadow-soft);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-text-primary);
}

.logo-icon {
    background-color: var(--color-text-primary);
    color: var(--color-surface);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    border-radius: 2px;
}

.nav-cta {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* Mobile Navigation Toggle Button */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 4px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: var(--color-text-primary);
    border-radius: 10px;
    transition: var(--transition-smooth);
}

/* Open states for toggle */
.mobile-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}
.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Mobile Nav Menu Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--color-surface);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    padding: 120px 40px 40px;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.mobile-link {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.mobile-link:hover, .mobile-link.active {
    color: var(--color-text-primary);
}

.mobile-cta {
    margin-top: 20px;
    width: 100%;
}

/* ==========================================================================
   Blog Hero Section & Tag Filters
   ========================================================================== */
.blog-hero {
    padding: 120px 0 40px;
    background-color: var(--color-bg);
    text-align: center;
}

.blog-hero-container {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.blog-main-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.022em;
}

.blog-hero-desc {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: 48px;
    max-width: 650px;
}

/* Search and Filter System */
.filter-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 10px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-secondary);
    pointer-events: none;
}

#blog-search {
    width: 100%;
    padding: 16px 20px 16px 54px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 100px;
    outline: none;
    box-shadow: var(--box-shadow-soft);
    transition: var(--transition-smooth);
}

#blog-search:focus {
    border-color: var(--color-primary);
    box-shadow: 0 12px 30px -10px hsla(155, 45%, 9%, 0.1);
}

.tag-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 100px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text-primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: var(--color-text-primary);
    border-color: var(--color-text-primary);
    color: var(--color-surface);
    box-shadow: var(--box-shadow-soft);
}

/* ==========================================================================
   Blog Cards Grid
   ========================================================================== */
.blog-grid-section {
    background-color: var(--color-bg);
    padding-top: 0px;
}

.blog-grid-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    transition: opacity 0.3s ease;
}

/* Article Cards layout */
.blog-post-card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow-soft);
    transition: var(--transition-smooth);
}

.blog-post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--box-shadow-hover);
    border-color: hsla(155, 40%, 25%, 0.15);
}

/* Post Graphics overlay panel */
.post-visual-overlay {
    height: 220px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 30px;
}

.teal-gradient { background: linear-gradient(135deg, hsl(155, 40%, 25%) 0%, hsl(155, 45%, 9%) 100%); }
.coral-gradient { background: linear-gradient(135deg, hsl(11, 95%, 60%) 0%, hsl(11, 40%, 20%) 100%); }
.slate-gradient { background: linear-gradient(135deg, hsl(155, 45%, 15%) 0%, hsl(155, 20%, 45%) 100%); }
.mint-gradient { background: linear-gradient(135deg, hsl(155, 35%, 15%) 0%, hsl(155, 40%, 35%) 100%); }

.inner-visual-code {
    width: 100%;
    height: 100%;
    background-color: rgba(10, 24, 18, 0.4);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    overflow: hidden;
}

.inner-visual-code.italic h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.inner-visual-code.italic p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
}

.inner-visual-code.uppercase h2 {
    font-size: 1.25rem;
    letter-spacing: 0.1em;
}

.inner-visual-code.uppercase p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.02em;
}

.code-line {
    white-space: nowrap;
}

.code-line.comment { color: #82aaff; }
.c-tag { color: #ff5370; }
.c-name { color: #ffcb6b; }
.c-val { color: #c3e88d; }
.c-fn { color: #82aaff; }
.c-prop { color: #f07178; }

/* Article Card Body */
.post-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.post-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.post-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
}

.post-category-separator {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text-secondary);
    opacity: 0.8;
}

.post-title h2, .post-title h3 {
    margin-bottom: 12px;
    transition: var(--transition-smooth);
}

.post-title h2 { font-size: 1.5rem; }
.post-title h3 { font-size: 1.35rem; }

.post-title:hover a {
    color: var(--color-accent);
}

.post-excerpt {
    color: var(--color-text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
    margin-top: auto;
}

.read-time {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.read-link {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-primary);
    transition: var(--transition-smooth);
}

.blog-post-card:hover .read-link {
    color: var(--color-accent);
    transform: translateX(4px);
}

/* Featured card specifics on desktop */
.featured-post {
    grid-column: span 2;
    flex-direction: row;
}

.featured-post .post-visual-overlay {
    width: 44%;
    height: auto;
    min-height: 320px;
}

.featured-post .post-content {
    width: 56%;
}

/* ==========================================================================
   Empty Search State
   ========================================================================== */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius-lg);
    border: 1px dotted var(--color-border);
    max-width: 520px;
    margin: 20px auto 0;
    box-shadow: var(--box-shadow-soft);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.empty-state p {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

/* ==========================================================================
   Callout / Quote Section
   ========================================================================== */
.blog-callout {
    background-color: var(--color-bg);
    padding-bottom: 100px;
}

.callout-card {
    background-color: var(--color-surface);
    padding: 50px 40px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--box-shadow-soft);
}

.callout-card h2 {
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.callout-card .quote {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

.callout-card .quote-author {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 80px 0 40px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    gap: 80px;
    margin-bottom: 60px;
}

.footer-brand {
    max-width: 380px;
}

.footer-brand .logo {
    margin-bottom: 18px;
}

.footer-desc {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.footer-links-group {
    display: flex;
    gap: 70px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.footer-col a {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.footer-col a:hover, .footer-col a.active {
    color: var(--color-accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
    padding-top: 30px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.footer-domain {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* ==========================================================================
   Back To Top Button
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 1000;
    border: 1px solid var(--color-border);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Animations & Transitions
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-animate] {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-animate]:nth-child(1) {
    animation-delay: 0.1s;
}

[data-animate]:nth-child(2) {
    animation-delay: 0.18s;
}

[data-animate]:nth-child(3) {
    animation-delay: 0.26s;
}

[data-animate]:nth-child(4) {
    animation-delay: 0.34s;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .blog-grid-inner {
        gap: 28px;
    }
    
    .featured-post {
        flex-direction: column;
    }
    
    .featured-post .post-visual-overlay {
        width: 100%;
        height: 200px;
    }
    
    .featured-post .post-content {
        width: 100%;
    }
}

@media (max-width: 860px) {
    section {
        padding: 60px 0;
    }

    .blog-hero {
        padding: 100px 0 30px;
    }

    .blog-grid-inner {
        grid-template-columns: 1fr;
    }

    .featured-post {
        grid-column: span 1;
    }

    .footer-container {
        flex-direction: column;
        gap: 40px;
    }

    .footer-links-group {
        justify-content: space-between;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .nav-links, .nav-cta {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .blog-main-title {
        font-size: 2.2rem;
    }

    .blog-hero-desc {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .filter-bar {
        gap: 16px;
    }

    .tag-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        width: 100vw;
        margin-left: -24px;
        padding-left: 24px;
        scrollbar-width: none; /* Hide scrollbars for webkit and firefox */
    }
    .tag-filters::-webkit-scrollbar {
        display: none;
    }

    .tag-filters .filter-btn {
        flex-shrink: 0;
    }

    .post-content {
        padding: 24px;
    }

    .callout-card {
        padding: 30px 20px;
    }

    .callout-card .quote {
        font-size: 1.15rem;
    }

    .footer-links-group {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
}
