/* portcullis documentation theme.
   A branded layer over mdBook's navy theme: amber-on-slate palette, modern
   typography, styled callouts/tables/code, and a hero. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --pc-amber: #f59e0b;
  --pc-amber-2: #fcd34d;
  --pc-slate-950: #0b1220;
  --pc-slate-900: #101b2e;
  --pc-slate-800: #1e293b;
  --pc-ink: #e2e8f0;
  --pc-muted: #94a3b8;
  --pc-radius: 12px;
}

/* ---- Palette overrides for the navy theme ---------------------------------- */
.navy {
  --bg: var(--pc-slate-950);
  --fg: #e6edf6;
  --sidebar-bg: #0a101c;
  --sidebar-fg: #b9c4d4;
  --sidebar-active: var(--pc-amber);
  --sidebar-non-existant: #52606d;
  --links: var(--pc-amber-2);
  --inline-code-color: #fcd34d;
  --theme-popup-bg: #0e1626;
  --theme-popup-border: #24324a;
  --scrollbar: #33415a;
  --table-border-color: #24324a;
  --table-header-bg: rgba(245, 158, 11, 0.14);
  --table-alternate-bg: rgba(148, 163, 184, 0.04);
  --quote-bg: rgba(245, 158, 11, 0.07);
  --quote-border: var(--pc-amber);
}

/* ---- Typography ------------------------------------------------------------ */
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
}
.content {
  line-height: 1.72;
  font-size: 1.02rem;
}
.content h1, .content h2, .content h3, .content h4 {
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.2;
}
.content h1 { font-size: 2.3rem; margin-top: 0.2em; }
.content h2 {
  font-size: 1.6rem;
  margin-top: 2.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}
.content h3 { font-size: 1.25rem; margin-top: 1.8rem; color: #f1f5f9; }
.content a { text-decoration: none; }
.content a:hover { text-decoration: underline; text-underline-offset: 3px; }
.content strong { color: #f4f7fb; font-weight: 600; }

/* ---- Code ------------------------------------------------------------------ */
code, pre, kbd {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
:not(pre) > code {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}
pre {
  border-radius: var(--pc-radius);
  border: 1px solid #24324a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
pre > code { padding: 1rem 1.15rem !important; }
pre:has(code) { position: relative; }

/* ---- Blockquotes as callouts ---------------------------------------------- */
.content blockquote {
  border-left: 4px solid var(--pc-amber);
  background: rgba(245, 158, 11, 0.07);
  border-radius: 0 var(--pc-radius) var(--pc-radius) 0;
  padding: 0.9rem 1.15rem;
  color: #dbe4f0;
  margin: 1.4rem 0;
}
.content blockquote p { margin: 0.3em 0; }

/* ---- Tables ---------------------------------------------------------------- */
.content table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #24324a;
  border-radius: var(--pc-radius);
  overflow: hidden;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.content table thead th {
  background: rgba(245, 158, 11, 0.13);
  color: #fde9c8;
  font-weight: 600;
  border: none;
  padding: 0.7rem 0.9rem;
}
.content table td { border: none; border-top: 1px solid #1c2739; padding: 0.6rem 0.9rem; }
.content table tbody tr:hover td { background: rgba(245, 158, 11, 0.05); }

/* ---- Sidebar --------------------------------------------------------------- */
.sidebar { border-right: 1px solid #16202f; }
.chapter li.chapter-item {
  line-height: 1.5;
  margin-top: 0.3em;
  font-size: 0.92rem;
}
.chapter li.chapter-item a.active {
  color: var(--pc-amber);
  font-weight: 600;
}
.sidebar .sidebar-scrollbox { padding: 1rem 0.9rem; }
/* Section headers (part-title) as amber, small-caps */
.chapter .part-title {
  color: var(--pc-amber-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 1.3rem;
}

/* ---- Top menu bar ---------------------------------------------------------- */
.menu-title { font-weight: 700; letter-spacing: -0.01em; }
#menu-bar { border-bottom: 1px solid #16202f; backdrop-filter: blur(8px); }

/* ---- Hero (intro page) ----------------------------------------------------- */
.pc-hero {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0.5rem auto 2rem;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

/* ---- Diagrams -------------------------------------------------------------- */
.pc-figure { margin: 1.8rem 0; text-align: center; }
.pc-figure img {
  width: 100%;
  max-width: 820px;
  border-radius: var(--pc-radius);
  border: 1px solid #24324a;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
}
.pc-figure figcaption {
  color: var(--pc-muted);
  font-size: 0.86rem;
  margin-top: 0.6rem;
}

/* ---- Feature pills / lead paragraph --------------------------------------- */
.content > p:first-of-type { font-size: 1.06rem; color: #cdd8e6; }

/* Wider content column for a modern feel */
.content main { max-width: 820px; }
