/* Base Styles */
body { 
    background-color: #800000; 
    margin: 0; 
    padding: 0; 
    color: #fff185; 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    line-height: 1.7; 
}

/* Layout */
.container { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding-bottom: 80px; 
}

.logo-wrap { 
    margin-top: 100px; 
    max-width: 80%; 
    width: 400px; 
}

.logo-wrap img { width: 100%; height: auto; }

.content-box { 
    max-width: 750px; 
    margin-top: 60px; 
    padding: 0 25px; 
}

/* --- SUB-PAGE SPECIFIC STYLES --- */

/* Align the container to the left on sub-pages */
.sub-page .container {
    align-items: flex-start;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Shrink and align the logo */
.sub-page .logo-wrap {
    width: 200px;      /* Half of the original 400px */
    max-width: 45%;    /* Responsive cap for mobile */
    margin-left: 25px; /* Aligns with content-box padding */
    margin-top: 60px;
}

/* Ensure the image within the wrap behaves */
.sub-page .logo-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

/* Optional: Slight mobile tweak for smaller screens */
@media (max-width: 480px) {
    .sub-page .logo-wrap {
        width: 160px;
        margin-top: 40px;
        margin-left: 20px;
    }
}

/* Hide the dropdown content by default in mobile, or let it stack */
nav.open .dropdown-content {
    position: static;
    border: none;
    display: block; /* Show sub-items when menu is open */
    padding-left: 20px;
}

/* Typography */
h2 { 
    color: #e0a4fc; 
    font-weight: 300; 
    font-size: 2.2rem; 
    text-transform: lowercase; 
    margin-bottom: 20px;
    letter-spacing: -1px;
}

p { font-size: 1.05rem; margin-bottom: 30px; font-weight: 300; }

/* Links & Notes */
.agreement-link {
    display: inline-block;
    color: #e0a4fc;
    text-decoration: none;
    border-bottom: 1px solid #e0a4fc;
    margin-bottom: 10px;
    font-weight: bold;
    transition: opacity 0.2s;
}

.agreement-link:hover { opacity: 0.8; }

.note {
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Language Visibility Logic */
[data-nl] { display: none; }

.menu-item { 
    color: #fff185; 
    text-decoration: none; 
    margin: 0 15px; 
    font-weight: bold; 
    display: inline-block; 
}

.active { color: #e0a4fc !important; }

/* Dropdown Positioning */
.dropdown { 
    display: inline-block; 
    position: relative; 
}

.dropdown-content { 
    display: none; 
    position: absolute; 
    background: #800000; 
    min-width: 160px; 
    z-index: 100; 
    border: 1px solid #fff185;
    top: 60px; /* Aligns exactly at bottom of nav */
    left: 0;
}

.dropdown-content a { 
    line-height: 1.4; 
    padding: 10px 15px; 
    color: #fff185; 
    display: block; 
    text-decoration: none; 
    text-align: left;
}

.dropdown-content a:hover {
    background-color: rgba(255, 241, 133, 0.1);
}

.dropdown:hover .dropdown-content { 
    display: block; 
}

/* Language Toggle Styles */
.lang-toggle { 
    margin-left: 20px; 
    background-color: #800000; 
    color: #fff185; 
    border: 1px solid #fff185; 
    cursor: pointer; 
    padding: 4px 8px;
    font-family: inherit;
    border-radius: 4px;
}

.lang-toggle option {
    background-color: #800000;
    color: #fff185;
}

/* Ensure the nav container can hold absolute elements */
nav {
    position: relative;
    background: #800000;
    height: 60px;
    display: flex;
    align-items: center;
}

/* Position the Language Wrapper to the far right */
.lang-wrapper {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%); /* Centers it vertically */
    z-index: 1001; /* Keeps it above the menu drawer */
}

/* Style the hamburger to the left */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 25px;
    padding: 0;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: #fff185;
    transition: 0.3s;
}

/* Collapsible Menu Drawer */
.menu-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #800000;
    flex-direction: column;
    text-align: left;
    padding: 10px 0 20px 0;
    border-bottom: 1px solid rgba(255, 241, 133, 0.3);
    z-index: 1000;
}

nav.open .menu-links {
    display: flex;
}

.menu-links .menu-item {
    padding: 15px 25px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 241, 133, 0.1);
}

/* --- SUB-PAGE SIDE-BY-SIDE LAYOUT --- */

@media (min-width: 768px) {
    .sub-page .container {
        flex-direction: row;      /* Places logo and text side-by-side */
        align-items: flex-start;  /* Aligns both to the top */
        justify-content: center;  /* Centers the pair on the screen */
        gap: 50px;                /* Space between logo and text */
        padding-top: 60px;
        max-width: 1100px;
        margin: 0 auto;
    }

    .sub-page .logo-wrap {
        margin-top: 0;            /* Remove top margin since container has padding */
        margin-left: 0;
        flex: 0 0 200px;          /* Fixes logo width at 200px */
    }

    .sub-page .content-box {
        margin-top: 0;            /* Aligns text top with logo top */
        padding: 0;
        flex: 1;                  /* Allows text to take up remaining space */
        max-width: 650px;
    }
}

/* Mobile Fallback: Stacks them vertically on small screens */
@media (max-width: 767px) {
    .sub-page .container {
        flex-direction: column;
        align-items: center;      /* Keeps it centered on mobile */
        padding: 0 20px;
    }

    .sub-page .logo-wrap {
        width: 150px;             /* Smaller logo for mobile */
        margin: 40px 0 20px 0;
    }

    .sub-page .content-box {
        margin-top: 20px;
        text-align: left;
    }
}

/* If user is NOT logged in, hide the logout button */
body:not(.user-logged-in) .auth-only-logged-in { display: none; }

/* If user IS logged in, hide the login button */
body.user-logged-in .auth-only-logged-out { display: none; }

/* Style the buttons to match the Troost aesthetic */
.auth-controls button {
    background: none;
    border: 1px solid #e0a4fc;
    color: #e0a4fc;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-left: 10px;
}
.auth-controls button:hover {
    background: rgba(224, 164, 252, 0.1);
}
