/* ==========================================================
   GloryBound Wiki - main.css
   ========================================================== */

:root {
    --color-background: #1a100a;
    --color-panel-deep: #22160e;
    --color-input: #170e08;
    --color-border: #4a3724;
    --color-bronze: #8a6a3f;
    --color-foreground: #f4ecdf;
    --color-muted-foreground: #b3a089;
    --color-primary: #f6b92b;
    --color-primary-dark: #d9911a;
    --color-on-primary: #2a1a0a;

    --font-display: "Oswald", "Arial Narrow", sans-serif;
    --font-body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;

    --container: none;
    --header-top-height: 4rem;
    --chamfer: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-background);
    color: var(--color-foreground);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
}

a:hover {
    color: var(--color-foreground);
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

svg {
    display: block;
    flex-shrink: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.gb-frame {
    display: block;
    padding: 1px;
    background: var(--color-bronze);
    border: 0;
    clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)),
            calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}

.gb-frame-inner {
    display: flex;
    align-items: center;
    height: 100%;
    background: var(--color-input);
    clip-path: polygon(calc(var(--chamfer) - 1px) 0, 100% 0, 100% calc(100% - var(--chamfer) + 1px),
            calc(100% - var(--chamfer) + 1px) 100%, 0 100%, 0 calc(var(--chamfer) - 1px));
}

/* Gold slanted button */
.gb-button {
    height: 2.5rem;
    padding: 0 1.5rem;
    border: 0;
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.gb-button:hover {
    filter: brightness(1.1);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(34, 22, 14, 0.95);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(8px);
    transition: transform 200ms ease;
}

/* Mobile: whole header slides away when scrolling down (set by JS) */
.site-header.is-hidden {
    transform: translateY(-100%);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--header-top-height);
}

.header-actions {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

.logo {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.625rem;
    color: var(--color-foreground);
    text-decoration: none;
}

.logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 2.25rem;
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-on-primary);
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.logo-badge svg {
    width: 1.25rem;
    height: 1.25rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.025em;
}

.logo-text span {
    color: var(--color-primary);
}

.search {
    display: none;
    width: 100%;
    max-width: 28rem;
    align-items: stretch;
    gap: 0.5rem;
}

.search .gb-frame {
    flex: 1;
}

.search .gb-frame-inner {
    gap: 0.5rem;
    padding: 0 0.75rem;
}

.search svg {
    width: 1rem;
    height: 1rem;
    color: var(--color-muted-foreground);
}

.search input {
    width: 100%;
    height: 2.5rem;
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    color: var(--color-foreground);
}

.search input::placeholder {
    color: var(--color-muted-foreground);
}

.search input:focus {
    outline: none;
}

.search .gb-frame:focus-within {
    background: var(--color-primary);
}

.lang-button {
    flex-shrink: 0;
    color: var(--color-foreground);
}

.lang-button .gb-frame-inner {
    gap: 0.25rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.lang-button:hover {
    color: var(--color-primary);
}

.lang-button .globe {
    display: none;
    width: 1rem;
    height: 1rem;
    color: var(--color-bronze);
}

.lang-button .lang-code {
    font-family: var(--font-display);
    letter-spacing: 0.025em;
}

.lang-button .chevron {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--color-muted-foreground);
}

.menu-toggle {
    color: var(--color-foreground);
}

.menu-toggle .gb-frame-inner {
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.menu-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.main-nav {
    display: none;
    border-top: 1px solid rgba(74, 55, 36, 0.6);
}

.site-header.is-open .main-nav {
    display: block;
}

.main-nav ul {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
}

.nav-link {
    position: relative;
    display: block;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: var(--color-muted-foreground);
    text-decoration: none;
    cursor: pointer;
    transition: color 150ms ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform 150ms ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
    transform: scaleX(1);
}

/* "Coming soon" entries */
.nav-disabled {
    display: block;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--color-muted-foreground);
}

.nav-disabled small {
    display: block;
    font-size: 0.75rem;
    line-height: 1rem;
}

.site-content {
    padding-top: 1.5rem;
    padding-bottom: 4rem;
    flex: 1;
}

.load-error {
    font-size: 0.875rem;
}

.site-footer {
    bottom: 0;
    background: var(--color-panel-deep);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.site-footer .container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    color: var(--color-muted-foreground);
}

@media (min-width: 400px) {
    .logo-text {
        font-size: 1.5rem;
    }
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .header-top {
        gap: 1rem;
    }

    .header-actions {
        gap: 0.75rem;
    }

    .logo {
        gap: 0.75rem;
    }

    .logo-text {
        font-size: 1.875rem;
    }

    .lang-button .gb-frame-inner {
        gap: 0.375rem;
        padding: 0 0.75rem;
    }

    .lang-button .globe {
        display: block;
    }
}

@media (min-width: 768px) {
    .site-header {
        top: calc(-1 * var(--header-top-height));
    }

    .search {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .main-nav {
        display: block;
    }

    .main-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem;
        padding: 0 1.5rem;
        max-width: var(--container);
        margin: 0 auto;
    }
}

.no-scrollbar {
    overflow: auto;
    /* Ensures scrolling still works */
    scrollbar-width: none;
    /* Firefox, Chrome 121+, Edge 121+, Safari 18.2+ */
    -ms-overflow-style: none;
    /* Legacy IE and Edge */
}

/* Older Chrome, Safari, and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}