/* SUQO Docs — themed stylesheet
   Inter Tight body, Cal Sans display.
   Light theme on :root, dark theme via [data-theme="dark"]. */

:root {
  /* Layout */
  --docs-sidebar-width: 280px;
  --docs-toc-width: 240px;
  --header-height: 72px;

  /* Light palette (semantic — names hold even in dark mode) */
  --white: #FFFFFF;
  --bg: var(--white);
  --bg-alt: #F8FAFC;
  --text-dark: #0D062D;
  --text-muted: #64748B;
  --primary-color: #0D062D;
  --accent: #2547FF;
  --border-color: #E2E8F0;
  --code-bg: #0D062D;
  --code-text: #E2E8F0;
  --callout-bg: #F0F4FF;
  --shadow: 0 4px 14px rgba(13, 6, 45, 0.08);
}

[data-theme="dark"] {
  --white: #0A0814;
  --bg: var(--white);
  --bg-alt: #14102B;
  --text-dark: #F1F5F9;
  --text-muted: #94A3B8;
  --primary-color: #C9C2FF;
  --accent: #8AA2FF;
  --border-color: #1E293B;
  --code-bg: #050310;
  --code-text: #E2E8F0;
  --callout-bg: #1A1245;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-dark);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ───────── Header ───────── */
.header.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  display: flex;
  align-items: center;
}
.header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.brand {
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 24px;
  width: auto;
  display: block;
}
.brand-tagline {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1;
}

/* Header search */
.search {
  position: relative;
  max-width: 480px;
  width: 100%;
  justify-self: center;
}
.search input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 6, 45, 0.1);
}

#search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  padding: 4px;
}
#search-results.visible { display: block; }
#search-results .result {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-dark);
  text-decoration: none;
}
#search-results .result:hover,
#search-results .result.active {
  background: var(--bg-alt);
  text-decoration: none;
}
#search-results .result .title { font-weight: 600; font-size: 14px; }
#search-results .result .crumb { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Theme toggle */
#theme-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
#theme-toggle:hover { border-color: var(--primary-color); }

/* ───────── Documentation layout (3-column) ───────── */
.docs-wrapper {
  display: grid;
  grid-template-columns: var(--docs-sidebar-width) 1fr var(--docs-toc-width);
  gap: 40px;
  max-width: 1440px;
  margin: var(--header-height) auto 0;
  padding: 0 32px;
}

/* Left sidebar (navigation) */
.docs-sidebar-left {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 40px 0;
  border-right: 1px solid var(--border-color);
}
.docs-nav-group { margin-bottom: 32px; }
.docs-nav-title {
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark);
  margin: 0 0 16px;
  font-weight: 600;
}
.docs-nav-list { list-style: none; padding: 0; margin: 0; }
.docs-nav-item { margin-bottom: 8px; }
.docs-nav-link {
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
}
.docs-nav-link:hover { color: var(--primary-color); text-decoration: none; }
.docs-nav-link.active { color: var(--primary-color); font-weight: 600; }

/* Main content */
.docs-main {
  padding: 40px 0 80px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}
.docs-content h1 {
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}
.docs-content .lead {
  font-size: 20px;
  color: var(--text-muted);
  margin: 0 0 40px;
  line-height: 1.6;
}
.docs-content h2 {
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  font-size: 32px;
  margin: 48px 0 24px;
  color: var(--text-dark);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: -0.01em;
}
.docs-content h3 {
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  font-size: 24px;
  margin: 32px 0 16px;
  color: var(--text-dark);
}
.docs-content p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 24px;
}
.docs-content ul,
.docs-content ol {
  margin: 0 0 24px;
  padding-left: 24px;
  color: var(--text-muted);
}
.docs-content li {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.65;
}
.docs-content li strong { color: var(--text-dark); }
.docs-content code:not(.code-block code) {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  color: var(--text-dark);
}

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 15px;
}
.docs-content th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-dark);
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  font-weight: 600;
}
.docs-content td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  vertical-align: top;
}

/* Code blocks */
.code-block {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
  overflow-x: auto;
}
.code-block pre { margin: 0; }
.code-block code {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.5;
  background: none;
  border: none;
  padding: 0;
}

/* Callouts */
.callout {
  padding: 20px;
  background: var(--callout-bg);
  border-left: 4px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  margin: 32px 0;
}
.callout p {
  margin: 0;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 16px;
}
.callout strong { color: var(--text-dark); }

/* Screenshot frame */
.screenshot {
  display: block;
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-alt);
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.screenshot img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}
.screenshot .caption { padding: 8px 0 0; font-style: italic; }
.screenshot.placeholder {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.screenshot.placeholder span{
  display: none;
}

/* Next/related links */
.next-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
.next-links a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text-dark);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}
.next-links a:hover {
  border-color: var(--primary-color);
  text-decoration: none;
  transform: translateY(-1px);
}
.next-links .label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.next-links .title {
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-dark);
  font-size: 15px;
}

/* Right sidebar (TOC) */
.docs-sidebar-right {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 40px 0;
}
.toc-title {
  font-family: 'Cal Sans', 'Inter Tight', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark);
  margin: 0 0 16px;
  font-weight: 600;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border-color);
}
.toc-item { padding-left: 16px; }
.toc-item.h3 { padding-left: 32px; }
.toc-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 6px 0;
  transition: color 0.2s;
}
.toc-link:hover,
.toc-link.active { color: var(--primary-color); text-decoration: none; }

/* ───────── Footer ───────── */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-alt);
  padding: 40px 32px;
  margin-top: 60px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.footer-logo-section .brand {
  font-size: 18px;
}
.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 24px;
}
.footer-links-list a {
  color: var(--text-muted);
  font-size: 14px;
}
.footer-links-list a:hover { color: var(--primary-color); }
.footer-copyright {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-copyright p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* ───────── Responsive ───────── */
@media (max-width: 1200px) {
  .docs-wrapper { grid-template-columns: 240px 1fr; }
  .docs-sidebar-right { display: none; }
}

@media (max-width: 992px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    padding: 0 20px;
  }
  .search { max-width: none; }
  .docs-wrapper {
    grid-template-columns: 1fr;
    padding: 0 20px;
    margin-top: var(--header-height);
  }
  .docs-sidebar-left {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
  }
  .docs-content h1 { font-size: 36px; }
  .docs-content h2 { font-size: 26px; }
  .next-links { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { gap: 12px; }
  .brand { font-size: 18px; }
  #theme-toggle { padding: 6px 10px; font-size: 13px; }
}
