/*
 * Modern shell — single source of truth for layout tokens & chrome.
 * Classic skin overrides live in classic-wiki.css.
 */

:root {
    --font-main: 'Inter', sans-serif;
    --eus-red: #ED1B2F;
    --sidebar-width: 280px;
    --canvas-bg: #f8fafc;
    --canvas-dot: #e2e8f0;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --radius-panel: 20px;
    --radius-control: 12px;
    --shadow-soft: 0 10px 30px -5px rgba(15, 23, 42, 0.06);
}

body {
    font-family: var(--font-main);
    background-color: var(--canvas-bg);
    background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px);
    background-size: 24px 24px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
}

/* Nav rail */
.sidebar-container {
    width: var(--sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.nav-panel {
    background: var(--surface);
    border-radius: var(--radius-panel);
    height: 100%;
    width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow-y: auto;
}

.main-content {
    flex-grow: 1;
    width: calc(100% - var(--sidebar-width));
    margin-left: 0;
    position: relative;
    min-height: 100vh;
}

.brand-box { color: var(--ink); display: block; }
.brand-text {
    font-family: var(--font-main);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
}
.text-highlight { color: var(--eus-red); }

.nav-section { flex: 1; }
.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    font-weight: 800;
    margin: 20px 0 10px 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-link:hover {
    background-color: #fff1f2;
    color: var(--eus-red);
    transform: translateX(4px);
    text-decoration: none;
}

.nav-link.active {
    background: linear-gradient(135deg, #ED1B2F 0%, #ff4d4d 100%);
    color: white;
    box-shadow: 0 8px 20px -5px rgba(237, 27, 47, 0.4);
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.mini-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    margin-right: 6px;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.nav-auth-top {
    margin: 0 0 1rem;
}
.btn-admin-panel,
.btn-login-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: background 0.15s ease, transform 0.15s ease;
}
.btn-admin-panel {
    background: #ed1b2f;
    color: #fff !important;
    box-shadow: 0 8px 18px -8px rgba(237, 27, 47, 0.55);
}
.btn-admin-panel:hover {
    background: #d41728;
    color: #fff !important;
    transform: translateY(-1px);
}
.btn-login-top {
    background: #0f172a;
    color: #fff !important;
}
.btn-login-top:hover {
    background: #1e293b;
    color: #fff !important;
    transform: translateY(-1px);
}

.user-card {
    background: var(--canvas-bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--eus-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

/* Skin toggle */
.skin-toggle {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px -6px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.skin-toggle:hover {
    border-color: var(--eus-red);
    color: var(--eus-red);
}

.skin-toggle i { font-size: 0.85rem; }
.skin-toggle-mobile { display: none; }
.brand-logo-classic { display: none; }

.mobile-header,
.overlay,
.mobile-drawer-head,
.mobile-menu-toggle,
.mobile-admin-btn { display: none; }

html.eus-menu-open,
html.eus-menu-open body {
    overflow: hidden !important;
    touch-action: none;
}

@media (max-width: 992px) {
    body {
        display: block;
        overflow: auto;
        height: auto;
    }

    .sidebar-container {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(20rem, 88vw);
        z-index: 2000;
        padding: 0;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        height: 100dvh;
        max-height: 100dvh;
    }

    .nav-panel {
        border-radius: 0;
        padding: 0.85rem 1rem 1.25rem;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 12px 0 40px -16px rgba(15, 23, 42, 0.35);
    }

    .sidebar-container.show { transform: translateX(0); }

    .main-content {
        width: 100%;
        padding: 0;
        height: auto;
        overflow: visible;
        display: block;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        padding: 0.7rem 0.9rem;
        background: white;
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .mobile-header .brand-link {
        min-width: 0;
        flex: 1;
    }

    .mobile-header .brand-text {
        font-size: 1.15rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1500;
        display: none;
        backdrop-filter: blur(3px);
    }

    .overlay.show {
        display: block;
    }
    .overlay[hidden] {
        display: none !important;
    }

    .skin-toggle-desktop { display: none; }

    .skin-toggle-mobile {
        display: inline-flex;
        position: static;
        box-shadow: none;
        padding: 0.4rem 0.65rem;
        font-size: 0.62rem;
        max-width: 6.5rem;
    }
    .skin-toggle-mobile .skin-toggle-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;
    }

    .mobile-admin-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 2.4rem;
        padding: 0 0.75rem;
        border-radius: 999px;
        background: #ed1b2f;
        color: #fff !important;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.02em;
        text-decoration: none !important;
        white-space: nowrap;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        margin: 0;
        padding: 0;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        color: #0f172a;
        cursor: pointer;
    }
    .mobile-menu-toggle:hover {
        border-color: #ed1b2f;
        background: #fff1f2;
        color: #ed1b2f;
    }
    .mobile-menu-toggle__bars,
    .mobile-menu-toggle__bars::before,
    .mobile-menu-toggle__bars::after {
        display: block;
        width: 1.1rem;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.18s ease, opacity 0.18s ease;
    }
    .mobile-menu-toggle__bars {
        position: relative;
    }
    .mobile-menu-toggle__bars::before,
    .mobile-menu-toggle__bars::after {
        content: "";
        position: absolute;
        left: 0;
    }
    .mobile-menu-toggle__bars::before { top: -5px; }
    .mobile-menu-toggle__bars::after { top: 5px; }
    .eus-menu-open .mobile-menu-toggle__bars { background: transparent; }
    .eus-menu-open .mobile-menu-toggle__bars::before {
        top: 0;
        transform: rotate(45deg);
    }
    .eus-menu-open .mobile-menu-toggle__bars::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.85rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #f1f5f9;
    }
    .mobile-drawer-title {
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #94a3b8;
    }
    .mobile-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.4rem;
        height: 2.4rem;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        color: #334155;
        cursor: pointer;
    }

    .nav-link {
        min-height: 2.75rem;
        padding: 0.75rem 0.9rem;
        font-size: 1rem;
        margin-bottom: 0.15rem;
    }
    .nav-link:hover {
        transform: none;
    }
    .nav-label {
        margin-top: 1.1rem;
    }
}

@media (max-width: 420px) {
    .skin-toggle-mobile .skin-toggle-label {
        display: none;
    }
    .skin-toggle-mobile {
        width: 2.4rem;
        height: 2.4rem;
        padding: 0;
        justify-content: center;
        max-width: none;
    }
}

/* Never show Wagtail’s floating bird / userbar on the public site */
.w-userbar,
[data-wagtail-userbar],
aside[data-wagtail-userbar] {
    display: none !important;
}

/* Quieter default cards site-wide (pages can opt into lift) */
.surface-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
}

.surface-card.is-interactive:hover {
    border-color: var(--eus-red);
    box-shadow: 0 10px 20px -8px rgba(15, 23, 42, 0.08);
}
