/* Wiki Navigation Bar - Vice Community Redesign */

/* Отдельная белая полоска с меню — фиксирована под хедером при скролле */
.wiki-nav-bar {
    z-index: 400;
    background-color: #fff;
    border: 1px solid #cbd1e2;
    border-top: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Article page: на десктопе панель фиксирована под хедером (top-nav 4.5vw) */
.wiki-article-page .wiki-page-content {
    position: fixed;
    top: var(--desktop-subnav-h, clamp(44px, 2.5vw, 56px));
    left: 4.5vw;
    right: 0;
    width: calc(100% - 4.5vw);
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    z-index: 400;
    box-sizing: border-box;
}

/* Контент ниже: сразу под панелью */
.wiki-article-page .wiki-editor-container {
    padding-top: clamp(6px, 0.6vw, 12px);
}

/* Desktop override: панель инструментов вики сразу под верхним меню */
@media (min-width: 1024px) {
    .wiki-article-page .wiki-page-content {
        position: sticky;
        top: var(--desktop-subnav-h, clamp(44px, 2.5vw, 56px));
        z-index: 451;
    }
}

/* Article page (общий блок без фикса для мобильных) */
.wiki-page-content {
    margin-left: 4.5vw;
    width: calc(100% - 4.5vw);
    box-sizing: border-box;
    margin-top: 0;
}

/* Mobile/Tablet: скрыть верхнюю панель, убрать фикс и отступ */
@media (max-width: 1023px) {
    .wiki-article-page .wiki-page-content {
        position: static;
        display: none !important;
        left: auto;
        right: auto;
        width: 100%;
    }
    .wiki-article-page .wiki-editor-container {
        padding-top: 0;
    }
}

/* Mobile/Tablet: full width, no sidebar offset */
@media (max-width: 1023px) {
    .wiki-page-content {
        margin-left: 0;
        width: 100%;
    }
}

.wiki-page-content .wiki-nav-bar {
    width: 100%;
    margin-top: 0;
}

.wiki-page-content .wiki-nav-bar__inner {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.wiki-page-content .wiki-share-buttons {
    flex-shrink: 0;
}

/* Equal visual gap above and below buttons: top padding larger to offset content gap below */
.wiki-nav-bar__inner {
    display: flex;
    align-items: center;
    gap: 0.58vw;
    padding: 1.15vw 1.38vw 0.55vw;
    width: 100%;
}

/* ── Buttons ── */
.wiki-nav-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.46vw;
    height: 2.5vw;
    padding: 0 1vw;
    background-color: #fafbfc;
    border-radius: 0.35vw;
    border: 0.069vw solid #e2e5ea;
    font-size: 0.88vw;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Inter', system-ui, sans-serif;
}

.wiki-nav-bar__btn:hover {
    background-color: #f0f4ff;
    border-color: rgba(79, 110, 247, 0.35);
    color: #4f6ef7;
}

/* Bookmark active state: no button highlight, icon filled purple, text "Bookmarked" */
.wiki-nav-bar__btn--bookmark.active {
    background-color: transparent;
    border-color: #e2e5ea;
    color: #374151;
}

.wiki-nav-bar__btn--bookmark.active .lucide-icon,
.wiki-nav-bar__btn--bookmark.active [data-lucide] {
    color: #4f6ef7;
}

.wiki-nav-bar__btn--bookmark.active .lucide-icon svg,
.wiki-nav-bar__btn--bookmark.active [data-lucide] svg {
    fill: #4f6ef7;
}

.wiki-nav-bar__btn--bookmark.active .lucide-icon svg path,
.wiki-nav-bar__btn--bookmark.active [data-lucide] svg path {
    fill: #4f6ef7;
    stroke: #4f6ef7;
}

/* Lucide icons */
.wiki-nav-bar__btn [data-lucide],
.wiki-nav-bar__btn .lucide-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.08vw;
    height: 1.08vw;
    flex-shrink: 0;
}

.wiki-nav-bar__btn [data-lucide] svg,
.wiki-nav-bar__btn .lucide-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ── Share: 4 square buttons (link, X, Facebook, Reddit) ── */
.wiki-share-buttons {
    display: flex;
    align-items: center;
    gap: 0.35vw;
    margin-left: auto;
}

/* Mobile share: dropdown, hidden on desktop */
.wiki-share-mobile {
    display: none;
    position: relative;
    margin-left: auto;
}
@media (max-width: 639px) {
    .wiki-share-buttons--desktop {
        display: none !important;
    }
    .wiki-share-mobile {
        display: block;
    }
}
.wiki-share-mobile-trigger {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    background: transparent;
    color: #667085;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.wiki-share-mobile-trigger:hover,
.wiki-share-mobile-trigger[aria-expanded="true"] {
    background: #f0f4ff;
    border-color: rgba(79,110,247,0.3);
    color: #4f6ef7;
}
.wiki-share-mobile-trigger .lucide-icon {
    width: 16px;
    height: 16px;
}
.wiki-share-mobile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 8px;
    z-index: 350;
    min-width: 160px;
}
.wiki-share-mobile-dropdown.is-open {
    display: block;
}
.wiki-share-mobile-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.2s;
}
.wiki-share-mobile-item:hover {
    background: #f0f4ff;
}
.wiki-share-mobile-item .lucide-icon,
.wiki-share-mobile-item .icon-x {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.wiki-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2vw;
    height: 2.2vw;
    min-width: 36px;
    min-height: 36px;
    border-radius: 0.35vw;
    border: 0.069vw solid rgba(0,0,0,0.12);
    background-color: #fff;
    color: #667085;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.wiki-share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Colorful share buttons (same as category page) */
.wiki-share-btn--copy {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.06);
}
.wiki-share-btn--copy:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.wiki-share-btn--x {
    color: #000;
    border-color: rgba(0,0,0,0.2);
    background: rgba(0,0,0,0.04);
}
.wiki-share-btn--x:hover {
    border-color: rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.08);
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.wiki-share-btn--facebook {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.3);
    background: rgba(24, 119, 242, 0.06);
}
.wiki-share-btn--facebook:hover {
    border-color: #1877f2;
    background: rgba(24, 119, 242, 0.12);
    color: #1877f2;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.2);
}

.wiki-share-btn--reddit {
    color: #ff4500;
    border-color: rgba(255, 69, 0, 0.3);
    background: rgba(255, 69, 0, 0.06);
}
.wiki-share-btn--reddit:hover {
    border-color: #ff4500;
    background: rgba(255, 69, 0, 0.12);
    color: #ff4500;
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.2);
}

.wiki-share-btn [data-lucide],
.wiki-share-btn .lucide-icon,
.wiki-share-btn .icon-x,
.wiki-share-btn .fab {
    width: 1.1vw;
    height: 1.1vw;
    min-width: 1.105vw;
    min-height: 1.105vw;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wiki-share-btn [data-lucide] svg,
.wiki-share-btn .lucide-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.wiki-share-btn .icon-x svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.wiki-share-btn .fab {
    font-size: 1vw;
}

/* ── Category dropdown (single expanding panel with columns) ── */
.wiki-category-dropdown {
    position: relative;
}

.wiki-category-panel {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #ffffff;
    border: 0.069vw solid #e2e5ea;
    border-radius: 0.35vw;
    padding: 0 0.4vw;
    box-shadow: 0 0.276vw 1.105vw rgba(0, 0, 0, 0.1);
    z-index: 320;
    display: none;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    min-height: var(--wiki-category-panel-min-height, auto);
    max-height: 70vh;
}

.wiki-category-panel--single {
    top: 100%;
    margin-top: 0.45vw;
    left: 0;
    min-width: 10vw;
    max-width: 60vw;
}

.wiki-category-panel--single::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -0.4vw;
    right: -0.4vw;
    height: 0.6vw;
}

.wiki-category-dropdown:hover .wiki-category-panel--single {
    display: flex;
}

.wiki-category-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 12.5vw;
    min-width: 12.5vw;
    flex-shrink: 0;
    overflow-y: auto;
}

.wiki-category-column--1 {
    padding: 0.4vw 0 0.2vw 0;
}

.wiki-category-column--2,
.wiki-category-column--3,
.wiki-category-column--4 {
    display: none;
}

.wiki-category-panel--single.wiki-category-panel--col2-visible .wiki-category-column--2,
.wiki-category-panel--single.wiki-category-panel--col3-visible .wiki-category-column--3,
.wiki-category-panel--single.wiki-category-panel--col4-visible .wiki-category-column--4 {
    display: flex;
}

.wiki-category-column-divider {
    width: 0.069vw;
    background: #e2e5ea;
    flex-shrink: 0;
    display: none;
}

.wiki-category-panel--single.wiki-category-panel--col2-visible .wiki-category-column-divider--1,
.wiki-category-panel--single.wiki-category-panel--col3-visible .wiki-category-column-divider--2,
.wiki-category-panel--single.wiki-category-panel--col4-visible .wiki-category-column-divider--3 {
    display: block;
}

.wiki-category-column-content {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.4vw 0 0.2vw 0;
    width: 100%;
    box-sizing: border-box;
}

.wiki-category-column-content.wiki-category-column-content--active {
    display: flex;
}

.wiki-category-item,
.wiki-category-item--row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.wiki-category-item--link,
.wiki-category-item-link {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 0.45vw 0.85vw;
    font-size: 0.84vw;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: font-weight 0.15s ease, color 0.15s ease;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.wiki-category-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wiki-category-item--row {
    position: static;
}

.wiki-category-item--link:hover,
.wiki-category-item-link:hover,
.wiki-category-item--link.wiki-category-item--in-path,
.wiki-category-item-link.wiki-category-item--in-path {
    font-weight: 600;
    color: #4f6ef7;
}

.wiki-category-item--has-children .wiki-category-item-link {
    flex: 0 1 auto;
    min-width: 0;
}

.wiki-category-chevron {
    flex-shrink: 0;
    width: 0.9vw;
    height: 0.9vw;
    margin-left: 0.25vw;
    opacity: 0.6;
}

.wiki-category-item-link:hover + .wiki-category-chevron {
    opacity: 1;
}

.wiki-category-chevron svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.wiki-category-separator {
    height: 0.069vw;
    min-height: 0.069vw;
    flex-shrink: 0;
    align-self: stretch;
    background: #e2e5ea;
    margin: 0.35vw 0.85vw;
    box-sizing: border-box;
}

/* Tablet: hide nav text, icon-only buttons */
@media (max-width: 68.508vw) {
    .wiki-nav-bar__btn span { display: none; }
    .wiki-nav-bar__btn { padding: 0 0.68vw; }
    .wiki-category-dropdown:hover .wiki-category-panel--single { display: none; }
}

/* Mobile: compact nav, horizontal scroll */
@media (max-width: 639px) {
    .wiki-nav-bar__inner {
        padding: clamp(8px, 0.7vw, 14px) clamp(12px, 1.38vw, 24px);
        gap: clamp(6px, 0.58vw, 10px);
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .wiki-nav-bar__inner::-webkit-scrollbar {
        display: none;
    }
    .wiki-nav-bar__btn {
        height: clamp(34px, 2.75vw, 44px);
        padding: 0 clamp(8px, 1vw, 16px);
        flex-shrink: 0;
    }
    .wiki-share-buttons {
        flex-shrink: 0;
    }
    .wiki-share-btn {
        width: clamp(34px, 2.2vw, 40px);
        height: clamp(34px, 2.2vw, 40px);
        min-width: 34px;
        min-height: 34px;
    }
}
