/* Docs CSS - Midnight Void (marketing) */
/* Inherits tokens + base typography from /blog/blog.css */

:root {
  --max-width: 72rem;
  --content-width: 56rem;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.docs-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  margin-top: 14px;
  padding: 28px 24px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in oklch, var(--primary) 10%, transparent), transparent 62%),
    var(--glass-bg);
  box-shadow: var(--surface-shadow-soft);
}

.docs-hero .pill {
  margin-bottom: 14px;
}

.docs-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4.3vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.docs-hero p {
  margin: 0 0 18px;
  max-width: 62ch;
  color: var(--muted-foreground);
  font-size: 16px;
  line-height: 1.65;
}

.docs-hero .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.docs-hero .hero-actions .cta {
  margin: 0;
}

.docs-hero .ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--foreground);
  box-shadow: none;
  transition: color var(--transition-base), border-color var(--transition-base), background-color var(--transition-base);
}

.docs-hero .ghost:hover {
  color: var(--foreground);
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
  background: color-mix(in oklch, var(--foreground) 4%, var(--glass-bg));
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Page layout
   --------------------------------------------------------------------------- */
.docs-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 60px;
}

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

/* ---------------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------------- */
.docs-card {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--surface-shadow-soft);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

a.docs-card {
  cursor: pointer;
}

.docs-card:hover {
  border-color: color-mix(in oklch, var(--primary) 40%, var(--border));
  box-shadow: var(--surface-shadow);
  text-decoration: none;
}

.docs-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.docs-card p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------- */
.docs-section {
  margin-top: 36px;
}

.docs-section h2 {
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------------------
   Header top-bar override
   --------------------------------------------------------------------------- */
header .top-bar {
  flex-wrap: wrap;
}

header .top-bar > .cta {
  min-height: 40px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}

/* ---------------------------------------------------------------------------
   Search
   --------------------------------------------------------------------------- */
.docs-search {
  position: relative;
  flex: 1 1 220px;
  max-width: 280px;
  min-width: min(280px, 100%);
}

.docs-search input {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  padding: 9px 12px;
  background: var(--muted);
  font-size: 13px;
  color: var(--foreground);
  box-shadow: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

.docs-search input::placeholder {
  color: color-mix(in oklch, var(--muted-foreground) 80%, transparent);
}

.docs-search input:focus {
  outline: none;
  border-color: color-mix(in oklch, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 14%, transparent);
}

/* ---------------------------------------------------------------------------
   Shell layout (sidebar / content / toc)
   --------------------------------------------------------------------------- */
.docs-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 180px;
  gap: 20px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}

/* ---------------------------------------------------------------------------
   Navigation (sidebar + toc)
   --------------------------------------------------------------------------- */
.docs-nav {
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--surface-shadow-soft);
}

.docs-nav-section {
  margin-bottom: 14px;
}

.docs-nav-title {
  margin: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
}

.docs-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--foreground);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.docs-nav a:hover {
  background: color-mix(in oklch, var(--foreground) 4%, var(--muted));
  border-color: color-mix(in oklch, var(--border) 80%, transparent);
  text-decoration: none;
}

.docs-nav a[aria-current="page"] {
  background: color-mix(in oklch, var(--primary) 10%, var(--glass-bg));
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
  color: var(--primary);
  font-weight: 600;
}

.docs-nav .docs-empty {
  display: none;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------
   Content panel
   --------------------------------------------------------------------------- */
.docs-content {
  background: var(--glass-bg);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--surface-shadow-soft);
}

.docs-content h1 {
  margin-top: 0;
  font-size: 30px;
}

.docs-content h2 {
  margin-top: 28px;
  font-size: clamp(1.44rem, 2.2vw, 1.7rem);
  line-height: 1.18;
}

.docs-content h3 {
  margin-top: 20px;
  font-size: clamp(1.08rem, 1.6vw, 1.26rem);
}

.docs-content > p,
.docs-content li {
  line-height: 1.72;
}

.docs-content pre {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  box-shadow: none;
}

.docs-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ---------------------------------------------------------------------------
   Meta tags
   --------------------------------------------------------------------------- */
.docs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}

.docs-meta .tag {
  padding: 6px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  box-shadow: none;
  transition: border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

/* ---------------------------------------------------------------------------
   Callout
   --------------------------------------------------------------------------- */
.docs-callout {
  background: color-mix(in oklch, var(--primary) 6%, var(--glass-bg));
  border: 1px solid color-mix(in oklch, var(--primary) 20%, var(--glass-border));
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 18px 0;
  box-shadow: none;
}

/* ---------------------------------------------------------------------------
   Lists
   --------------------------------------------------------------------------- */
.docs-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.docs-list li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
}

.docs-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   Next / Related
   --------------------------------------------------------------------------- */
.docs-next {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed color-mix(in oklch, var(--border) 60%, transparent);
}

.docs-next .related a {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

.docs-next .related a:hover {
  border-color: color-mix(in oklch, var(--primary) 40%, var(--border));
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 6%, var(--glass-bg));
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Figures
   --------------------------------------------------------------------------- */
.docs-figure {
  margin: 16px 0;
}

.docs-figure img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--surface-shadow-soft);
  padding: 8px;
  background: var(--glass-bg);
}

.docs-figure figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.docs-footer {
  margin-top: 34px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--muted-foreground);
  box-shadow: none;
}

/* ---------------------------------------------------------------------------
   Table of Contents
   --------------------------------------------------------------------------- */
.docs-toc {
  position: sticky;
  top: 96px;
  align-self: start;
}

.docs-toc .docs-nav a {
  font-size: 12px;
}

/* ---------------------------------------------------------------------------
   Breadcrumbs
   --------------------------------------------------------------------------- */
.docs-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: color-mix(in oklch, var(--muted-foreground) 80%, transparent);
  margin-bottom: 12px;
}

.docs-breadcrumbs a {
  color: color-mix(in oklch, var(--muted-foreground) 80%, transparent);
  transition: color var(--transition-base);
}

.docs-breadcrumbs a:hover {
  color: var(--foreground);
}

.docs-breadcrumbs span {
  color: color-mix(in oklch, var(--muted-foreground) 50%, transparent);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .docs-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 960px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }

  .docs-content {
    padding: 20px;
  }

  .docs-hero h1 {
    font-size: 32px;
  }

  .docs-search {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .docs-hero {
    padding-top: 24px;
    border-radius: var(--radius-xl);
  }

  .docs-hero h1 {
    font-size: 28px;
  }
}
