@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-rgb: 79, 70, 229;
    --secondary: #06b6d4;
    --secondary-light: #ecfeff;
    --accent: #f59e0b;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.92);

    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Bootstrap Overrides */
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--primary-hover);
    --bs-card-bg: var(--bg-card);
    --bs-card-border-color: var(--border);
    --bs-heading-color: var(--text);
    --bs-body-font-family: var(--font-sans);
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
    --bg: #0b1121;
    --bg-secondary: #111827;
    --bg-tertiary: #1e293b;
    --bg-card: #151f32;
    --bg-navbar: rgba(11, 17, 33, 0.92);

    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border: #1e293b;
    --border-hover: #334155;

    --primary-light: rgba(79, 70, 229, 0.15);
    --secondary-light: rgba(6, 182, 212, 0.15);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);

    /* Bootstrap Overrides */
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-card-bg: var(--bg-card);
    --bs-card-border-color: var(--border);
    --bs-heading-color: var(--text);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.3;
    font-weight: 700;
}

::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.main-content {
    min-height: calc(100vh - 160px);
    padding-top: 80px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.grid-sidebar {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 10000;
    transition: width 0.1s linear;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: 72px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}
.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: nowrap !important;
}

/* Compact navbar on medium screens to prevent layout wrapping */
@media (max-width: 1200px) {
    .navbar-nav a {
        padding: 8px 10px;
        font-size: 13px;
    }
    .navbar-search input {
        width: 130px;
    }
    .navbar-search input:focus {
        width: 180px;
    }
    .navbar .container {
        gap: 12px;
    }
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.navbar-brand img { height: 36px; width: auto; }
.navbar-brand-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.navbar-nav a:hover, .navbar-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Custom Dropdown & Mobile Sub-menu accordion styling */
.nav-item-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    cursor: pointer;
}
.nav-dropdown-toggle .chevron-icon {
    margin-left: 4px;
    transition: transform var(--transition-fast);
}
.nav-item-dropdown:hover .nav-dropdown-toggle .chevron-icon,
.nav-item-dropdown.open .nav-dropdown-toggle .chevron-icon {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    width: 280px;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    backdrop-filter: blur(10px);
}
.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text) !important;
    text-decoration: none;
    transition: var(--transition-fast);
    width: 100%;
    overflow: hidden;
}
.dropdown-item:hover {
    background: var(--primary-light);
}
.dropdown-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
}
.dropdown-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    transition: color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-item:hover .dropdown-item-title {
    color: var(--primary);
}
.dropdown-item-desc {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Mobile accordion classes */
.mobile-dropdown-sub {
    list-style: none;
    padding-left: 16px;
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    margin-bottom: 8px;
    border-left: 2px solid var(--border);
}
.mobile-dropdown-sub.open {
    display: flex;
}
.mobile-dropdown-toggle {
    display: flex !important;
    align-items: center;
}
.mobile-dropdown-toggle .chevron-icon {
    margin-left: auto;
    transition: transform 0.2s;
}
.mobile-dropdown-toggle .chevron-icon.rotate {
    transform: rotate(180deg);
}
.mobile-dropdown-sub a {
    font-size: 13px !important;
    padding: 8px 12px !important;
}

/* Category Hero Banner Customization */
.hero {
    position: relative;
    padding: 64px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.hero.has-bg {
    border: none;
    box-shadow: var(--shadow-lg);
}
.hero.has-bg h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hero.has-bg p {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.hero.has-bg .breadcrumb a,
.hero.has-bg .breadcrumb .separator,
.hero.has-bg .breadcrumb .current {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    list-style: none;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
}
.breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.breadcrumb a:hover {
    color: var(--primary);
}
.breadcrumb .separator {
    color: var(--text-muted);
}
.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
}


.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-search {
    position: relative;
}
.navbar-search input {
    width: 200px;
    padding: 8px 36px 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 13px;
    transition: var(--transition);
    outline: none;
}
.navbar-search input:focus {
    border-color: var(--primary);
    width: 260px;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.navbar-search input::placeholder { color: var(--text-muted); }
.navbar-search .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Theme toggle */
.theme-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 16px;
}
.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Mobile navigation drawer */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--bg);
    z-index: 9999;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 24px;
}
.mobile-nav.open {
    transform: translateX(0);
}
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s;
}
.mobile-nav-overlay.open {
    opacity: 1;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.mobile-nav-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-nav-links a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.mobile-nav-links a:hover, .mobile-nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    font-weight: 500;
}
.btn-google:hover {
    background: #f8f8f8;
    border-color: #bbb;
    color: #333;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.card:hover .card-title a {
    color: var(--primary);
}

.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: var(--bg-card);
}

.card-body { padding: 20px; }

.card-badge {
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
}
.card-badge-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); }

.card-title a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.card-meta {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.card-meta svg { width: 14px; height: 14px; }

.card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

/* Featured card (large) */
.card-featured {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
}
.card-featured .card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.card-featured .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}
.card-featured .card-body {
    position: relative;
    z-index: 2;
    padding: 32px;
    width: 100%;
}
.card-featured .card-title {
    color: #fff;
    font-size: 1.5rem;
    -webkit-line-clamp: 3;
}
.card-featured .card-title a { color: #fff; }
.card-featured .card-title a:hover { opacity: 0.85; color: #fff; }
.card-featured .card-meta { color: rgba(255,255,255,0.7); }
.card-featured .card-excerpt { color: rgba(255,255,255,0.8); }

/* Category card */
.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    transition: var(--transition);
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.category-card .cat-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}
.category-card:hover .cat-bg { transform: scale(1.05); }
.category-card .cat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 100%);
}
.category-card .cat-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    width: 100%;
}
.category-card .cat-name {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.category-card .cat-count {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    padding: 80px 0 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}
.hero-content {
    max-width: 100%;
}
.hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: var(--transition);
}
.hero-image:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.3);
}

/* Float animation for hero image */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    .hero-content {
        margin: 0 auto;
        max-width: 680px;
    }
    .hero-search {
        margin: 0 auto;
    }
    .hero-image {
        max-width: 80%;
    }
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}
.hero h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}
.hero p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}
.hero-search {
    position: relative;
    max-width: 520px;
}
.hero-search input {
    width: 100%;
    padding: 16px 52px 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}
.hero-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}
.hero-search button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.hero-search button:hover { background: var(--primary-hover); }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-secondary); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title svg { color: var(--primary); flex-shrink: 0; }
.section-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.section-link:hover { gap: 8px; }

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.grid-sidebar {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

/* Featured grid: 1 large + 2 small stacked */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 24px;
}
.featured-grid .card-featured:first-child {
    grid-row: 1 / 3;
}

/* Trending horizontal scroll */
.trending-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-scroll .card {
    min-width: 300px;
    max-width: 300px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.sidebar-widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.sidebar-post {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 10px 0;
}
.sidebar-post + .sidebar-post { border-top: 1px solid var(--border); }
.sidebar-post-img {
    width: 72px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--bg-card);
}
.sidebar-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sidebar-post-title a { color: var(--text); }
.sidebar-post-title a:hover { color: var(--primary); }
.sidebar-post-title a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}
.sidebar-post-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tags cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-chip {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    border: 1px solid transparent;
}
.tag-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Newsletter widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 28px;
}
.newsletter-widget .sidebar-widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.3);
}
.newsletter-widget p { color: rgba(255,255,255,0.8); font-size: 14px; margin-bottom: 16px; }
.newsletter-widget input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
}
.newsletter-widget .btn {
    width: 100%;
    background: #fff;
    color: var(--primary);
    font-weight: 700;
}
.newsletter-widget .btn:hover { background: #f0f0f0; }

/* ============================================================
   NEWSLETTER CTA (full width)
   ============================================================ */
.newsletter-cta {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
}
.newsletter-cta h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.newsletter-cta p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.newsletter-cta form {
    display: flex;
    gap: 10px;
    max-width: 440px;
    margin: 0 auto;
}
.newsletter-cta input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.newsletter-cta input:focus { border-color: var(--primary); }
.newsletter-feedback { font-size: 13px; margin-top: 8px; }
.newsletter-feedback.success { color: var(--success); }
.newsletter-feedback.error { color: var(--danger); }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-wrapper {
    background: var(--bg-tertiary);
    padding: 40px 0 60px 0;
}
.reading-page {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    box-shadow: var(--shadow-md);
}
@media (max-width: 576px) {
    .article-wrapper {
        padding: 0 0 40px 0;
    }
    .reading-page {
        padding: 24px 20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}
.article-header { margin-bottom: 32px; }
.article-header .card-badge { margin-bottom: 16px; }
.article-header h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    margin-bottom: 16px;
    line-height: 1.25;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 14px;
}
.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.article-featured-img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    background: var(--bg-tertiary);
}

.article-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-secondary);
}
.article-content h2 {
    font-size: 1.5rem;
    margin: 40px 0 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.article-content h3 {
    font-size: 1.2rem;
    margin: 32px 0 12px;
}
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 16px 0; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content img {
    border-radius: var(--radius);
    margin: 24px 0;
}
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.6;
}
.article-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}
.article-content pre code {
    background: none;
    padding: 0;
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text);
}
.article-content a { text-decoration: underline; }

/* Table of Contents */
.toc {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
}
.toc-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.toc-list {
    list-style: none;
    padding: 0;
}
.toc-list li { margin-bottom: 6px; }
.toc-list a {
    display: block;
    padding: 4px 0;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition-fast);
}
.toc-list a:hover { color: var(--primary); padding-left: 4px; }
.toc-list .toc-h3 { padding-left: 16px; }

/* Social sharing */
.share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 32px 0;
}
.share-bar span { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.share-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 14px;
}
.share-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Article tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
}

/* Author box */
.author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 32px 0;
}
.author-box-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.author-box-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.author-box-name a { color: var(--text); }
.author-box-name a:hover { color: var(--primary); }
.author-box-bio {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comment-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
}
.comment-item + .comment-item { border-top: 1px solid var(--border); }
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.comment-author { font-weight: 600; font-size: 14px; }
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.comment-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.comment-actions button:hover { color: var(--primary); }

.comment-reply { margin-left: 56px; }

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    font-size: 13px;
    flex-wrap: wrap;
}
.breadcrumb li { display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--text-muted); }
.breadcrumb .current { color: var(--text-secondary); font-weight: 500; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 120px; resize: vertical; }

.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.form-help { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ============================================================
   AUTH PAGES (Login, Register, etc.)
   ============================================================ */
.auth-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-footer a { font-weight: 600; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,0.1); color: #6ee7b7; border-color: rgba(16,185,129,0.2); }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,0.1); color: #fca5a5; border-color: rgba(239,68,68,0.2); }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.1); color: #fcd34d; border-color: rgba(245,158,11,0.2); }
[data-theme="dark"] .alert-info { background: rgba(59,130,246,0.1); color: #93c5fd; border-color: rgba(59,130,246,0.2); }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.filter-chip {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}
.filter-chip:hover, .filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    list-style: none;
    padding: 0;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}
.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #0f172a;
    color: #e2e8f0;
    padding: 60px 0 0;
    margin-top: 60px;
}
.footer h5 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 20px;
}
.footer p { color: #94a3b8; font-size: 14px; line-height: 1.7; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #94a3b8; font-size: 14px; transition: var(--transition-fast); }
.footer-links a:hover { color: #fff; padding-left: 4px; }

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.footer-social a {
    width: 36px;
    height: 36px;
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: var(--transition-fast);
}
.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 20px 0;
    margin-top: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 20px; width: 80%; margin-bottom: 12px; }
.skeleton-img { aspect-ratio: 16/9; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 360px; margin: 0 auto; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-small { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVE — 1366px
   ============================================================ */
@media (max-width: 1366px) {
    .container { max-width: 1100px; }
    .grid-sidebar { grid-template-columns: 1fr 300px; gap: 32px; }
}

/* ============================================================
   RESPONSIVE — 1024px (Tablets landscape)
   ============================================================ */
@media (max-width: 1024px) {
    .container { max-width: 100%; }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-sidebar { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .featured-grid .card-featured:first-child { grid-row: auto; }
    .featured-grid .card-featured { min-height: 300px; }
    .navbar-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-nav { display: block; }
    .navbar-search input { width: 160px; }
    .navbar-search input:focus { width: 200px; }
}

/* ============================================================
   RESPONSIVE — 768px (Tablets portrait)
   ============================================================ */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .section { padding: 40px 0; }
    .hero { padding: 48px 0 40px; }
    .hero h1 { font-size: 1.75rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .featured-grid { gap: 16px; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .section-title { font-size: 1.25rem; }
    .trending-scroll .card { min-width: 260px; max-width: 260px; }
    .newsletter-cta { padding: 32px 24px; }
    .newsletter-cta form { flex-direction: column; }
    .auth-card { padding: 28px; }
    .author-box { flex-direction: column; text-align: center; align-items: center; }
    .share-bar { flex-wrap: wrap; }
    .article-meta { gap: 8px; }
    .footer .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================================================
   RESPONSIVE — 425px (Mobile large)
   ============================================================ */
@media (max-width: 425px) {
    .container { padding: 0 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .hero { padding: 32px 0; }
    .hero h1 { font-size: 1.5rem; }
    .hero-search input { padding: 14px 48px 14px 16px; }
    .card-featured { min-height: 260px; }
    .card-featured .card-body { padding: 20px; }
    .card-featured .card-title { font-size: 1.15rem; }
    .card-body { padding: 16px; }
    .section { padding: 32px 0; }
    .navbar { height: 60px; }
    .main-content { padding-top: 60px; }
    .navbar-search { display: none; }
    .trending-scroll .card { min-width: 240px; max-width: 240px; }
    .auth-card { padding: 24px 20px; border-radius: var(--radius-lg); }
    .footer { padding: 40px 0 0; }
    .footer .grid-4 { grid-template-columns: 1fr; gap: 32px; }
    .article-content { font-size: 15px; }
    .comment-reply { margin-left: 24px; }
    .pagination a, .pagination span { min-width: 36px; height: 36px; }
}

/* ============================================================
   RESPONSIVE — 375px (Mobile medium)
   ============================================================ */
@media (max-width: 375px) {
    .hero h1 { font-size: 1.35rem; }
    .hero p { font-size: 14px; }
    .section-title { font-size: 1.15rem; }
    .card-featured .card-title { font-size: 1.05rem; }
    .card-title { font-size: 0.95rem; }
    .auth-card { padding: 20px 16px; }
}

/* ============================================================
   RESPONSIVE — 320px (Mobile small)
   ============================================================ */
@media (max-width: 320px) {
    .container { padding: 0 12px; }
    .hero h1 { font-size: 1.2rem; }
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-lg { padding: 10px 20px; font-size: 14px; }
    .card-body { padding: 14px; }
    .navbar-brand-text { font-size: 1.25rem; }
}

/* ============================================================
   LARGE SCREEN — 1920px+
   ============================================================ */
@media (min-width: 1440px) {
    .container { max-width: 1280px; }
}
@media (min-width: 1920px) {
    .container { max-width: 1400px; }
    body { font-size: 16px; }
}

/* ============================================================
   LAZY LOADING IMAGES
   ============================================================ */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}
img[data-src].loaded {
    opacity: 1;
}

/* ============================================================
   SEARCH SUGGESTIONS DROPDOWN
   ============================================================ */
.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-suggestions.open { display: block; }
.search-suggestion-item {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border);
}
.search-suggestion-item:last-child { border-bottom: none; }
.search-suggestion-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================================
   ADVERTISING ALIGNMENT FIX
   ============================================================ */
.header-ad-wrapper {
    margin-top: 72px !important;
}
.header-ad-wrapper ~ .main-content {
    padding-top: 0px !important;
}
@media (max-width: 425px) {
    .header-ad-wrapper {
        margin-top: 60px !important;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .navbar, .footer, .back-to-top, .share-bar, .reading-progress, .sidebar { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .article-content { max-width: 100%; }
    a { color: #000; text-decoration: underline; }
}
