/**
 * Desktop-only Fandom-inspired chrome (left rail + peach top bar).
 * Loaded from layout-top.php; hidden below 1025px (mobile uses existing UI).
 */
:root {
  --vc-rail-w: 66px;
  --vc-header-h: 56px;
  --vc-peach: #ffc58e;
  --vc-peach-search: #e8a96e;
  --vc-peach-nav: #0a0a0a;
  /* Dark rail: same deep violet as wiki second strip (.wiki-fandom-toolbar) */
  --vc-rail-bg: #2a1530;
  --vc-rail-fg: rgba(255, 255, 255, 0.92);
  --vc-rail-muted: rgba(255, 255, 255, 0.55);
  --vc-rail-active: #ffd300;
  /* Palm: saturated violet (not pink); stroke only — no glow */
  --vc-palm-purple: #5b21b6;
  --vc-z-rail: 8010;
  /* Above .wiki-fandom-toolbar (8048) so header popovers (notifications) are not covered on wiki article */
  --vc-z-header: 8060;
  --vc-z-dd: 8070;
}

html[data-vc-rail="light"] {
  --vc-rail-bg: #ffffff;
  --vc-rail-fg: #111111;
  --vc-rail-muted: rgba(0, 0, 0, 0.55);
  --vc-rail-active: #b45309;
}

@media (min-width: 1025px) {
  html {
    overflow-x: clip;
  }

  /* !important: style.css loads after this file and sets body { padding: 0 } */
  body {
    padding-left: var(--vc-rail-w) !important;
    padding-top: var(--vc-header-h) !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 100vh;
  }

  /* Wiki article: second strip same height as peach bar — flush, no gap */
  body.wiki-article-page {
    padding-top: calc(var(--vc-header-h, 56px) * 2) !important;
  }

  .vc-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--vc-rail-w);
    z-index: var(--vc-z-rail);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--vc-rail-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    padding: 10px 0 12px;
    font-family: "Rubik", "Inter", system-ui, -apple-system, sans-serif;
  }

  html[data-vc-rail="light"] .vc-rail {
    border-right-color: rgba(0, 0, 0, 0.1);
  }

  .vc-rail__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    color: transparent;
    margin-bottom: 10px;
    text-decoration: none;
    transition: background 0.15s ease;
  }

  .vc-rail__logo:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  html[data-vc-rail="light"] .vc-rail__logo:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .vc-rail__logo-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    color: var(--vc-palm-purple) !important;
    stroke: var(--vc-palm-purple);
    filter: none;
  }

  html[data-vc-rail="light"] .vc-rail__logo-icon {
    color: var(--vc-palm-purple) !important;
    stroke: var(--vc-palm-purple);
    filter: none;
  }

  .vc-rail__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    width: 100%;
    min-height: 0;
    padding-top: 6px;
  }

  .vc-rail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0 8px;
    text-decoration: none;
    color: var(--vc-rail-muted);
    border-radius: 0;
    transition: color 0.15s ease, background 0.15s ease;
    gap: 5px;
  }

  .vc-rail__item:hover {
    color: var(--vc-rail-fg);
    background: rgba(255, 255, 255, 0.06);
  }

  html[data-vc-rail="light"] .vc-rail__item:hover {
    background: rgba(0, 0, 0, 0.05);
  }

  .vc-rail__item--active {
    color: var(--vc-rail-active);
  }

  .vc-rail__item--active:hover {
    color: var(--vc-rail-active);
  }

  .vc-rail__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .vc-rail__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .vc-rail__label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    line-height: 1;
    max-width: 64px;
    text-align: center;
    word-break: break-word;
  }

  .vc-rail__more {
    width: 100%;
    position: relative;
    padding: 0 0 8px;
    margin-top: auto;
  }

  .vc-rail__more-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 0 8px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--vc-rail-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .vc-rail__more-btn:hover,
  .vc-rail__more.is-open .vc-rail__more-btn {
    color: var(--vc-rail-fg);
    background: rgba(255, 255, 255, 0.06);
  }

  html[data-vc-rail="light"] .vc-rail__more-btn:hover,
  html[data-vc-rail="light"] .vc-rail__more.is-open .vc-rail__more-btn {
    background: rgba(0, 0, 0, 0.05);
  }

  .vc-rail__more-menu {
    position: absolute;
    left: calc(100% + 10px);
    bottom: 8px;
    min-width: 168px;
    max-width: min(220px, calc(100vw - var(--vc-rail-w) - 24px));
    padding: 6px;
    border-radius: 6px;
    background: #2f1936;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: calc(var(--vc-z-rail) + 5);
    overflow: hidden;
    box-sizing: border-box;
  }

  .vc-rail__more.is-open .vc-rail__more-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  html[data-vc-rail="light"] .vc-rail__more-menu {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16);
  }

  .vc-rail__more-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-decoration: none;
    border-radius: 4px;
    padding: 8px 8px;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.14s ease, color 0.14s ease;
    min-width: 0;
  }

  .vc-rail__more-link:hover {
    background: rgba(255, 255, 255, 0.09);
  }

  html[data-vc-rail="light"] .vc-rail__more-link {
    color: #1f2937;
  }

  html[data-vc-rail="light"] .vc-rail__more-link:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .vc-rail__more-link-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }

  .vc-rail__more-link--danger {
    color: #ffb0b0;
  }

  html[data-vc-rail="light"] .vc-rail__more-link--danger {
    color: #b91c1c;
  }

  .vc-peach-header {
    position: fixed;
    top: 0;
    left: var(--vc-rail-w);
    right: 0;
    height: var(--vc-header-h);
    z-index: var(--vc-z-header);
    background: var(--vc-peach);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 clamp(22px, 3.2vw, 48px) 0 clamp(14px, 1.5vw, 28px);
    font-family: "Rubik", "Inter", system-ui, -apple-system, sans-serif;
  }

  .vc-peach-header__inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: clamp(14px, 1.6vw, 28px);
    min-width: 0;
  }

  .vc-peach-nav {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.55vw, 14px);
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }

  .vc-peach-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--vc-peach-nav);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .vc-peach-nav__link:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .vc-peach-nav__caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
  }

  .vc-peach-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    max-width: min(378px, 28.8vw);
    height: 36px;
    margin-left: auto;
    margin-right: clamp(10px, 1.1vw, 20px);
    padding: 0 6px 0 14px;
    background: var(--vc-peach-search);
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }

  .vc-peach-search__icon {
    width: 18px;
    height: 18px;
    color: rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
  }

  .vc-peach-search .vc-peach-search__submit {
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex-shrink: 0;
    color: rgba(0, 0, 0, 0.55);
    margin: 0;
  }

  .vc-peach-search .vc-peach-search__submit:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .vc-peach-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
  }

  .vc-peach-search input::placeholder {
    color: rgba(0, 0, 0, 0.45);
  }

  /* Logged-in: search + theme + bell + avatar share one row; three flex gaps are equal */
  .vc-peach-session {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    gap: clamp(8px, 0.7vw, 12px);
  }

  .vc-peach-session__pre {
    display: none;
  }

  .vc-peach-session .vc-peach-search {
    flex: 0 1 min(378px, 28.8vw);
    max-width: min(378px, 28.8vw);
    width: min(378px, 28.8vw);
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .vc-peach-session__actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: auto;
    gap: clamp(6px, 0.55vw, 10px);
  }

  .vc-peach-session__gap {
    display: none;
  }

  .vc-peach-session__actions > .vc-icon-btn,
  .vc-peach-session__actions > .notifications-wrapper,
  .vc-peach-session__actions > .vc-avatar-btn {
    flex-shrink: 0;
  }

  .vc-peach-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: clamp(12px, 1.5vw, 28px);
  }

  .vc-peach-auth {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.1vw, 22px);
    margin-right: 6px;
  }

  .vc-peach-auth__link {
    font-family: inherit;
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vc-peach-nav);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: nowrap;
  }

  .vc-peach-auth__link:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .vc-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--vc-peach-nav);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
  }

  .vc-icon-btn:hover {
    background: rgba(0, 0, 0, 0.08);
  }

  .vc-icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .vc-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.2);
    text-decoration: none;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.35);
  }

  .vc-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .notifications-wrapper {
    position: relative;
  }

  .vc-peach-tools .notifications-wrapper,
  .vc-peach-session__actions .notifications-wrapper {
    margin-left: 0;
    z-index: auto;
  }

  .vc-peach-tools .notification-btn,
  .vc-peach-session__actions .notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
  }

  .vc-peach-tools .notification-btn:hover,
  .vc-peach-session__actions .notification-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--vc-peach-nav);
    box-shadow: none;
  }

  .notification-btn {
    position: relative;
  }

  .notification-dropdown {
    z-index: var(--vc-z-dd);
  }

  /*
   * Body already has padding-left = rail and padding-top = header.
   * Flow content must not add rail width again; wiki bar aligns to content box.
   */
  .wiki-page-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .wiki-article-page .wiki-page-content {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100%;
    top: var(--vc-header-h) !important;
    box-sizing: border-box;
  }

  .news-article-wiki-container,
  .news-article-wiki-container--news-article,
  .news-article-wiki-container--wiki-explore {
    margin-left: clamp(8px, 1vw, 20px) !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .home-page-container,
  .main-layout {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ----- Footer (matches rail + peach header vibe) ----- */
  .main-footer.vc-footer {
    margin-left: 0 !important;
    margin-top: clamp(2.25rem, 4vw, 3.5rem);
    border-top: none;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    background: #2a1530;
    color: rgba(255, 255, 255, 0.88);
    font-family: "Rubik", "Inter", system-ui, -apple-system, sans-serif;
    overflow: hidden;
  }

  html[data-vc-rail="light"] .main-footer.vc-footer {
    background: linear-gradient(180deg, #fafafa 0%, #ececf0 100%);
    color: #141418;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.08);
  }

  .main-footer.vc-footer .footer-container {
    max-width: min(1180px, 92%);
    margin: 0 auto;
    padding: clamp(1.75rem, 2.5vw, 2.5rem) clamp(1rem, 2vw, 1.5rem) clamp(1.5rem, 2.2vw, 2rem);
  }

  .vc-footer__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    align-items: start;
  }

  .vc-footer__title {
    margin: 0 0 0.85rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffc58e;
  }

  html[data-vc-rail="light"] .vc-footer__title {
    color: #b45309;
  }

  .vc-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .vc-footer__link {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.15s ease, transform 0.15s ease;
  }

  html[data-vc-rail="light"] .vc-footer__link {
    color: rgba(20, 20, 24, 0.72);
  }

  .vc-footer__link:hover {
    color: #ffd300;
    transform: translateX(2px);
  }

  html[data-vc-rail="light"] .vc-footer__link:hover {
    color: #c026d3;
  }

  .vc-footer__col--social {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .vc-footer__col--social .vc-footer__title {
    width: 100%;
    margin-top: 0.6rem;
  }

  .vc-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
    justify-content: center;
  }

  .vc-footer__social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 197, 142, 0.35);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  }

  html[data-vc-rail="light"] .vc-footer__social-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: #1a1a1f;
  }

  .vc-footer__social-btn:hover {
    border-color: #ffd300;
    background: rgba(255, 211, 0, 0.12);
    color: #ffd300;
    transform: translateY(-2px);
  }

  html[data-vc-rail="light"] .vc-footer__social-btn:hover {
    border-color: #d946ef;
    color: #a21caf;
    background: rgba(217, 70, 239, 0.08);
  }

  .vc-footer__social-btn i {
    font-size: 1.1rem;
  }

  .vc-footer__lang-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 0.85rem;
    display: flex;
    justify-content: center;
  }

  .vc-footer__lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.28rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
  }

  html[data-vc-rail="light"] .vc-footer__lang-btn {
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.9);
    color: rgba(20, 20, 24, 0.9);
  }

  .vc-footer__lang-flag,
  .vc-footer__lang-option-flag {
    width: 1.1rem;
    height: 0.75rem;
    display: inline-flex;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  }

  .vc-footer__lang-flag svg,
  .vc-footer__lang-option-flag svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .vc-footer__lang-caret {
    width: 0.82rem;
    height: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
  }

  html[data-vc-rail="light"] .vc-footer__lang-caret {
    color: rgba(20, 20, 24, 0.6);
  }

  .vc-footer__lang-menu {
    position: absolute;
    top: calc(100% + 0.3rem);
    right: 50%;
    transform: translateX(50%);
    min-width: 11rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #111318;
    box-shadow: 0 20px 28px -18px rgba(0, 0, 0, 0.6);
    padding: 0.25rem;
    display: none;
    z-index: 20;
    box-sizing: border-box;
  }

  html[data-vc-rail="light"] .vc-footer__lang-menu {
    border-color: rgba(0, 0, 0, 0.12);
    background: #ffffff;
    box-shadow: 0 16px 28px -20px rgba(18, 24, 40, 0.35);
  }

  .vc-footer__lang-menu.open {
    display: grid;
    gap: 0.12rem;
  }

  .vc-footer__lang-option {
    display: inline-flex;
    align-items: center;
    width: 100%;
    min-height: 2rem;
    gap: 0.55rem;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 0 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    box-sizing: border-box;
  }

  .vc-footer__lang-option:hover,
  .vc-footer__lang-option.is-active {
    border-color: rgba(255, 211, 0, 0.28);
    background: rgba(255, 211, 0, 0.09);
  }

  html[data-vc-rail="light"] .vc-footer__lang-option {
    color: rgba(20, 20, 24, 0.9);
  }

  html[data-vc-rail="light"] .vc-footer__lang-option:hover,
  html[data-vc-rail="light"] .vc-footer__lang-option.is-active {
    border-color: rgba(217, 70, 239, 0.22);
    background: rgba(217, 70, 239, 0.08);
  }

  .vc-footer__bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: clamp(1.5rem, 2.2vw, 2rem);
    padding-top: clamp(1.25rem, 1.8vw, 1.75rem);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
  }

  html[data-vc-rail="light"] .vc-footer__bar {
    border-top-color: rgba(0, 0, 0, 0.1);
  }

  .vc-footer__copyright {
    max-width: 42rem;
    margin: 0 auto;
  }

  .vc-footer__copyright p {
    margin: 0 0 0.35rem;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.48);
    text-align: center;
    white-space: nowrap;
  }

  html[data-vc-rail="light"] .vc-footer__copyright p {
    color: rgba(20, 20, 24, 0.55);
  }

  .vc-footer__copyright p:last-child {
    margin-bottom: 0;
  }

  /* Wiki: sticky under peach + wiki fandom toolbar (same height as header). */
  .wiki-article-page .wiki-explore-page-wrapper {
    --na-sticky-top: calc(var(--vc-header-h, 56px) * 2 + 12px);
  }

  .wiki-article-page .news-article-wiki-container--wiki-explore {
    margin-right: clamp(2px, 0.35vw, 8px) !important;
    max-width: 100%;
  }

  @media (max-width: 1200px) {
    .vc-footer__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}

@media (max-width: 1024px) {
  .vc-rail,
  .vc-peach-header {
    display: none !important;
  }

  html {
    overflow-x: visible;
  }

  body {
    padding-left: 0 !important;
    padding-top: 0 !important;
    padding-right: 0 !important;
    max-width: none;
    min-height: 0;
  }
}
