/* DY, 맥 스타일 코드블록 - 티스토리용 수정본 */

/* 코드 블록 전용 폰트 */
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600&display=swap");

/* 코드블럭 전체 */
pre {
  position: relative;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

/* 티스토리 기본 여백/배경 충돌 방지 */
pre code {
  font-family: "Source Code Pro", monospace;
}

/* 코드 블록 오른쪽 아래 언어 표시 */
pre::after {
  content: attr(data-ke-language);
  position: absolute;
  bottom: 6px;
  right: 12px;
  color: #cfd2d1;
  font-size: 12px;
  z-index: 2;
}

/* 코드블럭 본체 */
.hljs {
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgb(0 0 0 / 40%);
  color: #cfd2d1;
  background-color: #2d3440;
  font-family: "Source Code Pro", monospace;
  counter-reset: line-idx;
  overflow: hidden;
}

/* 상단 mac 헤더 */
.hljs .code-header {
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 14px;
  background-color: #2d3440;
  border-radius: 8px 8px 0 0;
}

/* mac 버튼 공통 */
.hljs .code-header .btn {
  display: inline-block;
  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 .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;
}

/* 코드 본문 */
.hljs .code-body {
  max-height: 400px;
  margin: 15px 8px 30px 5px;
  padding-bottom: 10px;
  border-radius: 0 0 8px 8px;
  overflow: auto;
}

/* 각 코드 줄 */
.hljs .line {
  display: block;
  font-size: 14px;
  counter-increment: line-idx;
  line-height: 1.5;
  white-space: pre;
  padding-right: 12px;
  min-width: 100%;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

/* 코드 줄 hover */
.hljs .line:hover {
  background-color: #3a4352;
}

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

/* hover 시 줄 번호 */
.hljs .line:hover::before {
  color: #cfd2d1;
}

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

.hljs .code-body::-webkit-scrollbar-thumb {
  background-color: #d0d4d9;
  border-radius: 10px;
}

.hljs .code-body::-webkit-scrollbar-track-piece {
  background-color: transparent;
}

.hljs .code-body::-webkit-scrollbar-corner {
  display: none;
}