/* ==================== WIKI ==================== */
.wiki-wrapper {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: 'Lato', sans-serif;
    color: #333;
}

.wiki-header {
    background: linear-gradient(135deg, #1f1f2e 0%, #2c2c44 100%);
    border-radius: 12px 12px 0 0;
    padding: 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
	overflow: visible;
}
.wiki-header::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(181,150,62,0.25) 0%, transparent 70%);
    border-radius: 50%;
}
.wiki-header h1 { margin: 0 0 5px; font-size: 28px; color: #fff; }
.wiki-header h1 i { color: #d9c264; }
.wiki-header p { color: #bbb; margin: 0 0 20px; }

.wiki-search-box {
    position: relative;
    max-width: 700px;
    background: #fff;
    border-radius: 40px;
    padding: 6px 18px;
    display: flex;
    align-items: center;
    z-index: 10;
    /* NÃO use overflow: hidden aqui! */
}
.wiki-search-box > i.fa-search {
    color: #888; margin-right: 10px; font-size: 16px;
}
#wiki-search {
    flex: 1; border: none; outline: none;
    padding: 12px 5px; font-size: 15px;
    background: transparent; color: #333;
}
.wiki-search-clear { cursor: pointer; color: #999; padding: 5px 10px; }
.wiki-search-clear:hover { color: #d33; }

.search-results {
    position: absolute;
    top: calc(100% + 8px);        /* 8px de espaço abaixo do input */
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    max-height: 60vh;             /* ← altura máxima: 60% da tela */
    overflow-y: auto;             /* permite rolar se tiver muito item */
    display: none;
    z-index: 9999;                /* ← bem acima de tudo */
    text-align: left;
}

.search-results.active { 
    display: block; 
}

/* Rolagem bonitinha */
.search-results::-webkit-scrollbar {
    width: 8px;
}
.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.search-results::-webkit-scrollbar-thumb {
    background: #b5963e;
    border-radius: 10px;
}
.search-results::-webkit-scrollbar-thumb:hover {
    background: #8a712f;
}
.search-results .sr-item {
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
}
.search-results .sr-item:last-child { border-bottom: none; }
.search-results .sr-item:hover { background: #f5f5f5; }
.search-results .sr-item .sr-cat {
    font-size: 11px; color: #b5963e; font-weight: bold;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.search-results .sr-item .sr-name { font-weight: bold; color: #222; margin-top: 2px; }
.search-results .sr-item .sr-snippet { font-size: 12px; color: #666; margin-top: 3px; }
.search-results .sr-empty { padding: 20px; text-align: center; color: #888; }

.wiki-quick-filters {
    margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px;
    position: relative; z-index: 5;
}
.filter-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ddd; padding: 6px 14px;
    border-radius: 20px; cursor: pointer;
    font-size: 13px; transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.2); }
.filter-btn.active { background: #b5963e; border-color: #b5963e; color: #fff; font-weight: bold; }

.wiki-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    margin-top: 20px;
}
@media (max-width: 800px) {
    .wiki-body { grid-template-columns: 1fr; }
}

.wiki-sidebar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    padding: 15px;
    height: fit-content;
    position: sticky; top: 15px;
}
.wiki-sidebar h3 {
    margin: 0 0 12px; padding-bottom: 10px;
    border-bottom: 2px solid #b5963e;
    font-size: 15px; color: #333;
}
#categories-list { list-style: none; padding: 0; margin: 0; }
#categories-list li { margin-bottom: 4px; }
#categories-list li a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: #444; text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}
#categories-list li a:hover {
    background: #f5f1e3; color: #b5963e;
    transform: translateX(3px);
}
#categories-list li a.active {
    background: #b5963e; color: #fff; font-weight: bold;
}
#categories-list li a i { width: 18px; text-align: center; }
#categories-list li.loading { text-align: center; color: #999; padding: 20px; }

.wiki-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    padding: 25px;
    min-height: 400px;
}
.wiki-welcome { text-align: center; padding: 50px 20px; color: #888; }
.wiki-welcome i { color: #b5963e; margin-bottom: 15px; }
.wiki-welcome h2 { color: #333; margin: 10px 0; }
.wiki-stats { display: flex; gap: 20px; justify-content: center; margin-top: 25px; }
.wiki-stats .stat {
    background: #f9f6ec; padding: 10px 20px; border-radius: 8px;
    color: #b5963e; font-weight: bold;
}

.topic-header {
    border-bottom: 2px solid #f0e9d1;
    padding-bottom: 15px; margin-bottom: 20px;
}
.topic-header h2 {
    color: #222; margin: 0 0 8px;
    display: flex; align-items: center; gap: 10px;
}
.topic-header .topic-cat {
    font-size: 12px; color: #b5963e; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px;
}
.topic-body {
    color: #444; line-height: 1.7; font-size: 15px;
    white-space: pre-wrap;
}
.topic-body img.topic-cover {
    max-width: 100%; border-radius: 8px; margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.topic-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px; margin-top: 20px;
}
.topic-gallery .gallery-item {
    position: relative; cursor: pointer;
    border-radius: 8px; overflow: hidden;
    transition: transform 0.2s;
}
.topic-gallery .gallery-item:hover { transform: scale(1.05); }
.topic-gallery .gallery-item img { width: 100%; display: block; }

.topic-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 25px; padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 12px; color: #999;
}
.topic-votes { display: flex; gap: 12px; }
.topic-votes button {
    background: #f5f5f5; border: none;
    padding: 6px 14px; border-radius: 20px;
    cursor: pointer; color: #666;
    transition: all 0.2s; font-size: 13px;
}
.topic-votes button:hover { background: #eee; }
.topic-votes button.active-like { background: #4caf50; color: #fff; }
.topic-votes button.active-dislike { background: #f44336; color: #fff; }

.wiki-loading { text-align: center; padding: 50px; color: #999; }
.wiki-loading i { font-size: 30px; color: #b5963e; }

.topics-list { display: flex; flex-direction: column; gap: 8px; }
.topics-list .sr-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
}
.topics-list .sr-item:hover {
    border-color: #b5963e;
    background: #fdfbf5;
    transform: translateX(3px);
}