@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    --light-gray: #1a1a1f;
    --dark-bg: #121215;
    --text-color: #e0e0e0;
    --accent-red: #d33;
    --border-color: #333;
    --hover-gray: #222;

    font-family: 'Open Sans', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    background: var(--dark-bg);
    color: var(--text-color);
}

wiki-header,
wiki-nav,
wiki-page {
    display: block;
}

/* === GRID LAYOUT === */
@media (min-width: 768px) {
    body {
        display: grid;
        gap: 10px;
        grid-template-columns: 300px 1fr;
        grid-template-rows: 100px 1fr;
    }

    header {
        grid-column: 1 / 3;
    }
}

/* === GLOBAL LINKS === */
a {
    text-decoration: none;
    color: #ff5c5c; 
}

a:hover {
    text-decoration: underline;
}

/* === BUTTONS === */
button {
    padding: 0.5rem 1rem;
    background: #222;
    border: 1px solid var(--accent-red);
    border-radius: 4px;
    color: var(--accent-red);
    outline: 0;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

button:hover {
    background: var(--hover-gray);
}

button:active {
    background: #333;
}

button.primary {
    color: #fff;
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* === HEADER === */
header {
    background: #18181c;
    border-bottom: 1px solid var(--border-color);
}

/* === NAVIGATION === */
nav {
    background: #1c1c20;
    border-right: none;
    border-bottom: 2px solid var(--accent-red);
    color: var(--text-color);
}

@media (min-width: 768px) {
    nav {
        border-right: 2px solid var(--accent-red);
        border-bottom: none;
    }
}

/* === MAIN CONTENT === */
main {
    padding: 0 20px;
}

/* === WIKI HEADER === */
wiki-header {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100px;
    padding: 0 20px;
}

wiki-header h1,
wiki-header p {
    margin: 0.25rem 0;
    line-height: 1.2;
}

wiki-header h1 a {
    color: #fff;
}

wiki-header .admin {
    position: relative;
    top: auto;
    right: auto;
    padding-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

@media (min-width: 768px) {
    wiki-header .admin {
        position: absolute;
        top: 30px;
        right: 20px;
    }
}

/* === NAV LINKS === */
wiki-nav {
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    background: #1a1a1f;
}

@media (min-width: 768px) {
    wiki-nav {
        display: block;
    }
}

wiki-nav a {
    display: inline-block;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    margin: 0;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    wiki-nav a {
        display: block;
    }
}

wiki-nav a:hover {
    background: var(--hover-gray);
    border-left-color: var(--accent-red);
}

wiki-nav a.active {
    background: #252529;
    border-left-color: var(--accent-red);
}

wiki-nav .empty {
    padding: 0.6rem 1rem;
    color: #777;
}

/* === CONTENT AREA === */
.content > :first-child {
    margin-top: 1rem;
}

/* === TEXTAREA EDITOR === */
wiki-page textarea.editor {
    width: 100%;
    height: calc(100vh - 200px);
    margin-top: 10px;
    padding: 10px;
    background: #1c1c20;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* === BUTTONS CLASS === */
.button {
    padding: 0.5rem 1rem;
    background: #222;
    border: 1px solid var(--accent-red);
    border-radius: 4px;
    color: var(--accent-red);
    outline: 0;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.button:hover {
    background: var(--hover-gray);
}

.button:active {
    background: #333;
}

.button.primary {
    color: #fff;
    background: var(--accent-red);
    border-color: var(--accent-red);
}
