/* Body layout for sticky footer */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Wiki Header Styles */
.wiki-header {
    background: #ffffff;
    border-bottom: 1px solid #a7d7f9;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Header Top Section */
.header-top {
    background: #ffffff;
    padding: 0.75rem 0;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-section {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.wiki-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #000000;
}

.wiki-logo:hover .logo-text {
    text-decoration: none;
}

.logo-icon {
    font-size: 3rem;
    line-height: 1;
}

.logo-text {
    font-family: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
    font-size: 1.65rem;
    font-weight: 400;
    color: #000000;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.75rem;
    color: #54595d;
    font-family: sans-serif;
    margin-top: 0.25rem;
    display: block;
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    align-items: stretch;
    border: 1px solid #a2a9b1;
    background: #ffffff;
}

.search-form:focus-within {
    border-color: #3366cc;
}

.header-search input {
    border: none;
    background: transparent;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    width: 240px;
    outline: none;
    color: #000000;
    font-family: sans-serif;
}

.header-search input::placeholder {
    color: #72777d;
}

.search-btn {
    padding: 0.4rem 0.75rem;
    background: #f8f9fa;
    border: none;
    border-left: 1px solid #a2a9b1;
    cursor: pointer;
    transition: background-color 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #ffffff;
}

.search-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    background: #000000;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Header Bottom Section - Navigation */
.header-bottom {
    background: #f8f9fa;
    border-top: 1px solid #a7d7f9;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.header-nav {
    padding: 0;
    display: flex;
    justify-content: center;
    min-width: 100%;
}

.header-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.header-nav li {
    margin: 0;
}

.header-nav a {
    display: block;
    color: #0645ad;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border-right: 1px solid #a7d7f9;
    transition: background-color 0.1s ease;
}

.header-nav li:first-child a {
    border-left: 1px solid #a7d7f9;
}

.header-nav a:hover {
    background: #ffffff;
    text-decoration: none;
}

.header-nav a:visited {
    color: #0645ad;
}

/* Wiki Footer Styles */
.wiki-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #a2a9b1;
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-links ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
    gap: 1rem;
}

.footer-links a {
    color: #0645ad;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.footer-info {
    color: #54595d;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-info p {
    margin: 0.3rem 0;
}

.footer-info a {
    color: #0645ad;
    text-decoration: none;
}

.footer-info a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-main {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .logo-section {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        flex: 1;
    }

    .logo-tagline {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
        order: 2;
    }

    .header-search {
        width: 100%;
        margin-top: 0;
        order: 3;
        flex-basis: 100%;
    }

    .search-form {
        width: 100%;
    }

    .header-search input {
        flex: 1;
        width: 100%;
        padding: 0.6rem 0.75rem;
        font-size: 1rem;
    }

    .search-btn {
        padding: 0.6rem 1rem;
    }

    /* Mobile Navigation Menu */
    .header-bottom {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #ffffff;
        border-right: 1px solid #a7d7f9;
        border-top: none;
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .header-bottom.active {
        left: 0;
    }

    .header-nav {
        padding: 1rem 0;
        justify-content: flex-start;
    }

    .header-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .header-nav li {
        width: 100%;
        border-bottom: 1px solid #e8e9ea;
    }

    .header-nav a {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border: none !important;
        width: 100%;
        text-align: left;
    }

    .header-nav li:first-child a {
        border-left: none;
    }

    .header-nav a:hover {
        background: #f8f9fa;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

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

    .footer-links ul {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.4rem;
    }

    .logo-icon {
        font-size: 2.5rem;
    }

    .header-search input {
        padding: 0.7rem 0.75rem;
        font-size: 1rem;
    }

    .search-btn {
        padding: 0.7rem 1rem;
    }

    .header-bottom {
        width: 85%;
    }
}