/* ── Badgr Docs — Shared Stylesheet ─────────────────────────────────────────── */
/* Brand identity matches badgr.be/index.html exactly                            */

/* ── Variables (same as landing) ────────────────────────────────────────────── */
:root {
  --navy:    #1E3A5F;
  --blue:    #1D4ED8;
  --amber:   #F59E0B;
  --amber-d: #D97706;
  --text:    #374151;
  --muted:   #6B7280;
  --border:  rgba(30,58,95,.09);
  --bg:      #f8f9fb;
  --white:   #fff;
  --r:       16px;

  /* Docs-specific */
  --code-bg:   #18181b;
  --sidebar-w: 268px;
  --toc-w:     220px;
  --topbar-h:  60px;   /* matches landing navbar height */
  --radius:    8px;
}

/* ── Reset & base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img  { max-width: 100%; }
a    { text-decoration: none; color: inherit; }
button, input, textarea, select { font-family: inherit; }
em.s { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; }

/* ════════════════════════════════════════════════════════════════════════════════
   NAVBAR  (exact copy of landing navbar CSS)
════════════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease;
}
.navbar.scrolled { background: rgba(255,255,255,.97); }

.nav-inner {
  display: flex; align-items: center; gap: 32px;
  max-width: 1120px; margin: 0 auto; padding: 0 28px; height: 60px;
}
.nav-logo         { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.nav-logo-mark    { width: 30px; height: 30px; border-radius: 8px; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.28); display: flex; align-items: center; justify-content: center; }
.nav-logo-text    { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.04em; }
.nav-links        { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav-links a      { font-size: 14px; font-weight: 500; color: var(--muted); padding: 6px 12px; border-radius: 8px; transition: color .15s, background .15s; }
.nav-links a:hover  { color: var(--navy); background: rgba(30,58,95,.05); }
.nav-links a.active { color: var(--navy); background: rgba(30,58,95,.06); font-weight: 600; }
.nav-actions      { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-login        { font-size: 14px; font-weight: 500; color: var(--navy); padding: 7px 14px; border-radius: 8px; transition: background .15s; }
.nav-login:hover  { background: rgba(30,58,95,.06); }
.nav-cta          { font-size: 14px; font-weight: 600; color: #fff; background: var(--amber); padding: 8px 18px; border-radius: 99px; transition: opacity .15s, transform .1s; box-shadow: 0 2px 8px rgba(245,158,11,.35); }
.nav-cta:hover    { opacity: .88; transform: translateY(-1px); }

/* Docs-specific burger (mobile only — sidebar toggle on docs pages) */
.docs-burger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--navy); padding: 4px 8px; border-radius: 8px;
  line-height: 1; font-size: 22px;
  transition: background .15s; margin-left: auto;
  align-items: center;
}
.docs-burger:hover { background: rgba(30,58,95,.06); }

/* Nav hamburger — injected by nav.js on blog pages (no docs sidebar there) */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--navy); padding: 4px 8px; border-radius: 8px;
  line-height: 1; font-size: 22px; margin-left: auto;
  transition: background .15s; align-items: center;
}
.nav-hamburger:hover { background: rgba(30,58,95,.06); }

.nav-mobile-menu {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(30,58,95,.1);
  padding: 12px 20px 16px; flex-direction: column; gap: 4px; z-index: 200;
}
.nav-mobile-menu.open { display: flex; animation: navMenuOpen .2s ease; }
@keyframes navMenuOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-mobile-menu a {
  font-size: 15px; font-weight: 500; color: var(--navy);
  padding: 10px 12px; border-radius: 8px; transition: background .15s;
  text-decoration: none;
}
.nav-mobile-menu a.active { font-weight: 600; }
.nav-mobile-menu a:hover { background: rgba(30,58,95,.05); }
.nav-mobile-menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.nav-mobile-menu .mob-cta {
  text-align: center; background: var(--amber); color: #fff !important;
  padding: 12px; margin-top: 4px; border-radius: 10px; font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════════════
   FOOTER  (exact copy of landing footer CSS)
════════════════════════════════════════════════════════════════════════════════ */
.footer { background: #111827; padding: 64px 0 0; color: rgba(255,255,255,.6); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.07); }
.footer-brand .nav-logo-text { color: #fff; font-size: 18px; }
.footer-tagline    { font-size: 13px; margin-top: 10px; line-height: 1.6; max-width: 240px; }
.footer-made       { font-size: 13px; margin-top: 14px; color: rgba(255,255,255,.4); }
.footer-legal-id   { font-size: 11px; color: rgba(255,255,255,.25); margin-top: 4px; }
.footer-col h4     { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 16px; letter-spacing: -.01em; }
.footer-col ul     { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a      { font-size: 13px; color: rgba(255,255,255,.5); transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom     { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px 0; font-size: 12px; color: rgba(255,255,255,.3); }
.footer-badges     { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-badge      { font-size: 11px; font-weight: 500; color: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.1); padding: 3px 10px; border-radius: 99px; }

/* ════════════════════════════════════════════════════════════════════════════════
   DOCS LAYOUT SHELL
════════════════════════════════════════════════════════════════════════════════ */
.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.docs-sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid var(--border);
  background: var(--white);
  padding: 24px 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.docs-sidebar-section  { margin-bottom: 4px; }
.docs-sidebar-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 20px 4px;
}
.docs-sidebar-nav      { list-style: none; }
.docs-sidebar-nav li a {
  display: flex; align-items: center;
  padding: 8px 20px; font-size: 13.5px; color: #4b5563;
  border-left: 2px solid transparent;
  transition: all .12s; line-height: 1.4;
}
.docs-sidebar-nav li a:hover  { color: var(--navy); background: rgba(30,58,95,.04); }
.docs-sidebar-nav li.active a {
  color: var(--navy); font-weight: 600;
  border-left-color: var(--amber);
  background: rgba(245,158,11,.06);
}

/* Mobile sidebar footer links */
.docs-sidebar-mobile-footer {
  display: none;
  flex-direction: column; gap: 8px;
  margin-top: 24px; padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.docs-sidebar-mobile-footer a { font-size: 13.5px; color: var(--navy); font-weight: 500; padding: 8px 0; }
.docs-sidebar-mobile-footer .docs-sidebar-cta {
  display: block; text-align: center;
  background: var(--amber); color: #fff !important;
  padding: 10px 16px; border-radius: 99px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}

.docs-sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 89;
  background: rgba(0,0,0,.3); backdrop-filter: blur(2px);
}
.docs-sidebar-backdrop.open { display: block; }

/* ── Main Content ────────────────────────────────────────────────────────────── */
.docs-main {
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 760px;
}

/* Typography */
.docs-main h1 {
  font-size: 2rem; font-weight: 700; color: var(--navy);
  letter-spacing: -.03em; line-height: 1.25; margin-bottom: 12px;
}
.docs-main h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--navy);
  letter-spacing: -.02em; margin: 40px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.docs-main h2:first-of-type { margin-top: 24px; }
.docs-main h3 {
  font-size: 1.05rem; font-weight: 600; color: var(--navy);
  margin: 24px 0 8px;
}
.docs-main p        { margin-bottom: 14px; font-size: 15.5px; color: var(--text); }
.docs-main ul,
.docs-main ol       { padding-left: 22px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.docs-main li       { font-size: 15px; color: var(--text); }
.docs-main strong   { font-weight: 600; color: var(--navy); }
.docs-main a        { color: var(--blue); }
.docs-main a:hover  { text-decoration: underline; }

/* Page lead */
.docs-lead {
  font-size: 17px; color: var(--muted); line-height: 1.75;
  margin-bottom: 32px; border-bottom: 1px solid var(--border); padding-bottom: 28px;
}

/* Breadcrumb */
.docs-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.docs-breadcrumb a      { color: var(--muted); }
.docs-breadcrumb a:hover { color: var(--navy); }

/* ── Inline code ─────────────────────────────────────────────────────────────── */
.docs-main code,
.docs-main :not(pre) > code {
  font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: .875em;
  background: rgba(30,58,95,.07); color: var(--navy);
  padding: 2px 6px; border-radius: 4px; word-break: break-all;
}

/* ── Code blocks ─────────────────────────────────────────────────────────────── */
.docs-code-block {
  position: relative; margin: 20px 0; border-radius: var(--radius);
  background: var(--code-bg); overflow: hidden;
}
.docs-code-block pre {
  padding: 18px 20px; overflow-x: auto;
  font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.65; color: #e4e4e7;
}
.docs-code-block .code-lang {
  position: absolute; top: 0; left: 0;
  font-family: ui-monospace, monospace;
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  color: #71717a; text-transform: uppercase; padding: 5px 12px;
}
.docs-copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: #a1a1aa; font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 5px; cursor: pointer;
  transition: all .15s; opacity: 0;
}
.docs-code-block:hover .docs-copy-btn { opacity: 1; }
.docs-copy-btn:hover  { background: rgba(255,255,255,.15); color: #fff; }
.docs-copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,.3); }

/* ── Callouts ────────────────────────────────────────────────────────────────── */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius);
  border-left: 4px solid; margin: 24px 0;
  font-size: 14.5px; line-height: 1.6;
}
.callout p      { margin: 0; font-size: 14.5px; }
.callout strong { display: block; margin-bottom: 2px; font-size: 13.5px; }
.callout a      { text-decoration: underline; }
.callout-info    { background: #eff6ff; border-color: var(--blue);   color: #1e3a8a; }
.callout-warning { background: #fffbeb; border-color: var(--amber);  color: #78350f; }
.callout-success { background: #f0fdf4; border-color: #22c55e;       color: #14532d; }
.callout-danger  { background: #fef2f2; border-color: #ef4444;       color: #7f1d1d; }

/* ── Steps ───────────────────────────────────────────────────────────────────── */
.docs-steps      { display: flex; flex-direction: column; gap: 0; margin: 24px 0; }
.docs-step       { display: flex; gap: 20px; position: relative; padding-bottom: 28px; }
.docs-step:last-child { padding-bottom: 0; }
.docs-step-num-col   { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.docs-step-circle    { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.docs-step-line      { width: 2px; flex: 1; background: var(--border); margin-top: 4px; min-height: 24px; }
.docs-step:last-child .docs-step-line { display: none; }
.docs-step-body      { flex: 1; padding-top: 6px; }
.docs-step-title     { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 8px; line-height: 1.4; }
.docs-step-body p    { font-size: 14.5px; margin-bottom: 8px; }
.docs-step-body ul   { margin-bottom: 8px; }
.docs-step-body li   { font-size: 14.5px; }

/* ── Config table ────────────────────────────────────────────────────────────── */
.docs-config-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; margin: 16px 0 24px; }
.docs-config-table      { width: 100%; border-collapse: collapse; font-size: 14px; }
.docs-config-table th   { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px; background: rgba(30,58,95,.04); border-bottom: 1px solid var(--border); }
.docs-config-table td   { padding: 10px 12px; border-bottom: 1px solid rgba(30,58,95,.05); vertical-align: top; }
.docs-config-table tr:last-child td { border-bottom: none; }
.docs-config-table td:first-child   { font-weight: 600; color: var(--navy); white-space: nowrap; }
.docs-config-table td code { word-break: break-all; }

/* ── See-also box ────────────────────────────────────────────────────────────── */
.docs-see-also {
  background: rgba(30,58,95,.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 32px; font-size: 14px;
}
.docs-see-also-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.docs-see-also ul    { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.docs-see-also li a  { color: var(--blue); font-weight: 500; }
.docs-see-also li a:hover { text-decoration: underline; }

/* ── CTA footer buttons ──────────────────────────────────────────────────────── */
.docs-cta-footer {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border);
}
.docs-cta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: 99px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .15s;
}
.docs-cta-btn.primary   { background: var(--amber); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,.35); }
.docs-cta-btn.primary:hover  { opacity: .88; transform: translateY(-1px); }
.docs-cta-btn.secondary { border: 1.5px solid rgba(30,58,95,.2); color: var(--navy); }
.docs-cta-btn.secondary:hover { border-color: var(--navy); background: rgba(30,58,95,.04); }

/* ── Contact support form ────────────────────────────────────────────────────── */
.docs-contact-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); padding: 36px 40px;
  margin-top: 40px;
  box-shadow: 0 4px 24px rgba(30,58,95,.06);
}
.docs-contact-card h2 {
  font-size: 1.3rem; font-weight: 700; color: var(--navy);
  letter-spacing: -.02em; margin: 0 0 8px !important;
  border: none !important; padding: 0 !important;
}
.docs-contact-card > p {
  font-size: 15px; color: var(--muted); margin-bottom: 28px;
}
.docs-contact-form    { display: flex; flex-direction: column; gap: 16px; }
.docs-field           { display: flex; flex-direction: column; gap: 6px; }
.docs-field label     { font-size: 12.5px; font-weight: 600; color: var(--navy); letter-spacing: -.01em; }
.docs-field input,
.docs-field textarea  {
  width: 100%; padding: 11px 14px;
  border: 1px solid rgba(30,58,95,.15);
  border-radius: 9px; font-size: 14px; color: var(--navy);
  background: #fcfcfc; outline: none; transition: border-color .15s;
}
.docs-field input:focus,
.docs-field textarea:focus  { border-color: var(--navy); background: #fff; }
.docs-field textarea        { resize: vertical; min-height: 110px; line-height: 1.55; }
.docs-contact-submit {
  align-self: flex-start; padding: 12px 28px;
  background: var(--amber); color: #fff;
  border: none; border-radius: 99px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
  transition: opacity .15s, transform .1s;
}
.docs-contact-submit:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.docs-contact-submit:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.docs-contact-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0 !important; }

/* ── TOC (right column) ──────────────────────────────────────────────────────── */
.docs-toc {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overflow-x: hidden;
  padding: 32px 20px 32px 16px;
  border-left: 1px solid var(--border);
  background: var(--white);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.docs-toc-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.docs-toc-list  { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.docs-toc-item a {
  font-size: 12.5px; color: var(--muted); display: block;
  padding: 4px 0 4px 10px; border-left: 2px solid transparent;
  transition: all .12s; line-height: 1.4;
}
.docs-toc-item a:hover       { color: var(--navy); }
.docs-toc-item.active a      { color: var(--navy); font-weight: 600; border-left-color: var(--amber); }
.docs-toc-item.sub a         { padding-left: 20px; font-size: 12px; }

/* ════════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .docs-shell { grid-template-columns: var(--sidebar-w) 1fr; }
  .docs-toc   { display: none; }
  .docs-main  { padding: 32px 36px 60px; }
}

@media (max-width: 768px) {
  /* Navbar: hide desktop links; show docs-burger on docs pages, nav-hamburger on blog pages */
  .nav-links, .nav-actions { display: none; }
  .docs-burger              { display: inline-flex; }
  .nav-hamburger            { display: inline-flex; }

  /* Docs shell single column */
  .docs-shell { grid-template-columns: 1fr; }

  /* Sidebar: fixed slide-in panel */
  .docs-sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0;
    width: var(--sidebar-w); z-index: 90;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.08);
  }
  .docs-sidebar.open            { transform: translateX(0); }
  .docs-sidebar-mobile-footer   { display: flex; }

  /* Main */
  .docs-main { padding: 24px 20px 60px; }

  /* Components */
  .docs-cta-footer  { flex-direction: column; }
  .docs-see-also    { flex-direction: column; gap: 8px; }
  .docs-contact-card { padding: 24px 20px; }
  .docs-contact-submit { width: 100%; align-self: stretch; text-align: center; }
}

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { gap: 24px; }
}
