* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #4a9eff;
    --accent-hover: #6db3ff;
    --border: #3a3a3a;
    --shadow: rgba(0, 0, 0, 0.3);
}

.image-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.image-placeholder {
    width: 100%;
    height: auto;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: block;
    object-fit: contain;
}

.image-placeholder.single {
    max-height: 500px;
    margin: 1.5rem 0;
}

.image-row > div.image-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow);
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Container */
.container {
    max-width: 1800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 0;
    min-height: calc(100vh - 70px);
}

/* Left Sidebar */
.sidebar-left {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    overflow-y: auto;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
}

.sidebar-title {
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    padding: 0.8rem 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.nav-section-title:hover {
    background: var(--bg-tertiary);
}

.nav-section-title .arrow {
    transition: transform 0.2s;
}

.nav-section-title.active .arrow {
    transform: rotate(90deg);
}

.nav-links {
    display: none;
    padding: 0.5rem 0;
}

.nav-links.active {
    display: block;
}

.nav-links a {
    display: block;
    padding: 0.6rem 1.5rem 0.6rem 2.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    color: var(--accent);
    background: var(--bg-tertiary);
    border-left-color: var(--accent);
}

.nav-links a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--bg-tertiary);
}

/* Main Content */
.main-content {
    padding: 2rem 3rem;
    background: var(--bg-primary);
    min-height: 100%;
}

.breadcrumb {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.content-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.content-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.content-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Author Box */
.author-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.3rem;
}

.author-name:hover {
    text-decoration: underline;
}

.author-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Author Profile Page */
.author-profile {
    max-width: 800px;
    margin: 0 auto;
}

.author-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.author-profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    flex-shrink: 0;
}

.author-details {
    flex: 1;
}

.author-profile-name {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.author-bio {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.author-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s;
}

.author-link:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
}

/* Homepage Specific Styles */
.home-content {
    max-width: 1200px;
}

.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.section-heading {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.featured-section,
.categories-section,
.recent-section,
.stats-overview {
    margin-bottom: 4rem;
}

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.featured-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.featured-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.featured-image {
    width: 100%;
    height: 180px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.featured-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-content h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.category-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    transform: translateY(-4px);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--accent);
    font-size: 0.85rem;
}

.category-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.category-count {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Recent Updates List */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.recent-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.recent-date {
    min-width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.recent-content {
    flex: 1;
}

.recent-content h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.recent-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.recent-meta {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.8rem;
}

/* Stats Overview */
.stats-overview .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stats-overview .stat-card {
    text-align: center;
    padding: 2rem;
}

.stats-overview .stat-card .value {
    font-size: 2.5rem;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-overview .stat-card .label {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Content Body */
.content-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.content-body h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem;
    color: var(--text-primary);
}

.content-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.info-box {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.info-box h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Character Template Specific */
.character-showcase {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.character-image {
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.character-stats {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    color: var(--accent);
    font-weight: 600;
}

/* Item Template Specific */
.item-showcase {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.item-image {
    width: 100%;
    height: 250px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.item-properties {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Event Template Specific */
.event-banner {
    width: 100%;
    height: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.event-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.event-detail-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.event-detail-card h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* News Template Specific */
.news-image {
    width: 100%;
    height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.news-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-card .value {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 0.3rem;
}

/* Right Sidebar */
.sidebar-right {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
}

.ad-section {
    margin-bottom: 2rem;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-align: center;
}

.ad-placeholder {
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-height: 250px;
}

.ad-placeholder.tall {
    min-height: 600px;
}

/* Quick Links */
.quick-links {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 2rem;
}

.quick-links h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.quick-links a {
    display: block;
    color: var(--accent);
    text-decoration: none;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.quick-links a:hover {
    text-decoration: underline;
}

/* Mobile Styles */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 280px 1fr;
    }

    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .search-bar {
        max-width: none;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1100;
        transition: left 0.3s;
        box-shadow: 2px 0 10px var(--shadow);
    }

    .sidebar-left.active {
        left: 0;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1050;
    }

    .mobile-overlay.active {
        display: block;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .content-header h1 {
        font-size: 2rem;
    }

    .character-showcase,
    .item-showcase {
        grid-template-columns: 1fr;
    }

    .author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Homepage mobile styles */
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .recent-item {
        flex-direction: column;
        gap: 1rem;
    }

    .recent-date {
        width: 100%;
        max-width: 80px;
    }

    .section-heading {
        font-size: 1.5rem;
    }
}

/* Scrollbar */
.sidebar-left::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar {
    width: 8px;
}

.sidebar-left::-webkit-scrollbar-track,
.sidebar-right::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar-left::-webkit-scrollbar-thumb,
.sidebar-right::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.sidebar-left::-webkit-scrollbar-thumb:hover,
.sidebar-right::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ===== PAGEFIND SEARCH STYLING ===== */

/* Desktop: Normal search bar */
.pagefind-ui {
    --pagefind-ui-scale: 1;
    --pagefind-ui-primary: var(--accent);
    --pagefind-ui-text: var(--text-primary);
    --pagefind-ui-background: var(--bg-tertiary);
    --pagefind-ui-border: var(--border);
    --pagefind-ui-tag: var(--bg-secondary);
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 6px;
    --pagefind-ui-image-border-radius: 4px;
    --pagefind-ui-image-box-ratio: 3 / 2;
    --pagefind-ui-font: inherit;
    position: relative;
}

/* Search Input */
.pagefind-ui__search-input {
    width: 100%;
    padding: 0.2rem 0.5rem;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
}

.pagefind-ui__search-input:focus {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: none !important;
}

.pagefind-ui__search-input::placeholder {
    color: var(--text-secondary) !important;
}

/* Search Clear Button */
.pagefind-ui__search-clear {
    background: transparent !important;
    color: var(--text-secondary) !important;
    padding: 0.5rem !important;
}

.pagefind-ui__search-clear:hover {
    color: var(--accent) !important;
}

/* Drawer/Results Container - FLOATING OVERLAY */
.pagefind-ui__drawer {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px var(--shadow) !important;
    margin: 0 !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    z-index: 1200 !important;
}

/* Message (No results, loading, etc) */
.pagefind-ui__message {
    color: var(--text-secondary) !important;
    background: var(--bg-secondary) !important;
    padding: 1.5rem !important;
    text-align: center !important;
}

/* Results */
.pagefind-ui__results {
    padding: 0 !important;
}

.pagefind-ui__result {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border) !important;
    background: transparent !important;
    transition: background 0.2s !important;
}

.pagefind-ui__result:last-child {
    border-bottom: none !important;
}

.pagefind-ui__result:hover {
    background: var(--bg-tertiary) !important;
}

/* Result Link */
.pagefind-ui__result-link {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    display: block !important;
}

.pagefind-ui__result-link:hover {
    color: var(--accent) !important;
}

/* Result Title */
.pagefind-ui__result-title {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
}

/* Result Excerpt */
.pagefind-ui__result-excerpt {
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.5rem !important;
}

/* Highlighted search terms */
.pagefind-ui__result-excerpt mark {
    background: rgba(74, 158, 255, 0.3) !important;
    color: var(--accent) !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
}

/* Result Tags/Metadata */
.pagefind-ui__result-tags {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    margin-top: 0.5rem !important;
}

.pagefind-ui__result-tag {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
}

/* Loading indicator */
.pagefind-ui__loading {
    color: var(--accent) !important;
}

/* Scrollbar for results */
.pagefind-ui__drawer::-webkit-scrollbar {
    width: 8px;
}

.pagefind-ui__drawer::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.pagefind-ui__drawer::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.pagefind-ui__drawer::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Button styling */
.pagefind-ui__button {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s !important;
}

.pagefind-ui__button:hover {
    background: var(--bg-primary) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* ===== MOBILE SEARCH MODAL ===== */
@media (max-width: 768px) {
    /* Hide desktop search bar on mobile */
    .search-bar {
        display: none;
    }
    
    /* Search icon button (replaces search bar on mobile) */
    .mobile-search-btn {
        display: block;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.3rem;
        cursor: pointer;
        padding: 0.5rem;
        margin-left: auto;
    }
    
    /* Mobile search overlay */
    .mobile-search-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        z-index: 1500;
        padding: 1rem;
        overflow-y: auto;
    }
    
    .mobile-search-overlay.active {
        display: flex;
        flex-direction: column;
    }
    
    /* Close button for mobile search */
    .mobile-search-close {
        align-self: flex-end;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 2rem;
        cursor: pointer;
        padding: 0.5rem;
        margin-bottom: 1rem;
        line-height: 1;
    }
    
    /* Search container in mobile modal */
    .mobile-search-container {
        flex: 1;
        max-width: 600px;
        width: 100%;
        margin: 0 auto;
    }
    
    /* FIX: Add proper padding for the search icon */
    .mobile-search-overlay .pagefind-ui__search-input {
        font-size: 1rem !important;
        padding: 0.875rem 1rem 0.875rem 2.75rem !important; /* Extra left padding for icon */
    }
    
    /* FIX: Position the search icon properly */
    .mobile-search-overlay .pagefind-ui__search-clear {
        right: 1rem !important;
    }
    
    /* Adjust Pagefind drawer for mobile fullscreen */
    .mobile-search-overlay .pagefind-ui__drawer {
        position: static !important;
        max-height: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        margin-top: 1rem !important;
    }
    
    .mobile-search-overlay .pagefind-ui__result {
        background: var(--bg-secondary) !important;
        border-radius: 8px !important;
        margin-bottom: 0.75rem !important;
        border: 1px solid var(--border) !important;
    }
    
    .mobile-search-overlay .pagefind-ui__result:hover {
        background: var(--bg-tertiary) !important;
    }
    
    /* Ensure search icon doesn't overlap text */
    .mobile-search-overlay .pagefind-ui__form::before {
        left: 1rem !important;
    }
}

/* Desktop: Show normal search, hide mobile button */
@media (min-width: 769px) {
    .mobile-search-btn {
        display: none;
    }
    
    .mobile-search-overlay {
        display: none !important;
    }
}

/* Direct link section styling (for News, etc.) */
.nav-section-title.direct-link {
    padding: 0;
}

.nav-section-title.direct-link a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    width: 100%;
    transition: background 0.2s;
}

.nav-section-title.direct-link:hover a,
.nav-section-title.direct-link a:hover {
    background: var(--bg-tertiary);
}

.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.load-more-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.site-footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border);
    margin-top: 4rem;
    padding: 3rem 0 1.5rem;
    color: var(--text-primary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.footer-section h3 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section h4 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.6rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
    font-size: 0.95rem;
}

.footer-section ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-disclaimer {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    font-style: italic;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-section h3,
    .footer-section h4 {
        font-size: 1.1rem;
    }
    
    .footer-bottom {
        padding: 1rem 1.5rem 0;
    }
}

/* Content Footer Banner - Sticky at bottom between nav bars */
.content-footer-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0;
    margin: 0;
}

/* Desktop - between sidebars */
@media (min-width: 1025px) {
    .content-footer-banner {
        margin-left: 250px; /* Width of left sidebar */
        margin-right: 250px; /* Width of right sidebar */
    }
}

.content-footer-link {
    display: block;
    width: 100%;
    max-width: 728px;
    height: 90px;
    line-height: 0;
    padding: 0;
    margin: 0 auto;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.content-footer-link:hover {
    transform: translateY(-2px);
}

.content-footer-banner img {
    display: block;
    width: 100%;
    height: 90px;
    object-fit: contain;
    margin: 0;
}

/* Add padding to main content to prevent overlap */
main, .content {
    padding-bottom: 110px;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .content-footer-banner {
        margin: 0;
        padding: 0;
        height: 90px;
    }
    
    .content-footer-link {
        max-width: 100%;
        width: 100%;
        padding: 0 5px; /* Small padding to prevent edge cutoff */
    }
    
    .content-footer-banner img {
        width: 100%;
        max-width: 728px;
        margin: 0 auto;
    }

}

@media (max-width: 1024px) {
  main, .content {
    padding-bottom: 0;
  }
}
.content-footer-banner {
  bottom: env(safe-area-inset-bottom);
}


html, body {
    margin: 0;
    padding: 0;
}

/* Add this to your CSS file */

/* Mobile header scroll behavior */
header.header-scrollable {
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 768px) {
    header.header-scrollable {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    
    header.header-scrollable.header-hidden {
        transform: translateY(-100%);
    }
    
    /* Add padding to body to prevent content jump when header becomes fixed */
    body {
        padding-top: 60px; /* Adjust this value to match your header height */
    }
}

/* For desktop - keep sticky behavior if you want, or remove position: sticky */
@media (min-width: 769px) {
    header.header-scrollable {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
}

/* Floating Video Player */
.floating-video-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: hidden;
}

.floating-video-player iframe {
    display: block;
    border-radius: 8px;
}

.video-mute-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.video-mute-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.video-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.video-close-btn:hover {
    background: rgba(255, 68, 68, 0.9);
    transform: scale(1.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .floating-video-player {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 10px;
        width: calc(100% - 40px);
        max-width: 280px;
    }
    
    .floating-video-player iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .video-close-btn,
    .video-mute-btn {
        width: 28px;
        height: 28px;
        top: 6px;
    }
    
    .video-close-btn {
        font-size: 20px;
        right: 6px;
    }
    
    .video-mute-btn {
        left: 6px;
    }
    
    .video-mute-btn svg {
        width: 16px;
        height: 16px;
    }
}