/* ===================================================================
   xhost docs — style.css
   Color scheme: #345C00 primary green, #9DFF20 accent lime
   =================================================================== */

/* --- Reset & base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #345C00;
  --lime: #9DFF20;
  --lime-subtle: #e8ffc7;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --border: #e1e4e8;
  --text: #1a1a1a;
  --text-muted: #586069;
  --code-bg: #161b22;
  --code-text: #e6edf3;
  --get: #0366d6;
  --post: #28a745;
  --delete: #d73a49;
  --put: #ffc107;
  --radius: 6px;
  --sidebar-w: 260px;
  --content-max: 800px;
  --topbar-h: 48px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-alt);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

/* --- xhost topbar (shared with xhostd.com) ------------------------ */
.xhost-topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  z-index: 200;
}
.xhost-topbar-brand {
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  font-size: 1.05rem;
}
.xhost-topbar-brand:hover { text-decoration: none; }
.xhost-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}
.xhost-topbar-right a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}
.xhost-topbar-right a:hover { text-decoration: underline; }

/* --- Sidebar ------------------------------------------------------ */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
}
.sidebar-brand:hover { text-decoration: none; }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.sidebar-nav {
  list-style: none;
  padding: 0 12px;
  flex: 1;
}

.sidebar-nav li a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  transition: background 0.15s;
}

.sidebar-nav li a:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

.sidebar-nav li a.active {
  background: var(--lime-subtle);
  color: var(--green);
  font-weight: 600;
}

.sidebar-subnav {
  list-style: none;
  padding: 4px 0 4px 16px;
  margin: 2px 0 4px;
  border-left: 1px solid var(--border);
  margin-left: 18px;
}
.sidebar-subnav li a {
  padding: 5px 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.sidebar-subnav li a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-link-muted {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Mobile nav toggle -------------------------------------------- */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 16px;
  z-index: 150;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 90;
}

/* --- Content area ------------------------------------------------- */
.content {
  margin-left: var(--sidebar-w);
  max-width: var(--content-max);
  padding: 48px 40px 80px;
}

/* --- Hero --------------------------------------------------------- */
.hero {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-tagline {
  font-size: 1.375rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.hero-description {
  margin-top: 16px;
  font-size: 1.0625rem;
  color: var(--text);
  max-width: 600px;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { background: #2a4e00; }

.btn-secondary {
  background: var(--bg-alt);
  color: var(--green);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--lime-subtle); }

/* --- Features grid ------------------------------------------------ */
.features { margin-bottom: 48px; }
.features h2 { font-size: 1.5rem; margin-bottom: 24px; color: var(--green); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s;
}
.feature-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Quick start -------------------------------------------------- */
.quickstart { margin-bottom: 48px; }
.quickstart h2 { font-size: 1.5rem; margin-bottom: 12px; color: var(--green); }
.quickstart > p { margin-bottom: 20px; color: var(--text-muted); }
.quickstart ol, .quickstart ul { margin-bottom: 16px; padding-left: 24px; }
.quickstart li { margin-bottom: 6px; line-height: 1.6; }

/* --- Code blocks -------------------------------------------------- */
.code-block {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #30363d;
}

.code-header {
  background: #0d1117;
  color: #8b949e;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 8px 16px;
  border-bottom: 1px solid #30363d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-block pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  overflow-x: auto;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.code-block pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* --- Prose sections ----------------------------------------------- */
.prose h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; color: var(--green); }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin-top: 48px; margin-bottom: 16px; color: var(--green); }
.prose h3 { font-size: 1.125rem; font-weight: 600; margin-top: 32px; margin-bottom: 12px; }
.prose h4 { font-size: 1rem; font-weight: 600; margin-top: 24px; margin-bottom: 8px; }
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin-bottom: 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose .lead { font-size: 1.0625rem; color: var(--text-muted); margin-bottom: 32px; }

/* --- Info box / note ---------------------------------------------- */
.note {
  background: var(--lime-subtle);
  border-left: 3px solid var(--green);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 24px;
  font-size: 0.9375rem;
}

.note strong { color: var(--green); }

/* --- Step list ---------------------------------------------------- */
.step {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
}

.step h3 {
  font-size: 1.125rem;
  margin: 0;
}

.step p { margin-top: 12px; }

/* --- Getting Started: two-path option cards ---------------------- */
.path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}
@media (max-width: 760px) {
  .path-grid { grid-template-columns: 1fr; }
}
.path-card {
  background: var(--bg-alt, #f7f8fa);
  border: 1px solid var(--border, #e1e4e8);
  border-radius: 8px;
  padding: 20px 22px;
}
.path-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.path-card-header h4 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}
.path-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green, #345C00);
  color: #fff;
}
.path-badge-alt {
  background: transparent;
  color: var(--text-muted, #586069);
  border: 1px solid var(--border, #e1e4e8);
}
.path-card .path-tag {
  font-size: 0.875rem;
  color: var(--text-muted, #586069);
  margin: 0 0 14px;
}
.path-card ol {
  padding-left: 22px;
  margin: 0;
}
.path-card ol li { margin-bottom: 10px; }
.path-card ol li:last-child { margin-bottom: 0; }
.path-card .code-block { margin: 8px 0 4px; }
a.path-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
a.path-card-link:hover {
  border-color: var(--green, #345C00);
  transform: translateY(-1px);
  text-decoration: none;
}
a.path-card-link h4 { color: var(--text, #1a1a1a); }
.path-cta {
  margin-top: 14px;
  font-weight: 600;
  color: var(--green, #345C00);
}

/* --- API Reference ------------------------------------------------ */
.endpoint {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.endpoint:last-child { border-bottom: none; }

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.method-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.method-badge.get { background: var(--get); }
.method-badge.post { background: var(--post); }
.method-badge.delete { background: var(--delete); }
.method-badge.put { background: var(--put); }

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.endpoint-desc { margin-bottom: 16px; color: var(--text-muted); }

.endpoint-auth {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.endpoint-auth code {
  font-size: 0.8125rem;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.field-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-weight: 600;
}

.field-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.field-table code {
  font-size: 0.8125rem;
}

.required {
  color: var(--delete);
  font-size: 0.75rem;
  font-weight: 600;
}

.optional {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Reference tables --------------------------------------------- */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.ref-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-weight: 600;
}

.ref-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}

/* --- Responsive --------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close { display: block; }

  .mobile-nav-toggle { display: flex; }

  .overlay.open { display: block; }

  .content {
    margin-left: 0;
    padding: 72px 20px 60px;
  }

  .hero-title { font-size: 2.25rem; }
  .hero-tagline { font-size: 1.125rem; }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
