/* DY, 맥 스타일 코드블록(라이트버전) */
/* 코드 블록 전용 폰트 설정 */
@font-face {
  font-family: Source Code Pro;
  src: url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap");
}

/* pre 태그는 코드 블록 전체를 감싸는 상위 요소 */
pre {
  position: relative;
}

pre,
.hljs {
  border-radius: 8px;
  overflow: hidden;
}

/* 코드 블록 오른쪽 아래에 언어 종류 (ex. html, js 등) 표시 */
pre::after {
  content: attr(data-ke-language);
  position: absolute;
  bottom: 6px;
  right: 12px;
  color: #cfd2d1;
  font-size: 12px;
}

/* highlight.js 전체 코드 블록 스타일 */
.hljs {
  display: flex !important;
  /* 수직 정렬을 위한 flex */
  flex-direction: column;
  padding: 0 !important;
  /* font-size: 0px;   전체 코드 글자 크기 */
  border-radius: 8px;
  /* 둥근 테두리 */
  box-shadow: 0 12px 24px rgb(0 0 0 / 40%);
  /* 그림자 */
  /* color: #cfd2d1; */
  color: #2d3440;
  /* 기본 글자 색 */
  background-color: #2d3440;
  /* 전체 배경색 */
  font-family: "Source Code Pro", monospace;
  /* 코드 전용 폰트 */
}

.dark .hljs {
  color: #cfd2d1;
  /* 다크모드 글자 색 */
  background-color: #2d3440;
  /* 다크모드 배경색 */
}

/* 각 줄(line)을 나타냄 */
.hljs .line {
  font-size: 14px;
  /* 각 줄별 글자 크기 */
  counter-increment: line-idx;
  /* 줄 번호 증가 */
  line-height: 1.5;
  /* 코드 줄 간격 */
  white-space: pre;
  padding-right: 5px;
  min-width: 100% !important;
  transition: background-color 0.2s ease;
  /* 마우스오버 효과 부드럽게 */
}

/* 각 줄에 마우스를 올렸을 때 배경색 변경 */
.hljs .line:hover {
  background-color: #e9ecef;
}

.dark .hljs .line:hover {
  background-color: #3a3f47;
  /* 다크모드에서 마우스오버 배경색 */
}

/* 마우스를 올렸을 때 줄 번호 색 변경 */
.hljs .line:hover::before {
  color: #cfd2d1;
}

/* 줄 번호 표시 */
.hljs .line::before {
  content: counter(line-idx);
  /* 줄 번호 출력 */
  width: 24px;
  display: inline-block;
  text-align: right;
  margin-right: 16px;
  font-size: 0.8rem;
  color: #747a7a;
}

/* 코드 블록 상단 header (닫기 버튼들 있는 영역) */
.hljs .code-header {
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 14px;
  background-color: #2d3440;
  border-radius: 8px 8px 0 0;
}

/* 코드 블록 상단의 동그라미 버튼 스타일 (좌측 상단 버튼들) */
.hljs .code-header .btn {
  border-radius: 50%;
  width: 12px;
  height: 12px;
  margin: 0 4px;
}

/* 닫기 버튼 (빨간색) */
.hljs .code-header .btn.red {
  background-color: #f5655b;
}

/* 최소화 버튼 (노란색) */
.hljs .code-header .btn.yellow {
  background-color: #f6bd3b;
}

/* 최대화 버튼 (초록색) */
.hljs .code-header .btn.green {
  background-color: #43c645;
}

/* 코드 본문 내용 */
.hljs .code-body {
  max-height: 400px;
  margin: 15px 8px 30px 5px;
  /* 위, 오른쪽, 아래, 왼쪽 */
  padding-bottom: 10px;
  /* 내용과 스크롤바 사이 간격 */
  border-radius: 0 0 8px 8px;
  /* 하단 좌우 둥글게 */
  overflow: auto;
}

/* 스크롤바 너비 설정 */
.hljs .code-body::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

/* 스크롤바 막대 색상 */
.hljs .code-body::-webkit-scrollbar-thumb {
  background-color: #d0d4d9;
}

/* 스크롤바 배경 제거 */
.hljs .code-body::-webkit-scrollbar-track-piece {
  background-color: transparent;
}

/* 스크롤바 코너 제거 */
.hljs .code-body::-webkit-scrollbar-corner {
  display: none;
}

/* 복사 버튼 스타일 */
.hljs .copy-btn {
  background-color: #ffffff17;
  border: none;
  cursor: pointer;
  color: #fff;
  border-radius: 4px;
  width: 36px;
  height: 28px;
  margin-left: auto;
  transition: 0.2s background-color;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 복사 버튼 마우스오버 효과 */
.hljs .copy-btn:hover {
  background-color: #ffffff30;
}

/* DY, 맥 스타일 코드블록(라이트버전) */