/*!
 * Custom right-click navigation card (context-nav.js). Themed for light and dark, with the same animated,
 * clipped primary border as the theme popup. Colours come from Bootstrap/Alfuix tokens so each page keeps
 * its own accent.  © 2026 Mohammad Azad
 */
.cx-menu { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.cx-menu:not([hidden]) .cx-card { pointer-events: auto; }

.cx-card {
  position: fixed;
  width: 218px;
  max-width: calc(100vw - 20px);
  padding: 13px 13px 9px;
  color: #eaf2ff;
  background: linear-gradient(160deg, rgba(var(--bs-primary-rgb), 0.14), rgba(var(--bs-primary-rgb), 0.02)), #0a1526;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  /* Animated border = the Alfuix al-border ::after ring (its own clip-path follows the cut corners, exactly
     like the home-page tabs, so it never clips). We only animate its fill: a bright head sweeps round an
     otherwise-transparent ring, so there is no static border line — just the moving highlight. */
  --al-border-bg: conic-gradient(from var(--al-border-angle), transparent 0deg, transparent 250deg, rgba(var(--bs-primary-rgb), 0.85) 312deg, #ffffff 331deg, rgba(var(--bs-primary-rgb), 0.85) 350deg, transparent 360deg);
  animation: be-bg-spin 3.2s linear infinite;
}
.cx-menu.is-open .cx-card { opacity: 1; transform: none; }

.cx-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 10px; }
.cx-head-txt { font: 600 10px/1 var(--bs-font-monospace, monospace); letter-spacing: 0.22em; text-transform: uppercase; color: rgba(var(--bs-primary-rgb), 0.95); white-space: nowrap; }
.cx-head-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.5), transparent); }

.cx-list { display: flex; flex-direction: column; gap: 1px; }
.cx-link {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px;
  font-size: 13.5px; text-decoration: none; color: rgba(234, 242, 255, 0.82);
  transition: background-color 0.18s ease, color 0.18s ease;
}
/* hover/focus fills the row; the al-corner clip on the link gives it the cut corners */
.cx-link:hover, .cx-link:focus-visible { background: rgba(var(--bs-primary-rgb), 0.14); color: #fff; outline: none; }
.cx-ico { width: 40px; font-size: 15px; }
.cx-label { flex: 1; }
.cx-arrow { font-size: 10px; opacity: 0.4; transition: transform 0.18s ease, opacity 0.18s ease; }
.cx-link:hover .cx-arrow { opacity: 0.9; transform: translateX(2px); }

.cx-div { height: 1px; margin: 8px 6px; background: rgba(255, 255, 255, 0.08); }

/* "you are here" row — highlighted; clipped corners come from al-corner on the link */
.cx-link.is-active { background: rgba(var(--bs-primary-rgb), 0.18); color: #fff; }
.cx-link.is-active:hover, .cx-link.is-active:focus-visible { background: rgba(var(--bs-primary-rgb), 0.28); }

.cx-foot { padding: 10px 6px 2px; text-align: center; font: 600 9px/1 var(--bs-font-monospace, monospace); letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.3); }

/* ---- light theme: a light card with dark text ---- */
html[data-theme="light"] .cx-card {
  color: #0e1b2b;
  background: linear-gradient(160deg, rgba(var(--bs-primary-rgb), 0.1), rgba(255, 255, 255, 0.65)), #ffffff;
  box-shadow: 0 24px 60px -18px rgba(20, 50, 80, 0.3);
  /* light head so the sweep reads on a light card */
  --al-border-bg: conic-gradient(from var(--al-border-angle), transparent 0deg, transparent 250deg, rgba(var(--bs-primary-rgb), 0.95) 312deg, #0a3b2b 331deg, rgba(var(--bs-primary-rgb), 0.95) 350deg, transparent 360deg);
}
html[data-theme="light"] .cx-link { color: rgba(14, 27, 43, 0.78); }
html[data-theme="light"] .cx-link:hover, html[data-theme="light"] .cx-link:focus-visible { color: #0a1422; background: rgba(var(--bs-primary-rgb), 0.12); }
html[data-theme="light"] .cx-div { background: rgba(10, 25, 45, 0.1); }
html[data-theme="light"] .cx-foot { color: rgba(10, 25, 45, 0.4); }
html[data-theme="light"] .cx-link.is-active { color: #0a1422; }

@media (prefers-reduced-motion: reduce) {
  .cx-card { transition: opacity 0.12s ease; transform: none; animation: none; }
}
