/* Shared site chrome: header, Primary nav flyouts, search modal.
   Loaded by styles.css and directly by pages that do not use it (Swagger index.html). */
:root {
  --page-max: 1460px;
  --page-pad-x: 20px;
  --header-pad-y: 12px;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #152033;
  --muted: #5a6a7e;
  --line: #d7dee8;
  --accent: #1a4f8b;
  --accent-soft: #e8f0f8;
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.site-header,
#raisd-site-search {
  font-family: var(--sans);
  line-height: 1.55;
  color: var(--ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* Blur on ::before so overflow clipping does not hide side flyouts */
  background: transparent;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  backdrop-filter: blur(10px);
  background: rgba(246, 248, 251, 0.88);
}
.site-header-inner {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--header-pad-y) var(--page-pad-x);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  overflow: visible;
}
.brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; color: inherit; }
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
.brand strong {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand span { display: none; }
.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
  justify-content: flex-end;
  overflow: visible;
}
.nav a {
  text-decoration: none;
}
.nav-dd {
  position: relative;
  overflow: visible;
}
.nav-dd-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-dd-main::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
}
.nav-dd-main:hover,
.nav-dd:focus-within > .nav-dd-main,
.nav-dd.open > .nav-dd-main,
.nav-dd.is-hover > .nav-dd-main {
  background: var(--accent-soft);
  text-decoration: none;
}
.nav-dd-main.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
/* Active pill uses white text; hover/open softens the fill — switch ink to dark for contrast */
.nav-dd-main.active:hover,
.nav-dd:focus-within > .nav-dd-main.active,
.nav-dd.open > .nav-dd-main.active,
.nav-dd.is-hover > .nav-dd-main.active {
  color: var(--ink);
}
.nav-dd-menu {
  display: none;
  position: absolute;
  /* Flush under trigger — no dead gap; padding creates hit area */
  top: 100%;
  left: 0;
  min-width: 180px;
  padding: 10px 6px 6px;
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--line);
  border-top: none;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 40;
  overflow: visible;
}
/* Invisible bridge so the pointer can leave the pill without closing */
.nav-dd-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}
/* Hover open is JS-driven (.is-hover) with leave delay — avoids snap-close on the way to the menu */
.nav-dd:focus-within > .nav-dd-menu,
.nav-dd.open > .nav-dd-menu,
.nav-dd.is-hover > .nav-dd-menu {
  display: block;
}
.nav-dd-menu > a,
.nav-dd-menu .nav-sub-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  white-space: nowrap;
}
.nav-dd-menu > a:hover,
.nav-dd-menu .nav-sub-menu a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

/* Site search (magnifier + modal) */
.site-search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: auto;
  margin-right: 4px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.site-search-trigger:hover,
.site-search-trigger:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.nav { margin-left: 0; }

html.raisd-search-open { overflow: hidden; }
#raisd-site-search {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 24px;
}
.raisd-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 51, 0.45);
  backdrop-filter: blur(4px);
}
.raisd-search-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.raisd-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}
.raisd-search-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}
.raisd-search-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.raisd-search-close:hover { background: var(--accent-soft); color: var(--ink); }
.raisd-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.raisd-search-field-icon { color: var(--muted); display: inline-flex; }
.raisd-search-field input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.raisd-search-results {
  overflow: auto;
  padding: 0 10px 10px;
  flex: 1;
}
.raisd-search-hint,
.raisd-search-empty {
  margin: 8px 6px 16px;
  color: var(--muted);
  font-size: 0.92rem;
}
.raisd-search-result {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.raisd-search-result:hover,
.raisd-search-result.is-active {
  background: var(--accent-soft);
}
.raisd-search-result-section {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.raisd-search-result-title {
  font-weight: 650;
  font-size: 0.98rem;
  color: var(--ink);
}
.raisd-search-result-summary {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}
.raisd-search-footer {
  margin: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}
.raisd-search-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* Nested side flyout under LUCT CMS (Cyberjaya / Botswana / Sierra Leone) */
.nav-sub {
  position: relative;
  display: block;
}
.nav-dd-menu .nav-sub-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.nav-dd-menu .nav-sub-trigger::after {
  content: "›";
  flex: 0 0 auto;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  color: var(--muted, #6b7280);
  opacity: 0.85;
}
.nav-dd-menu .nav-sub-trigger:hover,
.nav-sub:focus-within > .nav-sub-trigger,
.nav-sub.open > .nav-sub-trigger,
.nav-sub.is-hover > .nav-sub-trigger {
  background: var(--accent-soft);
  text-decoration: none;
}
.nav-sub-menu {
  display: none;
  position: absolute;
  left: calc(100% - 2px);
  top: 0;
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 50;
}
/* Bridge so pointer can move into the side menu without closing */
.nav-sub-menu::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0;
  bottom: 0;
  width: 14px;
}
.nav-sub:focus-within > .nav-sub-menu,
.nav-sub.open > .nav-sub-menu,
.nav-sub.is-hover > .nav-sub-menu {
  display: block;
}

@media (max-width: 900px) {
  .nav-sub-menu {
    position: static;
    left: auto;
    top: auto;
    margin: 0 0 4px;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 8px;
  }
  .nav-sub-menu::before {
    display: none;
  }
  .nav-sub:not(.open):not(.is-hover):not(:focus-within) > .nav-sub-menu {
    display: none;
  }
  .nav-dd-menu .nav-sub-trigger::after {
    content: "▾";
    font-size: 0.75rem;
  }
  .nav-sub.open > .nav-sub-trigger::after,
  .nav-sub.is-hover > .nav-sub-trigger::after,
  .nav-sub:focus-within > .nav-sub-trigger::after {
    content: "▴";
  }
}


/* Portal-style Keychain float (top-right) — also used when openapi loads only site-chrome.css */
.raisd-keychain-access {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  visibility: visible !important;
  font-family: var(--sans);
}
.raisd-keychain-access-btn,
.raisd-keychain-access-panel { pointer-events: auto; }
.raisd-keychain-access-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(21, 32, 51, 0.12);
  cursor: pointer;
}
.raisd-keychain-access-btn:hover { background: var(--accent-soft); }
.raisd-keychain-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9aa8b8;
}
.raisd-keychain-dot.is-unlocked { background: #22c55e; }
.raisd-keychain-access-panel {
  width: min(22rem, calc(100vw - 1.5rem));
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(21, 32, 51, 0.16);
}
.raisd-keychain-access-frame {
  display: block;
  width: 100%;
  border: 0;
  background: var(--surface);
}
