/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Webkit-based browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: rgba(17, 3, 2, 0.8);
	border-radius: 6px;
	border: 1px solid rgba(243, 205, 118, 0.2);
}

::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, 
		rgba(243, 205, 118, 0.8) 0%, 
		rgba(243, 205, 118, 0.6) 50%, 
		rgba(243, 205, 118, 0.4) 100%);
	border-radius: 6px;
	border: 1px solid rgba(243, 205, 118, 0.3);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, 
		rgba(243, 205, 118, 1) 0%, 
		rgba(243, 205, 118, 0.8) 50%, 
		rgba(243, 205, 118, 0.6) 100%);
	border-color: rgba(243, 205, 118, 0.6);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
				0 0 8px rgba(243, 205, 118, 0.4);
}

::-webkit-scrollbar-thumb:active {
	background: linear-gradient(180deg, 
		rgba(210, 78, 61, 0.8) 0%, 
		rgba(243, 205, 118, 0.8) 100%);
	border-color: rgba(210, 78, 61, 0.6);
}

::-webkit-scrollbar-corner {
	background: rgba(17, 3, 2, 0.8);
}

/* Firefox */
html {
	scrollbar-width: thin;
	scrollbar-color: rgba(243, 205, 118, 0.6) rgba(17, 3, 2, 0.8);
}

/* =============================
   Fonts
   ============================= */
   @font-face {
	font-family: 'TrajanSansPro';
	src: url('/fonts/TrajanSansPro-Light.woff2') format('woff2');
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'TrajanSansPro';
	src: url('/fonts/TrajanSansPro-ExtraLight.woff2') format('woff2');
	font-weight: 200;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'TrajanSansPro';
	src: url('/fonts/TrajanSansPro-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'TrajanSansPro';
	src: url('/fonts/TrajanSansPro-Semibold.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'TrajanSansPro';
	src: url('/fonts/TrajanSansPro-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'TrajanSansPro';
	src: url('/fonts/TrajanSansPro-Black.woff2') format('woff2');
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Manrope';
	src: url('/fonts/Manrope-Light.woff2') format('woff2');
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Manrope';
	src: url('/fonts/Manrope-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Manrope';
	src: url('/fonts/Manrope-Medium.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Manrope';
	src: url('/fonts/Manrope-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 64px; /* Space for fixed header */
}

/* Set dark theme as default to prevent flash of light theme */
body:not(.light-theme) {
    /*background-color: #110302;*/
    background-color: #f8f9fa;
    /*color: #f2e8e7;*/
    color: #333;
}

/* Top Navigation Bar */

.top-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distribute items */
    padding: 0 20px;
    z-index: 1000;
}

.top-nav {
    width: 1500px;
    margin: 0 auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: space-between;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    position: relative;
    top: 10px;
    margin-left: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #212529;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Hamburger to close icon animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.top-nav h1 {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'TrajanSansPro', serif;
}

/* Top Navigation Menu */
.top-nav-menu {
    display: flex;
    list-style: none;
    margin: 0px 135px;
    padding: 0;
    gap: 20px;
}

.top-nav-menu li {
    margin: 0;
}

.top-nav-menu a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.top-nav-menu a:hover {
    background-color: #e9ecef;
    color: #0056b3;
}

/* Language Switcher */
.language-switcher {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* Theme Toggle Button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    /*border: 1px solid #ddd;*/
    border: 0;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: #007bff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 10px;
    font-size: 16px;
}

.theme-toggle:hover {
    background-color: #e9ecef;
    color: #0056b3;
    border-color: #007bff;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, opacity .12s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.btn--hero {
    font-family: 'TrajanSansPro', serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: #fff3cf;
    text-shadow: 0px 0px 7px black;
    backdrop-filter: blur(9px);
    padding-bottom: 8px;
    padding-right: 40px;
    background: linear-gradient(rgb(126, 102, 40) 36%, rgb(123, 103, 50) 89%), rgb(126, 102, 40);
    margin-right: 20px;
    margin-left: 20px;
    padding-left: 50px;
    box-shadow: 0px 7px 12px rgb(0 0 0 / 38%);
    border-style: none;
    border-top: 1px solid rgb(171, 143, 68);
    border-bottom: 2px solid rgb(171, 143, 68);
    border-radius: 4px;
    transition: all .5s ease-in;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.btn--hero:hover {
    filter: brightness(140%);
    text-decoration: none;
    color: #fff3cf;
}

.language-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.language-link:hover {
    background-color: #e9ecef;
    color: #0056b3;
    text-decoration: none;
}

/* Layout Container */
.layout-container {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    min-height: calc(100vh - 64px);
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #f8f9fa;
    border-right: 1px solid #eaeaea;
    padding: 20px 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Mobile sidebar */
.sidebar.mobile-open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

/* Search Container - New position in main content */
.search-container {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background-color: #0056b3;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav > ul > li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: block;
    padding: 8px 20px;
    text-decoration: none;
    color: #495057;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-radius: 4px 0 0 4px;
}

.sidebar-nav a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.sidebar-nav .active > a {
    background-color: #e9ecef;
    color: #007bff;
    font-weight: 500;
}

/* Category items in sidebar */
.category-item {
    margin-top: 15px;
}

.category-name {
    display: block;
    padding: 8px 20px;
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-pages {
    list-style: none;
    padding-left: 0;
}

.category-pages li {
    margin-bottom: 0;
    padding: 0 6px 0 6px;
}

.category-pages a {
    padding: 6px 20px 6px 30px;
    font-size: 0.9rem;
    color: #6c757d;
}

.category-pages a:hover {
    color: #007bff;
    background-color: transparent;
}

.category-pages .active a {
    background-color: #e9ecef;
    color: #007bff;
    font-weight: 500;
}

/* Search Results */
.search-results {
    display: none;
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-results.active {
    display: block;
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-results-list li {
   /* margin-bottom: 8px;*/
}

.search-results-list a {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: #495057;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    background-color: #fff;
    border: 1px solid #eaeaea;
}

.search-results-list a:hover {
    background-color: #f8f9fa;
    color: #007bff;
    border-color: #007bff;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #212529;
}

.search-result-snippet {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
}

.search-results-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
}

/* Search Suggestions */
.search-suggestions-header {
    font-weight: 600;
    color: #212529;
    padding: 12px;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 4px 4px 0 0;
    border-bottom: none;
}

.search-suggestion-item a {
    background-color: #fff;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.search-suggestion-item a:hover {
    background-color: #e9ecef;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 50px;
    max-width: calc(100% - 520px); /* Account for sidebar and rightbar */
    background: #ffffff;
}

/* Right Sidebar */
.rightbar {
    width: 260px;
    background-color: #f8f9fa;
    border-left: 1px solid #eaeaea;
    padding: 20px 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.rightbar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.rightbar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 10px;
}

.rightbar-nav ul {
    list-style: none;
    padding: 0 20px;
}

.rightbar-nav li {
    margin-bottom: 8px;
}

.rightbar-nav a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
    color: #495057;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.rightbar-nav a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.rightbar-nav .active a {
    background-color: #e9ecef;
    color: #007bff;
    font-weight: 500;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Page Metadata */
.page-metadata {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #eaeaea;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.metadata-item {
    display: flex;
    flex-direction: column;
    border-left: 2px solid #007bff;
    padding-left: 12px;
    margin-right: 20px;
}

.metadata-item strong {
    font-weight: 600;
    color: #212529;
    margin-right: 5px;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #6c757d;
}

.edit-button button {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-button button:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

/* Content Body */
.content-body h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #212529;
}

.lead {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 30px;
}

.content-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #212529;
    scroll-margin-top: 80px; /* Account for fixed header */
}

.content-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: #212529;
    scroll-margin-top: 80px; /* Account for fixed header */
}

.content-body p {
    margin-bottom: 15px;
}

.content-body ul, .content-body ol {
    margin: 15px 0 15px 30px;
}

.content-body li {
    margin-bottom: 8px;
}

.content-body a {
    color: #007bff;
    text-decoration: none;
}

.content-body a:hover {
    text-decoration: underline;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #ddd;
}

.card h3 {
    margin-bottom: 10px;
    color: #212529;
}

.card p {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.card-link {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Content Footer */
.content-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
    font-size: 0.9rem;
    color: #6c757d;
}

.suggest-edit a {
    color: #007bff;
    text-decoration: none;
}

.suggest-edit a:hover {
    text-decoration: underline;
}

/* Search Results Page */
.search-form-container {
    margin-bottom: 30px;
}

.search-info {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.search-results-list .search-result-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    background-color: #fff;
}

.search-results-list .search-result-item h3 {
    margin-bottom: 10px;
}

.search-results-list .search-result-item h3 a {
    color: #007bff;
    text-decoration: none;
}

.search-results-list .search-result-item h3 a:hover {
    text-decoration: underline;
}

.search-results-list .search-result-snippet {
    color: #6c757d;
    margin: 0;
}

.no-results, .no-search-term {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eaeaea;
}

/* Responsive */
@media (max-width: 1200px) {
    .layout-container {
        max-width: 100%;
    }
    
    .rightbar {
        display: none;
    }
    
    .main-content {
        max-width: calc(100% - 260px);
    }
    
    .sidebar, .rightbar {
        position: relative;
        top: 0;
        height: auto;
    }
    
    .page-metadata {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }
    
    .top-nav {
        width: 100%;
        padding: 0 15px;
    }
    
    /* Show mobile menu button */
    .mobile-menu-toggle {
        display: flex;
        height: 50px;
        width: 50px;
        scale: 1.4;
    }
    
    /* Hide top navigation menu on mobile */
    .top-nav-menu {
        display: none;
    }
    
    /* Sidebar becomes mobile menu */
    .sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        width: 280px;
        height: calc(100vh - 64px);
        transform: translateX(-100%);
        z-index: 999;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        max-width: 100%;
        margin-left: 0;
        padding: 20px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .edit-button {
        margin-top: 10px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .top-nav {
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
    }
    
    .top-nav-menu {
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .top-nav-menu li {
        margin-bottom: 10px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form .search-input,
    .search-form .search-button {
        width: 100%;
    }
    
    /* Ensure language switcher is visible on mobile */
    .language-switcher {
        margin-left: 0;
        margin-right: 10px;
        padding-top: 2px;
        padding-bottom: 4px;
    }
    
    .language-link {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .btn--hero {
        padding: 6px 12px;
        font-size: 13px;
        margin-right: 10px;
        margin-left: 10px;
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .btn--hero {
        font-size: 12px;
        padding: 5px 10px;
        padding-left: 25px;
        padding-right: 25px;
    }
    
    .language-link {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

@media (max-width: 464px) {
    .mobile-menu-toggle {
        position: absolute;
        right: 0;
        top: 18px;
    }
}

@media (max-width: 577px) {
    .search-container {
        margin-top: 20px;
    }
}