/* ============================================================
   생활의 달인 — 티스토리 스킨 CSS
   티스토리 스킨 편집 > CSS 탭에 전체 내용을 붙여넣으세요.
   ============================================================ */

/* ── 0. CSS 변수 ── */
:root {
  --cream : #fdf6ee;
  --beige : #f5e8d5;
  --sand  : #e8d4b8;
  --orange: #e07b39;
  --od    : #c4622a;
  --brown : #6b3d1e;
  --text  : #3a2a1a;
  --muted : #9a7f66;
  --white : #ffffff;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(107,61,30,.08);
  --trans : all .2s ease;
  --maxw  : 1100px;
}

/* ── 1. 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
}
a   { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; padding: 0; margin: 0; }

/* ── 2. 헤더 ── */
#header {
  background: linear-gradient(135deg, #6b3d1e 0%, #a0561f 55%, #e07b39 100%);
  color: var(--white);
  text-align: center;
  padding: 60px 24px 44px;
}
.header-inner { max-width: 720px; margin: 0 auto; }

.header-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  font-size: 12px; font-weight: 500; letter-spacing: .08em;
  padding: 4px 14px; margin-bottom: 16px;
}
#blog-title {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700; line-height: 1.2; margin-bottom: 12px;
}
#blog-title a { color: var(--white); }
#blog-desc {
  font-size: 14px; color: rgba(255,255,255,.82);
  max-width: 460px; margin: 0 auto 24px;
}
#search-form {
  display: flex; max-width: 360px; margin: 0 auto;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 28px; overflow: hidden;
}
#search-form input[type="text"] {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 10px 18px; color: var(--white); font-size: 14px;
}
#search-form input::placeholder { color: rgba(255,255,255,.6); }
#search-form button {
  background: var(--white); border: none; cursor: pointer;
  padding: 10px 18px; color: var(--od); font-size: 14px; font-weight: 700;
  border-radius: 0 28px 28px 0; flex-shrink: 0; transition: var(--trans);
}
#search-form button:hover { background: #ffd59e; }

/* ── 3. 네비게이션 ── */
#nav {
  background: var(--white);
  border-bottom: 1px solid var(--sand);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 6px rgba(107,61,30,.07);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.nav-logo {
  font-family: 'Noto Serif KR', serif;
  font-size: 17px; font-weight: 700;
  color: var(--brown); padding: 13px 0;
  white-space: nowrap; flex-shrink: 0;
}
.nav-logo em { color: var(--orange); font-style: normal; }

/* 티스토리 [##_category_list_##] 출력 ul/li/a 대응 */
.nav-menu ul {
  display: flex; flex-wrap: wrap; gap: 2px; list-style: none;
}
.nav-menu ul li a {
  display: block; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  white-space: nowrap; transition: var(--trans);
}
.nav-menu ul li a:hover { color: var(--orange); background: var(--beige); }
.nav-menu ul li ul { display: none; } /* 서브카테고리 숨김 */

/* ── 4. 본문 래퍼 ── */
#content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 24px 56px;
}

/* ── 5. 섹션 타이틀 (목록 페이지) ── */
.section-heading {
  font-family: 'Noto Serif KR', serif;
  font-size: 20px; font-weight: 700; color: var(--brown);
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
}
.section-heading::before {
  content: ''; display: block;
  width: 4px; height: 22px; border-radius: 2px;
  background: linear-gradient(180deg, var(--orange), var(--od));
  flex-shrink: 0;
}

/* ── 6. 글 그리드 ── */
/*
  .post-grid 는 목록 페이지에서는 3열 카드 그리드,
  퍼머링크 페이지에서는 .single-wrap 하나만 담습니다.
*/
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/*
  ★ 핵심: 퍼머링크 페이지에서는 .single-wrap 이 그리드 안에 생기고
          .post-card 가 그 뒤에 생깁니다.
  .single-wrap 이 있을 때 → 전체 너비, .post-card 숨김,
  .section-heading 숨김 처리를 CSS 형제 선택자로 처리합니다.
*/

/* 개별 글 본문: 그리드 전체 너비 차지 */
.single-wrap {
  grid-column: 1 / -1;
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 48px;
}

/* 퍼머링크 페이지일 때 .post-card 숨김 */
.single-wrap ~ .post-card { display: none !important; }

/* 퍼머링크 페이지일 때 .section-heading 숨김 */
.post-grid:has(.single-wrap) ~ * .section-heading,
.single-wrap ~ .section-heading { display: none; }

/* ── 7. 개별 글 헤더 ── */
.single-header {
  border-bottom: 2px solid var(--text);
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.single-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.8rem; font-weight: 700;
  line-height: 1.35; margin-bottom: 10px;
  color: var(--text);
}
.single-date { font-size: 13px; color: var(--muted); }

/* ── 8. 자동 목차 (TOC) ── */
#toc-wrap {
  background: #f8f9fa;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 32px;
}
.toc-heading {
  font-size: 14px; font-weight: 700;
  color: #495057; margin-bottom: 10px;
}
#toc-list { list-style: none; padding: 0; margin: 0; }
#toc-list li { margin-bottom: 6px; }
#toc-list li a {
  font-size: 14px; color: #495057;
  text-decoration: none; transition: var(--trans);
}
#toc-list li a:hover { color: var(--orange); text-decoration: underline; }
#toc-list .toc-sub { padding-left: 16px; }
#toc-list .toc-sub a { font-size: 13px; color: var(--muted); }

/* ── 9. 개별 글 본문 ── */
#article-body {
  line-height: 1.85;
  color: #3a3a3a;
  font-size: 15px;
}
#article-body h2 {
  font-size: 1.45rem; font-weight: 700;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
  color: var(--text);
}
#article-body h3 {
  font-size: 1.2rem; font-weight: 600;
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--orange);
  color: var(--text);
}
#article-body p  { margin-bottom: 20px; }
#article-body a  { color: var(--orange); text-decoration: underline; }
#article-body img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
#article-body blockquote {
  border-left: 4px solid var(--orange);
  background: var(--beige);
  margin: 20px 0; padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  color: var(--brown); font-style: italic;
}
#article-body ul,
#article-body ol  { margin: 12px 0 20px 22px; }
#article-body ul  { list-style: disc; }
#article-body ol  { list-style: decimal; }
#article-body li  { margin-bottom: 6px; }
#article-body code {
  background: #f1f3f5; color: #c0392b;
  padding: 2px 6px; border-radius: 4px; font-size: .9em;
}
#article-body pre {
  background: #2d2d2d; color: #f8f8f2;
  padding: 20px; border-radius: 8px;
  overflow-x: auto; margin: 20px 0; line-height: 1.6;
}
#article-body pre code { background: none; color: inherit; padding: 0; }
#article-body table  { width: 100%; border-collapse: collapse; margin: 20px 0; }
#article-body th,
#article-body td     { padding: 10px 14px; border: 1px solid var(--sand); font-size: 14px; }
#article-body th     { background: var(--beige); font-weight: 700; }

/* ── 10. 목록 카드 ── */
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--trans);
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(107,61,30,.13);
}

/* 썸네일 */
.card-thumb {
  display: block; width: 100%; height: 176px;
  overflow: hidden; flex-shrink: 0; background: var(--beige);
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.post-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #fde8d0, #f5c98a);
}

/* 카드 본문 */
.card-body {
  padding: 18px;
  display: flex; flex-direction: column; flex: 1;
}
.card-cat { font-size: 11px; font-weight: 700; color: var(--orange); margin-bottom: 6px; }
.card-cat a { color: var(--orange); }
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  line-height: 1.45; margin-bottom: 8px;
}
.card-title a:hover { color: var(--orange); }
.card-summary {
  font-size: 12px; color: var(--muted); flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 14px; padding-top: 10px;
  border-top: 1px solid var(--beige);
  font-size: 11px; color: var(--muted);
}

/* ── 11. 페이지네이션 ── */
#paging {
  display: flex; justify-content: center;
  gap: 6px; flex-wrap: wrap; margin-top: 48px;
}
#paging a, #paging span, #paging strong {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--sand); background: var(--white);
  color: var(--muted); transition: var(--trans);
}
#paging strong { background: var(--orange); color: var(--white); border-color: var(--orange); }
#paging a:hover { background: var(--beige); color: var(--orange); }

/* ── 12. 하단 위젯 ── */
#sub-info {
  background: var(--white);
  border-top: 1px solid var(--sand);
  padding: 52px 24px;
}
.sub-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px;
}
.sub-title {
  font-size: 14px; font-weight: 700; color: var(--brown);
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 2px solid var(--beige);
}
.profile-box { display: flex; align-items: center; gap: 14px; }
.profile-icon {
  width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--orange), var(--brown));
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.profile-name { font-size: 15px; font-weight: 700; color: var(--brown); margin-bottom: 4px; }
.profile-bio  { font-size: 12px; color: var(--muted); line-height: 1.6; }

.sub-cat ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sub-cat ul li a {
  display: flex; align-items: center; padding: 7px 10px;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text); transition: var(--trans);
}
.sub-cat ul li a:hover { background: var(--beige); color: var(--orange); }
.sub-cat ul li ul { padding-left: 10px; }
.sub-cat ul li ul a { font-size: 12px; color: var(--muted); }

.tag-box { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-box a {
  background: var(--beige); color: var(--brown);
  font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 20px; transition: var(--trans);
}
.tag-box a:hover { background: var(--orange); color: var(--white); }

/* ── 13. 푸터 ── */
#footer {
  background: var(--brown);
  color: rgba(255,255,255,.65);
  text-align: center; padding: 36px 24px;
}
.footer-logo {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px; font-weight: 700;
  color: var(--white); margin-bottom: 6px;
}
.footer-logo em { color: #ffd59e; font-style: normal; }
.footer-sub  { font-size: 13px; margin-bottom: 18px; }
.footer-links {
  display: flex; justify-content: center; gap: 22px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.footer-links a { font-size: 13px; color: rgba(255,255,255,.6); transition: var(--trans); }
.footer-links a:hover { color: #ffd59e; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.35); }

/* ── 14. 맨 위로 버튼 ── */
#btn-top {
  position: fixed; bottom: 28px; right: 24px;
  width: 44px; height: 44px;
  background: var(--orange); color: var(--white);
  border: none; border-radius: 50%; cursor: pointer;
  font-size: 18px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(224,123,57,.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; z-index: 999;
  transition: opacity .25s, transform .25s;
}
#btn-top:hover { background: var(--od); transform: translateY(-3px); }

/* ── 15. 반응형 ── */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .sub-inner  { grid-template-columns: 1fr 1fr; }
  .single-wrap { padding: 32px 28px; }
}
@media (max-width: 560px) {
  .post-grid  { grid-template-columns: 1fr; }
  .sub-inner  { grid-template-columns: 1fr; }
  .nav-menu   { display: none; }
  #content    { padding: 28px 16px 40px; }
  .single-wrap { padding: 24px 16px; }
  .single-title { font-size: 1.4rem; }
}

/* ==========================================
   🌊 블로그 첫 페이지 및 전체 바탕색 변경 (아쿠아 블루)
========================================== */
body, #main, .page-wrap, #wrap {
  background-color: #e0f7fa !important; /* 부드럽고 청량한 파스텔 아쿠아 블루 */
}

/* ==========================================
   🌊 헤더와 푸터 영역을 진한 아쿠아 블루로 변경
========================================== */
#header, .header-inner, #footer, .footer-inner, footer, .footer {
  background-color: #0077b6 !important; /* 깊고 진한 아쿠아 블루 */
  background: #0077b6 !important;
}

/* 글자색이 묻히지 않도록 흰색으로 강조 */
#blog-title a, #blog-desc, .header-badge, #footer, #footer a, .footer-inner, .footer p {
  color: #ffffff !important;
}

/* ==========================================
   ✨ [추가] 본문 레이아웃, 구분선, 목차 스타일
========================================== */

/* 1. 글을 클릭하고 들어갔을 때의 전체 본문 박스 */
.entry-content, .single-wrap {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: #ffffff !important; /* 본문은 글이 잘 보이게 흰색 바탕 */
  border: 1px solid #bde0fe !important; /* 연한 아쿠아 블루 테두리 */
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 180, 216, 0.05); /* 은은한 푸른빛 그림자 */
}

/* 2. 자동 목차(TOC) 전체 박스 디자인 */
#toc-container {
  background-color: #f0fdfa !important; /* 아주 연한 아쿠아 빛 배경 */
  border: 1px solid #00b4d8 !important; /* 아쿠아 블루 테두리 */
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 40px;
}
.toc-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #0077b6;
}
#toc {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
#toc li {
  margin-bottom: 8px;
}
#toc li a {
  text-decoration: none;
  color: #495057;
  transition: color 0.2s;
}
#toc li a:hover {
  color: #00b4d8 !important; /* 마우스 올리면 아쿠아블루 */
  text-decoration: underline;
}
/* 대제목(H2)과 소제목(H3) 목차 들여쓰기 구분 */
.toc-h2 { font-weight: 600; }
.toc-h3 { padding-left: 15px; font-size: 0.95rem; color: #666; }

/* 3. 본문 안의 제목(H2, H3) 및 구분선 스타일 */
.entry-content h2, .single-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #00b4d8 !important; /* 제목 아래 아쿠아블루 구분선 */
  color: #212529;
}
.entry-content h3, .single-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 4px solid #00b4d8 !important; /* 소제목 왼쪽 세로 포인트 선 */
  color: #0077b6;
}
