/* DocuDart Generated Styles */

:root {
  /* Colors - Light Mode */
  --color-primary: #0175c2;
  --color-secondary: #13b9fd;
  --color-background: #ffffff;
  --color-surface: #f8f9fa;
  --color-surface-variant: #f1f3f5;
  --color-text: #1d1d1d;
  --color-text-muted: #6c757d;
  --color-border: #e0e0e0;
  --color-code-background: #f5f5f5;
  --color-error: #dc3545;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-info: #17a2b8;

  /* Typography */
  --font-family: Inter, system-ui, -apple-system, sans-serif;
  --font-family-mono: JetBrains Mono, Fira Code, monospace;
  --font-size-base: 16.0px;
  --line-height: 1.6;
  --line-height-heading: 1.3;
}

/* Dark mode via system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #54c5f8;
    --color-secondary: #13b9fd;
    --color-background: #0d1117;
    --color-surface: #161b22;
    --color-surface-variant: #21262d;
    --color-text: #e6edf3;
    --color-text-muted: #8b949e;
    --color-border: #30363d;
    --color-code-background: #161b22;
    --color-error: #ff6b6b;
    --color-success: #51cf66;
    --color-warning: #ffd43b;
    --color-info: #4dabf7;
  }
}

/* Dark mode via toggle */
:root[data-theme="dark"] {
  --color-primary: #54c5f8;
  --color-secondary: #13b9fd;
  --color-background: #0d1117;
  --color-surface: #161b22;
  --color-surface-variant: #21262d;
  --color-text: #e6edf3;
  --color-text-muted: #8b949e;
  --color-border: #30363d;
  --color-code-background: #161b22;
  --color-error: #ff6b6b;
  --color-success: #51cf66;
  --color-warning: #ffd43b;
  --color-info: #4dabf7;
}

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

/* Base */
html {
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

body {
  font-family: var(--font-family);
  background-color: var(--color-background);
  color: var(--color-text);
  min-height: 100vh;
}

/* Skip to content (accessibility) */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.5rem 1rem;
  background-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.skip-to-content:focus {
  left: 0;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-main-row {
  padding: 1.0rem 2.0rem;
}

.logo,
.logo:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  line-height: 1;
}

.logo:hover,
.logo:visited:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.logo-image {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-image img {
  height: 1.75rem;
  width: auto;
  display: block;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

header a:not(.logo) {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

header a:not(.logo):hover,
header a:not(.logo).active {
  color: var(--color-primary);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375em;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  line-height: 0;
  flex-shrink: 0;
}

.nav-link-icon svg {
  width: 100%;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 2.0rem 1.0rem;
  border-right: 1px solid var(--color-border);
  background-color: var(--color-surface);
  height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
  overflow-y: auto;
}

/* ExpansionTile */
.expansion-tile {
  margin-bottom: 0.25rem;
}

.expansion-tile-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  transition: color 0.15s;
}

.expansion-tile-header:hover {
  color: var(--color-primary);

}

.expansion-tile-header::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: 0.5rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.expansion-tile[data-collapsed="false"] > .expansion-tile-header::before {
  transform: rotate(90deg);
}

.expansion-tile-content {
  padding-left: 0.75rem;
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.expansion-tile[data-collapsed="true"] > .expansion-tile-content {
  max-height: 0;
  opacity: 0;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background-color: var(--color-surface-variant);
  color: var(--color-primary);
}

.sidebar-link.active {
  border-left-color: var(--color-primary);
  color: var(--color-primary);
  background-color: rgba(1, 117, 194, 0.08);
  font-weight: 500;
}

/* Main */
.site-main {
  padding: 2.0rem 3.0rem;
}

/* Footer */
footer {
  width: 100%;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2.0rem 2.0rem;
}

/* Socials */
.socials {
  display: flex;
  gap: 0.75rem;
}

.socials .nav-link {
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.socials .nav-link:hover {
  color: var(--color-primary);
}

.socials .nav-link-icon {
  width: 1.5em;
  height: 1.5em;
}

/* Topics */
.topics {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topics-title {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.topics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.topics-grid .nav-link {
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border, rgba(128, 128, 128, 0.25));
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.topics-grid .nav-link:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Hero */
.home-page {
  max-width: 1200px;
  margin: 0 auto;
}

.landing-page {
  text-align: center;
  padding: 4.0rem 2rem;
}

.landing-page h1 {
  font-size: 3.0rem;
  font-weight: 700;
  color: var(--color-text);
}

.landing-page .description {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 600px;
}


.landing-page .logo-image img {
  height: 5rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.button-primary {
  background-color: var(--color-primary);
  color: white;
}

.button-primary:hover {
  filter: brightness(1.1);
}

/* Docs Content */
.docs-page {
  width: 100%;
}

.docs-content {
  max-width: 100%;
}

.docs-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.docs-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1.0rem;
}

.docs-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.0rem;
  margin-bottom: 0.75rem;
}

.docs-content h4 {
  font-size: 1.0rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-content p {
  margin-bottom: 1.0rem;
}

.docs-content ul, .docs-content ol {
  margin-bottom: 1.0rem;
  padding-left: 1.5rem;
}

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

.docs-content a {
  color: var(--color-primary);
  text-decoration: none;
}

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

.docs-content code {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  background-color: var(--color-code-background);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
}

.docs-content pre {
  padding: 1.0rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  overflow-x: auto;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.docs-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
  line-height: inherit;
}

/* Code block wrapper (injected by JS around <pre>) */
.code-block-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.code-block-wrapper pre {
  margin-bottom: 0;
}

/* Language label */
.code-block-label {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.8125rem;
  font-family: var(--font-family-mono);
  color: var(--color-text-muted);
  opacity: 0.6;
  user-select: none;
  pointer-events: none;
  line-height: 1.5;
  transition: opacity 0.25s;
  z-index: 1;
}

.code-block-wrapper:hover .code-block-label {
  opacity: 0;
}

/* Copy button */
.code-block-copy {
  position: absolute;
  top: 0.25rem;
  right: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  padding: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 0.25rem;
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity 0.25s, color 0.15s, background-color 0.15s;
  z-index: 2;
}

.code-block-wrapper:hover .code-block-copy {
  opacity: 0.7;
}

.code-block-copy:hover {
  opacity: 1 !important;
  color: var(--color-text);
  background-color: var(--color-surface-variant);
}

.docs-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1.0rem;
  margin: 1rem 0;
  color: var(--color-text-muted);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

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

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

.docs-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

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

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  scroll-margin-top: 80px;
}

/* Table of Contents */
.toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  padding: 1rem 0 1rem 1.5rem;
}

.toc-nav {
  border-left: 1px solid var(--color-border);
  padding-left: 1rem;
}

.toc-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 0;
}

.toc-level-3 {
  padding-left: 0.75rem;
}

.toc-level-4 {
  padding-left: 1.5rem;
}

.toc-link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  margin-left: -1rem;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--color-primary);
}

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

/* IconButton */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: var(--color-text-muted);
  transition: color 0.2s, background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.icon-button:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-hover);
}

.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Sidebar backdrop overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

/* Responsive — Tablet & Mobile (≤1024px) */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
  }

  .site-main {
    padding: 1.5rem;
  }

  .toc {
    display: none;
  }
}

/* Responsive — Mobile (≤768px) */
@media (max-width: 768px) {
  .header-main-row {
    padding: 0.75rem 1.0rem;
  }

  .site-main {
    padding: 1.0rem;
  }

  .landing-page {
    padding-left: 1.0rem;
    padding-right: 1.0rem;
  }

  .landing-page h1 {
    font-size: 2.0rem;
  }

  .landing-page .description {
    font-size: 1.0rem;
  }

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

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

  .card-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .docs-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Screen-responsive containers */
.screen-mobile, .screen-tablet, .screen-desktop { display: none; }

@media (max-width: 768px) {
  .screen-mobile { display: contents; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .screen-tablet { display: contents; }
}

@media (min-width: 1025px) {
  .screen-desktop { display: contents; }
}

/* SlideTransition */
.slide-transition[data-slide-active] {
  transform: translate(0, 0) !important;
}

/* ========== Component Styles ========== */

/* Callout Component */
.callout {
  padding: 1.0rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
  border-left: 4px solid;
}

.callout-icon {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.callout-info {
  background-color: rgba(23, 162, 184, 0.1);
  border-color: var(--color-info);
}

.callout-tip {
  background-color: rgba(40, 167, 69, 0.1);
  border-color: var(--color-success);
}

.callout-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-color: var(--color-warning);
}

.callout-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: var(--color-error);
}

.callout-note {
  background-color: rgba(107, 114, 128, 0.1);
  border-color: #6b7280;
}

/* Tabs Component */
.tabs-container {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.tabs-list {
  display: flex;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.tab-button {
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}

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

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tabs-content {
  padding: 1rem;
}

.tab-panel {
  display: none;
}

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

/* Card Component */
.card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background-color: var(--color-surface);
  transition: all 0.15s;

}

.card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-content {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(var(--card-grid-cols, 2), 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

/* Unknown Component */
.component-unknown {
  padding: 1rem;
  margin: 1rem 0;
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px dashed var(--color-error);
  border-radius: 0.5rem;
  color: var(--color-error);
  font-size: 0.875rem;
}

/* Dark Mode for Components */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .callout-info {
    background-color: rgba(77, 171, 247, 0.15);
  }

  :root:not([data-theme="light"]) .callout-tip {
    background-color: rgba(81, 207, 102, 0.15);
  }

  :root:not([data-theme="light"]) .callout-warning {
    background-color: rgba(255, 212, 59, 0.15);
  }

  :root:not([data-theme="light"]) .callout-danger {
    background-color: rgba(255, 107, 107, 0.15);
  }

  :root:not([data-theme="light"]) .callout-note {
    background-color: rgba(107, 114, 128, 0.2);
  }

  :root:not([data-theme="light"]) .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] .callout-info {
  background-color: rgba(77, 171, 247, 0.15);
}

:root[data-theme="dark"] .callout-tip {
  background-color: rgba(81, 207, 102, 0.15);
}

:root[data-theme="dark"] .callout-warning {
  background-color: rgba(255, 212, 59, 0.15);
}

:root[data-theme="dark"] .callout-danger {
  background-color: rgba(255, 107, 107, 0.15);
}

:root[data-theme="dark"] .callout-note {
  background-color: rgba(107, 114, 128, 0.2);
}

:root[data-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========== Theme Toggle ========== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s;
  font-size: 1em;
}

.theme-toggle:hover {
  color: var(--color-primary);
}

.theme-toggle-light,
.theme-toggle-dark {
  display: inline-flex;
  align-items: center;
  width: 1.375em;
  height: 1.375em;
}

.theme-toggle-light svg,
.theme-toggle-dark svg {
  width: 100%;
  height: 100%;
}

/* Default: light icon visible, dark icon hidden */
.theme-toggle-dark { display: none; }

/* Dark mode via attribute */
:root[data-theme="dark"] .theme-toggle-dark { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle-light { display: none; }

/* Dark mode via system preference (no explicit toggle yet) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-dark { display: inline-flex; }
  :root:not([data-theme="light"]) .theme-toggle-light { display: none; }
}

/* ========== Theme-Aware Assets ========== */

.theme-asset { display: inline-block; }
.theme-asset > .theme-asset-light { display: inline; }
.theme-asset > .theme-asset-dark { display: none; }

/* Dark mode via attribute */
:root[data-theme="dark"] .theme-asset > .theme-asset-light { display: none; }
:root[data-theme="dark"] .theme-asset > .theme-asset-dark { display: inline; }

/* Dark mode via system preference (no explicit toggle yet) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-asset > .theme-asset-light { display: none; }
  :root:not([data-theme="light"]) .theme-asset > .theme-asset-dark { display: inline; }
}

/* ========== Syntax Highlighting (opal build-time) ========== */

pre.opal {
  background-color: #f9fafb;
  color: #191c22;
}
.code-block-wrapper pre.opal {
  background-color: #f9fafb;
}

:root[data-theme="dark"] pre.opal {
  background-color: #202731;
  color: #dcdcdc;
}
:root[data-theme="dark"] .code-block-wrapper pre.opal {
  background-color: #202731;
}
:root[data-theme="dark"] pre.opal span[style] {
  color: var(--dd-dark-color) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) pre.opal {
    background-color: #202731;
    color: #dcdcdc;
  }
  :root:not([data-theme="light"]) .code-block-wrapper pre.opal {
    background-color: #202731;
  }
  :root:not([data-theme="light"]) pre.opal span[style] {
    color: var(--dd-dark-color) !important;
  }
}
