/*
 * Shared visual foundation for every migrated Movie Box Wiki route.
 *
 * Page-specific files only define their own content layouts. Keeping the
 * document reset and common site chrome here prevents the former per-page CSS
 * copies from drifting apart.
 */
:root {
    --bg: #000;
    --text: #fff;
    --muted: #c8cfdb;
    --line: #1f2937;
    --brand: #2f80ff;
    --brand-2: #22c55e;
    --max: 1180px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
    width: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        'Inter',
        'Segoe UI',
        'Helvetica Neue',
        Arial,
        system-ui,
        -apple-system,
        sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    margin-inline: auto;
    width: min(100% - 2rem, var(--max));
}

/* The header remains shared because every route uses the same React component. */
.site-header {
    backdrop-filter: blur(10px);
    background: rgba(15, 17, 21, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .inner {
    align-items: center;
    display: flex;
    gap: 1rem;
    max-width: none;
    padding: 0.9rem 1.5rem;
    width: 100%;
}

.brand {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.65rem;
    min-width: 0;
}

.brand-mark {
    display: block;
    flex: 0 0 auto;
    height: 40px;
    object-fit: contain;
    width: 40px;
}

.brand-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-nav {
    display: flex;
    flex: 1 1 0;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.top-nav a {
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text);
    font-size: 1.02rem;
    padding: 0.45rem 0.72rem;
    transition: 0.2s ease;
}

.top-nav a.active,
.top-nav a:hover,
.top-nav a:focus-visible {
    background: rgba(47, 128, 255, 0.16);
    border-color: rgba(47, 128, 255, 0.65);
    outline: none;
}

/* The mobile menu interaction is managed by PageInteractions. */
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 760px) {
    .site-header .inner {
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .mobile-nav-toggle {
        align-items: center;
        background: rgba(47, 128, 255, 0.12);
        border: 1px solid rgba(47, 128, 255, 0.55);
        border-radius: 10px;
        color: #dbe9ff;
        cursor: pointer;
        display: inline-flex;
        font-size: 1.15rem;
        height: 38px;
        justify-content: center;
        line-height: 1;
        width: 38px;
    }

    .brand {
        margin-inline: auto;
    }

    .brand-text {
        max-width: 42vw;
    }

    .site-header .top-nav {
        align-items: stretch;
        background: rgba(6, 10, 18, 0.96);
        border: 1px solid rgba(47, 128, 255, 0.45);
        border-radius: 12px;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
        display: none;
        flex-direction: column;
        gap: 0.16rem;
        left: 1rem;
        padding: 0.45rem;
        position: absolute;
        top: calc(100% + 0.45rem);
        width: min(78vw, 280px);
        z-index: 220;
    }

    .site-header.mobile-menu-open .top-nav {
        display: flex;
    }

    .site-header .top-nav a {
        text-align: left;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-search {
    align-self: flex-start;
    flex: 0 0 auto;
    width: min(100%, 15rem);
}
.header-search input {
    width: 100%;
    border: 1px solid rgba(47, 128, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 0.5rem 0.85rem;
}
.header-search input::placeholder {
    color: var(--muted);
}
.header-search input:focus-visible {
    border-color: var(--brand);
    outline: 2px solid rgba(47, 128, 255, 0.35);
    outline-offset: 2px;
}
.locale-switcher {
    align-self: flex-start;
    flex: 0 0 auto;
    position: relative;
}
.locale-switcher > button {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(47, 128, 255, 0.45);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
}
.locale-switcher > button:focus-visible {
    border-color: var(--brand);
    outline: 2px solid rgba(47, 128, 255, 0.35);
    outline-offset: 2px;
}
.locale-switcher > ul {
    background: rgba(6, 10, 18, 0.96);
    border: 1px solid rgba(47, 128, 255, 0.45);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
    list-style: none;
    margin: 0;
    min-width: 10rem;
    padding: 0.35rem;
    inset-inline-end: 0;
    position: absolute;
    top: calc(100% + 0.45rem);
    z-index: 220;
}
.locale-switcher li + li {
    margin-top: 0.15rem;
}
.locale-switcher li button {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    padding: 0.45rem 0.7rem;
    text-align: left;
    width: 100%;
}
.locale-switcher li button:hover,
.locale-switcher li button[aria-selected='true'] {
    background: rgba(47, 128, 255, 0.16);
}
@media (max-width: 760px) {
    .header-search {
        flex: 1 1 100%;
        order: 3;
        width: 100%;
    }
    .locale-switcher {
        order: 2;
    }
}
