/**
 * Wiki — стилі Battle Farm (як fexp / кабінет).
 * Усе під .wiki-page, без глобального body.
 */

.wiki-page {
    --wiki-soil: #3f5d3a;
    --wiki-leaf: #6fa04e;
    --wiki-sun: #e2b24a;
    --wiki-ink: #1f291c;
    --wiki-paper: #f2eee3;
    --wiki-card: rgba(255, 252, 246, 0.96);
    --wiki-line: rgba(55, 42, 28, 0.14);
    --wiki-mute: #6b7366;
    box-sizing: border-box;
    color: var(--wiki-ink);
    font-family: "PTSansRegular", Arial, Helvetica, sans-serif;
    background:
        radial-gradient(ellipse at top right, rgba(226, 178, 74, 0.18), transparent 48%),
        linear-gradient(180deg, #e4efd4 0%, var(--wiki-paper) 42%, #e7dcc6 100%);
    border-radius: 14px;
    padding: 14px;
    margin: 8px 0 24px;
}

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

.wiki-page .wiki-header {
    background: rgba(255, 252, 246, 0.7);
    border: 1px solid var(--wiki-line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    position: static;
    box-shadow: none;
}

.wiki-page .wiki-nav {
    max-width: none;
    margin: 0;
}

.wiki-page .wiki-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
}

.wiki-page .wiki-nav-item {
    margin: 0;
}

.wiki-page .wiki-nav-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    background: #4caf50;
    border-radius: 5px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    transition: filter 0.15s ease;
}

.wiki-page .wiki-nav-link:hover {
    filter: brightness(1.06);
    color: #fff;
    background: #43a047;
    transform: none;
}

.wiki-page .wiki-brand {
    margin-right: auto;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wiki-soil);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wiki-page .wiki-nav-search-item {
    position: relative;
    flex: 1 1 180px;
    max-width: 280px;
    min-width: 140px;
}

.wiki-page .wiki-nav-search {
    position: relative;
    width: 100%;
}

.wiki-page .wiki-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.wiki-page .wiki-search-input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid var(--wiki-line);
    border-radius: 5px;
    background: #fff;
    color: var(--wiki-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.wiki-page .wiki-search-input:focus {
    outline: 2px solid rgba(76, 175, 80, 0.45);
    outline-offset: 1px;
    border-color: #4caf50;
}

.wiki-page .wiki-search-results {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 220px;
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--wiki-line);
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(40, 30, 20, 0.12);
}

.wiki-page .wiki-search-list {
    list-style: none;
    margin: 0;
    padding: 4px;
}

.wiki-page .wiki-search-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 9px;
    text-decoration: none;
    color: var(--wiki-ink);
    border-radius: 5px;
}

.wiki-page .wiki-search-item:hover {
    background: rgba(76, 175, 80, 0.12);
    color: var(--wiki-ink);
}

.wiki-page .wiki-search-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--wiki-soil);
}

.wiki-page .wiki-search-snippet {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    color: #666;
}

.wiki-page .wiki-search-msg {
    padding: 10px 12px;
    font-size: 12px;
    color: #666;
}

.wiki-page .container {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: transparent;
}

.wiki-page aside {
    width: 260px;
    flex: 0 0 260px;
    background: var(--wiki-card);
    border: 1px solid var(--wiki-line);
    border-radius: 10px;
    padding: 10px;
    box-shadow: none;
}

.wiki-page .wiki-aside-title {
    margin: 0 0 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--wiki-soil);
    padding: 2px 4px;
}

.wiki-page .category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wiki-page .category-menu li {
    margin: 0;
}

.wiki-page .category-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--wiki-ink);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 9px;
    border-radius: 7px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wiki-page .category-menu a:hover,
.wiki-page .category-menu a.is-active {
    background: rgba(111, 160, 78, 0.14);
    border-color: rgba(76, 175, 80, 0.35);
    color: var(--wiki-soil);
}

.wiki-page .category-icon {
    margin: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(111, 160, 78, 0.16);
    color: var(--wiki-leaf);
    font-size: 12px;
    flex: 0 0 auto;
}

.wiki-page .category-name {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
}

.wiki-page .category-count {
    flex: 0 0 auto;
    min-width: 1.5em;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(63, 93, 58, 0.12);
    color: var(--wiki-soil);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.wiki-page .main_q {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    background: var(--wiki-card);
    border: 1px solid var(--wiki-line);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: none;
}

.wiki-page .main_q h1 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    color: var(--wiki-soil);
}

.wiki-page .main_q ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wiki-page .main_q li {
    margin: 0;
}

.wiki-page .wiki-cat-link,
.wiki-page .main_q > ul > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--wiki-ink);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--wiki-line);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wiki-page .wiki-cat-link:hover,
.wiki-page .main_q > ul > li > a:hover {
    border-color: rgba(76, 175, 80, 0.45);
    box-shadow: 0 2px 8px rgba(31, 41, 28, 0.08);
    text-decoration: none;
    color: var(--wiki-soil);
}

.wiki-page .article-content {
    font-size: 14px;
    line-height: 1.55;
    color: #3a4336;
}

.wiki-page .article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.wiki-page .wiki-empty {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed var(--wiki-line);
    color: var(--wiki-mute);
    font-size: 13px;
}

.wiki-page .wiki-guide-hint {
    margin: 0 0 14px;
    color: var(--wiki-mute);
    font-size: 13px;
    line-height: 1.45;
}

.wiki-page .wiki-flash {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.wiki-page .wiki-flash-ok {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.wiki-page .wiki-flash-error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.wiki-page .wiki-status-badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.wiki-page .wiki-status-pending {
    background: #fff3e0;
    color: #e65100;
}

.wiki-page .wiki-status-rejected {
    background: #ffebee;
    color: #c62828;
}

.wiki-page .wiki-article-form,
.wiki-page .wiki-comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.wiki-page .wiki-article-form label,
.wiki-page .wiki-comment-form label {
    font-weight: 700;
    font-size: 13px;
    color: var(--wiki-ink, #2a2e45);
}

.wiki-page .wiki-article-form input,
.wiki-page .wiki-article-form select,
.wiki-page .wiki-article-form textarea,
.wiki-page .wiki-comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid var(--wiki-line);
    border-radius: 7px;
    background: #fff;
    font: inherit;
    font-size: 14px;
}

.wiki-page .wiki-article-form textarea {
    min-height: 220px;
    resize: vertical;
}

.wiki-page .wiki-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-top: 4px;
}

.wiki-page .wiki-checkbox-label input {
    width: auto;
}

.wiki-page .wiki-moderation-note,
.wiki-page .wiki-form-error {
    font-size: 13px;
    margin: 4px 0;
}

.wiki-page .wiki-form-error {
    color: #c62828;
}

.wiki-page .wiki-moderation-note {
    color: var(--wiki-mute);
}

.wiki-page .wiki-submit-btn {
    align-self: flex-start;
    margin-top: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #5d8a3e 0%, #3f6b28 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.wiki-page .wiki-add-cta-wrap {
    margin: 0 0 16px;
}

.wiki-page a.wiki-add-cta:hover {
    color: #fff;
    opacity: 0.92;
}

.wiki-page .wiki-article-actions {
    margin: 12px 0 0;
}

.wiki-page .wiki-edit-link {
    color: var(--wiki-accent, #3f6b28);
    font-weight: 700;
    font-size: 13px;
}

.wiki-page .wiki-comments {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--wiki-line);
}

.wiki-page .wiki-comments h2 {
    font-size: 18px;
    margin: 0 0 12px;
}

.wiki-page .wiki-comments-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wiki-page .wiki-comment {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--wiki-line);
}

.wiki-page .wiki-comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--wiki-mute);
}

.wiki-page .wiki-comment-meta strong {
    color: var(--wiki-ink, #2a2e45);
    font-size: 13px;
}

.wiki-page .wiki-comment-body {
    font-size: 14px;
    line-height: 1.45;
}

.wiki-page .wiki-comment-delete {
    margin-top: 8px;
}

.wiki-page .wiki-comment-delete button {
    border: none;
    background: transparent;
    color: #c62828;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.wiki-page #wiki-content {
    padding: 0;
}

@media (max-width: 768px) {
    .wiki-page .container {
        flex-direction: column;
    }

    .wiki-page aside,
    .wiki-page .main_q {
        width: 100%;
        flex: none;
    }

    .wiki-page .wiki-nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .wiki-page .wiki-nav-search-item {
        flex: 1 1 100%;
        max-width: none;
        order: 2;
    }

    .wiki-page .wiki-nav-item:not(.wiki-nav-search-item) {
        order: 3;
    }

    .wiki-page .wiki-brand {
        order: 1;
        width: 100%;
        margin-right: 0;
    }
}
