/* BroadSQL website & documentation - single stylesheet, no external CSS framework. */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-code: #f2f4f7;
  --border: #e3e6ea;
  --text: #1c2128;
  --text-muted: #5b6572;
  --link: #0b5fff;
  --link-hover: #0847c4;
  --accent: #0b5fff;
  --accent-bg: #eaf1ff;
  --header-bg: #ffffff;
  --sidebar-bg: #fafbfc;
  --badge-bg: #eef0f3;
  --badge-text: #444c56;
  --code-text: #b3261e;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.06);
  --max-width: 920px;
  --sidebar-width: 250px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code, pre, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

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

img, svg { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; scroll-margin-top: 84px; }
h1 { font-size: 2rem; margin: 0 0 .6em; }
h2 { font-size: 1.4rem; margin: 1.8em 0 .6em; padding-top: .2em; border-top: 1px solid var(--border); }
h2:first-child { border-top: none; padding-top: 0; }
h3 { font-size: 1.12rem; margin: 1.4em 0 .5em; }
h4 { font-size: 1rem; margin: 1.2em 0 .4em; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin: .25em 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- code ---------- */

code {
  background: var(--bg-code);
  color: var(--code-text);
  padding: .12em .38em;
  border-radius: 4px;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9em 1.1em;
  overflow-x: auto;
  margin: 0 0 1.2em;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* ---------- video embeds ---------- */

.video-embed { position: relative; aspect-ratio: 16 / 9; max-width: 853px; margin: 0 0 1.4em; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
table { border-collapse: collapse; width: 100%; font-size: .94em; }
th, td { text-align: left; padding: .5em .75em; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--bg-alt); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:hover { background: var(--bg-alt); }

/* ---------- layout shell ---------- */

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: .6em 1em; z-index: 100; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1.5rem; height: 60px;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.08rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  height: 20px;
  width: auto;
  display: block;
}
.top-nav { display: flex; gap: 1.35rem; margin-left: auto; }
.top-nav a { color: var(--text); font-size: .95rem; font-weight: 500; padding: .3em 0; }
.top-nav a:hover { color: var(--accent); text-decoration: none; }
.top-nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle { display: none; }

.btn {
  display: inline-block; padding: .55em 1.1em; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--link-hover); color: #fff; }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

main { display: block; }

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.breadcrumbs { font-size: .85rem; color: var(--text-muted); margin-bottom: 1.1rem; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }

.lede { font-size: 1.15rem; color: var(--text-muted); margin: 0 0 1.6em; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.site-footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 2rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between;
  color: var(--text-muted); font-size: .88rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- home / marketing ---------- */

.hero {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg) 70%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: 1180px; margin: 0 auto; padding: 4.5rem 1.25rem 3.5rem;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: .5rem; }
.hero .lede { font-size: 1.2rem; margin-bottom: 1.6rem; }
.hero-meta { font-size: .92rem; color: var(--text-muted); margin: -1rem 0 1.6rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-terminal {
  background: #10151d; color: #d7dde5; border-radius: 10px; padding: 1.2rem 1.3rem;
  font: .88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  box-shadow: 0 10px 30px rgba(16, 21, 29, .18);
  white-space: pre-wrap; word-break: break-word;
}
.hero-terminal .t-muted { color: #7d8896; }
.hero-terminal .t-cmd { color: #7ec4ff; }
.hero-terminal .t-ok { color: #7fe0a5; }

.section { max-width: 1180px; margin: 0 auto; padding: 3.2rem 1.25rem; }
.section-title { text-align: center; margin-bottom: .4rem; }
.section-lede { text-align: center; color: var(--text-muted); max-width: 640px; margin: 0 auto 2.4rem; }

.grid-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.feature-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem;
  background: var(--bg);
}
.feature-card h3 { margin-top: 0; font-size: 1.02rem; }
.feature-card p { color: var(--text-muted); margin-bottom: 0; font-size: .93rem; }
.feature-icon {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: .8rem; font-weight: 700;
}

.db-strip { text-align: center; color: var(--text-muted); font-size: .95rem; padding: 1.6rem 1.25rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.db-strip strong { color: var(--text); }

.cta-band { background: var(--accent); color: #fff; text-align: center; padding: 3rem 1.25rem; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); }
.cta-band .btn-primary { background: #fff; color: var(--accent); }
.cta-band .btn-primary:hover { background: #eef1f6; }

/* ---------- docs layout ---------- */

.docs-shell { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-width) 1fr; }
.docs-sidebar {
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  padding: 1.6rem 1.1rem 3rem;
  align-self: start; position: sticky; top: 61px;
  max-height: calc(100vh - 61px); overflow-y: auto;
}
.docs-sidebar h4 {
  text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: var(--text-muted);
  margin: 1.3rem 0 .4rem;
}
.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar li { margin: 0; }
.docs-sidebar a {
  display: block; padding: .32em .55em; border-radius: 5px; color: var(--text); font-size: .9rem;
}
.docs-sidebar a:hover { background: var(--accent-bg); color: var(--accent); text-decoration: none; }
.docs-sidebar a[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.docs-search { width: 100%; padding: .5em .7em; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; margin-bottom: .4rem; }

.docs-content { min-width: 0; padding: 2.4rem 2.4rem 5rem; }
.docs-content .page { max-width: 760px; margin: 0; padding: 0; }

.docs-toc {
  border: 1px solid var(--border); background: var(--bg-alt); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: 0 0 1.8rem; font-size: .9rem;
}
.docs-toc h2 { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border: none; padding: 0; }
.docs-toc ul { margin: 0; padding-left: 1.2em; }

.badge { display: inline-block; background: var(--badge-bg); color: var(--badge-text); font-size: .78rem; font-weight: 600; padding: .15em .55em; border-radius: 999px; }
.badge-group { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.4rem; }

.note {
  border-left: 3px solid var(--accent); background: var(--accent-bg);
  padding: .8em 1em; border-radius: 0 6px 6px 0; margin: 0 0 1.4em; font-size: .93rem;
}

.cmd-index-search { max-width: 420px; margin: 0 0 1.4rem; }
.cmd-table td:first-child, .cmd-table th:first-child { white-space: nowrap; }

.pager { display: flex; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: .9rem; }

.mobile-docs-toggle {
  display: none; width: 100%; text-align: left; padding: .7rem 1rem; background: var(--sidebar-bg);
  border: none; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; color: var(--text);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .grid-features { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; padding-top: 2.6rem; }
  .top-nav {
    position: absolute; top: 60px; left: 0; right: 0; background: var(--header-bg);
    border-bottom: 1px solid var(--border); flex-direction: column; padding: .6rem 1.25rem 1rem;
    gap: .2rem; display: none;
  }
  .top-nav.open { display: flex; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--border); background: none;
    font-size: 1.1rem; color: var(--text); cursor: pointer;
  }
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .docs-sidebar.open { display: block; }
  .mobile-docs-toggle { display: block; }
  .docs-content { padding: 1.6rem 1.25rem 3.5rem; }
}

@media (max-width: 560px) {
  .grid-features { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
}
