/* =====================================================================
   doc.css — Shared stylesheet for all NFLTR docs pages
   Eliminates the duplicate inline <style> block in every docs HTML file.
   ===================================================================== */

/* ── Design tokens ── */
:root {
  --bg:              #0d1117;
  --surface:         #161b22;
  --surface-alt:     #1c2128;
  --surface-elevated:#21262d;
  --border-subtle:   #21262d;
  --border:          #30363d;
  --text-heading:    #f0f6fc;
  --text:            #c9d1d9;
  --text-secondary:  #e6edf3;
  --text-muted:      #8b949e;
  --text-dim:        #484f58;
  --blue:            #58a6ff;
  --blue-bg:         #388bfd;
  --green:           #3fb950;
  --green-bg:        #238636;
  --red:             #f85149;
  --yellow:          #d29922;
  --orange:          #f0883e;
  --cyan:            #00acd7;
  --pink:            #ff7b72;
  --radius-sm:       6px;
  --radius-md:       8px;
  --radius-lg:       10px;
  --radius-xl:       12px;
  --radius-pill:     20px;
}

/* ── Reset ── */
*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Base typography ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text-heading); font-weight: 600; }
h1 { font-size: 2rem; margin-bottom: 1rem; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border-subtle); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 .6rem; color: var(--text-secondary); }
h4 { font-size: 1rem; margin: 1.25rem 0 .5rem; color: var(--text); }

p { margin: .75rem 0; }
ul, ol { padding-left: 1.5rem; margin: .75rem 0; }
li { margin: .3rem 0; }
hr { border: none; border-top: 1px solid var(--border-subtle); margin: 2rem 0; }

blockquote {
  border-left: 3px solid var(--blue-bg);
  padding: .5rem 1rem;
  margin: 1rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}

strong { color: var(--text-heading); font-weight: 600; }

/* ── Code ── */
code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .875em;
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  overflow-wrap: break-word;
  word-break: break-word;
}
pre {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
pre code { background: none; padding: 0; font-size: .85em; line-height: 1.6; }

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0;
  font-size: .9rem;
  display: block;
  overflow-x: auto;
}
th {
  background: var(--surface);
  color: var(--text-heading);
  padding: .6rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
td { padding: .55rem 1rem; border-bottom: 1px solid var(--border-subtle); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #161b2266; }

/* ── Header / nav ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0d1117ee;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
header nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ── Logo ── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-heading);
}
.logo:hover { text-decoration: none; color: var(--text-heading); }
.logo img { border-radius: var(--radius-sm); }
.logo-mark { display: block; border-radius: var(--radius-sm); }

.nav-right { display: flex; align-items: center; gap: 1rem; font-size: .875rem; }
.nav-right a { color: var(--text-muted); }
.nav-right a:hover { color: var(--text-heading); text-decoration: none; }

/* ── Page layout ── */
.page-layout {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
  min-height: calc(100vh - 58px);
}

/* ── Sidebar ── */
.sidebar {
  display: block;
  width: 240px;
  flex-shrink: 0;
  padding: 2rem 0;
  border-right: 1px solid var(--border-subtle);
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-section { margin-bottom: 1.5rem; padding: 0 1.25rem; }
.sidebar-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .5rem;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: .3rem .5rem;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: .875rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.sidebar a:hover { color: var(--text); background: var(--surface-elevated); text-decoration: none; }
.sidebar a.active { color: var(--text-heading); background: var(--surface-elevated); font-weight: 500; }

/* ── Content ── */
.content { flex: 1; padding: 2.5rem 2.5rem 4rem; min-width: 0; }
.page-title { margin-bottom: .25rem; }
.page-desc { color: var(--text-muted); font-size: 1rem; margin-bottom: 2rem; }
.breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--blue); }
.breadcrumb span { margin: 0 .4rem; }

/* ── Diagram box ── */
.diagram-box {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
}

/* ── Feature grid + card ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.feature-card h3 { margin-top: 0; font-size: 1rem; }
.feature-card h4 { font-size: .95rem; margin-bottom: .4rem; }
.feature-card p { font-size: .9rem; color: var(--text-muted); margin: 0; }

/* ── Callout ── */
.callout {
  background: #0d419d16;
  border: 1px solid #388bfd30;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout-title { font-weight: 600; color: var(--blue); margin-bottom: .25rem; }
.callout-warn { background: #d2992216; border: 1px solid #d2992230; }
.callout-warn .callout-title { color: var(--yellow); }

/* ── CTA box ── */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  margin: 3rem 0;
}
.cta-box h3 { margin-bottom: .5rem; }
.cta-box p { color: var(--text-muted); margin-bottom: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}
.btn-primary { background: var(--green-bg); color: #fff; border: 1px solid #2ea043; }
.btn-primary:hover { background: #2ea043; text-decoration: none; }
.btn-secondary { background: var(--surface-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-ml { margin-left: .5rem; }

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 600;
  background: #388bfd22;
  color: var(--blue);
  border: 1px solid #388bfd30;
  margin-left: .5rem;
}
/* Docs index tag variants */
.card .tag {
  margin-top: .75rem;
  font-size: .7rem;
  padding: 2px 8px;
  align-self: flex-start;
  margin-left: 0;
}
.tag-core  { background: #23863616; color: var(--green);  border: 1px solid #23863630; }
.tag-ref   { background: #388bfd16; color: var(--blue);   border: 1px solid #388bfd30; }
.tag-guide { background: #f0883e16; color: var(--orange); border: 1px solid #f0883e30; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: .4rem;
}
.badge-cli { background: #f0883e16; color: var(--orange); border: 1px solid #f0883e30; }
.badge-new { background: #23863616; color: var(--green);  border: 1px solid #23863630; }
.badge-go  { background: #00acd716; color: var(--cyan);   border: 1px solid #00acd730; }
.badge-req { background: #23863616; color: var(--green);  border: 1px solid #23863630; }
.badge-opt { background: #8b949e16; color: var(--text-muted); border: 1px solid #8b949e30; }

/* ── Terminal mock (browser-ssh, web-terminal, log-streaming) ── */
.terminal-mock {
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-family: "SF Mono", Consolas, monospace;
  font-size: .8rem;
  line-height: 1.8;
  color: var(--green);
  overflow-x: auto;
}
.terminal-mock .title-bar { display: flex; gap: .4rem; margin-bottom: .75rem; }
.terminal-mock .dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-mock .dot-red    { background: var(--red); }
.terminal-mock .dot-yellow { background: #e3b341; }
.terminal-mock .dot-green  { background: var(--green); }
.terminal-mock .prompt { color: var(--blue); }
.terminal-mock .output { color: var(--text); }

/* ── SDK field list (sdk.html) ── */
.field {
  margin: .5rem 0;
  padding: .6rem .8rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.field-name {
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  color: #79c0ff;
  font-size: .9em;
}
.field-type {
  color: var(--pink);
  font-size: .85em;
  margin-left: .5rem;
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}
.field-desc { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Docs index layout (docs/index.html) ── */
.wrapper { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.subtitle { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color .2s, transform .15s;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--border); transform: translateY(-2px); }
.card-icon { font-size: 1.5rem; margin-bottom: .5rem; }
.card h3 { font-size: 1rem; margin-bottom: .35rem; }
.card h3 a { color: var(--text-heading); text-decoration: none; }
.card h3 a:hover { color: var(--blue); }
.card p { color: var(--text-muted); font-size: .85rem; line-height: 1.5; flex: 1; }
.back-home {
  display: inline-block;
  margin-top: 3rem;
  padding: .6rem 1.2rem;
  background: var(--surface-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: background .2s;
}
.back-home:hover { background: var(--border); text-decoration: none; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: .8rem;
}
footer a { color: var(--blue); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 1.5rem 1.25rem 3rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
  table { font-size: .8rem; }
  th, td { padding: .45rem .6rem; }
  .feature-grid { grid-template-columns: 1fr; }
}
