/* =====================================================
   Tech Blog — 코드 블록 & PlantUML 스타일
   (Prism Tomorrow 테마와 함께 로드)
===================================================== */

/* --------------------------------------------------
   공통 코드 래퍼
-------------------------------------------------- */
.tc-code-wrap {
  margin: 1.6em 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2d333b;
  font-size: .88rem;
  line-height: 1;
}

/* --------------------------------------------------
   코드 헤더 (lang 배지 + 제목 + 복사 버튼)
-------------------------------------------------- */
.tc-code-header,
.tc-auto-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #22272e;
  padding: 7px 14px;
  min-height: 36px;
}

.tc-lang-badge {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8b949e;
  background: #2d333b;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.tc-code-title {
  flex: 1;
  font-size: .78rem;
  color: #8b949e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-copy-btn {
  margin-left: auto;
  padding: 3px 11px;
  font-size: .72rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid #444d56;
  border-radius: 5px;
  color: #8b949e;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.tc-copy-btn:hover  { background: #2d333b; color: #e6edf3; border-color: #8b949e; }
.tc-copy-btn.copied { color: #3fb950; border-color: #3fb950; }

/* Prism pre 여백 제거 (래퍼가 있으므로) */
.tc-code-wrap pre[class*="language-"] {
  margin: 0;
  border-radius: 0;
  border: none;
  font-size: .87rem;
}

/* --------------------------------------------------
   Gutenberg 기본 코드 블록 덮어쓰기
-------------------------------------------------- */
.tech-single-content .wp-block-code,
.tech-single-content .wp-block-preformatted {
  padding: 0 !important;
  border-radius: 10px !important;
  overflow: hidden;
  border: 1px solid #2d333b !important;
  background: #1d1f21 !important;
  margin: 1.6em 0;
}

.tech-single-content .wp-block-code .tc-auto-header {
  border-radius: 0;
}

.tech-single-content .wp-block-code pre,
.tech-single-content .wp-block-code code {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: transparent !important;
  padding: 1.1em 1.2em !important;
  font-size: .87rem !important;
}

/* --------------------------------------------------
   PlantUML 다이어그램
-------------------------------------------------- */
.tc-uml-wrap {
  margin: 1.8em 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.tc-uml-caption {
  display: block;
  padding: 9px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  background: var(--cream, #fafaf8);
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin: 0;
}

.tc-uml-diagram {
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #fff;
  overflow-x: auto;
}

.tc-uml-diagram img {
  max-width: 100%;
  height: auto;
}

.tc-uml-source {
  border-top: 1px solid var(--border, #e2e8f0);
}

.tc-uml-source summary {
  padding: 8px 16px;
  font-size: .75rem;
  color: var(--muted, #64748b);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.tc-uml-source summary::before { content: '▶  '; font-size: .6rem; }
.tc-uml-source[open] summary::before { content: '▼  '; }

.tc-uml-source pre {
  margin: 0;
  padding: 12px 16px;
  font-size: .77rem;
  background: #f8f9fa;
  overflow-x: auto;
  border-top: 1px solid var(--border, #e2e8f0);
}

.tc-uml-source pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
