/* ====================================================================
   Variables
   ==================================================================== */
:root {
  --sidebar-w:      268px;
  --sidebar-bg:     #0d1b2e;
  --sidebar-border: #1a2f4a;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  #1a2f4a;
  --sidebar-active: #ff8315;
  --brand-color:    #ff8315;

  --bg:          #f8fafc;
  --surface:     #f1f5f9;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --link:        #01579b;
  --link-hover:  #013f75;

  --code-bg:     #1e1e2e;
  --code-text:   #cdd6f4;

  --get:         #16a34a;
  --post:        #2563eb;
  --put:         #d97706;
  --delete:      #dc2626;

  --required-bg: #fff1f2;
  --required-text: #be123c;
  --optional-bg: #f1f5f9;
  --optional-text: #475569;

  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

/* ====================================================================
   Reset & base
   ==================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* ====================================================================
   Layout
   ==================================================================== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ====================================================================
   Sidebar
   ==================================================================== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-border) transparent;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 24px 20px 8px;
}

.sidebar-brand svg { flex-shrink: 0; color: var(--brand-color); }
.sidebar-logo { height: 32px; width: auto; filter: brightness(0) invert(1); }

.sidebar-version {
  padding: 2px 20px 16px;
  font-size: .72rem;
  color: var(--sidebar-text);
  opacity: .6;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
  letter-spacing: .03em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 400;
  transition: background .18s ease, color .18s ease;
  text-decoration: none;
}

.sidebar-nav a:hover { background: var(--sidebar-hover); color: #cbd5e1; }
.sidebar-nav a.active {
  background: rgba(255,131,21,.1);
  color: var(--sidebar-active);
  font-weight: 600;
  border-left: 2px solid var(--sidebar-active);
  padding-left: 10px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  opacity: .5;
  font-size: .72rem;
}

/* ====================================================================
   Main content
   ==================================================================== */
.main {
  flex: 1;
  overflow: auto;
  min-width: 0;
}

.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px 96px;
}

/* ====================================================================
   Page header
   ==================================================================== */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -.02em;
}

.page-desc {
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.home .page-header { padding-bottom: 28px; }

/* ====================================================================
   Typography
   ==================================================================== */
.page-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.page-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}

.page-body p { margin: 0 0 14px; }

.page-body ul, .page-body ol {
  margin: 0 0 14px 24px;
}

.page-body li { margin-bottom: 4px; }

.page-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ====================================================================
   Inline code & code blocks
   ==================================================================== */
.page-body code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .83em;
  color: #be185d;
  font-weight: 500;
}

.page-body pre {
  margin: 0 0 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.page-body pre code {
  display: block;
  background: var(--code-bg);
  color: var(--code-text);
  border: none;
  border-radius: var(--radius);
  padding: 18px 22px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: .84rem;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 2;
  color: inherit;
}

/* Hugo syntax highlighting (dracula) overrides */
.page-body .highlight {
  border-radius: var(--radius);
  margin: 0 0 16px;
  overflow: hidden;
}
.page-body .highlight pre {
  margin: 0;
  border-radius: 0;
}
.page-body .highlight code {
  border-radius: 0;
}

/* ====================================================================
   Tables
   ==================================================================== */
.page-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: .875rem;
}

.page-body th {
  background: var(--surface);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.page-body td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.page-body tr:nth-child(even) td { background: var(--surface); }

/* ====================================================================
   HTTP method + endpoint display
   ==================================================================== */
.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 24px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: .875rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.method {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
}

.method-get    { background: #dcfce7; color: var(--get);    border: 1px solid #86efac; }
.method-post   { background: #dbeafe; color: var(--post);   border: 1px solid #93c5fd; }
.method-put    { background: #fef3c7; color: var(--put);    border: 1px solid #fcd34d; }
.method-delete { background: #fee2e2; color: var(--delete); border: 1px solid #fca5a5; }

.endpoint-url { color: var(--text); word-break: break-all; }

/* ====================================================================
   Badges (required / optional / stub)
   ==================================================================== */
.badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 1px 6px;
  border-radius: 3px;
}

.badge-required { background: var(--required-bg); color: var(--required-text); border: 1px solid #fed7d7; }
.badge-optional { background: var(--optional-bg); color: var(--optional-text); border: 1px solid #e2e8f0; }
.badge-stub     { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ====================================================================
   Callout / notice boxes
   ==================================================================== */
.callout {
  border-left: 4px solid;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: .9rem;
}

.callout-info    { border-color: var(--post); background: #e8f0fe; }
.callout-warning { border-color: #f59e0b;    background: #fffbeb; }
.callout-success { border-color: var(--get);  background: #e6f4ea; }

.callout strong { display: block; margin-bottom: 4px; }

/* Quick-start steps on home page */
.steps { counter-reset: step; list-style: none; margin: 0 0 20px; padding: 0; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--link);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ====================================================================
   Mobile header (hamburger)
   ==================================================================== */
.mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--sidebar-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--sidebar-border);
}

.mobile-title { color: #fff; font-weight: 600; font-size: .95rem; }

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sidebar-text);
  border-radius: 2px;
  transition: .2s;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ====================================================================
   Responsive
   ==================================================================== */
@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .layout { display: block; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s ease;
    height: 100vh;
  }

  .nav-open .sidebar    { transform: translateX(0); }
  .nav-open .overlay    { display: block; }

  .main { min-height: 100vh; }
  .content { padding: 24px 16px 60px; }

  .endpoint { flex-direction: column; align-items: flex-start; gap: 8px; }
}
