/* Bringo documentation — supplemental styles (Tailwind handles layout/utilities).
   Long-form content uses the .prose recipe so pages stay plain, readable HTML. */

:root {
  --brand: #0c831f;
  --brand-dark: #0a6b19;
  --brand-50: #eafaf0;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --code-bg: #0f172a;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Anchor offset so in-page links land below the sticky topbar */
:target { scroll-margin-top: 5rem; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
#docs-sidebar { scrollbar-width: thin; }
#docs-sidebar a.nav-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .38rem .6rem; margin: 1px 0; border-radius: .5rem;
  font-size: .875rem; color: var(--body); text-decoration: none; line-height: 1.3;
  border-left: 2px solid transparent;
}
#docs-sidebar a.nav-link:hover { background: var(--surface-2); color: var(--ink); }
#docs-sidebar a.nav-link.active {
  background: var(--brand-50); color: var(--brand-dark);
  font-weight: 600; border-left-color: var(--brand);
}
#docs-sidebar .nav-badge {
  margin-left: auto; font-size: .6rem; font-weight: 700; letter-spacing: .02em;
  padding: .05rem .35rem; border-radius: 999px; text-transform: uppercase;
}
.nav-group-title {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: .25rem .6rem; margin-top: 1rem; user-select: none;
}

/* ── Prose: the content typography recipe ──────────────────────────────── */
.prose { color: var(--body); font-size: .975rem; line-height: 1.7; max-width: 52rem; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 2rem; line-height: 1.2; font-weight: 800; color: var(--ink); margin: 0 0 .5rem; letter-spacing: -.02em; }
.prose h2 { font-size: 1.4rem; font-weight: 700; color: var(--ink); margin: 2.4rem 0 .9rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); letter-spacing: -.01em; }
.prose h3 { font-size: 1.12rem; font-weight: 700; color: var(--ink); margin: 1.8rem 0 .6rem; }
.prose h4 { font-size: 1rem; font-weight: 700; color: var(--ink); margin: 1.3rem 0 .4rem; }
.prose p { margin: .8rem 0; }
.prose ul, .prose ol { margin: .8rem 0; padding-left: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose a { color: var(--brand-dark); text-decoration: none; font-weight: 500; border-bottom: 1px solid rgba(12,131,31,.25); }
.prose a:hover { border-bottom-color: var(--brand); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose blockquote { margin: 1rem 0; padding: .2rem 1rem; border-left: 3px solid var(--border-strong); color: var(--muted); }
.prose kbd { font-family: ui-monospace, monospace; font-size: .8em; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; }

/* Inline + block code */
.prose :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em;
  background: #f1f5f9; color: #be123c; padding: .12rem .38rem; border-radius: 5px;
  border: 1px solid #e2e8f0; word-break: break-word;
}
.prose pre {
  position: relative; background: var(--code-bg); color: #e2e8f0;
  border-radius: 10px; padding: 1rem 1.1rem; margin: 1rem 0; overflow-x: auto;
  font-size: .82rem; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.copy-btn {
  position: absolute; top: .5rem; right: .5rem; font-size: .68rem; font-weight: 600;
  color: #cbd5e1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px; padding: .15rem .5rem; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.prose pre:hover .copy-btn { opacity: 1; }
.copy-btn.copied { color: #4ade80; background: rgba(74,222,128,.15); }

/* Tables */
.prose table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: .88rem; display: block; overflow-x: auto; }
.prose thead { background: var(--surface-2); }
.prose th, .prose td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.prose th { font-weight: 650; color: var(--ink); white-space: nowrap; }

/* ── Callouts ──────────────────────────────────────────────────────────── */
.callout { display: flex; gap: .75rem; margin: 1.2rem 0; padding: .9rem 1rem; border-radius: 10px; border: 1px solid; font-size: .9rem; }
.callout .ico { flex: none; font-size: 1.05rem; line-height: 1.4; }
.callout p { margin: .2rem 0; }
.callout > div { min-width: 0; }
.callout-note { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
.callout-tip { background: #ecfdf5; border-color: #bbf7d0; color: #14532d; }
.callout-warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.callout-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.callout-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.callout strong { color: inherit; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .02em; padding: .12rem .5rem; border-radius: 999px; text-transform: uppercase; vertical-align: middle; }
.badge-fix { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-admin { background: var(--brand-50); color: var(--brand-dark); border: 1px solid #bbf7d0; }
.badge-build { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.badge-android { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-ios { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }
.badge-optional { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

/* ── Step list (numbered cards) ────────────────────────────────────────── */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.2rem 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.2rem 2.6rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem;
  background: var(--brand); color: #fff; border-radius: 999px; display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: .82rem; top: 1.9rem; bottom: 0; width: 2px; background: var(--border); }
.steps > li > strong:first-child { display: block; color: var(--ink); margin-bottom: .15rem; }

/* ── Screenshot placeholder ────────────────────────────────────────────── */
.shot { margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.shot img { display: block; max-width: 100%; height: auto; }
.shot figcaption { padding: .6rem .9rem; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--border); background: var(--surface-2); }
.shot.missing { border: 2px dashed var(--border-strong); border-radius: 12px;
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 12px, #f4f4f5 12px, #f4f4f5 24px); }
.shot.missing img { display: none; }
.shot.missing figcaption { border-top: 0; background: transparent; text-align: center; padding: 1.6rem 1rem; color: #6b7280; }
.shot.missing figcaption::before { content: "📷  Screenshot placeholder — "; font-weight: 700; color: #475569; }

/* ── Definition grid (key/value reference rows) ────────────────────────── */
.kv { margin: 1.1rem 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.kv > div { display: grid; grid-template-columns: 13rem 1fr; gap: 0; border-top: 1px solid var(--border); }
.kv > div:first-child { border-top: 0; }
.kv dt { background: var(--surface-2); padding: .55rem .8rem; font-weight: 600; color: var(--ink); font-size: .85rem; }
.kv dd { padding: .55rem .8rem; margin: 0; font-size: .88rem; }
@media (max-width: 640px){ .kv > div { grid-template-columns: 1fr; } .kv dt { border-bottom: 1px solid var(--border); } }

/* ── Cards (landing page) ──────────────────────────────────────────────── */
.card-link { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(15,23,42,.18); border-color: var(--border-strong); }

/* Prev / next footer */
.pagenav a { transition: border-color .12s, background .12s; }
.pagenav a:hover { border-color: var(--brand); background: var(--surface-2); }

/* Print */
@media print {
  #docs-topbar, #docs-sidebar, #docs-pagenav, .copy-btn { display: none !important; }
  main { max-width: none !important; }
}
