/* Tabbed multi-language code samples + dark syntax blocks */

.code-sample {
  margin: 12px 0 20px;
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1117;
}

.code-sample__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.code-sample__tab {
  appearance: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 16px;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8b949e;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.code-sample__tab:hover {
  color: #e6edf3;
  background: rgba(56, 139, 253, 0.08);
}

.code-sample__tab.is-active,
.code-sample__tab[aria-selected="true"] {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
  background: rgba(56, 139, 253, 0.12);
}

.code-sample__tab:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: -2px;
}

.code-sample__panels {
  padding: 0;
}

.code-sample__panel {
  display: none;
  padding: 14px 16px 16px;
}

.code-sample__panel.is-active {
  display: block;
}

.code-sample__file {
  font-size: 12px;
  font-weight: 600;
  color: #8b949e;
  margin: 14px 0 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.code-sample__file:first-child {
  margin-top: 0;
}

.code-sample__panel > p:not(.code-sample__file) {
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
  margin: 12px 0 0;
}

.code-sample__note {
  font-size: 13px;
  line-height: 1.65;
  color: #c9d1d9;
  margin: 12px 0 0;
}

/* Beat .sd-article p { color: var(--text) } on dark code panels */
.sd-article .code-sample .code-sample__panel > p:not(.code-sample__file),
.sd-article .code-sample .code-sample__note {
  color: #c9d1d9;
}

.sd-article .code-sample .code-sample__panel > p:not(.code-sample__file) code,
.sd-article .code-sample .code-sample__note code {
  color: #79c0ff;
  background: rgba(110, 118, 129, 0.35);
  border-color: #484f58;
}

.sd-article .code-sample .code-sample__panel > p:not(.code-sample__file) strong,
.sd-article .code-sample .code-sample__note strong {
  color: #e6edf3;
}

/* Dark code blocks (standalone + inside tabs) */
.sd-article pre.tech,
.sd-article pre.tech code,
.code-sample pre,
.code-sample pre code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  tab-size: 2;
}

.sd-article pre.tech,
.code-sample pre {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: #0d1117 !important;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow-x: auto;
  color: #e6edf3;
}

.sd-article pre.tech:last-child,
.code-sample pre:last-child {
  margin-bottom: 0;
}

.sd-article pre.tech code,
.code-sample pre code {
  display: block;
  background: transparent !important;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

/* Prism token colors (VS Code–style on black) */
code[class*="language-"],
pre[class*="language-"] {
  text-shadow: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #8b949e;
  font-style: italic;
}

.token.punctuation {
  color: #e6edf3;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #79c0ff;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #a5d6ff;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #ff7b72;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #ff7b72;
}

.token.function,
.token.class-name {
  color: #d2a8ff;
}

.token.regex,
.token.important,
.token.variable {
  color: #ffa657;
}

.token.important,
.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}
