/**
 * High-Performance Blog Style Sheet
 * Architecture: Mobile-First, CSS Variables, System Design Paradigm.
 */

/* 1. Design Token Layer */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-surface: #ffffff;
    --border-color: #e9ecef;
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    --accent: #10b981; /* Premium Emerald Accent */
    --accent-hover: #059669;
    --dark-toggle-bg: #edf2f7;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-surface: #1e293b;
    --border-color: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --dark-toggle-bg: #334155;
}

/* 2. Global Resets & Structural Layout Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.625;
    transition: var(--transition-smooth);
    overflow-x: hidden;
}

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

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

/* 3. Layout Infrastructure Component Controls */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Sticky Header Layout Setup */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
}

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

.navbar-brand img{width: 180px;}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.action-btn:hover {
    background-color: var(--dark-toggle-bg);
}

/* 4. Layout & Card Design Systems */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px 32px;
}

.blog-card {
    background: var(--bg-surface);
    border-radius: 0px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background-color: var(--border-color);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.blog-card:hover .card-image {
    transform: scale(1.04);
}

.category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-uppercase: uppercase;
    padding: 4px 10px;
    letter-spacing: 1px;
    z-index: 2;
}

.card-content {
    padding: 20px 0 0 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 5. Interactive UI Element Layer */
.premium-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.premium-popup.is-active {
    opacity: 1;
    visibility: visible;
}

.popup-inner {
    background-color: var(--bg-surface);
    width: 100%;
    max-width: 540px;
    padding: 48px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.premium-popup.is-active .popup-inner {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

/* 6. Layout Responsiveness Matrix */
@media (max-width: 991px) {
    .nav-menu {
        display: none; /* Add programmatic mobile hamburger controls here */
    }
}

/* Premium Component Cards Layout rules */
.premium-card {
    border: 1px solid var(--border-color);
    background: #ffffff;
    transition: var(--transition-smooth);
}
.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.04);
}

.img-hover-scale {
    overflow: hidden;
}
.img-hover-scale img {
    transition: var(--transition-smooth);
}
.img-hover-scale:hover img {
    transform: scale(1.05);
}

/* Slide-out Transactional Drawer Styles */
.cart-drawer-backdrop {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(0,0,0,0.05);
    z-index: 1050;
    transition: var(--transition-smooth);
}
.cart-drawer-backdrop.active {
    right: 0;
}