/* 본명조 폰트 로드 */
@font-face {
  font-family: 'Source Han Serif';
  src: url('../fonts/sourceserif/SourceHanSerifKR-VF.otf.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* D2Coding 폰트 정의 */
@font-face {
  font-family: 'D2Coding';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/D2Coding/D2Coding-Ver1.3.1-20180115.ttf') format('truetype');
}

@font-face {
  font-family: 'D2Coding';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/D2Coding/D2CodingBold-Ver1.3.1-20180115.ttf') format('truetype');
}

/* 기본 스타일 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #f8f8f8;
}

.container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 사이드바 스타일 */
.sidebar {
  width: 280px;
  padding: 30px;
  background-color: #f5f5f5;
  border-right: 1px solid #eee;
}

.profile {
  text-align: center;
  margin-bottom: 30px;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  background-color: #e1e1e1; /* 이미지가 없을 때를 대비한 배경색 */
}

.profile-name {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 5px;
}

.profile-bio {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 15px;
}

.social-links {
  margin-bottom: 20px;
}

.social-links a {
  margin: 0 5px;
  color: #555;
}

/* 내비게이션 스타일 */
.nav-title {
  font-size: 1em;
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ddd;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu li {
  margin-bottom: 8px;
}

.nav-menu a {
  display: block;
  padding: 5px 0;
  color: #555;
  transition: all 0.2s;
}

.nav-menu a:hover {
  color: #0366d6;
  text-decoration: none;
}

.nav-menu a.active {
  color: #0366d6;
  font-weight: bold;
}

/* 메인 콘텐츠 스타일 */
.main-content {
  flex: 1;
  padding: 40px;
  min-width: 0;
}

/* 헤더 스타일 */
header {
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
  margin-bottom: 30px;
}

header h1 {
  margin-top: 0;
  font-size: 2em;
}

/* 포스트 목록 스타일 */
.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.post-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.5em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.85em;
  color: #767676;
}

.post-date,
.post-work-date,
.post-work-end-date,
.post-work-hours {
  display: flex;
  align-items: center;
}

.post-date i,
.post-work-date i,
.post-work-end-date i,
.post-work-hours i,
.post-category i {
  margin-right: 5px;
}

.work-duration {
  margin-left: 5px;
  font-size: 0.9em;
  color: #999;
}

.post-category {
  margin-right: 15px;
}

.post-excerpt {
  margin-bottom: 15px;
}

.post-link {
  font-weight: bold;
}

.read-more {
  font-size: 0.9em;
  font-weight: bold;
}

/* 태그 스타일 */
.post-tags {
  margin-top: 10px;
}

.post-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 5px;
  margin-bottom: 5px;
  border-radius: 3px;
  background-color: #f1f1f1;
  color: #444;
  font-size: 0.8em;
}

.post-tag:hover {
  background-color: #e1e1e1;
  text-decoration: none;
}

/* 카테고리 스타일 */
.category-list {
  list-style: none;
  padding: 0;
}

.category-item {
  margin-bottom: 20px;
}

.category-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.category-count {
  font-size: 0.8em;
  color: #767676;
  margin-left: 5px;
}

/* 푸터 스타일 */
footer {
  border-top: 1px solid #eee;
  padding-top: 20px;
  margin-top: 40px;
  font-size: 0.8em;
  color: #767676;
}

/* 사이드바 토글 버튼 스타일 */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 400px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: left 0.3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.sidebar-toggle:hover {
  background-color: #f5f5f5;
}

/* 사이드바 접기 스타일 */
.sidebar {
  transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar-collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-hidden .sidebar-toggle {
  left: 30px;
}

/* 메뉴 토글 스타일 */
.nav-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.menu-arrow {
  font-size: 0.8em;
  margin-left: 5px;
  transition: transform 0.3s;
}

.menu-collapsed {
  display: none;
}

/* 모바일 반응형 */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: auto;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .sidebar-toggle {
    top: 10px;
    left: 30px;
  }
  
  .sidebar-collapsed {
    transform: translateX(-100%);
  }
  
  .portfolio-mode .post-list {
    grid-template-columns: 1fr;
  }
}

/* 포트폴리오 모드 버튼 스타일 */
.mode-toggle-btn {
  display: block;
  width: 100%;
  margin-top: 15px;
  padding: 8px 12px;
  background-color: #0366d6;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s;
}

.mode-toggle-btn:hover {
  background-color: #0256b9;
}

.mode-toggle-btn i {
  margin-right: 5px;
}

/* 포트폴리오 모드 스타일 */
.portfolio-mode .post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.portfolio-mode .post-item {
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
  margin-bottom: 0;
}

.portfolio-mode .post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.portfolio-mode .post-thumbnail {
  width: 100%;
  height: 160px;
  background-color: #f5f5f5;
  background-size: cover;
  background-position: center;
}

.portfolio-mode .post-content {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-mode .post-title {
  font-size: 1.2em;
  margin-top: 0;
}

.portfolio-mode .post-excerpt {
  font-size: 0.9em;
  color: #666;
  flex-grow: 1;
}

.portfolio-mode .post-meta {
  margin-top: 10px;
  font-size: 0.8em;
  color: #999;
}

/* 포트폴리오 스타일 */
.portfolio {
  margin-bottom: 40px;
}

.portfolio-title {
  margin-bottom: 10px;
  font-size: 2em;
}

.portfolio-intro {
  margin-bottom: 30px;
  color: #666;
  font-size: 1.1em;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.portfolio-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  background-color: #fff;
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.portfolio-thumbnail {
  height: 180px;
  position: relative;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.thumbnail-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  color: rgba(255,255,255,0.8);
  background-color: #0366d6;
}

.theme-color-1 { background-color: #3498db; }
.theme-color-2 { background-color: #e74c3c; }
.theme-color-3 { background-color: #2ecc71; }
.theme-color-4 { background-color: #f39c12; }
.theme-color-5 { background-color: #9b59b6; }

.portfolio-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-item-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.3em;
  line-height: 1.3;
}

.portfolio-item-meta {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8em;
  color: #666;
  margin-bottom: 12px;
}

.portfolio-date {
  margin-right: 15px;
}

.portfolio-category {
  display: flex;
  align-items: center;
}

.portfolio-category i {
  margin-right: 5px;
}

.portfolio-item-excerpt {
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #555;
  flex-grow: 1;
  line-height: 1.5;
}

.portfolio-readmore {
  align-self: flex-start;
  padding: 8px 15px;
  background-color: #f5f5f5;
  color: #333;
  border-radius: 20px;
  font-size: 0.85em;
  transition: background-color 0.2s;
  text-decoration: none;
}

.portfolio-readmore:hover {
  background-color: #e5e5e5;
  text-decoration: none;
}

@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* 코드 블록 스타일 (Prism.js 호환) */
pre[class*="language-"],
code[class*="language-"] {
  color: #333;
  font-family: 'D2Coding', monospace;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  line-height: 1.5;
  tab-size: 4;
  hyphens: none;
  background: none;
}

pre[class*="language-"] {
  padding: 1em;
  margin: .5em 0;
  overflow: auto;
  border-radius: 4px;
  background-color: #f5f7f9;
}

:not(pre) > code[class*="language-"] {
  padding: .1em .3em;
  border-radius: .3em;
  background-color: rgba(27, 31, 35, 0.05);
  color: #d14;
}

/* 라인 번호 스타일 */
pre.line-numbers {
  position: relative;
  padding-left: 3.8em;
  counter-reset: linenumber;
}

pre.line-numbers > code {
  position: relative;
  white-space: inherit;
}

.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8em;
  width: 3em;
  letter-spacing: -1px;
  border-right: 1px solid #ddd;
  user-select: none;
}

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span:before {
  content: counter(linenumber);
  color: #999;
  display: block;
  padding-right: 0.8em;
  text-align: right;
}

/* 복사 버튼 스타일 */
.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: #666;
  background-color: #f1f1f1;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
}

pre:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background-color: #e0e0e0;
}

/* 프롬프트 블록 스타일 */
.prompt-block {
  margin: 1.5em 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.prompt-header {
  padding: 8px 12px;
  font-size: 0.85em;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.prompt-user .prompt-header {
  background-color: #f1f8ff;
  color: #0366d6;
}

.prompt-assistant .prompt-header {
  background-color: #f1f1f1;
  color: #24292e;
}

.prompt-content {
  padding: 12px 15px;
  background-color: #f6f8fa;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  white-space: pre-wrap;
  font-family: 'D2Coding', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.9em;
  line-height: 1.5;
  overflow-x: auto;
}

/* 마인드맵 블록 스타일 */
.mindmap-container {
  width: 100%;
  height: 500px;
  margin: 1.5em 0;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}

.mindmap-svg {
  width: 100%;
  height: 100%;
}

/* 머메이드 블록 스타일 */
.mermaid {
  margin: 1.5em 0;
  text-align: center;
}

/* 다크 모드 대응 */
@media (prefers-color-scheme: dark) {
  pre, code, .prompt-content {
    font-family: 'D2Coding', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  }
}

/* 블로그 콘텐츠 스타일 */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
}

.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  overflow-x: auto;
  display: block;
}

.post-content th,
.post-content td {
  border: 1px solid #ddd;
  padding: 8px 12px;
}

.post-content th {
  background-color: #f5f5f5;
}

/* 프롬프트 블록 스타일 */
.prompt-block {
  margin: 1.5em 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.prompt-header {
  padding: 8px 12px;
  font-size: 0.85em;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.prompt-user .prompt-header {
  background-color: #f1f8ff;
  color: #0366d6;
}

.prompt-assistant .prompt-header {
  background-color: #f1f1f1;
  color: #24292e;
}

.prompt-content {
  padding: 12px 15px;
  background-color: #f6f8fa;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  white-space: pre-wrap;
  font-family: 'D2Coding', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.9em;
  line-height: 1.5;
  overflow-x: auto;
}

/* 마인드맵 블록 스타일 */
.mindmap-container {
  width: 100%;
  height: 500px;
  margin: 1.5em 0;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}

.mindmap-svg {
  width: 100%;
  height: 100%;
}

/* 머메이드 블록 스타일 */
.mermaid {
  margin: 1.5em 0;
  text-align: center;
}

/* 다크 모드 대응 */
@media (prefers-color-scheme: dark) {
  pre, code, .prompt-content {
    font-family: 'D2Coding', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  }
}

/* 본명조 커스텀 블록 스타일 */
.serif-block {
  font-family: 'Source Han Serif', 'Noto Serif KR', serif;
  font-weight: 500;
  font-stretch: 98%;
  letter-spacing: -0.04em;
  line-height: 20pt;
  background-color: #f9f5f0;
  padding: 1em;
  margin: 1em 0;
  border-left: 3px solid #a87c4f;
  color: #333;
  white-space: pre-wrap;
}

.serif-block.italic {
  font-style: italic;
} 