/* ════════════════════════════════════════════════════════════════
   ST Registry Knowledge Base — main.css
   Shared foundation: tokens, base typography, nav, sidebar,
   breadcrumb, code blocks, footer. Included on every page.
   ════════════════════════════════════════════════════════════════ */

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Inter', system-ui, sans-serif; }
svg { overflow: visible; }

/* ─── DESIGN TOKENS ─── */
:root {
  /* Bootstrap token overrides */
  --bs-font-sans-serif: 'Inter', system-ui, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-color: #374351;
  --bs-body-bg: #ffffff;
  --bs-border-color: #e2e8ef;
  --bs-link-color: #0491CF;
  --bs-link-hover-color: #0372a3;

  /* ST Registry brand tokens */
  --st-blue:        #0491CF;
  --st-blue-dark:   #0372a3;
  --st-blue-deeper: #025c84;
  --st-blue-pale:   #e8f5fc;
  --st-blue-mid:    #b8dff4;
  --st-off-white:   #f7f9fb;
  --st-gray-100:    #f0f4f8;
  --st-gray-300:    #a8b5c2;
  --st-gray-500:    #60717f;
  --st-gray-700:    #374351;
  --st-gray-900:    #18232e;

  /* Unprefixed aliases (legacy names used across article pages) */
  --blue:        var(--st-blue);
  --blue-dark:   var(--st-blue-dark);
  --blue-deeper: var(--st-blue-deeper);
  --blue-pale:   var(--st-blue-pale);
  --blue-mid:    var(--st-blue-mid);
  --white:       #ffffff;
  --off-white:   var(--st-off-white);
  --border:      #e2e8ef;
  --gray-100:    var(--st-gray-100);
  --gray-300:    var(--st-gray-300);
  --gray-500:    var(--st-gray-500);
  --gray-700:    var(--st-gray-700);
  --gray-900:    var(--st-gray-900);

  /* Domain lifecycle stage tokens */
  --lc-green-bg:#dff0e8; --lc-green-bd:#86c9a4; --lc-green-dot:#22a86e; --lc-green-text:#166534;
  --lc-blue-bg:#e8f5fc;  --lc-blue-bd:#7fcce8;  --lc-blue-text:#025c84;
  --lc-orange-bg:#fff7ed;--lc-orange-bd:#fbbf7a;--lc-orange-dot:#f97316;--lc-orange-text:#92400e;--lc-orange-sub:#b45309;
  --lc-purple-bg:#fff0f0;--lc-purple-bd:#ffb3b3;--lc-purple-dot:#f87171;--lc-purple-text:#b91c1c;--lc-purple-sub:#dc2626;
  --lc-red-bg:#fde8e8;   --lc-red-bd:#f87171;   --lc-red-dot:#dc2626;   --lc-red-text:#7f1d1d;  --lc-red-sub:#991b1b;
}

/* ─── LAYOUT & TYPOGRAPHY HELPERS ─── */
.section { padding: 80px 0; }
.eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--blue); margin-bottom: 10px;
}
.section-title {
  font-size: clamp(28px, 3vw, 38px); font-weight: 700;
  color: var(--gray-900); letter-spacing: -.6px; line-height: 1.15; margin-bottom: 14px;
}
.section-sub {
  font-size: 16px; color: var(--gray-500); font-weight: 300;
  line-height: 1.7; max-width: 520px;
}

/* ─── NAV ─── */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1030;
  height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.nav-logo img { height: 47px; width: auto; }
.nav-divider { width: 1px; height: 22px; background: var(--border); }
.nav-site-label { font-size: 15px; font-weight: 600; color: var(--gray-500); }

/* Landing variant (ul.nav-links) */
.site-nav .nav-links { gap: 2px; }
.site-nav .nav-links .nav-link {
  font-size: 14px;
  color: var(--gray-700);
  padding: 8px 14px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.site-nav .nav-links .nav-link:hover,
.site-nav .nav-links .nav-link.active {
  background: var(--blue-pale);
  color: var(--blue);
}
.site-nav .nav-links .nav-link.active { font-weight: 500; }

/* Article-page variant (a.nav-link-item) */
.nav-link-item { font-size: 14px; color: var(--gray-700); padding: 8px 14px; border-radius: 7px; text-decoration: none; transition: background .15s, color .15s; }
.nav-link-item:hover, .nav-link-item.active { background: var(--blue-pale); color: var(--blue); }
.nav-link-item.active { font-weight: 500; }

/* ─── SIDEBAR ─── */
.sidebar-desktop {
  position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--off-white);
  padding: 32px 0;
  width: 260px; flex-shrink: 0;
  transition: width .25s ease, padding .25s ease;
}
/* Offcanvas sidebar (mobile) */
.offcanvas-sidebar { width: 260px !important; background: var(--off-white) !important; padding: 16px 0 !important; }
.offcanvas-sidebar .offcanvas-header { padding: 12px 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.offcanvas-sidebar .offcanvas-title { font-size: 13px; font-weight: 600; color: var(--gray-500); }
.offcanvas-sidebar .btn-close { opacity: .4; }
/* Sidebar toggle button */
.sidebar-toggle {
  position: fixed;
  top: 80px;
  left: 260px;
  transform: translateX(-50%);
  z-index: 100;
  width: 24px; height: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: left .25s ease, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.sidebar-toggle:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); background: var(--blue-pale); }
.sidebar-toggle svg { width: 12px; height: 12px; stroke: var(--gray-500); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; flex-shrink: 0; }
/* Collapsed state */
body.sidebar-collapsed .sidebar-desktop { width: 0 !important; overflow: hidden; padding: 0; border-right: none; }
body.sidebar-collapsed .sidebar-toggle { left: 0; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-heading { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray-300); padding: 0 20px; margin-bottom: 6px; margin-top: 16px; }
.sidebar-heading:first-child { margin-top: 0; }
.sidebar-link { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gray-500); text-decoration: none; padding: 8px 20px; border-left: 2px solid transparent; transition: background .15s, color .15s, border-color .15s; line-height: 1.3; }
.sidebar-link:hover { background: var(--blue-pale); color: var(--blue); }
.sidebar-link.active { background: var(--blue-pale); color: var(--blue); font-weight: 500; border-left-color: var(--blue); }
.sidebar-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: .6; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 20px; }
.sidebar-sublink { font-size: 12px; color: var(--gray-300); text-decoration: none; padding: 5px 20px 5px 42px; display: flex; align-items: center; gap: 6px; transition: color .15s; line-height: 1.3; }
.sidebar-sublink::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.sidebar-sublink:hover { color: var(--blue); }
.sidebar-sublink.active { color: var(--blue); }

/* ─── BREADCRUMB ─── */
.st-breadcrumb { display: flex; align-items: center; gap: 8px; padding: 24px 48px 0; margin-bottom: 20px; font-size: 13px; color: var(--gray-300); flex-wrap: wrap; }
.st-breadcrumb a { color: var(--gray-500); text-decoration: none; transition: color .15s; }
.st-breadcrumb a:hover { color: var(--blue); }
.st-breadcrumb-sep { font-size: 11px; }
.st-breadcrumb-current { color: var(--gray-700); font-weight: 500; }

/* ─── CODE BLOCK ─── */
.code-block {
  background: var(--gray-900); border-radius: 10px;
  padding: 18px 20px; font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; line-height: 1.8;
}
.code-block pre { color: rgba(255,255,255,.72); }
.code-line { display: flex; gap: 12px; }
.code-kw      { color: #85e89d; font-weight: 600; }
.code-num     { color: rgba(255,255,255,.2); user-select: none; min-width: 18px; }
.code-comment { color: #5a8a6f; }
.code-key     { color: #79b8ff; }
.code-str     { color: #f97583; }
.code-tag     { color: #85e89d; }
.code-plain   { color: rgba(255,255,255,.75); }

/* ─── FOOTER ─── */
footer { background: var(--gray-900); border-top: 1px solid rgba(255,255,255,.07); padding: 36px 0 28px; }
.footer-logo { display: flex; align-items: center; gap: 14px; }
.footer-logo img { height: 34px; width: auto; }
.footer-sep { width: 1px; height: 20px; background: rgba(255,255,255,.15); }
.footer-site-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.35); }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.2); }
.footer-links a { font-size: 12px; color: rgba(255,255,255,.35); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: rgba(255,255,255,.75); }

/* ─── RESPONSIVE NAV & SIDEBAR ─── */
@media (max-width: 991.98px) {
  .sidebar-desktop { display: none !important; }
  .sidebar-toggle { display: none !important; }
  .st-breadcrumb { padding: 20px 24px 0; }
  .nav-menu-desktop { display: none !important; }
  .nav-toggler { display: flex !important; }
}
@media (min-width: 992px) {
  .nav-toggler { display: none !important; }
  .nav-menu-desktop { display: flex !important; }
}
