/* === Обёртка и шапка над кодом === */
.highlightjs-wrapper {
  margin: 1.2em 0;
  position: relative;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4em 0.8em;
  background: #1c3c49;
  color: #eee;
  font-size: 0.85em;
  border-radius: 4px 4px 0 0;
  font-family: system-ui, -apple-system, sans-serif;
}

.code-language::before {
  content: "Language: ";
  opacity: 0.7;
  font-weight: normal;
}

.copy-icon {
  cursor: pointer;
  padding: 0.25em;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.copy-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* === Убираем верхние скругления у кода === */
.code-container code {
  border-radius: 0 0 4px 0 !important;
  line-height: 1.5;
}

/* === Блочные блоки: место под номера строк === */
.code-container:not(.code-container--inline) {
  position: relative;
  padding-left: 40px; /* только для блочных */
}

/* === Инлайновый код — отдельный стиль === */
.code-container--inline {
  display: inline-block;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 85%;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.code-container--inline:hover {
  background-color: #eaeef2;
  color: #24292f;
}

.code-container--inline code {
  background-color: #8aaebc;
  color: #fff;
  border-radius: 4px !important;
}

/* === Нумерация строк (только для блочных) === */
.code-container:not(.code-container--inline) .hljs-line-numbers {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  border-right: 1px solid #003647;
  padding: 1em 8px 1em 0;
  text-align: right;
  user-select: none;
  color: #8aaebc;
  background: #002635;
  line-height: 1.5;
  pointer-events: none;
  display: block;
  border-bottom-left-radius: 4px;
}

/* Убедимся, что span отображаются */
.hljs-line-numbers span {
  display: block;
  color: inherit;
}

/* Убираем курсор pointer у обычных блоков */
.code-container:not(.code-container--inline) {
  cursor: auto;
}
