/* Docs styles aligned with heyo.computer marketing site (dark theme) */

:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --link-hover: #79b8ff;
  --code-bg: #161b22;
  --code-border: #30363d;
  --accent: #3fb950;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}

a {
  color: var(--link);
  text-decoration: none;
}

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

/* Sidebar */
.sidebar {
  width: 14rem;
  min-width: 14rem;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.sidebar-brand a {
  color: var(--text);
}

.sidebar-brand a:hover {
  color: var(--link);
  text-decoration: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0 0.75rem;
}

.sidebar-nav a {
  color: var(--text);
  font-weight: 500;
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
}

.sidebar-nav a:hover {
  color: var(--link);
  background: var(--bg-tertiary);
  text-decoration: none;
}

.sidebar-group {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  padding: 0 0.5rem;
}

/* Accordion sections in the sidebar (details/summary) */
.sidebar-accordion {
  margin-top: 0.25rem;
}

.sidebar-accordion > summary.sidebar-group {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  user-select: none;
}

.sidebar-accordion > summary.sidebar-group::-webkit-details-marker {
  display: none;
}

.sidebar-accordion > summary.sidebar-group::before {
  content: "▸";
  font-size: 0.65rem;
  transition: transform 0.15s ease;
  color: var(--text-muted);
}

.sidebar-accordion[open] > summary.sidebar-group::before {
  transform: rotate(90deg);
}

.sidebar-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-top: 0.125rem;
}

/* Layout wrapper for main + footer */
.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Main content */
main {
  flex: 1;
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

article h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text);
}

article h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

article p {
  margin-bottom: 1rem;
  color: var(--text);
}

article ul, article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

article li {
  margin-bottom: 0.25rem;
}

/* Code */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  color: var(--text);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--code-border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.875rem;
}

/* Zola syntax highlighting overlay: keep dark theme */
pre[data-lang] {
  background: var(--code-bg);
}

/* Footer */
.layout-main footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

footer a {
  color: var(--link);
}

footer a:hover {
  color: var(--link-hover);
}

/* Home / index list */
.section ul,
main ul {
  list-style: none;
  padding-left: 0;
}

.section ul li,
main > article ul li {
  margin-bottom: 0.5rem;
}

.section ul a,
main > article ul a {
  color: var(--link);
}

.section ul a:hover,
main > article ul a:hover {
  color: var(--link-hover);
}

/* Ensure inline code in paragraphs doesn’t break line height */
p code {
  font-size: 0.9em;
}

/* Tables */
article table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

article th,
article td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

article th {
  background: var(--bg-secondary);
  font-weight: 600;
}

article tr:nth-child(even) td {
  background: var(--bg-secondary);
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-group {
    width: 100%;
    margin-bottom: 0.25rem;
  }
}
