/* ══ Docs layout ══ */
.docs-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem 0;
  gap: 2.5rem;
}

/* ══ Sidebar ══ */
.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h, 3.5rem) + 1rem);
  width: 220px;
  height: calc(100vh - var(--nav-h, 3.5rem) - 1rem);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-toc {
  display: flex;
  flex-direction: column;
}

.toc-title {
  display: block;
  padding: 0.2rem 0.75rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.toc-link {
  display: block;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.4;
}

@media (hover: hover) {
  .toc-link:hover {
    color: var(--text);
  }
}

.toc-link.active {
  color: var(--edg-gold);
  border-left-color: var(--edg-gold);
  font-weight: 500;
}

.toc-h3 {
  padding-left: 1.5rem;
  font-size: 0.78rem;
}

/* ══ Content ══ */
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
  padding-bottom: 6rem;
}

/* Headings */
.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  scroll-margin-top: calc(var(--nav-h, 3.5rem) + 1.5rem);
}

.docs-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin: 3rem 0 1rem;
  letter-spacing: -0.01em;
}

.docs-content h1:first-child {
  margin-top: 0;
}

.docs-content h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin: 3rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.docs-content h1 + h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 1.5rem;
}

.docs-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.5rem;
}

.docs-content h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}



/* Prose */
.docs-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  margin: 0 0 1rem;
}

.docs-content strong {
  color: var(--text);
  font-weight: 600;
}

.docs-content em {
  font-style: italic;
}

/* Links */
.docs-content a {
  color: var(--edg-gold);
  text-decoration: none;
  transition: color 0.2s;
}

.docs-content a:hover {
  color: var(--edg-gold);
  text-decoration: underline;
}

/* Lists */
.docs-content ul,
.docs-content ol {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
  line-height: 1.7;
}

.docs-content li {
  margin-bottom: 0.75rem;
}

.docs-content li p {
  margin: 0;
}

/* Inline code */
.docs-content code:not(.shiki code):not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  color: var(--text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-variant-ligatures: none;
}

/* Code blocks */
.docs-content pre {
  margin: 0 0 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
}

.docs-content pre:not(:has(.shiki)) {
  background: var(--bg-card);
  color: var(--text);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  font-variant-ligatures: none;
}

.docs-content .shiki {
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-card) !important;
}

.docs-content .shiki code {
  white-space: pre;
}

[data-theme="light"] .docs-content .shiki {
  background-color: #ffffff !important;
}
[data-theme="light"] .docs-content pre:not(:has(.shiki)) {
  background: #ffffff;
}

/* Images */
.docs-content img {
  max-width: 100%;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.docs-content th,
.docs-content td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.docs-content th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.docs-content tr:nth-child(even) td {
  background: var(--bg-elevated);
}

/* Feature comparison table,label column (row headers) */
.feature-table td:nth-child(1) {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Feature comparison table,highlight Loreline column */
.feature-table th:nth-child(2),
.feature-table td:nth-child(2) {
  box-shadow: inset 1px 0 0 var(--edg-gold), inset -1px 0 0 var(--edg-gold);
  color: var(--text);
}

.feature-table th:nth-child(2) {
  color: var(--edg-gold);
  box-shadow: inset 1px 0 0 var(--edg-gold), inset -1px 0 0 var(--edg-gold), inset 0 1px 0 var(--edg-gold);
}

.feature-table tr:last-child td:nth-child(2) {
  box-shadow: inset 1px 0 0 var(--edg-gold), inset -1px 0 0 var(--edg-gold), inset 0 -1px 0 var(--edg-gold);
}

/* Code tabs */
.code-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 1.5rem;
}

.code-tab {
  padding: 0.4rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s, border-color 0.2s;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--edg-gold);
  border-bottom-color: var(--edg-gold);
}

.code-tab-panel {
  display: none;
}

.code-tab-panel.active {
  display: block;
}

.code-tab-panel pre {
  margin-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* Callout box (blockquote) */
.docs-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--edg-gold);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}
[data-theme="light"] .docs-content blockquote {
  background: var(--bg-elevated);
}

.docs-content blockquote p {
  margin: 0 0 0.5rem;
}

.docs-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Horizontal rule */
.docs-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ══ Theme transitions ══ */
.docs-content .shiki,
.docs-content pre:not(:has(.shiki)),
.docs-content code:not(.shiki code),
.docs-content img,
.docs-content th,
.docs-content td,
.docs-content blockquote,
.docs-content hr,
.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4,
.docs-sidebar {
  transition: background 0.35s ease, border-color 0.35s ease, color 0.25s ease;
}

/* ══ Responsive ══ */
@media (max-width: 900px) {
  .docs-layout {
    flex-direction: column;
    padding-top: 4rem;
    gap: 0;
  }

  .docs-sidebar {
    position: sticky;
    top: calc(var(--nav-h, 3.5rem) - 1px);
    z-index: 50;
    width: auto;
    height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 0.5rem 0;
    margin-left: -2rem;
    margin-right: -2rem;
  }

  .docs-sidebar::-webkit-scrollbar {
    display: none;
  }

  .docs-toc {
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
    padding: 0;
  }

  .toc-title {
    display: none;
  }

  .toc-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
  }

  .toc-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--edg-gold);
  }

  .toc-h3 {
    padding-left: 0.6rem;
  }

  .docs-content {
    max-width: 100%;
    padding-top: 1rem;
  }

  .docs-content h1,
  .docs-content h2,
  .docs-content h3,
  .docs-content h4 {
    scroll-margin-top: calc(var(--nav-h, 3.5rem) + 4rem);
  }
}

@media (max-width: 640px) {
  .docs-content .shiki {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .docs-content h1 {
    font-size: 1.6rem;
  }

  .docs-content h2 {
    font-size: 1.25rem;
  }
}

/* ══ Guide cross-navigation ══ */
.docs-guide-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.docs-guide-nav-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.docs-guide-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.docs-content .docs-guide-nav-card {
  padding: 0.9rem 1rem;
  transform: none !important;
  transition: background 0.35s ease, color 0.25s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.docs-content .docs-guide-nav-card:hover {
  text-decoration: none;
}

.docs-guide-nav-card .link-card-title {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.docs-guide-nav-card .link-card-desc {
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .docs-guide-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* ══ About page ══ */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

.about-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.about-content h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin: 3rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.about-content h1 + h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 1.5rem;
}

.about-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.5rem;
}

.about-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  margin: 0 0 1rem;
}

.about-content strong {
  color: var(--text);
  font-weight: 600;
}

.about-content a {
  color: var(--edg-gold);
  text-decoration: none;
  transition: color 0.2s;
}

.about-content a:hover {
  text-decoration: underline;
}

.about-content ul,
.about-content ol {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
  line-height: 1.7;
}

.about-content li {
  margin-bottom: 0.75rem;
}

.about-content li p {
  margin: 0;
}

.about-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.about-content img,
.about-content video {
  max-width: 100%;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.about-content h1,
.about-content h2,
.about-content h3,
.about-content hr {
  transition: background 0.35s ease, border-color 0.35s ease, color 0.25s ease;
}
