/* --- 초기화 및 기본 설정 --- */
:root {
    --bg-color: #fdfaff;
    --card-bg: #ffffff;
    --text-color: #343a40;
    --title-color: #212529;
    --point-color-1: #e6d4ff;
    --point-color-2: #ffc2d1;
    --point-text-color: #5c3b8a;
    --border-color: #eeeeee;
    --font-main: 'Pretendard', sans-serif;
    --font-title: 'Pretendard', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    word-break: keep-all;
}

a { text-decoration: none; color: inherit; }
#wrap { width: 100%; overflow-x: hidden; }
.container { max-width: 1280px; margin: 40px auto; padding: 0 20px; }

/* --- 헤더 & 로고 스타일 --- */
#header { background-color: var(--card-bg); border-bottom: 1px solid var(--border-color); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; height: 110px; }

#header .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

#header .site-logo {
    height: 75px;
    width: auto;
    margin-right: 15px;
}

#header .site-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.2rem;
    font-weight: 700;
    color: #FF8C00;
    text-shadow: 0 5px 10px rgba(255, 140, 0, 0.4);
}

.navigation { display: flex; gap: 25px; }
.navigation a { font-weight: 500; font-size: 1rem; color: var(--text-color); transition: color 0.2s ease; }
.navigation a:hover { color: var(--point-text-color); }

/* --- 포스트 리스트 (앨범형) --- */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.post-item { background-color: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.post-item:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(92, 59, 138, 0.1); }
.post-link { display: flex; flex-direction: column; height: 100%; }
.thumbnail-box { width: 100%; padding-top: 56.25%; position: relative; background-color: #f0f0f0; }
.thumbnail-box img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.text-box { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.category { font-size: 0.75rem; font-weight: 700; background-color: var(--point-color-1); color: var(--point-text-color); padding: 4px 10px; border-radius: 20px; align-self: flex-start; margin-bottom: 12px; }
.title { font-family: var(--font-title); font-size: 1.25rem; font-weight: 600; color: var(--title-color); margin-bottom: 8px; line-height: 1.4; }
.summary { font-size: 0.9rem; color: #6c757d; margin-bottom: 15px; flex-grow: 1; }
.date { font-size: 0.8rem; color: #adb5bd; text-align: right; margin-top: auto; }

/* --- 게시물 본문 --- */
.post-content-area { max-width: 800px; margin: 0 auto; padding: 50px; background-color: #ffffff; border-radius: 12px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07); }
.post-header { text-align: center; margin-bottom: 40px; padding-bottom: 30px; border-bottom: 1px solid var(--border-color); }
.post-title { font-family: 'Orbitron', sans-serif; font-size: 30px; line-height: 1.4; color: #5B2C6F; text-shadow: 0 0 5px rgba(224, 64, 251, 0.6); margin-bottom: 15px; }
.post-meta { color: #888; font-size: 0.9rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1em 0; }

.post-body h2 {
    position: relative;
    color: #00aaff;
    margin-top: 2.5em;
    margin-bottom: 1em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    padding-bottom: 2px;
    font-size: 1.8rem;
    border-bottom: 1px solid;
    border-image: linear-gradient(to right, #00aaff, #e04fb) 1;
}

.post-body h2::after {
    display: none;
}

.post-body h3 {
    font-family: var(--font-title);
    font-weight: 600;
    color: #304090;
    margin-top: 2.5em;
    margin-bottom: 1em;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.post-body th,
.post-body td {
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    text-align: left;
}

.post-body th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.post-body tr:nth-of-type(even) {
    background-color: #fdfdfd;
}

/* --- 본문 컴포넌트 --- */
.quick-facts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; }
.related-reading-box { border: 1px solid var(--border-color); background-color: #fafafa; padding: 15px 20px; border-radius: 10px; margin: 2em 0; font-size: 0.9rem; }
.related-reading-box strong { margin-right: 10px; }

details { border: 1px solid var(--border-color); background-color: #fafafa; padding: 20px; border-radius: 10px; margin: 30px 0; }
details summary { font-weight: 600; cursor: pointer; }
details ol { margin-top: 15px; padding-left: 25px; }
details ol li { line-height: 1.5; margin-bottom: 8px; }

/* --- About 페이지 --- */
.about-profile-container { display: flex; align-items: center; gap: 20px; margin-bottom: 2em; }
.about-profile-logo { height: 80px; width: 80px; border-radius: 50%; flex-shrink: 0; }
.post-body .about-name { margin-bottom: 0; border-bottom: none; padding-bottom: 0; margin-top: 0; }
.post-body .about-curator { font-size: 1.2rem; color: #FF8C00; font-weight: 600; margin-top: 0.25em; }
.post-body .about-divider { border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0)); margin: 2.5em 0; }
.post-body .about-section-title { font-family: 'Rajdhani', sans-serif; font-size: 1.8rem; font-weight: 700; color: #00aaff; margin-top: 2.5em; margin-bottom: 1em; padding-bottom: 3px; border-bottom: 1px solid; border-image: linear-gradient(to right, #00aaff, #e04fb) 1; }
.post-body .about-list { list-style-type: '✓  '; padding-left: 20px; }
.post-body .about-list li { margin-bottom: 0.8em; }
.post-body .about-contact { margin-top: 2.5em; font-size: 1rem; color: #555; text-align: center; background-color: #f9f9f9; padding: 20px; border-radius: 8px; }
.post-body .about-email-link { color: #007bff; text-decoration: underline; font-weight: 600; }

/* --- 카테고리 페이지 --- */
.category-index-container { margin-bottom: 3em; padding-bottom: 2em; border-bottom: 1px solid var(--border-color); }
.category-index-container h3 { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; margin-bottom: 1em; }
.category-index { list-style-type: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.index-item a { display: inline-block; padding: 8px 15px; background-color: #f5f5f5; border-radius: 20px; font-size: 0.9rem; font-weight: 600; transition: all 0.2s ease; }
.index-item a:hover { background-color: #FF8C00; color: #fff; }
.category-archive-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5em; }
.category-group { margin-bottom: 0; }
.category-name { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--title-color); margin-bottom: 1em; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5em; }
.category-post-list { list-style-type: none; padding-left: 0; }
.category-post-list li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.category-post-list a { font-weight: 600; font-size: 0.9rem; color: var(--text-color); }
.category-post-list .post-date { font-size: 0.8rem; color: #888; display: block; margin-top: 4px; }

/* --- 페이지네이션, 댓글, 푸터 --- */
.pagination { display: flex; justify-content: center; align-items: center; padding: 2rem 0; gap: 8px; clear: both; }
.pagination-item { display: flex; justify-content: center; align-items: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 8px; text-decoration: none; font-weight: 600; transition: all 0.2s ease; background-color: #ffffff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); color: var(--text-color); font-size: 0.9rem; }
.pagination-item.arrow { font-size: 1.2rem; }
.pagination-item:hover { transform: translateY(-2px); background-color: #FF8C00; color: #fff; border-color: #FF8C00; }
.pagination-item.active { background-color: #FF8C00; color: #fff; border-color: #FF8C00; cursor: default; transform: none; box-shadow: 0 4px 10px rgba(255, 140, 0, 0.3); }
.pagination-item.disabled { color: #ccc; background-color: #f9f9f9; cursor: not-allowed; box-shadow: none; }
.pagination-item.disabled:hover { transform: none; background-color: #f9f9f9; border-color: var(--border-color); color: #ccc; }

.comments-section { margin-top: 4em; padding-top: 2em; border-top: 1px solid var(--border-color); }
.comments-section h2 { border-bottom: none; text-align: center; margin-bottom: 2em; }

#footer { text-align: center; }
.footer-links { margin-bottom: 15px; }
.footer-links a { color: #555; margin: 0 10px; text-decoration: underline; }
.footer-links a:hover { color: #FF8C00; }

.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 2em 0; }
.table-scroll-hint { display: none; font-size: 0.8rem; color: #888; text-align: right; margin-bottom: 0.5em; padding-right: 5px; }

/* --- 반응형 디자인 (하나로 통합) --- */
@media (max-width: 768px) {
    .container { margin: 20px auto; }
    #header .header-inner { flex-direction: column; height: auto; padding: 20px; gap: 15px; }
    #header .site-logo { height: 60px; }
    #header .site-title { font-size: 1.6rem; }
    .post-list { grid-template-columns: 1fr; gap: 25px; }
    .post-content-area { padding: 30px; }
    .post-title { font-size: 2.2rem; }
    .quick-facts-grid { grid-template-columns: 1fr; }
    .about-profile-container { flex-direction: column; text-align: center; }
    .table-scroll-hint { display: block; }
    .category-archive-grid { grid-template-columns: 1fr; }
}
/* --- 검색 페이지 스타일 --- */
.search-container {
  margin-top: 2em;
}

#search-input {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.2rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 2em;
  transition: border-color 0.2s ease;
}

#search-input:focus {
  outline: none;
  border-color: #FF8C00;
}

#search-results {
  list-style-type: none;
  padding-left: 0;
}

.search-result-item {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  border-color: #FF8C00;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.search-result-item a {
  text-decoration: none;
  display: block;
}

.search-result-item h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  color: #007bff;
  margin: 0 0 0.5em 0;
}

.search-result-item p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1em;
}

.search-result-item .search-result-date {
  font-size: 0.8rem;
  color: #888;
}
/* --- 관련 글 섹션 스타일 --- */
.related-posts-section {
  margin-top: 4em; /* 본문과 관련 글 섹션 사이의 간격 */
  padding-top: 2em;
  border-top: 1px solid var(--border-color); /* 윗부분에 구분선 추가 */
}

/* 관련 글 섹션의 h2 제목에는 밑줄을 없애기 위한 예외 처리 */
.related-posts-section h2 {
  border-bottom: none;
  text-align: center;
  margin-bottom: 2em;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 데스크탑에서는 3단 */
  gap: 20px;
}

/* 관련 글 아이템 스타일 (홈페이지와 비슷하지만 조금 작게) */
.post-item.related .text-box {
  padding: 15px;
}

.post-item.related .title {
  font-size: 1rem; /* 제목 글씨 크기 축소 */
  line-height: 1.3;
}

/* 모바일 화면에서는 1단으로 변경 */
@media (max-width: 768px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
/* --- 태그 페이지 스타일 --- */
.tag-index-container {
  margin-bottom: 3em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--border-color);
}

.tag-index-container h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1em;
}

.tag-index {
  list-style-type: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-group {
  margin-bottom: 3em;
}

.tag-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--title-color);
  margin-bottom: 1em;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5em;
}

.tag-post-list {
  list-style-type: none;
  padding-left: 0;
}

.tag-post-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.tag-post-list a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-color);
}

.tag-post-list a:hover {
  color: #FF8C00;
}

.tag-post-list .post-date {
  font-size: 0.8rem;
  color: #888;
  display: block;
  margin-top: 4px;
}
