/* ------------------------------------------------------------------ */
/*  gotogolang — overrides for Compose theme                          */
/* ------------------------------------------------------------------ */

:root {
  --color-bg:     #0d0d0d;
  --color-fg:     #c8c8c8;
  --color-accent: #00ff88;
  --color-border: #2a2a2a;
  --font-mono:    "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

/* Mirrored last character in nav items */
.mirror-last {
  display: inline-block;
  transform: scaleX(-1);
}

/* More breathing room above headings in content */
.content h2 { margin-top: 2.5rem; }
.content h3 { margin-top: 2rem; }
.content h4 { margin-top: 1.5rem; }

/* Terminal widget container */
.goalgo-terminal-wrap {
  margin: 2rem 0;
}

/* Inline code & code blocks */
code, pre {
  font-family: var(--font-mono);
}

/* Difficulty badges on exercise list */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid currentColor;
}
.badge-easy   { color: var(--color-accent); }
.badge-medium { color: #ffd166; }
.badge-hard   { color: #ef476f; }

/* ------------------------------------------------------------------ */
/*  Sidebar accordion                                                  */
/* ------------------------------------------------------------------ */

/* Course title (h2) */
.aside .section_title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--color-accent);
  padding: 0.5rem 0 0.75rem;
  margin: 0;
}
.aside .section_title a { color: inherit; }

/* Chapter accordion container */
details.sidebar-chapter {
  border-top: 1px solid var(--color-border);
}

/* Chapter toggle button */
details.sidebar-chapter > summary {
  list-style: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-fg);
  user-select: none;
}
details.sidebar-chapter > summary::-webkit-details-marker { display: none; }

/* Rotating arrow */
details.sidebar-chapter > summary::before {
  content: "▸";
  font-size: 0.6rem;
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.15s ease, opacity 0.15s;
}
details.sidebar-chapter[open] > summary::before {
  transform: rotate(90deg);
  opacity: 0.7;
}

details.sidebar-chapter > summary.active        { color: var(--color-accent); }
details.sidebar-chapter > summary.active::before { opacity: 1; }
details.sidebar-chapter > summary a             { color: inherit; }

/* Paragraph link — block, indented, left-border on active */
a.sidebar-para {
  display: block;
  padding: 0.28rem 0 0.28rem 1.1rem;
  font-size: 0.88rem;
  color: var(--color-fg);
  opacity: 0.6;
  border-left: 2px solid transparent;
  transition: opacity 0.12s, border-color 0.12s;
}
a.sidebar-para:hover  { opacity: 1; }
a.sidebar-para.active {
  opacity: 1;
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

/* TOC of active paragraph — theme JS adds .toc / .toc_active to <nav>,
   .toc_item to <li>, .toc_link to <a>. Override colours & indent. */
.aside .toc {
  padding: 0 0 0.4rem 1.3rem;
  border-left-color: var(--color-accent);
  margin: 0;
}
.aside .toc_item { margin: 0; }
.aside .toc_link {
  display: block;
  padding: 0.1rem 0;
  font-size: 0.78rem;
  color: var(--color-fg);
  opacity: 0.55;
}
.aside .toc_link:hover {
  opacity: 1;
  color: var(--color-accent);
}
