/* Minehut MCP docs - product docs style */
:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --bg-code: #0f172a;
  --border: #e4e7ec;
  --text: #1a2233;
  --text-secondary: #5b6472;
  --text-faint: #8a93a5;
  --accent: #4f5bd5;
  --accent-soft: rgba(79, 91, 213, 0.08);
  --link: #4f5bd5;
  --code-text: #e6e8f2;
  --code-dim: #8b93a7;
  --callout-bg: #ffffff;
  --toc-bg: transparent;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

html[data-theme="dark"] {
  --bg: #0e1116;
  --bg-subtle: #141922;
  --bg-code: #0b0e14;
  --border: #242b38;
  --text: #dbe1ea;
  --text-secondary: #9aa3b2;
  --text-faint: #6b7484;
  --accent: #8b93ee;
  --accent-soft: rgba(139, 147, 238, 0.1);
  --link: #a5abf2;
  --code-text: #e2e6f0;
  --code-dim: #79819a;
  --callout-bg: #141922;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- top header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.version {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--bg-subtle);
}

.header-spacer { flex: 1; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }

.header-link { font-size: 13.5px; color: var(--text-secondary); }
.header-link:hover { color: var(--text); text-decoration: none; }

/* ---- 3 column layout ---- */
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 190px;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 32px 0;
}

/* sidebar */
.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.side-group { margin-bottom: 22px; }
.side-label {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  padding: 0 10px 6px;
}
.side-link {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 4.5px 10px;
  border-radius: 6px;
  line-height: 1.4;
}
.side-link:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.side-link.active { color: var(--accent); font-weight: 600; background: var(--accent-soft); }

/* content */
.content { min-width: 0; }

.breadcrumb { font-size: 12.5px; color: var(--text-faint); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--link); }

h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 14px;
}
h1 + p, .lead { font-size: 16.5px; color: var(--text-secondary); margin-bottom: 26px; }

h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
  padding-top: 0;
  scroll-margin-top: 76px;
}
h3 {
  font-size: 16.5px;
  font-weight: 650;
  margin: 28px 0 9px;
  scroll-margin-top: 76px;
}
h2 .anchor, h3 .anchor { opacity: 0; margin-left: 6px; font-weight: 400; color: var(--text-faint); }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.h2-logo { display: inline-flex; align-items: center; gap: 10px; }
.h2-logo svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }

p { margin: 12px 0; }
ul, ol { margin: 12px 0 12px 24px; }
li { margin: 4px 0; }
li::marker { color: var(--text-faint); }

strong { font-weight: 600; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 5px;
  color: var(--text);
}

pre {
  position: relative;
  background: var(--bg-code);
  border-radius: 9px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
pre code {
  display: block;
  padding: 16px 18px 18px;
  background: none;
  border: none;
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--code-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
pre:hover .code-copy { opacity: 1; }
.code-copy:hover { color: #fff; }
.code-copy.copied { color: #7ee2a3; border-color: rgba(126, 226, 163, 0.4); }

/* tables */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td code { white-space: nowrap; }

/* callouts */
.callout {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-left-color: var(--accent);
  background: var(--callout-bg);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 20px 0;
  font-size: 14px;
}
.callout strong { color: var(--text); }
.callout.warn { border-left-color: #d9801a; }
.callout.danger { border-left-color: #d33a48; }
.callout.ok { border-left-color: #1f9d57; }

/* prev / next */
.doc-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.doc-nav a {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-nav a:hover { color: var(--link); text-decoration: none; }
.doc-nav a .nav-label { font-size: 11.5px; color: var(--text-faint); }
.doc-nav a .nav-title { font-weight: 600; color: var(--text); }
.doc-nav a:hover .nav-title { color: var(--link); }
.doc-nav .next { text-align: right; margin-left: auto; }

/* right toc */
.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.toc-label {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.toc a {
  display: block;
  font-size: 12.8px;
  color: var(--text-secondary);
  padding: 3px 0 3px 10px;
  border-left: 2px solid transparent;
  line-height: 1.45;
}
.toc a:hover { color: var(--link); text-decoration: none; border-left-color: var(--border); }
.toc a.toc-sub { padding-left: 22px; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc .toc-empty { font-size: 12.8px; color: var(--text-faint); }

footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 32px;
  color: var(--text-faint);
  font-size: 13px;
}

@media (max-width: 1020px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 20px 18px 0; }
  .sidebar { position: static; max-height: none; }
  .side-label { display: none; }
  .site-header-inner { padding: 0 18px; }
  .header-link { display: none; }
  h1 { font-size: 25px; }
  .doc-nav { flex-direction: column; }
  .doc-nav .next { text-align: left; margin-left: 0; }
}