/* =========================================================
   REVERSE SIDE NAVIGATION
   Right-side philosophical traditions navigation
   ========================================================= */

/* ---------- Main side navigation ---------- */

.category-nav.nav-reverse {

  position: fixed;

  top: 120px;
  left: 22px;
  right: auto;

  width: 150px;
  max-height: calc(100vh - 120px);

  margin: 0;

  z-index: 900;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateX(30px);

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: none;

  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.35s ease;
}


/* ---------- JavaScript visible state ---------- */

.category-nav.nav-reverse.nav-reverse-visible {

  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translateX(0);
}


/* ---------- Inner panel ---------- */

.nav-reverse-inner {

  display: flex;
  flex-direction: column;

  gap: 0.15rem;

  padding: 0.8rem 0.65rem;

  border: 1px solid color-mix(in srgb,
      var(--gold, #b88a44) 22%,
      transparent);

  border-radius: 16px;

  background: color-mix(in srgb,
      var(--background, #14100b) 92%,
      transparent);

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.22);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}


/* ---------- Label ---------- */

.nav-reverse-label {

  display: block;

  padding:
    0.35rem 0.55rem 0.55rem;

  color: var(--gold, #b88a44);

  font-family: var(--mono);

  font-size: 0.65rem;

  font-weight: 700;

  letter-spacing: 0.18em;

  text-transform: uppercase;
}


/* ---------- Links ---------- */

.category-nav.nav-reverse a {

  display: grid;

  grid-template-columns: 1.8rem 1fr;

  align-items: center;

  gap: 0.45rem;

  padding:
    0.48rem 0.5rem;

  border-radius: 6px;

  color: inherit;

  font-size: 0.78rem;

  line-height: 1.25;

  text-decoration: none;

  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease;
}


/* ---------- Icons ---------- */

.category-nav.nav-reverse a span {

  font-size: 0.95rem;

  text-align: center;
}


/* ---------- Text ---------- */

.category-nav.nav-reverse a strong {

  font-weight: 500;
}


/* ---------- Hover / keyboard focus ---------- */

.category-nav.nav-reverse a:hover,
.category-nav.nav-reverse a:focus-visible {

  background: color-mix(in srgb,
      var(--gold, #b88a44) 10%,
      transparent);

  color: var(--gold, #b88a44);

  transform: translateX(2px);

  outline: none;
}


/* ---------- Active section ---------- */

.category-nav.nav-reverse a.is-active,
.category-nav.nav-reverse a[aria-current="location"] {

  color: var(--gold, #b88a44);

  background: color-mix(in srgb,
      var(--gold, #b88a44) 16%,
      transparent);
}


/* ---------- Active text ---------- */

.category-nav.nav-reverse a.is-active strong,
.category-nav.nav-reverse a[aria-current="location"] strong {

  font-weight: 700;
}


/* ---------- Right-side active indicator ---------- */

.category-nav.nav-reverse a.is-active::after,
.category-nav.nav-reverse a[aria-current="location"]::after {

  content: "";

  position: absolute;

  right: 0.7rem;

  width: 3px;

  height: 55%;

  border-radius: 3px;

  background: var(--gold, #b88a44);
}


/* ---------- Make links the positioning context ---------- */

.category-nav.nav-reverse a {

  position: relative;
}


/* ---------- Anchor offset ---------- */

#ancient-greek,
#eastern-indian,
#chinese,
#enlightenment-modern,
#islamic {

  scroll-margin-top: 100px;
}


/* =========================================================
   LIGHT THEME
   ========================================================= */

body:not(.theme-dark) .nav-reverse-inner {

  background: rgba(255, 255, 255, 0.98);

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.10);
}


body:not(.theme-dark) .category-nav.nav-reverse a {

  color: #1d1710;
}


body:not(.theme-dark) .category-nav.nav-reverse a:hover,
body:not(.theme-dark) .category-nav.nav-reverse a:focus-visible {

  background: rgba(184, 138, 68, 0.10);

  color: #6f4e22;
}


body:not(.theme-dark) .category-nav.nav-reverse a.is-active,
body:not(.theme-dark) .category-nav.nav-reverse a[aria-current="location"] {

  color: #1d1710;

  background: #b88a44;
}


/* =========================================================
   TABLET + MOBILE
   Hide the side navigation completely.
   ========================================================= */

@media (max-width: 860px) {

  .category-nav.nav-reverse {

    display: none !important;
  }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .category-nav.nav-reverse,
  .category-nav.nav-reverse.nav-reverse-visible {

    transition: none;

    transform: none;
  }

  .category-nav.nav-reverse a {

    transition: none;
  }

}

.nav-reverse-inner {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-reverse-inner::-webkit-scrollbar {
  display: none;
}