* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Source Sans Pro", "Helvetica Neue", Roboto, Arial, sans-serif;
    background: #f8f9fa;
    color: #212529;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 2px solid #e9ecef;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    text-decoration: none;
    gap: 0.5rem;
}

.navbar-brand img {
    width: 40px;
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3888c5;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(56, 136, 197, 0.3) 0%, rgba(26, 26, 26, 0.8) 100%),
                url('assets/BackGR.png');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid #2e2e35;
}

.hero .container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}

.hero .cta-button {
    display: inline-block;
    background: #3888c5;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hero .cta-button:hover {
    background: #2e6fa3;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Section Headers */
.section-header {
    background: rgba(56, 136, 197, 0.1);
    border-left: 4px solid #3888c5;
    padding: 1rem 1.5rem;
    margin: 2rem 0 1rem;
    border-radius: 4px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #212529;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    border-color: #3888c5;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(56, 136, 197, 0.2);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #3888c5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card i {
    font-size: 1.5rem;
}

.card p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Navigation Boxes */
.nav-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.nav-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #212529;
}

.nav-box:hover {
    border-color: #3888c5;
    background: rgba(56, 136, 197, 0.05);
    transform: translateY(-2px);
}

.nav-box i {
    font-size: 2rem;
    color: #3888c5;
    margin-bottom: 0.5rem;
}

.nav-box h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Info Section */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
}

.info-card h3 {
    color: #3888c5;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-card ul { list-style: none; padding: 0; }
.info-card ul li {
    padding: 0.5rem 0;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}
.info-card ul li:last-child { border-bottom: none; }

/* Members Grid Horizontal */
.members-grid { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }
.member-card { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 200px; padding: 1.5rem; background-color: white; border: 2px solid #e9ecef; border-radius: 10px; transition: all 0.3s ease; }
.member-card:hover { border-color: #3888c5; transform: translateY(-5px); box-shadow: 0 8px 16px rgba(56, 136, 197, 0.2); }
.member-card img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 0.5rem; background: #e9ecef; }
.member-card h4 { margin-bottom: 0.3rem; color: #212529; font-size: 1.1rem; }
.member-card p { margin: 0; font-size: 0.9rem; color: #6c757d; }

/* Page Content */
.page-content { display: none; }
.page-content.active { display: block; }

/* Alert */
.alert-banner { background: #0288d1; color: white; text-align: center; padding: 0.75rem; font-size: 0.9rem; }

/* Handbook Layout */
.handbook-layout { display: flex; min-height: calc(100vh - 200px); max-width: 1400px; margin: 0 auto; }
.handbook-sidebar { width: 280px; background: white; border-right: 2px solid #e9ecef; padding: 2rem 0; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.sidebar-content { padding: 0 1.5rem; }
.sidebar-section { margin-bottom: 2rem; }
.sidebar-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; color: #212529; margin-bottom: 0.75rem; letter-spacing: 0.5px; }
.sidebar-links { list-style: none; padding: 0; margin: 0; }
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; color: #6c757d; text-decoration: none; border-radius: 6px; transition: all 0.2s ease; font-size: 0.9rem; margin-bottom: 0.25rem; }
.sidebar-link:hover { background: rgba(56, 136, 197, 0.1); color: #3888c5; }
.sidebar-link.active { background: rgba(56, 136, 197, 0.15); color: #3888c5; font-weight: 600; border-left: 3px solid #3888c5; padding-left: calc(0.75rem - 3px); }
.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; }

/* Submenu styles */
.has-submenu .caret { margin-left: auto; font-size: 0.9rem; opacity: 0.8; }
.submenu { display: none; list-style: none; padding-left: 1.25rem; margin-top: 0.25rem; }
.submenu.open { display: block; }
.submenu .sub-link { display: block; padding: 0.35rem 0.75rem; font-size: 0.88rem; color: #6c757d; border-radius: 6px; }
.submenu .sub-link:hover { background: rgba(56, 136, 197, 0.06); color: #3888c5; }

.handbook-main { flex: 1; padding: 2rem 3rem; background: #f8f9fa; }
.handbook-content { display: none; max-width: 900px; }

/* Markdown typography for handbook pages */
.handbook-content .docs-markdown { padding: 0.5rem 0 1.5rem; font-size: 16px; line-height: 1.75; color: inherit; }
.handbook-content .docs-markdown h1 { font-size: 2rem; margin: 0 0 0.75rem; font-weight: 700; }
.handbook-content .docs-markdown h2 { font-size: 1.5rem; margin: 1.25rem 0 0.5rem; font-weight: 700; }
.handbook-content .docs-markdown h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; font-weight: 600; }
.handbook-content .docs-markdown p { margin: 0 0 1rem; color: inherit; }
.handbook-content .docs-markdown ul, .handbook-content .docs-markdown ol { margin: 0 0 1rem 1.25rem; }
.handbook-content .docs-markdown li { margin: 0.4rem 0; }
.handbook-content .docs-markdown a { color: #0ea5a4; text-decoration: underline; }
.handbook-content .docs-markdown blockquote { border-left: 3px solid rgba(56,136,197,0.15); padding: 0.5rem 1rem; color: #6c757d; margin: 0 0 1rem; background: rgba(56,136,197,0.02); }
.handbook-content .docs-markdown pre { background: #0f1720; color: #e6eef6; padding: 1rem; border-radius: 8px; overflow: auto; margin: 0 0 1rem; }
.handbook-content .docs-markdown code { background: rgba(0,0,0,0.06); padding: 0.15rem 0.3rem; border-radius: 4px; }
.handbook-content .docs-markdown table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.handbook-content .docs-markdown table th, .handbook-content .docs-markdown table td { border: 1px solid rgba(0,0,0,0.06); padding: 0.5rem 0.75rem; text-align: left; }
.handbook-content .docs-markdown img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 0.5rem 0; }
.handbook-content .docs-markdown hr { border: none; height: 1px; background: rgba(0,0,0,0.06); margin: 1.5rem 0; }

/* Per-page layout helpers */
.handbook-content.doc-wide { max-width: 1200px; }
.handbook-content.doc-narrow { max-width: 680px; }
.handbook-content.doc-two-column { column-count: 2; column-gap: 2rem; }
.handbook-content.doc-two-column img, .handbook-content.doc-two-column pre { column-span: all; }

.handbook-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Typography controls */
.handbook-toolbar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.handbook-toolbar .group { display: flex; gap: 0.35rem; align-items: center; }
.handbook-toolbar button { background: white; border: 1px solid #e9ecef; padding: 0.35rem 0.6rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.handbook-toolbar button.active { background: #3888c5; color: white; border-color: #3888c5; }
.handbook-content.font-small { font-size: 14px; }
.handbook-content.font-normal { font-size: 16px; }
.handbook-content.font-large { font-size: 18px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.handbook-content h1 { font-size: 2.5rem; font-weight: 300; color: #212529; margin-bottom: 1rem; }
.handbook-intro { font-size: 1.2rem; color: #6c757d; margin-bottom: 2rem; line-height: 1.6; }

.handbook-card { background: white; border: 2px solid #e9ecef; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; }
.handbook-card.alert { border-left: 4px solid #dc3545; background: #fff5f5; }
.handbook-card h2 { color: #3888c5; font-size: 1.3rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.handbook-card.alert h2 { color: #dc3545; }
.handbook-card p { color: #495057; line-height: 1.8; }
.handbook-card ul { color: #495057; line-height: 1.8; padding-left: 1.5rem; }
.handbook-card ul li { margin-bottom: 0.5rem; }

/* Factions Horizontal List (appended) */
.factions-list { display: flex; flex-direction: column; gap: 1rem; }
.faction-item { display: flex; justify-content: space-between; align-items: center; background-color: #e0e0e0; border-radius: 6px; padding: 0.5rem 1rem; transition: background 0.2s; }
.faction-item:hover { background-color: #d0d0d0; }
.faction-left { display: flex; align-items: center; gap: 0.75rem; }
.faction-icon { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.faction-info h4 { margin: 0; font-size: 1rem; color: #212529; }
.faction-info p { margin: 0; font-size: 0.85rem; color: #6c757d; }
.faction-button { background-color: #63a4e0; color: white; padding: 0.4rem 0.8rem; border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 0.85rem; transition: background 0.2s; }
.faction-button:hover { background-color: #63a4e0; }
@media (max-width: 768px) { .faction-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; } .faction-button { align-self: flex-end; } }

/* Responsive */
@media (max-width: 768px) {
    .navbar .container { flex-wrap: wrap; }
    .nav-links { display: none; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1.1rem; }
    .members-grid { flex-direction: column; align-items: center; }
    .faction-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .faction-button { align-self: flex-end; }
}
