/* ==========================
   Base Layout Structure
========================== */
.page-shell {
    width: 100%;
}

.page-inner {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

body.auth-page .page-inner {
    max-width: 480px;
}

.page-main {
    width: 100%;
}

/* ==========================
   Navbar
========================== */
/* Full-width background */
.global-nav {
    width: 100%;
}

/* Inner layout container (responsive width, centered content) */
.nav-inner,
.global-nav .nav-inner {
    background: transparent;
    /* optional see-through navbar */
    display: flex;
    justify-content: space-between;
    align-items: center;

    width: min(100%, 900px);
    margin: 0 auto;
    /* centers content on wide screens */
    padding: 0.5rem 1rem;
    /* vertical + horizontal spacing */
    flex-wrap: nowrap;
    /* prevents the second row */
}

.nav-inner>* {
    min-height: 48px;
    min-width: 0;
    /* Allow flex items to shrink */
}

/* Branding / logo */
.nav-brand,
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.brand-title {
    white-space: nowrap;
    /* prevent line break */
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1;
    /* THIS IS THE KEY */
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links:empty {
    display: none;
}

/* Links inside navbar */
.global-nav a,
.global-nav button {
    font: inherit;
}

.account-links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 1rem;
    /* slightly smaller text */
}

.account-links a {
    margin-left: 0.9rem;
}

/* Username link */
.account-trigger {
    font-size: 1rem;
    text-decoration: none;
}

.logout-form {
    border-left: 1px solid #444;
    padding-left: 0.8rem;
}

/* Logout button styled as link */
.logout-link {
    font-size: 1rem;
    display: contents;
}

/* Link-like buttons */
.link-like {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    display: inline;
    font-size: 1rem;
}

.link-like,
.link-like:link,
.link-like:visited {
    color: #99c7f2;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.link-like:hover,
.link-like:focus {
    color: orange;
    text-decoration: underline;
}

.link-like:active {
    color: red;
}

/* ==========================
   Language Selector
========================== */
.language-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.language-selector select {
    background-color: transparent;
    color: #d0d8e6;
    border: none;
    border-radius: 0;
    padding: 0.25rem 0.5rem;
    text-align: left;
    appearance: none;
    min-width: 2.5rem;
    font-size: 1rem;
    max-width: 80px;
}

/* Small screen adjustments */
@media (max-width: 400px) {
    .language-selector select {
        font-size: 0.8rem;
        min-width: 2rem;
    }

    .nav-inner,
    .global-nav .nav-inner {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Very small screens: collapse language selector to icon (<375px) */
@media (max-width: 374px) {
    .language-selector {
        gap: 0;
        position: relative;
    }

    .language-selector select {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        font-size: 0.9rem;
        min-width: 3rem;
    }

    .language-selector:focus-within select {
        display: block;
    }
}

/* ==========================
   Responsive navbar wrapping
========================== */
@media (max-width: 768px) {
    .global-nav .nav-inner {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .account-and-language {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==========================
   Messages Overlay
========================== */
.messages-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    text-align: center;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.messages-overlay .message {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    pointer-events: auto;
}

/* ==========================
   Fonts
========================== */
@font-face {
    font-family: 'Raleway';
    src: url('../fonts/raleway/Raleway-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Raleway';
    src: url('../fonts/raleway/Raleway-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

body {
    font-family: 'Raleway', sans-serif;
}

.account-and-language {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}