/* ========================================
   MazeWiki - Estilos CSS
   Wiki não-oficial do servidor MazeOT
   ======================================== */

/* ========== Variáveis CSS ========== */
:root {
    --bg: #0b0e12;
    --bg-soft: #12161d;
    --panel: #1a202b;
    --panel-2: #171c25;
    --gold: #d2aa59;
    --gold-2: #b08a3a;
    --accent: #69b07f;
    /* verde musgo */
    --text: #e7e5dc;
    --muted: #a9a39a;
    --danger: #d96c6c;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --radius: 14px;
}

/* ========== Reset e Base ========== */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font: 16px/1.6 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background:
        radial-gradient(1000px 600px at 20% -10%, #29324122, transparent 70%),
        radial-gradient(900px 600px at 110% 10%, #1f293722, transparent 70%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><rect width="64" height="64" fill="%23111618"/><path d="M0 32 H64 M32 0 V64" stroke="%231a212b" stroke-width="1"/></svg>'),
        var(--bg);
    background-size: auto, auto, 64px 64px, auto;
}

/* ========== Componentes Utilitários ========== */
/* Moldura dourada sutil */
.frame {
    border: 1px solid #000;
    box-shadow:
        inset 0 0 0 1px #000,
        inset 0 0 0 2px #3a2d14,
        inset 0 0 0 3px var(--gold-2),
        var(--shadow);
    border-radius: 12px;
}

/* ========== Header ========== */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(#141922cc, #0f141acc);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #000;
}

.topbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #000;
    display: block;
}

.brand h1 {
    margin: 0;
    font-family: 'Cinzel Decorative', serif;
    font-weight: 700;
    letter-spacing: .5px;
    font-size: 20px;
    text-shadow: 0 2px 0 #000;
}

/* ========== Busca ========== */
.search {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 560px;
}

.search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid #0d0f14;
    outline: none;
}

.search button {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #0d0f14;
    background: linear-gradient(#2a3444, #1b2330);
    color: var(--text);
    cursor: pointer;
}

.search button:hover {
    filter: brightness(1.05);
}

.menu-btn {
    display: none;
    border: 1px solid #0d0f14;
    background: #1b2330;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

/* ========== Layout Principal ========== */
.layout {
    max-width: 1200px;
    margin: 18px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

/* ========== Sidebar ========== */
aside {
    position: sticky;
    top: 70px;
    align-self: start;
    background: linear-gradient(#141922, #0e131a);
    border: 1px solid #0d0f14;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-title {
    margin: 0;
    padding: 14px 16px;
    font-family: 'Cinzel Decorative', serif;
    background: linear-gradient(#3a2d14, #20180d);
    color: #ffdf99;
    border-bottom: 1px solid #000;
}

/* ========== Navegação ========== */
.nav {
    list-style: none;
    margin: 0;
    padding: 10px 8px;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    margin: 4px 0;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    border-radius: 10px;
    background: var(--panel-2);
    border: 1px solid #0d0f14;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(210, 170, 89, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav a:hover::before {
    left: 100%;
}

.nav a:hover {
    outline: 1px solid var(--gold-2);
    box-shadow: 0 0 0 2px #000 inset, 0 0 15px rgba(210, 170, 89, 0.2);
    transform: translateX(2px);
}

.nav a.active {
    background: linear-gradient(#2a2f3b, #1b1f28);
    outline: 1px solid var(--gold-2);
    box-shadow: 0 0 0 2px #000 inset, 0 0 10px rgba(210, 170, 89, 0.3);
}

/* ========== Submenu ========== */
.submenu {
    list-style: none;
    margin: 6px 0;
}

.submenu-btn {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid #0d0f14;
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: inset 0 0 0 1px #000;
}

.submenu-btn:hover,
.submenu-btn.active {
    outline: 1px solid var(--gold-2);
    box-shadow: 0 0 0 2px #000 inset;
    background: linear-gradient(#2a2f3b, #1b1f28);
    color: var(--gold);
}

.submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--muted);
}

.submenu-btn.active .submenu-arrow {
    transform: rotate(180deg);
    color: var(--gold);
}

.submenu-list {
    list-style: none;
    margin: 0;
    padding-left: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.submenu-list.open {
    max-height: 500px;
    padding-top: 8px;
}

.submenu-list li {
    margin: 3px 0;
}

.submenu-list li a {
    display: block;
    padding: 8px 10px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.25s ease;
    position: relative;
}

.submenu-list li a::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gold);
    border-radius: 2px;
    transition: height 0.25s ease;
}

.submenu-list li a:hover {
    outline: 1px solid var(--gold-2);
    background: #1b212c;
    padding-left: 16px;
}

.submenu-list li a:hover::before {
    height: 16px;
}

/* ========== Conteúdo Principal ========== */
main {
    min-height: 60vh;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid #0d0f14;
    background: linear-gradient(120deg, #1a202b, #121721);
    padding: 22px;
}

.hero h2 {
    font-family: 'Cinzel Decorative', serif;
    margin: 0 0 6px;
    color: #ffe199;
    text-shadow: 0 2px 0 #000;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.hero::after {
    content: "";
    position: absolute;
    inset: -10px -60px auto auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(closest-side, #ffc85a55, transparent 70%);
    transform: rotate(25deg);
    filter: blur(10px);
    pointer-events: none;
}

/* ========== Grid e Cards ========== */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 18px;
}

.card {
    background: linear-gradient(#151a21, #10151c);
    border: 1px solid #0d0f14;
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.card .title {
    font-family: 'Cinzel Decorative', serif;
    color: #ffdf99;
    margin-top: 0;
}

.paper {
    background: linear-gradient(#f2ebd9, #e5d7b4);
    color: #2a2214;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid #b08a3a;
    box-shadow: inset 0 0 0 2px #f5e9c9, inset 0 0 24px #e6d6af66;
}

.paper h3 {
    margin-top: 0;
    font-family: 'Cinzel Decorative', serif;
    color: #7a4b12;
}

/* ========== Elementos Utilitários ========== */
.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #263142;
    color: #dbe5f7;
    border: 1px solid #0d0f14;
    margin-right: 6px;
}

.meta {
    color: var(--muted);
    font-size: 13px;
}

/* ========== Footer ========== */
footer {
    max-width: 1200px;
    margin: 24px auto 0 auto;
    padding: 16px;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--border);
}

/* ========== Responsividade ========== */
@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    aside {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        z-index: 30;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    aside.mobile-open {
        left: 0;
    }

    .menu-btn {
        display: inline-block;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    /* Overlay para fechar menu ao clicar fora */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 25;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .brand h1 {
        font-size: 18px;
    }

    .search {
        max-width: none;
    }

    .layout {
        margin: 12px auto;
        padding: 0 12px;
        gap: 12px;
    }

    .hero {
        padding: 16px;
    }

    .card {
        padding: 12px;
    }
}