/* Global Styles & Variables */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

:root {
    /* Light Mode (Default) */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --bg-header: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-pill: #F0F2F5;
    --bg-pill-hover: #E2E8F0;

    --text-primary: #1a2332;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-nav: #2d3748;
    --text-nav-hover: #1a1a1a;

    --border-color: #E2E8F0;
    --card-border: #E2E8F0;
    --divider: #EDF2F7;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Accents (Constant) */
    --accent-blue: #2196F3;
    --accent-pink: #FF4B91;
    --accent-orange: #FF9F45;
    --accent-green: #00b894;
    --gradient-main: linear-gradient(90deg, #FF4B91 0%, #FF9F45 100%);

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --font-main: 'Inter', sans-serif;

    /* Hero Specific (Light Mode) */
    --hero-bg: #1a2332;
    /* Hero usually stays dark or needs specific light styling. Let's make it dark in light mode too for contrast, OR light? Prompt implies specific hero colors for Dark Mode. Let's make Light Mode hero ... Navy? No, typically light mode has light hero. But the design is "Tech that matters" with gradients. Let's try a very light gray for hero in Light Mode. */
    --hero-bg: #f8fafc;
    --hero-overlay: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    /* Dark Mode (User Specified) */
    --bg-primary: #121212;
    /* or #1a1a1a */
    --bg-secondary: #1e1e1e;
    --bg-header: #0d1117;
    /* Very dark navy */
    --bg-card: #1e1e1e;
    --bg-pill: #2a2a2a;
    --bg-pill-hover: #3a3a3a;

    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #666666;
    --text-nav: #E0E0E0;
    --text-nav-hover: #FFFFFF;

    --border-color: #404040;
    --card-border: #2a2a2a;
    --divider: #333333;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

    /* Adjust Accents for Dark Mode */
    --accent-blue: #42A5F5;
    --accent-pink: #FF6BA8;
    --accent-orange: #FFB366;

    --hero-bg: #0d1117;
}

/* View Transition Animation */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
    height: 100%;
    overflow: clip;
}

::view-transition-new(root) {
    z-index: 9999;
    /* Always keep new content on top */
}

::view-transition-old(root) {
    z-index: 1;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: fa-spin 2s infinite linear;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    object-fit: cover;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Utilities */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.hidden {
    display: none !important;
}

/* Header Styles */
/* Header Styles */
#main-header {
    background-color: transparent;
    /* Handled by theme selectors */
    border-bottom: 0;
    /* Handled by theme selectors */
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] #main-header {
    background-color: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] #main-header {
    background-color: rgba(13, 17, 23, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Admin Bar Compatibility */
body.admin-bar #main-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #main-header {
        top: 46px;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: none;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

/* Desktop Nav */
.desktop-nav ul {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.desktop-nav li {
    position: relative;
    list-style: none;
}

.desktop-nav a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-nav);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.desktop-nav a:hover {
    border-color: var(--accent-pink);
    color: var(--text-nav-hover);
    background: var(--bg-pill-hover);
}

.desktop-nav .menu-item-has-children>a::after {
    content: '\f0d7';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 6px;
    margin-top: 2px;
}

/* Dropdown Menu (Sub-menu) */
.desktop-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 0;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    display: block !important;
    flex-direction: column;
    z-index: 100;
    list-style: none;
}

.desktop-nav li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.desktop-nav .sub-menu li {
    display: block;
}

.desktop-nav .sub-menu a {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 0;
    border: none;
    font-size: 14px;
    justify-content: flex-start;
}

.desktop-nav .sub-menu a:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-blue) !important;
    border: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--bg-pill-hover);
    color: var(--text-primary);
}

/* Expanding Search Bar */
.search-expandable {
    display: flex;
    align-items: center;
    position: relative;
    background: transparent;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.search-expandable.expanded {
    background: var(--bg-card);
    border-color: var(--border-color);
    padding: 2px;
}

.search-expandable .search-form {
    display: flex;
    align-items: center;
    width: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    /* Added visibility */
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    border: none;
}

.search-expandable.expanded .search-form {
    width: 220px;
    opacity: 1;
    visibility: visible;
    margin-right: 5px;
}

.search-expandable .search-field {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    outline: none;
    box-shadow: none;
    /* Remove shadows */
}

.search-expandable .search-submit {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    display: none;
    /* Hide submit button visually */
}

/* Trigger Button */
.search-trigger {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-nav);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-main);
    transition: all 0.2s;
    white-space: nowrap;
}

.search-trigger:hover {
    border-color: var(--accent-pink);
    background: var(--bg-pill-hover);
    color: var(--text-nav-hover);
}

.search-expandable.expanded .search-trigger {
    display: none;
}

/* Close Button */
.search-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 10px;
}

.search-close:hover {
    color: var(--accent-pink);
}

.search-expandable.expanded .search-close {
    display: block;
}

/* Hide default WP search styles if present */
.search-form label {
    display: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-header);
    transition: left 0.3s ease;
    z-index: 10002;
    padding: 20px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.close-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mobile-nav-list a {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    flex: 1;
}

/* Mobile Dropdowns */
.mobile-dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    padding: 5px 10px;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-list .menu-item-has-children.active .mobile-dropdown-toggle {
    transform: rotate(90deg);
}

.mobile-nav-list .sub-menu {
    display: none;
    flex-direction: column;
    padding-left: 15px;
    margin-top: 10px;
    gap: 12px;
    border-left: 2px solid var(--border-color);
    margin-left: 5px;
    width: 100%;
    list-style: none;
}

.mobile-nav-list .menu-item-has-children.active .sub-menu {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.mobile-nav-list .sub-menu a {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.feat-card {
    position: relative;
    background-color: var(--bg-card-hover);
    /* Placeholder */
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    min-height: 250px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

#hero-section {
    position: relative;
    background-color: var(--hero-bg);
    padding: 80px 0;
    overflow: hidden;
    text-align: center;
    transition: background-color 0.3s ease;
}

#hero-section::before,
#hero-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] #hero-section::before,
[data-theme="dark"] #hero-section::after {
    opacity: 0.3;
    /* Slightly reduced in dark mode per prompt */
}

#hero-section::before {
    top: -50px;
    left: -50px;
    background: var(--accent-pink);
}

#hero-section::after {
    bottom: -50px;
    right: -50px;
    background: var(--accent-orange);
}

/* Single Page Hero */
.page-hero {
    background: var(--hero-bg);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 107, 107, 0.15), transparent 40%),
        radial-gradient(circle at bottom left, rgba(78, 205, 196, 0.15), transparent 40%);
    pointer-events: none;
}

[data-theme="dark"] .page-hero {
    background: #0d1117;
}

.page-hero .page-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -1px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.page-hero .page-description {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .page-hero {
        padding: 50px 0;
    }

    .page-hero .page-title {
        font-size: 32px;
    }

    .page-hero .page-description {
        font-size: 16px;
    }
}


.hero-container {
    position: relative;
    z-index: 1;
}

.hero-tagline {
    font-size: 72px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
    margin: 0;
    color: var(--text-primary);
    /* For light mode contrast */
}

/* Trending Bar */
/* Trending Bar Redesign */
#trending-bar {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 0;
    border: none;
}

.trending-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.trending-label {
    font-weight: 800;
    font-size: 15px;
    background: linear-gradient(90deg, #00b894, #6c5ce7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 15px;
    border-right: 1px solid var(--divider);
}

.trending-scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
    align-items: center;
    padding-right: 40px;
    /* Space for right arrow */
}

.trending-scroll-container::-webkit-scrollbar {
    display: none;
}

.trending-pill {
    white-space: nowrap;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    text-decoration: none;
}

.trending-pill:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

[data-theme="dark"] .trending-pill:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.scroll-arrow {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    position: absolute;
    z-index: 2;
}

.scroll-arrow:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: scale(1.1);
}

.scroll-arrow.left {
    left: 120px;
    /* Adjust based on label width */
    background: var(--bg-card);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.scroll-arrow.right {
    right: 12px;
    background: var(--bg-card);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.scroll-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Featured Grid */
#featured-posts {
    margin-bottom: 60px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr;
    grid-auto-rows: minmax(100px, auto);
    gap: 20px;
}

.feat-card.area-a {
    grid-column: 1 / 3;
    grid-row: 1 / 4;
    min-height: 450px;
}

.feat-card.area-b {
    grid-column: 1 / 2;
    grid-row: 4 / 6;
    min-height: 250px;
}

.feat-card.area-c {
    grid-column: 2 / 3;
    grid-row: 4 / 6;
    min-height: 250px;
}

.feat-card.area-side {
    grid-column: 3;
    min-height: 200px;
    /* Increased height */
}

.feat-card.area-side:nth-of-type(4) {
    grid-row: 1 / 2;
}

.feat-card.area-side:nth-of-type(5) {
    grid-row: 2 / 3;
}

.feat-card.area-side:nth-of-type(6) {
    grid-row: 3 / 5;
}

.feat-card.area-side:nth-of-type(7) {
    grid-row: 5 / 6;
}

.feat-card.area-standard {
    grid-column: span 1;
    min-height: 250px;
}

.feat-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    border: 1px solid var(--card-border);
}

.feat-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.feat-card:hover {
    transform: scale(1.02);
    z-index: 2;
    box-shadow: var(--shadow-hover);
}

.card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Moved to Right */
    left: auto;
    background: var(--accent-blue);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    z-index: 2;
}

.card-content {
    z-index: 2;
    position: relative;
}

.card-tag {
    color: var(--accent-orange);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: none;
    /* Hidden per user request to avoid overlap */
}

.card-title {
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    color: white;
    /* Always white on image cards */
}

.area-a .card-title {
    font-size: 32px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    /* Always light on image cards */
}

.avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ddd;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    background-size: cover;
}

/* Latest Content Wrapper */
.content-wrapper {
    display: flex;
    gap: 50px;
    padding-bottom: 60px;
}

#latest-discoveries {
    flex: 7;
}

#sidebar {
    flex: 3;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    padding-bottom: 10px;
    display: inline-block;
    position: relative;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.latest-card {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--divider);
}

.latest-card:last-child {
    border-bottom: none;
}

.latest-thumb {
    width: 260px;
    height: 145px;
    border-radius: 12px;
    background-color: var(--bg-secondary);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.latest-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.latest-content .article-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.2s;
}

.latest-content .article-title:hover {
    color: var(--accent-blue);
}

.latest-content .meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--accent-blue);
    margin-bottom: 12px;
    font-weight: 600;
}

.latest-content .meta .author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.latest-content .meta .dot {
    color: var(--text-muted);
    font-size: 8px;
}

.latest-content .meta .time {
    color: var(--text-muted);
    font-weight: 400;
}

.latest-content .article-para {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.load-more-btn {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

/* Sidebar Widgets */
.sidebar-box {
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    background: var(--bg-header);
    /* Slightly different bg for sidebar boxes if desired, using header for now */
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.sidebar-box:last-child {
    margin-bottom: 0;
    /* Prevent extra gap before footer */
}

.sidebar-box h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
    position: relative;
    color: var(--text-primary);
}

.sidebar-box ol {
    counter-reset: sb-counter;
    padding-left: 0;
    z-index: 1;
    position: relative;
    list-style: none;
}

.sidebar-box li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--text-secondary);
}

.sidebar-box li:hover {
    color: var(--text-primary);
}

.sidebar-box li::before {
    counter-increment: sb-counter;
    content: counter(sb-counter);
    position: absolute;
    left: 0;
    top: 2px;
    font-weight: 900;
    font-size: 20px;
    opacity: 0.6;
}

/* Sidebar Gradients Overlays - adjustments for dark/light */
/* We keep the transparent gradients but might need to adjust opacity */
.sidebar-box.orange-grad::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 159, 69, 0.15), transparent 70%);
}

.sidebar-box.orange-grad li::before,
.sidebar-box.orange-grad h3 i {
    color: var(--accent-orange);
}

.sidebar-box.blue-grad::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(33, 150, 243, 0.15), transparent 70%);
}

.sidebar-box.blue-grad li::before,
.sidebar-box.blue-grad h3 i {
    color: var(--accent-blue);
}

.sidebar-box.yellow-grad::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 235, 59, 0.15), transparent 70%);
}

.sidebar-box.yellow-grad li::before,
.sidebar-box.yellow-grad h3 i {
    color: #ffe600;
}

/* Footer */
#main-footer {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    padding: 40px 0 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 60px;
}

.footer-brand {
    max-width: 450px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 20px 0 30px;
    line-height: 1.6;
}

.socials {
    display: flex;
    gap: 15px;
}

.socials a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    transition: all 0.3s;
}

.socials a:hover {
    background: var(--bg-header);
    color: var(--text-primary);
    /* Or accent? */
    transform: translateY(-3px);
}

[data-theme="dark"] .socials a:hover {
    background: white;
    color: #1a1a1a;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links a {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    position: relative;
    width: fit-content;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-pink);
    transition: width 0.3s;
}

.footer-links a:hover::after {
    width: 100%;
}


/* Responsive */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: 1fr 1fr;
    }

    .feat-card.area-side {
        grid-column: auto;
    }

    .feat-card.area-a {
        grid-column: 1 / 3;
    }

    .feat-card.area-b {
        grid-column: 1;
        grid-row: auto;
    }

    .feat-card.area-c {
        grid-column: 2;
        grid-row: auto;
    }
}

@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
    }

    #sidebar {
        order: 2;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .hero-tagline {
        font-size: 42px;
    }

    .featured-grid {
        display: flex;
        flex-direction: column;
    }

    .feat-card {
        min-height: 250px;
    }

    .latest-card {
        flex-direction: column;
        gap: 15px;
    }

    .latest-thumb {
        width: 100%;
        height: 200px;
    }

    #main-footer {
        padding-top: 20px;
        margin-top: 0;
    }

    .footer-content {
        gap: 20px;
        /* Reduced from 60px */
    }

    .footer-copyright {
        margin-top: 15px;
        padding-top: 15px;
    }
}

/* =========================================
   ARTICLE PAGE STYLES
   ========================================= */

/* Reading Progress Bar */
#progress-bar-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1001;
}

#progress-bar {
    height: 100%;
    background: var(--accent-blue);
    width: 0%;
    transition: width 0.1s ease;
}

/* Layout */
.article-page-container {
    padding-top: 30px;
    padding-bottom: 60px;
}

.article-layout {
    display: flex;
    gap: 40px;
    position: relative;
    margin-top: 40px;
}

.share-sidebar {
    flex: 0 0 70px;
    /* Fixed width for icon stack */
}

.article-content {
    flex: 1;
    /* Takes remaining space usually around 60-70% */
    max-width: 800px;
    margin: 0 auto;
    /* Center if sidebar collapses */
}

.right-sidebar {
    flex: 0 0 320px;
    display: none;
    /* Hidden on smaller screens by default, visible on desktop */
}

@media (min-width: 1200px) {
    .right-sidebar {
        display: block;
    }

    .share-sidebar {
        display: block;
    }
}

/* Sticky behaviors */
.share-buttons-sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.sticky-sidebar-content {
    position: sticky;
    top: 100px;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 500;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 5px;
    color: var(--text-muted);
}

/* Article Hero */
.article-hero {
    margin-bottom: 40px;
    text-align: left;
}

.article-title-main {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-primary);
    max-width: 900px;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    font-size: 15px;
    color: var(--text-secondary);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--border-color);
}

.author-name a {
    font-weight: 700;
    color: var(--text-primary);
}

.author-name a:hover {
    color: var(--accent-blue);
}

.meta-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.publish-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    /* Constrain to article content width */
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: var(--shadow-card);
}

/* Shift sidebar up to align with hero image */
.article-page-container .right-sidebar {
    margin-top: -480px;
    /* Pull sidebar up to align with hero image */
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
}

/* Fixed stray brace */

/* Author Hero */
.author-hero {
    background-color: var(--bg-secondary);
    padding: 60px 0;
    margin-bottom: 0;
}

.author-hero-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/*
.author-avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-card);
    box-shadow: var(--shadow-card);
}

.author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
*/

/* 
.author-name {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.author-bio {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 800px;
} 
*/

.author-socials {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 25px;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 50px;
    align-items: center;
    position: relative;
}

.author-socials .social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.author-socials .social-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* Author Stats Strip */
.author-stats-strip {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    margin-bottom: 40px;
    position: sticky;
    top: var(--header-height);
    z-index: 99;
}

.stats-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-count {
    font-size: 28px;
    color: var(--text-primary);
}

.article-count strong {
    font-weight: 800;
    color: var(--text-primary);
}

.filter-pills {
    display: flex;
    gap: 10px;
}

.filter-pill {
    white-space: nowrap;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.filter-pill:hover,
.filter-pill.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

[data-theme="dark"] .filter-pill:hover,
[data-theme="dark"] .filter-pill.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Sidebar Widgets for Author Page */
.sidebar-box.author-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.sidebar-box.author-stats .stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.badges-row {
    display: flex;
    gap: 8px;
}

.author-badge {
    background: #ffecdb;
    color: #e67e22;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

[data-theme="dark"] .author-badge {
    background: rgba(230, 126, 34, 0.2);
}

/* Related Authors */
.related-author-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.ra-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
}

.ra-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.ra-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.follow-btn-sm {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--accent-blue);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.follow-btn-sm:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Orphaned styles - missing selector
    bottom: 20px;
    left: 20px;
    background: var(--accent-blue);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    z-index: 2;
*/

/* Share Buttons */
.share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.share-btn:hover {
    transform: scale(1.1);
    color: white;
    border-color: transparent;
}

.share-btn.fb:hover {
    background: #1877F2;
}

.share-btn.tw:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

[data-theme="dark"] .share-btn.tw:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.share-btn.li:hover {
    background: #0A66C2;
}

.share-btn.wa:hover {
    background: #25D366;
}

.share-btn.cp:hover {
    background: #666666;
}

.share-btn.em:hover {
    background: #EA4335;
}



/* Article Content Typography */
.article-content p {
    font-size: 19px;
    line-height: 1.8;
    margin-bottom: 28px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    /* Could be Georgia for serif */
}

.article-content h2 {
    font-size: 30px;
    font-weight: 800;
    margin-top: 50px;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.article-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.article-content ul,
.article-content ol {
    margin-bottom: 30px;
    padding-left: 20px;
}

.article-content li {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 10px;
    color: var(--text-primary);
    list-style-type: disc;
}

.article-content blockquote {
    margin: 30px 0;
    padding: 24px 30px;
    border-left: 4px solid var(--accent-pink);
    background: var(--bg-secondary);
    font-style: italic;
    font-size: 20px;
    color: var(--text-primary);
    border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
    margin-bottom: 0;
    font-size: inherit;
}

.article-image {
    margin: 40px 0;
}

.article-image img {
    border-radius: 8px;
    width: 100%;
}

.article-image figcaption {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

.code-block {
    background: var(--bg-pill);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 30px;
}

.code-block pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--text-primary);
}

/* Author Box */
.author-box {
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.author-box-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 3px solid var(--bg-secondary);
}

.author-box-content {
    flex: 1;
}

.author-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.author-box-content h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
}

.author-bio {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.author-role {
    font-size: 13px;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.cat-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}



/* Comments Section */
.comments-section {
    padding-top: 20px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.comments-header h2 {
    font-size: 28px;
    font-weight: 800;
}

.comment-count {
    background: var(--bg-secondary);
    font-size: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 10px;
    color: var(--accent-blue);
}

.comment-input-area {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.input-wrapper {
    flex: 1;
}

.input-wrapper textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-family: inherit;
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.post-comment-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-comment-btn:hover {
    opacity: 0.9;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-card {
    display: flex;
    gap: 20px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--divide);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-meta {
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 700;
    font-size: 15px;
    margin-right: 10px;
    color: var(--text-primary);
}

.comment-time {
    font-size: 13px;
    color: var(--text-muted);
}

.comment-body p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-actions button {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.comment-actions button:hover {
    color: var(--accent-blue);
}

/* Responsive Article Styles */
@media (max-width: 1200px) {

    /* Tablet/Small Desktop: Hide sidebars or adjust */
    .right-sidebar {
        display: none;
        /* We will re-enable it at the bottom for mobile/tablet if desired, 
           or keep hidden on tablet and show on bottom for phone.
           Let's move it to bottom for tablet+mobile */
    }

    .share-sidebar {
        display: none;
    }

    .article-content {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 992px) {

    /* Re-enable sidebars for mobile/tablet layout but stacked */
    .article-layout {
        flex-direction: column;
    }

    /* Move Right Sidebar to bottom */
    .right-sidebar,
    .article-page-container .right-sidebar {
        display: block;
        width: 100%;
        flex: none;
        margin-top: 10px;
        /* Reduced gap from 40px */
        position: relative;
        z-index: 10;
    }

    .sticky-sidebar-content {
        position: static;
    }

    /* Transform Share Sidebar to Fixed Bottom Bar */
    .share-sidebar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        padding: 10px 20px;
        flex: none;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .share-buttons-sticky {
        position: static;
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        gap: 0;
    }

    .share-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        background: transparent;
        border: none;
    }

    /* Adjust Article Page Container padding to account for bottom bar */
    .article-page-container {
        padding-bottom: 30px;
        /* Reduced to pull footer closer */
    }
}

@media (max-width: 768px) {
    .article-title-main {
        font-size: 28px;
    }

    .article-content p {
        font-size: 17px;
    }

    .article-meta-bar {
        font-size: 13px;
        gap: 15px;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .author-socials {
        justify-content: center;
    }

    .hero-img {
        aspect-ratio: 4/3;
        /* Taller image on mobile */
    }
}

/* =========================================
   Category Page Styles
   ========================================= */

/* Hero Section */
.category-hero {
    background-color: var(--bg-header);
    padding: 60px 0 80px;
    position: relative;
    overflow: visible;
    /* Changed from hidden so dropdown isn't clipped */
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
    /* Added to ensure it stays above .category-layout-container */
}

.category-hero .category-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.category-hero .category-description {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.category-hero .breadcrumbs-hero {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.category-hero .breadcrumbs-hero a {
    color: var(--text-secondary);
    text-decoration: none;
}

.category-hero .breadcrumbs-hero a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* Hero Gradients similar to homepage */
.hero-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 107, 107, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, rgba(78, 205, 196, 0.1), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Category Layout */
.category-layout-container {
    padding-top: 40px;
    padding-bottom: 60px;
}

.category-trending-section {
    margin-bottom: 50px;
}

/* Category Layout */
.category-hero .breadcrumbs-hero,
.page-hero .breadcrumbs-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
}

.category-hero .breadcrumbs-hero .breadcrumbs,
.page-hero .breadcrumbs-hero .breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Big Search Bar */
/* Big Search Bar - Restyled to match Header */
.search-refine {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

.search-refine .search-form {
    display: flex;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 4px 10px;
    /* Increased left padding */
    border: 1px solid var(--border-color);
    box-shadow: none;
    transition: border-color 0.3s ease;
    align-items: center;
    /* Ensure vertical alignment */
}

.search-refine .search-form:hover,
.search-refine .search-form:focus-within {
    border-color: var(--accent-pink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-refine label {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    /* Ensure label flexes correct */
}

.search-refine .search-field {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 10px 8px 5px;
    /* Reduce left padding for input */
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-refine .search-submit {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: color 0.2s ease;
    order: -1;
    /* Move to the left */
    margin-right: 5px;
}

.search-refine .search-submit:hover {
    color: var(--accent-pink);
    transform: none;
    background-color: transparent;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .search-refine .search-form {
    background: var(--bg-card);
    box-shadow: none;
}


/* Live Search Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
    z-index: 9999;
    /* Ensure high z-index */
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: left;
    /* Prevent center align inheritance */
}

.live-search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    margin-bottom: 5px;
}

.live-search-item:last-child {
    margin-bottom: 0;
}

.live-search-item:hover {
    background-color: #f5f5f7;
}

.live-search-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    margin-right: 15px;
    background-color: #eee;
    flex-shrink: 0;
}

.live-search-content {
    flex: 1;
    min-width: 0;
    /* Prevent text overflow issues */
}

.live-search-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.live-search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

[data-theme="dark"] .search-results-dropdown {
    background: #1e2530;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .live-search-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.section-heading {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* Trending Grid */
.trending-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

/* Large Featured Card */
.trending-large-card {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.trending-thumb {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.3s ease;
}

.trending-large-card:hover .trending-thumb {
    transform: scale(1.03);
}

.overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    z-index: 1;
}

.trending-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 2;
    color: #fff;
}

.trending-info-overlay .category-tag {
    background: var(--accent-blue);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}

.trending-info-overlay h3 a {
    color: #fff;
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    display: block;
    margin-bottom: 10px;
}

.trending-info-overlay h3 a:hover {
    text-decoration: underline;
}

.trending-info-overlay .meta {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.trending-info-overlay .meta img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.trending-info-overlay .meta .author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* Small Grid Cards */
.trending-small-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trending-small-card {
    display: flex;
    gap: 15px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.trending-small-card:hover {
    background: var(--bg-hover);
}

.trending-small-card .small-thumb {
    width: 120px;
    height: 90px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.trending-small-card .small-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.trending-small-card h4 a {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 6px;
    display: block;
}

.trending-small-card h4 a:hover {
    color: var(--accent-blue);
}

.trending-small-card .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trending-small-card .meta .dot {
    margin: 0 2px;
}




/* Main Content Layout */
.content-wrapper-category {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    position: relative;
    /* Ensure sticky sidebar works relative to this container */
    align-items: flex-start;
}

.latest-discoveries-list {
    flex: 1;
    /* Takes remaining space */
    min-width: 0;
    /* Prevent overflow */
}

/* List Header */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.list-header .section-title {
    margin-bottom: 0;
    border-bottom: none;
    /* Override default section title border */
}

.filter-toggles {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--bg-hover);
}

.filter-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* Category Article Card */
.cat-article-card {
    display: flex;
    gap: 25px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.cat-article-card:last-child {
    border-bottom: none;
}

.cat-article-card .cat-thumb {
    width: 260px;
    height: 160px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    cursor: pointer;
}

.cat-article-card .cat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cat-article-card .cat-title a {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.3;
}

.cat-article-card .cat-title a:hover {
    color: var(--accent-blue);
}

.cat-article-card .cat-excerpt {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 8px 0 12px;
}

.cat-article-card .cat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.cat-article-card .cat-meta .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.cat-article-card .cat-meta .dot {
    margin: 0 4px;
    font-size: 8px;
    opacity: 0.6;
}



/* Sidebar Styling Specifics */
.sidebar-box.green-grad {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
}

.sidebar-box.purple-grad {
    background: linear-gradient(135deg, #8E2DE2, #4A00E0);
    color: #fff;
}

.sidebar-box.teal-grad {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    color: #fff;
}

.sidebar-box h3 {
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.trending-list-styled {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trending-item {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: #fff;
    align-items: flex-start;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.trending-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.trending-item .rank {
    font-size: 24px;
    font-weight: 900;
    opacity: 0.3;
    line-height: 1;
}

.trending-item .t-info {
    display: flex;
    flex-direction: column;
}

.trending-item .t-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

/* Sidebar Widgets */
.sidebar-box {
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    background: var(--bg-header);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.sidebar-box h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
    position: relative;
    color: var(--text-primary);
}

.sidebar-box ol {
    counter-reset: sb-counter;
    padding-left: 0;
    z-index: 1;
    position: relative;
    list-style: none;
}

.sidebar-box li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--text-secondary);
}

.sidebar-box li:hover {
    color: var(--text-primary);
}

.sidebar-box li::before {
    counter-increment: sb-counter;
    content: counter(sb-counter);
    position: absolute;
    left: 0;
    top: 2px;
    font-weight: 900;
    font-size: 20px;
    opacity: 0.6;
}

/* Sidebar Gradients */
.sidebar-box.orange-grad::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 159, 69, 0.15), transparent 70%);
}

.sidebar-box.orange-grad li::before,
.sidebar-box.orange-grad h3 i {
    color: var(--accent-orange);
}

.sidebar-box.blue-grad::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(33, 150, 243, 0.15), transparent 70%);
}

.sidebar-box.blue-grad li::before,
.sidebar-box.blue-grad h3 i {
    color: var(--accent-blue);
}

.sidebar-box.yellow-grad::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 235, 59, 0.15), transparent 70%);
}

.sidebar-box.yellow-grad li::before,
.sidebar-box.yellow-grad h3 i {
    color: #ffe600;
}

.trending-item .t-auth {
    font-size: 12px;
    opacity: 0.8;
}

.subscribe-box {
    margin-top: 30px;
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.subscribe-box h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.subscribe-box p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.subscribe-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.subscribe-box button {
    width: 100%;
    padding: 10px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* Category Responsive Styles */
@media (max-width: 992px) {
    .trending-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
    }

    .trending-large-card {
        height: 300px;
    }

    .trending-small-grid {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .trending-small-card {
        min-width: 280px;
    }

    .content-wrapper-category {
        flex-direction: column;
    }

    .right-sidebar {
        width: 100%;
        margin-top: 40px;
    }

    .sidebar-box {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .category-hero .category-title {
        font-size: 32px;
    }

    .cat-article-card {
        flex-direction: column;
    }

    .cat-article-card .cat-thumb {
        width: 100%;
        height: 200px;
    }

    .filter-toggles {
        display: none;
        /* Hide on mobile to save space or adjust */
    }

    .trending-small-grid {
        flex-direction: column;
    }

    .trending-small-card {
        min-width: 100%;
    }
}


/* -------------------------------------------------- */
/*                  AUTHOR PROFILE PAGE                */
/* -------------------------------------------------- */

/* 1. Author Hero Section */
.author-hero {
    background-color: var(--bg-primary);
    /* Light by default */
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s;
}

[data-theme="dark"] .author-hero {
    background-color: #1a2332;
    /* User requested dark navy mostly for dark mode */
}


/* Decorative Gradient Waves */
.author-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(238, 82, 83, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(40px);
    z-index: 0;
    opacity: 0.6;
    /* Subtler in light mode */
}

/* Dark mode wave adjustments */
[data-theme="dark"] .author-hero::before {
    background: radial-gradient(circle, rgba(238, 82, 83, 0.3) 0%, rgba(26, 35, 50, 0) 70%);
    opacity: 1;
}

.author-hero::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 159, 67, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(40px);
    z-index: 0;
    opacity: 0.6;
}

[data-theme="dark"] .author-hero::after {
    background: radial-gradient(circle, rgba(255, 159, 67, 0.3) 0%, rgba(26, 35, 50, 0) 70%);
    opacity: 1;
}

.author-hero-container {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.author-hero .author-avatar {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--bg-card);
    /* Matches bg */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.author-hero .author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-hero .author-info {
    flex: 1;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    /* Force stack */
    align-items: flex-start;
    gap: 15px;
    /* Spacing between Name, Bio, Socials */
}

.author-hero .author-name {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0px;
    /* Handled by gap */
    background: linear-gradient(90deg, #ff9f43, #ee5253);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.author-hero .author-bio {
    font-size: 17px;
    color: var(--text-secondary);
    /* Adapts to light/dark */
    line-height: 1.6;
    margin-bottom: 5px;
    font-weight: 400;
}

/* Social Buttons */
.author-socials {
    display: flex;
    gap: 12px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    background-color: #333;
    /* Fallback */
}

.social-btn:hover {
    transform: translateY(-3px) scale(1.05);
    filter: brightness(1.1);
}

/* Disable hover movement for author page socials specifically as requested */
.author-socials .social-btn:hover {
    transform: none;
    filter: brightness(1.1);
    /* Keep brightness to show interactivity */
}

.social-btn.linkedin {
    background-color: #0077b5 !important;
    color: #fff !important;
}

.social-btn.linkedin i {
    color: #fff !important;
}

/* Force icon white */
.social-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

.social-btn.twitter {
    background-color: #000 !important;
    color: #fff;
}

[data-theme="dark"] .social-btn.twitter {
    border: 1px solid #333;
}

.social-btn.website {
    background-color: var(--accent-blue) !important;
}

.social-btn.facebook {
    background-color: #1877F2 !important;
    color: #fff !important;
}

.social-btn.youtube {
    background-color: #FF0000 !important;
    color: #fff !important;
}





/* 3. Main Content Layout */
.main-content-area {
    padding-top: 50px;
    padding-bottom: 80px;
}

.content-wrapper {
    display: flex;
    gap: 50px;
}

.author-articles-list {
    flex: 1;
    /* Takes 70% roughly */
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 150px;
    height: fit-content;
}


/* Author Page Specific Article Card overrides (if needed) */
/* We are mostly reusing .cat-article-card from main.css */

/* Quick Summary removed locally */

/* Pagination */
.pagination-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 60px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.page-btn.active,
.page-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}


/* 4. Sidebar Styles */
.sidebar-box.author-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.badges-row {
    display: flex;
    gap: 8px;
}

.author-badge {
    background: #ffecdb;
    color: #e67e22;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

[data-theme="dark"] .author-badge {
    background: rgba(230, 126, 34, 0.2);
}

/* Related Authors */
.related-authors .related-author-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--divider);
}

.related-authors .related-author-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ra-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.ra-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ra-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.follow-btn-sm {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    width: fit-content;
    transition: all 0.2s;
}

.follow-btn-sm:hover {
    background: var(--accent-blue);
    color: #fff;
}


/* -------------------------------------------------- */
/*                  RESPONSIVE DESIGN                 */
/* -------------------------------------------------- */

@media (max-width: 900px) {
    .author-hero-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .author-hero .author-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .author-hero .author-name {
        font-size: 36px;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .stats-content {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .author-hero .author-avatar {
        width: 120px;
        height: 120px;
    }

    .author-hero .author-name {
        font-size: 32px;
    }

    .author-hero .author-bio {
        font-size: 15px;
    }

    .article-count {
        font-size: 22px;
    }

    .filter-pills {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .filter-pill {
        white-space: nowrap;
    }
}

/* Author Box Social Icons */
.author-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff !important;
    margin-right: 10px;
    text-decoration: none;
    transition: transform 0.2s;
}

.author-socials a i {
    color: #ffffff !important;
}

.author-socials a:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.author-socials .social-link-facebook {
    background-color: #1877F2;
}

.author-socials .social-link-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.author-socials .social-link-linkedin {
    background-color: #0077B5;
}

.author-socials .social-link-twitter {
    background-color: #000000;
}

.author-socials .social-link-email {
    background-color: #666666;
}

@media (min-width: 769px) {
    .footer-content .socials {
        margin-bottom: 25px;
    }
}