/* ==========================================================================
   TechNovate Design System & Modern Theme
   Palette: Deep Navy (#0a1128), Royal Sapphire (#1a56db / #2563eb),
            Cyan (#06b6d4), Slate (#64748b), Pure White & Subtle Grays
   ========================================================================== */

:root {
    /* Color Tokens - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --border-focus: #2563eb;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --brand-primary: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-light: #eff6ff;
    --brand-accent: #06b6d4;
    --brand-dark: #0a1128;
    
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-purple: #8b5cf6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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.04);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, Monaco, 'Courier New', monospace;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1380px;
}

/* Dark Mode Tokens */
[data-theme="dark"] {
    --bg-primary: #0b1329;
    --bg-secondary: #070d1e;
    --bg-tertiary: #131f3d;
    --bg-card: #0f1a36;
    --bg-glass: rgba(15, 26, 54, 0.88);
    --border-color: #1e293b;
    --border-focus: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --brand-primary: #3b82f6;
    --brand-hover: #60a5fa;
    --brand-light: rgba(59, 130, 246, 0.15);
    --brand-accent: #22d3ee;
    --brand-dark: #050a18;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Reset and Global Elements */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100vw;
}

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

a:hover {
    color: var(--brand-hover);
}

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

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

ul, ol {
    list-style-position: inside;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Top Announcement / Breaking News Bar */
.top-bar {
    background: var(--brand-dark);
    color: #94a3b8;
    font-size: 0.8125rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.breaking-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-badge {
    background: var(--accent-red);
    color: #fff;
    font-weight: 800;
    font-size: 0.6875rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.75; }
    100% { opacity: 1; }
}

.ticker-link {
    color: #cbd5e1;
    font-weight: 500;
}
.ticker-link:hover {
    color: #fff;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.top-date {
    display: none;
}
@media (min-width: 768px) {
    .top-date { display: inline-block; }
}

.top-social-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-social-links a {
    color: #94a3b8;
}
.top-social-links a:hover {
    color: #38bdf8;
}

/* Main Header & Navbar */
.site-header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.site-header .container {
    max-width: 1440px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 1rem;
}

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

.site-logo img {
    height: 38px;
    width: auto;
}

/* Primary Navigation Menu */
.nav-menu {
    display: none;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .nav-menu {
        display: flex;
    }
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap !important;
    word-break: keep-all !important;
    display: inline-block;
}

.nav-link:hover, .nav-item.active .nav-link {
    color: var(--brand-primary);
    background-color: var(--brand-light);
}

/* Header Action Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* Animated High-Contrast Dual-Segment Theme Switcher Pill */
.theme-switch-pill {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 0;
    user-select: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
    isolation: isolate;
    cursor: pointer;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

html[data-theme="dark"] .theme-switch-pill {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(255, 255, 255, 0.05);
}

.theme-switch-pill:hover {
    border-color: #94a3b8;
}

html[data-theme="dark"] .theme-switch-pill:hover {
    border-color: #334155;
}

/* The Animated Glider Thumb with Spring Physics */
.theme-switch-glider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: var(--radius-full);
    pointer-events: none;
    z-index: 1;
    transform: translateX(0);
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.42s cubic-bezier(0.34, 1.45, 0.64, 1),
                background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Subtle gloss shine overlay on glider */
.theme-switch-glider::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Dark Mode Glider State - Slides across with glowing sapphire gradient & spring lift */
html[data-theme="dark"] .theme-switch-glider {
    transform: translateX(100%);
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.6),
                0 0 16px rgba(59, 130, 246, 0.45),
                inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .theme-switch-glider::before {
    opacity: 1;
}

/* Hover brightness enhancement */
.theme-switch-pill:hover .theme-switch-glider {
    filter: brightness(1.05);
}

/* Keyframe Pop & Spin Animations */
@keyframes celestialFloat {
    0% { transform: scale(0.6) rotate(-50deg); opacity: 0.3; }
    55% { transform: scale(1.32) rotate(15deg); }
    100% { transform: scale(1.18) rotate(0deg); opacity: 1; }
}

@keyframes solarBurst {
    0% { transform: scale(0.6) rotate(60deg); opacity: 0.3; }
    55% { transform: scale(1.32) rotate(-15deg); }
    100% { transform: scale(1.15) rotate(0deg); opacity: 1; }
}

/* Buttons inside the pill */
.theme-opt-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent !important;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    transition: color 0.25s ease, transform 0.15s ease;
}

.theme-opt-btn:active {
    transform: scale(0.92);
}

.theme-opt-btn .theme-icon {
    flex-shrink: 0;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1), 
                stroke 0.3s ease, 
                color 0.3s ease, 
                filter 0.3s ease, 
                opacity 0.3s ease;
}

/* Light Mode active button state */
html:not([data-theme="dark"]) #themeBtnLight {
    color: #1d4ed8;
}

html:not([data-theme="dark"]) #themeBtnLight .sun-icon {
    stroke: #2563eb;
    color: #2563eb;
    transform: scale(1.15) rotate(0deg);
    filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.25));
}

html:not([data-theme="dark"]) #themeBtnLight.active .sun-icon {
    animation: solarBurst 0.45s cubic-bezier(0.34, 1.5, 0.64, 1) forwards;
}

html:not([data-theme="dark"]) #themeBtnDark {
    color: #64748b;
}

html:not([data-theme="dark"]) #themeBtnDark .moon-icon {
    stroke: #64748b;
    color: #64748b;
    transform: scale(0.9) rotate(25deg);
    opacity: 0.7;
}

html:not([data-theme="dark"]) #themeBtnDark:hover {
    color: #0f172a;
}

html:not([data-theme="dark"]) #themeBtnDark:hover .moon-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Dark Mode active button state */
html[data-theme="dark"] #themeBtnDark {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] #themeBtnDark .moon-icon {
    stroke: #ffffff;
    color: #ffffff;
    transform: scale(1.18) rotate(0deg);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

html[data-theme="dark"] #themeBtnDark.active .moon-icon {
    animation: celestialFloat 0.45s cubic-bezier(0.34, 1.5, 0.64, 1) forwards;
}

html[data-theme="dark"] #themeBtnLight {
    color: #94a3b8;
}

html[data-theme="dark"] #themeBtnLight .sun-icon {
    stroke: #94a3b8;
    color: #94a3b8;
    transform: scale(0.85) rotate(-35deg);
    opacity: 0.65;
}

html[data-theme="dark"] #themeBtnLight:hover {
    color: #f8fafc;
}

html[data-theme="dark"] #themeBtnLight:hover .sun-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Responsive navigation adjustments */
@media (max-width: 1280px) {
    .site-header .container {
        padding: 0 1rem;
    }
    .header-inner {
        gap: 0.5rem;
    }
    .nav-menu {
        gap: 0.2rem;
    }
    .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.8125rem;
    }
    .header-actions {
        gap: 0.45rem;
    }
    .search-btn-label {
        display: none;
    }
}

@media (max-width: 640px) {
    .theme-btn-text {
        display: none;
    }
    .theme-opt-btn {
        padding: 0.38rem 0.55rem;
        min-width: 32px;
        justify-content: center;
    }
}

/* Header Search Button with Premium Glassmorphism & Keyboard Badge */
.header-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.38rem 0.85rem;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

html[data-theme="dark"] .header-search-btn {
    background: #0f172a;
    border-color: #1e293b;
    color: #94a3b8;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(255, 255, 255, 0.03);
}

.header-search-btn .search-btn-icon {
    flex-shrink: 0;
    color: var(--brand-primary);
    stroke: var(--brand-primary);
    transition: transform 0.3s cubic-bezier(0.34, 1.45, 0.64, 1), filter 0.3s ease;
}

.header-search-btn:hover {
    background: #ffffff;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18), 0 0 0 2px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

html[data-theme="dark"] .header-search-btn:hover {
    background: #1e293b;
    border-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.header-search-btn:hover .search-btn-icon {
    transform: scale(1.18) rotate(-8deg);
    filter: drop-shadow(0 2px 5px rgba(37, 99, 235, 0.4));
}

.header-search-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: none;
}

/* 3D Keyboard Shortcut Key Badge */
.search-kbd-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 19px;
    padding: 0 0.35rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-bottom: 2px solid #94a3b8;
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    line-height: 1;
}

html[data-theme="dark"] .search-kbd-key {
    background: #1e293b;
    border-color: #334155;
    border-bottom: 2px solid #0f172a;
    color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.header-search-btn:hover .search-kbd-key {
    background: var(--brand-primary);
    border-color: #1d4ed8;
    border-bottom-color: #1e40af;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

@media (max-width: 768px) {
    .search-btn-label, .search-kbd-key {
        display: none;
    }
    .header-search-btn {
        padding: 0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        justify-content: center;
    }
}

/* Admin Portal / Login Button */
.admin-portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary) !important;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.admin-portal-btn:hover {
    background: var(--brand-light);
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary);
}

.admin-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--brand-primary);
    color: #fff !important;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}
.admin-badge-btn:hover {
    background: var(--brand-hover);
}

.mobile-toggle-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-toggle-btn:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
}

/* Search Dropdown Modal / Bar */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 17, 40, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    animation: fadeIn 0.2s ease-out;
}

.search-overlay.active {
    display: flex;
}

.search-modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 640px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.search-modal-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.125rem;
    color: var(--text-primary);
    outline: none;
}

.search-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.search-quick-tags {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
}

.quick-tag {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 2500;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.mobile-nav-drawer.open {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-links .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
}

.mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2400;
    display: none;
}
.mobile-backdrop.open {
    display: block;
}

/* Main Layout Grid */
.main-wrapper {
    flex: 1;
    padding: 2rem 0;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 1024px) {
    .layout-grid {
        grid-template-columns: 8fr 4fr;
    }
}

/* Category Navigation Bar / Sub-Header */
.category-nav-strip {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 90;
    user-select: none;
}

.category-nav-container {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0.5rem 1rem;
    gap: 10px;
}

/* Scrollable Track */
.category-nav-scroll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    -webkit-overflow-scrolling: touch;
    flex: 1;
    padding: 2px 0;
}

.category-nav-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Desktop Arrow Buttons */
.cat-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    z-index: 2;
}

.cat-nav-arrow:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

.cat-nav-arrow:active {
    transform: scale(0.96);
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    flex-shrink: 0;
    text-decoration: none;
}

.cat-pill:hover, .cat-pill.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* On Mobile & Tablets: Hide Arrow buttons completely and enable native smooth swipe */
@media (max-width: 768px) {
    .cat-nav-arrow {
        display: none !important;
    }
    .category-nav-container {
        padding: 0.4rem 0.75rem;
        gap: 0;
    }
    .category-nav-scroll {
        padding-right: 1.5rem;
    }
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--brand-primary);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title i {
    color: var(--brand-primary);
}

.section-view-all {
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================================================
   HERO / FEATURED SHOWCASE
   (Primary: Big Image Top, Content Below | Side: Image Left, Title Right)
   ========================================================================== */
.featured-hero-section {
    margin-bottom: 2.75rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 960px) {
    .hero-grid {
        grid-template-columns: 1.25fr 1fr;
    }
}

/* Primary Big Card */
.hero-main-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hero-main-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
    border-color: var(--brand-primary);
}

[data-theme="dark"] .hero-main-card:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.hero-main-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 330px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.hero-main-img-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.hero-main-card:hover .hero-main-img {
    transform: scale(1.04);
}

.hero-badge-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 2;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.badge-primary {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.badge-dark {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.badge-new {
    background: #ef4444;
    color: #ffffff;
    font-weight: 800;
    animation: blinkBadge 1.5s infinite;
}

.hero-main-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hero-main-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.65rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-main-title a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-main-title a:hover {
    color: var(--brand-hover);
}

[data-theme="dark"] .hero-main-title a {
    color: var(--brand-primary);
}

[data-theme="dark"] .hero-main-title a:hover {
    color: var(--brand-hover);
}

.hero-main-summary {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.58;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-main-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-footer-left {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    flex-wrap: wrap;
}

.hero-footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.hero-read-more {
    font-weight: 700;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
    white-space: nowrap !important;
}

.hero-read-more:hover {
    gap: 8px;
    color: var(--brand-hover);
}

/* Secondary Hero Stack (Side Cards: Image Left, Title Right) */
.hero-sub-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: flex-start;
}

.hero-sub-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hero-sub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
    border-color: var(--brand-primary);
}

[data-theme="dark"] .hero-sub-card:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.hero-sub-img-wrap {
    width: 160px;
    min-width: 160px;
    height: 110px;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.hero-sub-img-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-sub-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.hero-sub-card:hover .hero-sub-img {
    transform: scale(1.06);
}

.hero-sub-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.hero-sub-cat {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    display: inline-block;
}

.hero-sub-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.38;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-sub-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-sub-title a:hover {
    color: var(--brand-primary);
}

.hero-sub-summary {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-sub-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-sub-meta-dot {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Standard Article Card Component */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
}

@media (min-width: 640px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .article-grid.grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .article-grid.grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(37,99,235,0.12);
    border-color: var(--brand-primary);
}

.card-img-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.article-card:hover .card-img {
    transform: scale(1.05);
}

.card-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 2;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.1875rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--brand-primary);
}

.card-summary {
    color: var(--text-secondary);
    font-size: 0.9125rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-muted);
    gap: 0.75rem;
}

.read-more-link {
    font-weight: 700;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: gap 0.2s;
    white-space: nowrap !important;
    flex-shrink: 0;
}
.read-more-link:hover {
    gap: 0.5rem;
}

/* Horizontal / List Article Cards - Full 16:9 Artwork */
.article-card-horizontal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    margin-bottom: 1.5rem;
}

@media (min-width: 680px) {
    .article-card-horizontal {
        flex-direction: row;
        align-items: stretch;
    }
    .article-card-horizontal .card-img-wrapper {
        width: 320px;
        flex-shrink: 0;
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 200px;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }
}
@media (max-width: 679px) {
    .article-card-horizontal .card-img-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
}

.article-card-horizontal:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(37,99,235,0.12);
    border-color: var(--brand-primary);
}
.article-card-horizontal .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.article-card-horizontal .card-title {
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 800;
}

/* Bento Spotlight Multi-Category Layouts (Full-Width Below Sidebar) */
.full-width-showcase-section {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--border-color);
}

.bento-spotlight-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.75rem;
    margin-bottom: 2rem;
}
@media (max-width: 900px) {
    .bento-spotlight-layout {
        grid-template-columns: 1fr;
    }
}
.bento-main-spotlight {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
}
.bento-main-spotlight .bento-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.bento-main-spotlight:hover .bento-img {
    transform: scale(1.04);
}
.bento-main-spotlight .bento-body {
    padding: 1.75rem;
    background: linear-gradient(180deg, rgba(15,23,42,0.7) 0%, rgba(15,23,42,0.98) 100%);
    display: flex;
    flex-direction: column;
    flex: 1;
    color: #ffffff;
}
.bento-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bento-sub-img {
    width: 200px;
    min-height: 140px;
    flex-shrink: 0;
}

.category-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* Archive Hero Boxes (Category, Tag, Search) */
.archive-hero-box {
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    margin: 1.5rem 0 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.archive-hero-title {
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.archive-hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 720px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .archive-hero-box {
        padding: 1.35rem 1rem !important;
        margin: 1rem 0 1.5rem !important;
        border-radius: var(--radius-md) !important;
    }
    .archive-hero-title {
        font-size: 1.45rem !important;
    }
    .archive-hero-desc {
        font-size: 0.875rem !important;
    }
}

.spec-chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.spec-chip {
    font-size: 0.6875rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(37,99,235,0.1);
    color: var(--brand-primary);
    border: 1px solid rgba(37,99,235,0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Trending Ranking Widget (#1, #2, #3, ...) */
/* Trending Ranking Widget (#1, #2, #3, ...) */
.trending-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    margin: 0;
    padding: 0;
}

.trending-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--border-color);
}
.trending-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trending-rank {
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;
    min-width: 34px;
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    flex-shrink: 0;
    margin-top: 1px;
}
.trending-item:nth-child(1) .trending-rank { color: #f59e0b; }
.trending-item:nth-child(2) .trending-rank { color: var(--brand-primary); }
.trending-item:nth-child(3) .trending-rank { color: #06b6d4; }
.trending-item:nth-child(n+4) .trending-rank { color: var(--text-muted); }

.trending-info {
    flex: 1;
    min-width: 0;
}

.trending-cat {
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    display: inline-block;
}

.trending-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.38;
    margin-bottom: 0.45rem;
    word-break: break-word;
}

.trending-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.trending-title a:hover {
    color: var(--brand-primary);
}

/* Trending Metadata Row - Explicit single-line flex with icons */
.trending-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    line-height: 1.2;
}

.meta-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: var(--text-muted);
}

.meta-badge-item svg {
    display: inline-block !important;
    vertical-align: middle;
    flex-shrink: 0;
    margin: 0;
}

.meta-badge-dot {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Global Meta Helper Classes to prevent broken icon wrapping everywhere */
.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: var(--text-muted);
}

.meta-item svg {
    display: inline-block !important;
    vertical-align: middle;
    flex-shrink: 0;
    margin: 0;
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.widget-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
}

.widget-title svg {
    color: var(--brand-primary);
    display: inline-block !important;
    flex-shrink: 0;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 2px;
}

/* Category Sidebar Widget */
.widget-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-category-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.widget-category-item a:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    transform: translateX(4px);
}

.cat-count {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Tags Cloud Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--transition);
}

.tag-badge:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

/* Newsletter Subscription Box */
.newsletter-widget {
    background: linear-gradient(135deg, #0a1128 0%, #1c2541 100%);
    color: #fff;
    border: 1px solid #1e293b;
}

.newsletter-widget .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.15);
}

.newsletter-desc {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.9125rem;
    outline: none;
    transition: var(--transition);
}

.newsletter-input:focus {
    border-color: var(--brand-accent);
    background: rgba(255, 255, 255, 0.15);
}

.newsletter-btn {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.newsletter-btn:hover {
    background: var(--brand-hover);
}

.newsletter-privacy {
    font-size: 0.6875rem;
    color: #64748b;
    text-align: center;
    margin-top: 0.4rem;
}

/* ==========================================================================
   Single Article Detail Page
   ========================================================================== */
.article-detail-header {
    margin-bottom: 2rem;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.breadcrumb-nav a {
    color: var(--text-secondary);
}
.breadcrumb-nav a:hover {
    color: var(--brand-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Category Badge on Article Detail */
.badge-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 800;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    margin-bottom: 1.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.badge-cat:hover {
    transform: translateY(-2px);
    opacity: 0.94;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.article-main-title {
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

@media (max-width: 768px) {
    .article-main-title {
        font-size: 1.75rem;
    }
}

.article-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.author-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.author-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-primary);
}

.author-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.author-name-row h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.author-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--brand-light);
    color: var(--brand-primary);
    border: 1px solid rgba(37, 99, 235, 0.22);
    line-height: 1.2;
}

[data-theme="dark"] .author-role-badge {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

.author-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* WhatsApp & Telegram Community Join Banners */
.article-channel-joins {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1.25rem 0 1.75rem 0;
}

@media (min-width: 640px) {
    .article-channel-joins {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.15rem;
    }
}

.channel-join-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.channel-join-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-20deg);
    transition: left 0.75s ease;
}

.channel-join-box:hover::before {
    left: 150%;
}

.channel-join-box:hover {
    transform: translateY(-3px);
    color: #ffffff !important;
}

.channel-whatsapp {
    background: linear-gradient(135deg, #128c7e 0%, #15803d 40%, #16a34a 100%);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.28);
}

.channel-whatsapp:hover {
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.42);
}

.channel-telegram {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #0088cc 100%);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.28);
}

.channel-telegram:hover {
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.42);
}

.channel-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.channel-icon-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.channel-whatsapp .channel-icon-circle {
    color: #16a34a;
}

.channel-telegram .channel-icon-circle {
    color: #0284c7;
}

.channel-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.channel-title {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.3;
    color: #ffffff;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.38);
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.channel-join-box:hover .channel-pill {
    background: #ffffff;
    transform: scale(1.04);
}

.channel-whatsapp:hover .channel-pill {
    color: #15803d !important;
}

.channel-telegram:hover .channel-pill {
    color: #0284c7 !important;
}

@media (max-width: 480px) {
    .channel-join-box {
        padding: 10px 12px;
        gap: 8px;
    }
    .channel-icon-circle {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    .channel-title {
        font-size: 0.88rem;
    }
    .channel-desc {
        font-size: 0.7rem;
    }
    .channel-pill {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

.article-metrics {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.article-featured-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2.25rem;
    box-shadow: var(--shadow-md);
}

.article-featured-img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.image-caption {
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    text-align: center;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Social Share Bar */
.share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.share-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.share-twitter { background: #1da1f2; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-whatsapp { background: #25d366; }
.share-copy { background: #475569; }

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Table of Contents Box & Collapsible Toggle */
.toc-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.toc-title {
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.toc-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toc-toggle-btn:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

[data-theme="dark"] .toc-toggle-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

[data-theme="dark"] .toc-toggle-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border-color: #3b82f6;
}

.toc-toggle-icon {
    display: inline-flex;
    transition: transform 0.25s ease;
}

.toc-box.collapsed {
    padding-bottom: 1.25rem;
}

.toc-box.collapsed .toc-toggle-icon {
    transform: rotate(-90deg);
}

.toc-box.collapsed .toc-list {
    display: none;
}

.toc-list {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-list li a {
    color: var(--text-secondary);
    font-size: 0.9125rem;
    display: block;
    transition: var(--transition);
}

.toc-list li a:hover {
    color: var(--brand-primary);
    transform: translateX(4px);
}

.toc-list li.toc-h3 {
    margin-left: 1.25rem;
    font-size: 0.875rem;
}

/* Article Prose / Rich Body Content */
.article-prose {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-prose p {
    margin-bottom: 1.5rem;
}

.article-prose h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 2.25rem 0 1rem;
    padding-top: 0.5rem;
}

.article-prose h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 1.75rem 0 0.85rem;
}

.article-prose ul, .article-prose ol {
    margin: 1.25rem 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.article-prose blockquote {
    border-left: 4px solid var(--brand-primary);
    background: var(--bg-tertiary);
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-prose blockquote cite {
    display: block;
    margin-top: 0.6rem;
    font-style: normal;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.article-prose pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin: 1.75rem 0;
    border: 1px solid #1e293b;
}

.article-prose code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    color: var(--brand-primary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.article-prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.article-table th {
    background: var(--brand-dark);
    color: #fff;
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-weight: 700;
}

.article-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.article-table tr:last-child td {
    border-bottom: none;
}

/* Callouts */
.callout {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.75rem 0;
    border-left: 4px solid var(--brand-primary);
    background: var(--brand-light);
}

.callout h4 {
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.callout-info {
    border-left-color: var(--brand-primary);
    background: var(--brand-light);
}

.callout-success {
    border-left-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

/* ==========================================================================
   Author Bio Spotlight Card (Desktop & Mobile Optimized)
   ========================================================================== */
.author-bio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--brand-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 3rem 0;
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
    position: relative;
    transition: var(--transition);
}

.author-bio-card:hover {
    box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    border-left-color: var(--brand-primary);
}

.bio-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.bio-avatar-link {
    display: block;
    position: relative;
    text-decoration: none;
}

.bio-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
    background: var(--bg-secondary);
    display: block;
    transition: transform 0.25s ease;
}

.bio-avatar-link:hover .bio-avatar {
    transform: scale(1.05);
}

.bio-verified-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.bio-content {
    flex: 1;
    min-width: 0;
}

.bio-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.bio-identity {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bio-label-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.725rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-primary);
    background: rgba(37, 99, 235, 0.08);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
}

.bio-author-name {
    margin: 4px 0 2px 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.bio-author-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bio-author-name a:hover {
    color: var(--brand-primary);
}

.bio-meta-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.bio-designation-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 3px 9px;
    border-radius: 6px;
}

.bio-articles-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.775rem;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 2px 8px;
    border-radius: 6px;
}

.btn-author-archive {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.825rem;
    font-weight: 700;
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    padding: 0.5rem 1.15rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-author-archive:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    color: #ffffff !important;
}

.bio-text {
    margin: 0.65rem 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.bio-social-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border-color);
}

.bio-social-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bio-social-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bio-social-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--soc-bg, var(--bg-tertiary));
    color: var(--soc-color, var(--text-secondary));
    font-size: 0.775rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.bio-social-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    filter: brightness(0.96);
}

/* Responsive: Mobile & Tablet */
@media (max-width: 768px) {
    .author-bio-card {
        padding: 1.5rem;
        gap: 1.25rem;
        margin: 2rem 0;
    }
    
    .bio-avatar {
        width: 72px;
        height: 72px;
    }

    .bio-author-name {
        font-size: 1.2rem;
    }
}

@media (max-width: 580px) {
    .author-bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem 1.25rem;
        border-left: 1px solid var(--border-color);
        border-top: 4px solid var(--brand-primary);
    }

    .bio-header-row {
        flex-direction: column;
        align-items: center;
        gap: 0.85rem;
    }

    .bio-identity {
        align-items: center;
    }

    .bio-label-pill {
        margin: 0 auto;
    }

    .bio-meta-pills {
        justify-content: center;
    }

    .btn-author-archive {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1rem;
    }

    .bio-social-strip {
        flex-direction: column;
        align-items: center;
        gap: 0.65rem;
    }

    .bio-social-links {
        justify-content: center;
    }
    
    .bio-social-pill {
        padding: 6px 14px;
    }
}

/* Next / Prev Article Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2.5rem 0;
}

@media (min-width: 640px) {
    .post-navigation {
        grid-template-columns: 1fr 1fr;
    }
}

.nav-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}

.nav-box:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.nav-direction {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-box-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

/* Comments Section */
.comments-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.comments-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.comment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.comment-author {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Comment Form */
.comment-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--brand-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-sm);
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--brand-hover);
    color: #fff;
}

/* Alerts / Notifications */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9125rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid var(--accent-green);
    color: #065f46;
}
[data-theme="dark"] .alert-success {
    color: #6ee7b7;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid var(--accent-red);
    color: #991b1b;
}
[data-theme="dark"] .alert-danger {
    color: #fca5a5;
}

/* Pagination Component */
.pagination-wrapper {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.pagination {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-item.active .page-link {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.page-item:not(.active):not(.disabled) .page-link:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer Design */
.site-footer {
    background: var(--brand-dark);
    color: #94a3b8;
    margin-top: auto;
    border-top: 1px solid #1e293b;
    padding: 4rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--brand-primary);
}

.footer-desc {
    color: #94a3b8;
    font-size: 0.9125rem;
    line-height: 1.6;
    margin: 1rem 0 1.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #38bdf8;
    transform: translateX(4px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.back-to-top-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.back-to-top-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    z-index: 3000;
    display: none;
    animation: slideUp 0.3s ease-out;
}

.cookie-banner.show {
    display: block;
}

.cookie-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
}

.cookie-btn-accept {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
}

.cookie-btn-decline {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Article FAQs Section (Accordion)
   ========================================================================== */
.article-faqs-section {
    margin-top: 3.5rem;
    margin-bottom: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.faq-header-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.faq-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--brand-light);
    color: var(--brand-primary);
    flex-shrink: 0;
}

.faq-header-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.faq-header-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.faq-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.article-faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.article-faq-item[open] {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.article-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease;
    gap: 1rem;
}

.article-faq-question::-webkit-details-marker {
    display: none;
}

.article-faq-question:hover {
    background: var(--bg-tertiary);
}

.article-faq-item[open] .article-faq-question {
    color: var(--brand-primary);
    background: var(--brand-light);
}

.faq-chevron-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.article-faq-item[open] .faq-chevron-icon {
    transform: rotate(180deg);
}

.article-faq-answer {
    padding: 1.15rem 1.35rem 1.35rem;
    font-size: 0.975rem;
    line-height: 1.75;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* ==========================================================================
   Mobile & Responsive Polish - Anti-Squeeze & Premium Card Layouts
   ========================================================================== */

/* Tablet & Intermediate Viewports (max-width: 991px) */
@media (max-width: 991px) {
    .featured-hero-section {
        margin-bottom: 2rem;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .hero-sub-stack {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    .bento-spotlight-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Small Tablets & Mobile Landscape (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    .main-wrapper {
        padding: 1.25rem 0;
    }
    .layout-grid {
        gap: 1.75rem;
    }

    /* Top Breaking Bar */
    .top-bar-content {
        padding: 0;
    }
    .top-bar-right {
        display: none;
    }
    .breaking-ticker {
        width: 100%;
    }
    .ticker-link {
        font-size: 0.775rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Site Header */
    .header-inner {
        height: 64px;
        gap: 0.75rem;
    }
    .site-logo img {
        height: 36px;
    }
    .brand-site-title {
        font-size: 1.3rem !important;
    }
    .brand-site-tagline {
        font-size: 0.58rem !important;
    }

    /* Hero Section on Mobile (Matches User Reference Screenshots) */
    .hero-main-card {
        border-radius: var(--radius-md);
    }
    .hero-main-body {
        padding: 1.25rem 1rem;
    }
    .hero-main-title {
        font-size: 1.25rem;
        line-height: 1.35;
        margin-bottom: 0.5rem;
    }
    .hero-main-summary {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.85rem;
    }
    .hero-main-footer {
        padding-top: 0.75rem;
        font-size: 0.75rem;
    }
    .hero-footer-left {
        gap: 0.75rem;
    }
    .hero-badge-overlay {
        bottom: 8px;
        left: 8px;
        gap: 6px;
    }
    .badge-pill {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    /* Sub cards on mobile: horizontal side-by-side matching Screenshot 2 */
    .hero-sub-stack {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .hero-sub-card {
        padding: 10px;
        gap: 12px;
        border-radius: var(--radius-md);
    }
    .hero-sub-img-wrap {
        width: 120px;
        min-width: 120px;
        height: 85px;
    }
    .hero-sub-cat {
        font-size: 0.68rem;
        margin-bottom: 3px;
    }
    .hero-sub-title {
        font-size: 0.95rem;
        line-height: 1.32;
        margin-bottom: 4px;
    }
    .hero-sub-summary {
        display: none !important;
    }
    .hero-sub-meta {
        font-size: 0.72rem;
    }

    /* Section Headers */
    .section-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        margin-bottom: 1.35rem;
        padding-bottom: 0.65rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    .section-title {
        font-size: 1.3rem;
    }
    .section-view-all {
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    /* Article Card Component */
    .article-grid {
        gap: 1.25rem;
    }
    .article-card {
        border-radius: var(--radius-md);
    }
    .article-card .card-body {
        padding: 1.25rem 1.15rem;
    }
    .article-card .card-title {
        font-size: 1.125rem;
        line-height: 1.38;
        margin-bottom: 0.5rem;
    }
    .article-card .card-summary {
        font-size: 0.875rem;
        line-height: 1.52;
        margin-bottom: 0.85rem;
        -webkit-line-clamp: 2;
    }
    .article-card .card-footer {
        padding-top: 0.75rem;
        font-size: 0.775rem;
    }
    .card-cat-badge {
        top: 10px;
        left: 10px;
        font-size: 0.65rem;
        padding: 0.2rem 0.55rem;
        border-radius: 4px;
    }

    /* Horizontal List Post Cards */
    .article-card-horizontal {
        border-radius: var(--radius-md);
        margin-bottom: 1.25rem;
    }
    .article-card-horizontal .card-img-wrapper {
        border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    }
    .article-card-horizontal .card-body {
        padding: 1.25rem 1.15rem;
    }
    .article-card-horizontal .card-title {
        font-size: 1.15rem;
        line-height: 1.38;
        margin-bottom: 0.5rem;
    }
    .article-card-horizontal .card-summary {
        font-size: 0.875rem;
        line-height: 1.52;
        margin-bottom: 0.85rem;
        -webkit-line-clamp: 2;
    }
    .article-card-horizontal .card-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.85rem;
    }
    .article-card-horizontal .card-footer .meta-row {
        font-size: 0.775rem;
        gap: 0.35rem 0.6rem;
    }
    .article-card-horizontal .read-more-link {
        font-size: 0.8125rem;
        margin-left: auto;
    }

    /* Bento Spotlight Stack on Mobile - Eliminate 200px squish */
    .bento-stack .article-card-horizontal {
        flex-direction: column !important;
    }
    .bento-sub-img {
        width: 100% !important;
        min-height: unset !important;
        aspect-ratio: 16 / 9 !important;
        border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    }
    .bento-main-spotlight {
        border-radius: var(--radius-md);
    }
    .bento-main-spotlight .bento-body {
        padding: 1.25rem;
    }
    .bento-main-spotlight h3 {
        font-size: 1.3rem !important;
    }

    /* Category Directory Hub */
    .category-directory-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }

    /* Article Detail Page Optimization */
    .article-detail-header {
        margin-bottom: 1.25rem;
    }
    .article-main-title {
        font-size: 1.65rem;
        line-height: 1.3;
    }
    .article-featured-wrapper {
        border-radius: var(--radius-md);
        margin: 1.25rem 0;
    }
    .article-featured-img {
        max-height: 300px;
    }
    .article-meta-bar {
        padding: 0.75rem 0;
        gap: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .author-info h4 {
        font-size: 0.9rem;
    }
    .author-info p {
        font-size: 0.75rem;
    }
    .article-metrics {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .share-bar {
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
        flex-wrap: wrap;
    }
    .share-label {
        width: 100%;
        margin-bottom: 0.15rem;
        font-size: 0.75rem;
    }
    .share-btn {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        padding: 0.45rem 0.6rem;
        font-size: 0.78rem;
    }
    .article-prose {
        font-size: 1.05rem;
        line-height: 1.7;
    }
    .article-prose table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 1.25rem 0;
    }
    .article-prose img {
        max-width: 100%;
        height: auto;
        border-radius: var(--radius-md);
    }
    .article-prose iframe {
        max-width: 100%;
        width: 100%;
    }
    .article-faqs-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    .faq-header-title {
        font-size: 1.2rem;
    }
    .article-faq-question {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
    .article-faq-answer {
        padding: 0.85rem 1rem 1rem;
        font-size: 0.9rem;
    }
    .author-bio-card {
        padding: 1.25rem;
        gap: 1rem;
    }
    .post-navigation {
        flex-direction: column;
        gap: 0.85rem;
    }
    .post-navigation .nav-box {
        width: 100%;
        text-align: left !important;
        padding: 1rem;
    }
    .post-navigation .nav-box .nav-direction {
        justify-content: flex-start !important;
    }
    .category-nav-scroll {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }
    .cat-pill {
        scroll-snap-align: start;
    }
    .brand-logo-img {
        max-height: 38px !important;
    }
}

/* Compact Mobile Screens (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    .header-inner {
        height: 58px;
        gap: 0.5rem;
    }
    .brand-site-title {
        font-size: 1.15rem !important;
    }
    .brand-site-tagline {
        display: none !important;
    }
    .header-actions {
        gap: 0.35rem;
    }
    .theme-opt-btn {
        padding: 0.25rem 0.35rem;
    }
    .header-search-btn {
        width: 34px;
        height: 34px;
    }
    .mobile-toggle-btn {
        width: 34px;
        height: 34px;
    }

    /* Hero main card tight mobile */
    .hero-main-body {
        padding: 1.1rem 0.85rem;
    }
    .hero-main-title {
        font-size: 1.15rem;
        line-height: 1.34;
        margin-bottom: 0.4rem;
    }
    .hero-main-summary {
        font-size: 0.8125rem;
        margin-bottom: 0.65rem;
    }
    .hero-main-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .hero-read-more {
        align-self: flex-start;
    }

    /* Mini side cards on compact screens */
    .hero-sub-card {
        padding: 8px;
        gap: 10px;
        border-radius: 8px;
    }
    .hero-sub-img-wrap {
        width: 105px;
        min-width: 105px;
        height: 75px;
    }
    .hero-sub-cat {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    .hero-sub-title {
        font-size: 0.88rem;
        line-height: 1.3;
        margin-bottom: 3px;
    }
    .hero-sub-meta {
        font-size: 0.68rem;
    }

    /* Section Headers */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .section-title {
        font-size: 1.18rem;
    }

    /* Horizontal Cards */
    .article-card-horizontal .card-body {
        padding: 1rem 0.85rem;
    }
    .article-card-horizontal .card-title {
        font-size: 1.05rem;
    }
    .article-card-horizontal .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .article-card-horizontal .read-more-link {
        margin-left: 0;
        align-self: flex-start;
    }

    /* Article grid cards */
    .article-card .card-body {
        padding: 1rem 0.85rem;
    }
    .article-card .card-title {
        font-size: 1.05rem;
    }
    .article-card .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Category Directory */
    .category-directory-grid {
        grid-template-columns: 1fr;
    }

    .article-main-title {
        font-size: 1.4rem;
    }
    .share-btn {
        flex: 1 1 100%;
    }
    .comments-header h3 {
        font-size: 1.25rem;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Author Profile & Archive Page Styles
   ========================================================================== */
.author-profile-hero {
    background: linear-gradient(135deg, #0a1128 0%, #172554 100%);
    border: 1px solid #1e293b;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    color: #ffffff;
    margin-top: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.author-profile-top {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.author-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.author-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3b82f6;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    background: #1e293b;
}

.author-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid #0a1128;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.author-profile-info {
    flex: 1;
}

.author-profile-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.author-profile-link:hover {
    color: var(--brand-primary);
}
.btn-author-archive:hover {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}

.author-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.author-profile-name {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.author-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    background: rgba(37, 99, 235, 0.3);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-username-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.author-handle {
    font-weight: 700;
    color: #38bdf8;
}

.author-meta-divider {
    color: #475569;
}

.author-joined-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.author-profile-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
    max-width: 800px;
    margin: 0;
}

.author-designation-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 700;
}

.author-profile-socials {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.15rem;
    flex-wrap: wrap;
}

.author-social-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    transition: all 0.2s ease;
}

.author-social-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 4-Column Stat Counter Grid */
.author-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.author-stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.author-stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.author-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.author-stat-content {
    display: flex;
    flex-direction: column;
}

.author-stat-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

.author-stat-lbl {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 0.2rem;
}

@media (max-width: 900px) {
    .author-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .author-profile-hero {
        padding: 1.5rem 1.15rem;
    }
    .author-profile-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .author-title-row {
        justify-content: center;
    }
    .author-profile-name {
        font-size: 1.45rem;
    }
    .author-username-row {
        justify-content: center;
    }
    .author-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   Category Rich Information Panel on Public Category Page
   ========================================================================== */
.category-info-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

html[data-theme="dark"] .category-info-panel {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.category-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.category-info-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-info-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-info-heading {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.category-info-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.category-info-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.775rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-info-toggle-btn:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.cat-toggle-chevron {
    transition: transform 0.3s ease;
}

.category-info-panel.collapsed .cat-toggle-chevron {
    transform: rotate(-90deg);
}

.category-info-panel.collapsed .category-info-body {
    display: none;
}

.category-info-panel.collapsed .category-info-header {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}

.category-info-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.category-info-body p {
    margin-bottom: 1rem;
}

.category-info-body h2, 
.category-info-body h3, 
.category-info-body h4 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.category-info-body ul, 
.category-info-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.category-info-body li {
    margin-bottom: 0.35rem;
}

.category-info-body blockquote {
    border-left: 3px solid var(--brand-primary);
    padding-left: 1rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 1.25rem 0;
}

.category-info-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.category-info-body th, 
.category-info-body td {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color);
}

.category-info-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

@media (max-width: 640px) {
    .category-info-panel {
        padding: 1.15rem 1rem;
    }
    .category-info-heading {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   Global Floating Actions (Right Edge: Back to Top Arrow & Share Any Page)
   ========================================================================== */
.floating-actions-group {
    position: fixed;
    right: 24px;
    bottom: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.floating-share-wrapper {
    position: relative;
}

.floating-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

/* Scroll-to-Top Floating Arrow Button */
.floating-top-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.85);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease, background 0.2s, color 0.2s;
}

.floating-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-top-btn:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.floating-top-btn:active {
    transform: translateY(-1px) scale(0.96);
}

/* Floating Share Trigger Button */
.floating-share-trigger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.36), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.floating-share-trigger:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 14px 32px rgba(239, 68, 68, 0.48);
}

.floating-share-trigger.active {
    background: #0f172a;
    color: #ffffff;
    transform: rotate(90deg);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.4);
}

[data-theme="dark"] .floating-share-trigger.active {
    background: #ffffff;
    color: #0f172a;
}

/* Floating Share Popover Panel */
.floating-share-popup {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.94);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-share-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.share-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.share-popup-title {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.share-popup-close {
    background: none;
    border: none;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.share-popup-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.share-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.share-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    border-radius: 12px;
    text-decoration: none !important;
    font-size: 0.72rem;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary) !important;
}

.share-pop-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.share-popup-item:hover .share-pop-icon {
    transform: scale(1.12);
}

/* Specific Social Button Themes */
.share-pop-whatsapp .share-pop-icon { background: #25d366; color: #ffffff; }
.share-pop-facebook .share-pop-icon { background: #1877f2; color: #ffffff; }
.share-pop-twitter .share-pop-icon { background: #0f172a; color: #ffffff; }
[data-theme="dark"] .share-pop-twitter .share-pop-icon { background: #ffffff; color: #000000; }
.share-pop-telegram .share-pop-icon { background: #0088cc; color: #ffffff; }
.share-pop-linkedin .share-pop-icon { background: #0a66c2; color: #ffffff; }
.share-pop-copy .share-pop-icon { background: var(--brand-primary); color: #ffffff; }

.share-popup-item:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.share-popup-url-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px 6px;
}

#sharePageUrlInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: inherit;
    text-overflow: ellipsis;
    padding: 4px 6px;
}

.share-url-copy-btn {
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.share-url-copy-btn:hover {
    background: var(--brand-hover);
    transform: scale(1.03);
}

.share-url-copy-btn.copied {
    background: #10b981;
}

/* Footer inline top button */
.footer-text-top-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.footer-text-top-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

@media (max-width: 640px) {
    .floating-actions-group {
        right: 16px;
        bottom: 22px;
        gap: 10px;
    }
    .floating-action-btn {
        width: 44px;
        height: 44px;
    }
    .floating-share-popup {
        width: calc(100vw - 32px);
        max-width: 320px;
        right: 0;
        bottom: 56px;
    }
}



