/**
 * Wiki explore article — second top strip (Fandom-style), desktop only.
 * Same height as .vc-peach-header; flush under it. Dropdowns must not clip (no overflow on track).
 */

.wiki-fandom-toolbar {
  display: none;
}

@media (min-width: 1025px) {
  .wiki-fandom-toolbar {
    display: block;
    position: fixed;
    top: var(--vc-header-h, 56px);
    left: var(--vc-rail-w, 66px);
    right: 0;
    width: auto;
    height: var(--vc-header-h, 56px);
    /* Above page content so mega-menu / lang list are not covered */
    z-index: 8048;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Rubik", "Inter", system-ui, -apple-system, sans-serif;
    overflow: visible;
    border-bottom: 1px solid rgba(126, 34, 206, 0.22);
    /* Light rail: soft cool-lilac, readable for dark controls */
    background: #dbe4f7;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  }

  html[data-vc-rail="light"] .wiki-fandom-toolbar {
    background: #e2e9fa;
    border-bottom-color: rgba(71, 85, 105, 0.22);
  }

  /* Dark rail: flat strip */
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar {
    background: #2a1530;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35) inset;
  }

  .wiki-fandom-toolbar__inner {
    height: 100%;
    max-width: 100%;
    margin: 0;
    /* Align first control with first link in .vc-peach-header (same horizontal padding as peach bar) */
    padding: 0 clamp(22px, 3.2vw, 48px) 0 clamp(14px, 1.5vw, 28px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    overflow: visible;
  }

  .wiki-fandom-toolbar__track {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(6px, 0.55vw, 12px);
    min-width: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .wiki-fandom-toolbar__grow {
    flex: 1 1 48px;
    min-width: 8px;
    height: 1px;
  }

  .wiki-fandom-toolbar__group {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.4vw, 8px);
    flex-shrink: 0;
    min-width: 0;
    overflow: visible;
  }

  .wiki-fandom-toolbar__group--start {
    gap: clamp(6px, 0.55vw, 12px);
  }

  .wiki-fandom-toolbar__group--stats {
    gap: clamp(8px, 0.75vw, 14px);
    align-items: center;
    overflow: visible;
  }

  .wiki-fandom-toolbar__dropdown {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    align-self: stretch;
    overflow: visible;
  }

  .wiki-fandom-toolbar__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 10px 0 4px;
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a0a14;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    white-space: nowrap;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__cat {
    color: rgba(255, 255, 255, 0.92);
  }

  /* Category: no pill darken — only mega panel on hover (handled by dropdown JS) */
  .wiki-fandom-toolbar__cat:hover {
    background: transparent;
    color: #6b21a8;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__cat:hover {
    background: transparent;
    color: #fce7f3;
  }

  .wiki-fandom-toolbar__chev {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
  }

  .wiki-fandom-toolbar__chev--sm {
    width: 12px;
    height: 12px;
    opacity: 0.75;
  }

  /* Ghost actions: same look as Edit — no pill border */
  .wiki-fandom-toolbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    background: transparent;
    color: rgba(30, 10, 24, 0.82);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn {
    color: rgba(255, 255, 255, 0.86);
  }

  .wiki-fandom-toolbar__btn--ghost:hover {
    background: rgba(126, 34, 206, 0.12);
    color: #581c87;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  /* Language trigger: no pill fill; label + icons go purple like category (beat .btn--ghost:hover) */
  .wiki-fandom-toolbar__lang:hover .wiki-fandom-toolbar__lang-btn.wiki-fandom-toolbar__btn--ghost,
  .wiki-fandom-toolbar__lang:focus-within .wiki-fandom-toolbar__lang-btn.wiki-fandom-toolbar__btn--ghost {
    background: transparent;
    color: #6b21a8;
  }

  .wiki-fandom-toolbar__lang:hover .wiki-fandom-toolbar__lang-btn .lucide-icon,
  .wiki-fandom-toolbar__lang:focus-within .wiki-fandom-toolbar__lang-btn .lucide-icon {
    color: #6b21a8;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang:hover .wiki-fandom-toolbar__lang-btn.wiki-fandom-toolbar__btn--ghost,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang:focus-within .wiki-fandom-toolbar__lang-btn.wiki-fandom-toolbar__btn--ghost {
    background: transparent;
    color: #fce7f3;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang:hover .wiki-fandom-toolbar__lang-btn .lucide-icon,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang:focus-within .wiki-fandom-toolbar__lang-btn .lucide-icon {
    color: #fce7f3;
  }

  /* Saved: no filled pill — icon (and label tint) only */
  .wiki-fandom-toolbar__btn.is-saved,
  .wiki-fandom-toolbar__btn--ghost.is-saved {
    background: transparent;
    color: rgba(30, 10, 24, 0.78);
  }

  .wiki-fandom-toolbar__btn.is-saved .wiki-fandom-toolbar__save-icon,
  .wiki-fandom-toolbar__btn--ghost.is-saved .wiki-fandom-toolbar__save-icon {
    color: #6d28d9;
  }

  .wiki-fandom-toolbar__btn.is-saved .wiki-fandom-toolbar__btn-text,
  .wiki-fandom-toolbar__btn--ghost.is-saved .wiki-fandom-toolbar__btn-text {
    color: #5b21b6;
    font-weight: 800;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn.is-saved,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn--ghost.is-saved {
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn.is-saved .wiki-fandom-toolbar__save-icon,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn--ghost.is-saved .wiki-fandom-toolbar__save-icon {
    color: #e9d5ff;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn.is-saved .wiki-fandom-toolbar__btn-text,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__btn--ghost.is-saved .wiki-fandom-toolbar__btn-text {
    color: #f3e8ff;
  }

  .wiki-fandom-toolbar__btn-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }

  .wiki-fandom-toolbar__lang {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
    height: 100%;
    min-height: var(--vc-header-h, 56px);
    overflow: visible;
  }

  /* Hover bridge: list has pointer-events:none while closed; this keeps :hover on .lang while moving to the menu */
  .wiki-fandom-toolbar__lang::after {
    content: "";
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    height: min(320px, 70vh);
    z-index: 1;
    pointer-events: none;
  }

  .wiki-fandom-toolbar__lang:hover::after {
    pointer-events: auto;
  }

  .wiki-fandom-toolbar__lang-btn {
    position: relative;
    z-index: 2;
    height: 34px;
    padding: 0 8px 0 6px;
  }

  .wiki-fandom-toolbar__lang-list {
    position: absolute;
    top: 100%;
    left: 0;
    /* Match .wiki-category-panel--single under toolbar (margin-top: 12px) */
    margin-top: 12px;
    min-width: 168px;
    padding: 6px 0;
    list-style: none;
    border-radius: 10px;
    border: 1px solid rgba(126, 34, 206, 0.12);
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    z-index: 12060;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.12s ease,
      visibility 0.12s ease;
  }

  .wiki-fandom-toolbar__lang:hover .wiki-fandom-toolbar__lang-list,
  .wiki-fandom-toolbar__lang:focus-within .wiki-fandom-toolbar__lang-list {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang-list {
    background: #2a1a30;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  }

  .wiki-fandom-toolbar__lang-list li {
    display: block;
    padding: 0;
  }

  .wiki-fandom-toolbar__lang-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
  }

  .wiki-fandom-toolbar__lang-link:hover,
  .wiki-fandom-toolbar__lang-link.is-active {
    background: rgba(79, 110, 247, 0.12);
    color: #4f46e5;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang-link {
    color: rgba(255, 255, 255, 0.88);
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang-link:hover,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__lang-link.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
  }

  .wiki-fandom-toolbar__lang-flag {
    flex-shrink: 0;
    width: 18px;
    height: 12px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .wiki-fandom-toolbar__lang-flag svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* Like / dislike: icon-led controls, no outer chrome */
  .wiki-fandom-toolbar__reactions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: none;
    background: transparent;
  }

  .wiki-fandom-toolbar__icon-vote {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: clamp(11px, 0.75vw, 12px);
    font-weight: 700;
    color: rgba(30, 10, 24, 0.78);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote {
    color: rgba(255, 255, 255, 0.78);
  }

  .wiki-fandom-toolbar__icon-vote .lucide-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
  }

  .wiki-fandom-toolbar__icon-vote:hover {
    background: transparent;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote:hover {
    background: transparent;
  }

  /* Active vote: colour icon + count only; never paint the button chrome */
  .wiki-fandom-toolbar__icon-vote.active {
    background: transparent;
    color: rgba(30, 10, 24, 0.78);
  }

  .wiki-fandom-toolbar__icon-vote.active .lucide-icon,
  .wiki-fandom-toolbar__icon-vote.active .vote-count {
    color: #15803d;
  }

  .wiki-fandom-toolbar__icon-vote.vote-btn--down.active .lucide-icon,
  .wiki-fandom-toolbar__icon-vote.vote-btn--down.active .vote-count {
    color: #b91c1c;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote.active {
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote.active .lucide-icon,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote.active .vote-count {
    color: #86efac;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote.vote-btn--down.active .lucide-icon,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__icon-vote.vote-btn--down.active .vote-count {
    color: #fecaca;
  }

  /* Toolbar votes use .vote-btn from wiki-sidebar.css — kill white pill / borders / fills here */
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--up:hover,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--down:hover,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--up.active,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--up.active:hover,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--down.active,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--down.active:hover {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--up.active .lucide-icon svg,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--up.active:hover .lucide-icon svg {
    fill: none !important;
  }

  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--down.active .lucide-icon svg,
  .wiki-fandom-toolbar .wiki-fandom-toolbar__icon-vote.vote-btn--down.active:hover .lucide-icon svg {
    fill: none !important;
  }

  .wiki-fandom-toolbar__views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 2px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(30, 10, 24, 0.85);
    white-space: nowrap;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__views {
    color: rgba(255, 255, 255, 0.9);
  }

  .wiki-fandom-toolbar__views-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.8;
  }

  .wiki-fandom-toolbar__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    line-height: 1.05;
    padding-left: clamp(16px, 1.45vw, 28px);
    flex-shrink: 0;
    text-align: right;
    text-decoration: none;
  }

  .wiki-fandom-toolbar__brand:hover .wiki-fandom-toolbar__brand-name,
  .wiki-fandom-toolbar__brand:hover .wiki-fandom-toolbar__brand-meta {
    color: #334155;
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__brand:hover .wiki-fandom-toolbar__brand-name,
  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__brand:hover .wiki-fandom-toolbar__brand-meta {
    color: #ffffff;
  }

  .wiki-fandom-toolbar__brand-name {
    font-size: clamp(11px, 0.82vw, 14px);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(30, 10, 24, 0.88);
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__brand-name {
    color: rgba(255, 255, 255, 0.92);
  }

  .wiki-fandom-toolbar__brand-meta {
    margin-top: 3px;
    font-size: clamp(10px, 0.68vw, 12px);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(107, 33, 168, 0.72);
  }

  html:not([data-vc-rail="light"]) .wiki-fandom-toolbar__brand-meta {
    color: rgba(252, 211, 232, 0.75);
  }

  .wiki-fandom-toolbar .wiki-category-dropdown--tools-subnav .wiki-category-panel--single {
    z-index: 12060 !important;
    top: 100%;
    margin-top: 12px;
    left: 0;
  }

  .wiki-fandom-toolbar .wiki-category-dropdown--tools-subnav .wiki-category-panel--single::before {
    bottom: 100%;
    left: 0;
    right: 0;
    height: 14px;
  }
}

@media (max-width: 1024px) {
  .wiki-fandom-toolbar {
    display: none !important;
  }
}
