/* ==========================================================
   몸마음 살림노트 — 티스토리 스킨
   팔레트: 아이보리 종이 / 세이지 그린 / 우드 브라운
   ========================================================== */

:root {
  --paper: #FAF7F0;
  --paper-2: #F3EDE0;
  --card: #FFFDF9;
  --sage: #6F8F73;
  --sage-dark: #4F6E54;
  --sage-tint: #E4ECE3;
  --sage-tint-2: #F0F4EE;
  --wood: #9A7555;
  --wood-dark: #5C4634;
  --ink: #33302A;
  --ink-2: #6B655B;
  --ink-3: #9A9388;
  --line: #E5DDCD;
  --serif: "Gowun Batang", "Noto Serif KR", "Nanum Myeongjo", Georgia, serif;
  --sans: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 45, 20, .04), 0 8px 24px -12px rgba(60, 45, 20, .18);
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.8 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
.screen_out { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; top: -100px; left: 0; padding: 8px 14px; background: var(--sage-dark); color: #fff; z-index: 100; }
.skip:focus { top: 0; }
.inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--sage); }
.section-title { font-size: 20px; margin-bottom: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border: 0; border-radius: 999px;
  background: var(--sage-dark); color: #fff; font-weight: 500; cursor: pointer;
}
.btn:hover { background: var(--sage); }

/* ---------- 헤더 ---------- */
#header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 24px; padding-top: 22px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--wood-dark); letter-spacing: -.01em; }
.brand-tagline { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; letter-spacing: .02em; }

.util-menu ul { display: flex; gap: 22px; }
.util-menu a { font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.util-menu a:hover { color: var(--sage-dark); }

.menu-toggle { display: none; position: relative; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.menu-toggle-bar, .menu-toggle-bar::before, .menu-toggle-bar::after {
  position: absolute; left: 11px; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; content: ""; transition: transform .2s;
}
.menu-toggle-bar { top: 20px; }
.menu-toggle-bar::before { top: -6px; left: 0; }
.menu-toggle-bar::after { top: 6px; left: 0; }
.is-open .menu-toggle-bar { background: transparent; }
.is-open .menu-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.is-open .menu-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* 카테고리 내비게이션 */
.nav-bar { border-top: 1px solid var(--line); background: var(--card); }
.nav-row { display: flex; align-items: center; gap: 24px; min-height: 56px; }
#gnb { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#gnb::-webkit-scrollbar { display: none; }
#gnb .tt_category > li { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#gnb .category_list { display: flex; gap: 4px; }
#gnb .sub_category_list, #gnb .c_cnt { display: none; }
#gnb a { display: inline-block; padding: 16px 14px; font-size: 15px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
#gnb a:hover { color: var(--sage-dark); border-bottom-color: var(--sage); }
#gnb .link_tit { font-size: 0; }
#gnb .link_tit::before { content: "전체 글"; font-size: 15px; }
#gnb .tt_category > li > .link_tit { padding-left: 0; }

/* 검색 */
.search { display: flex; align-items: center; height: 38px; padding-left: 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); flex: none; }
.search input { width: 140px; border: 0; background: transparent; outline: 0; font-size: 14px; }
.search input::placeholder { color: var(--ink-3); }
.search button { display: flex; align-items: center; justify-content: center; width: 38px; height: 36px; border: 0; background: transparent; color: var(--sage-dark); cursor: pointer; }
.search button svg { width: 18px; height: 18px; }

/* ---------- 홈 소개 ---------- */
.hero { display: none; background: linear-gradient(180deg, var(--paper-2), var(--paper)); border-bottom: 1px solid var(--line); }
#tt-body-index .hero { display: block; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 48px; padding-top: 64px; padding-bottom: 64px; }
.hero-title { font-size: 36px; margin: 12px 0 18px; color: var(--wood-dark); }
.hero-desc { font-size: 16px; color: var(--ink-2); max-width: 460px; }
.pillars { display: grid; gap: 12px; }
.pillars li { display: grid; grid-template-columns: 34px 64px 1fr; align-items: baseline; gap: 12px; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pillar-no { font-family: var(--serif); font-size: 13px; color: var(--sage); letter-spacing: .1em; }
.pillars strong { font-family: var(--serif); font-size: 20px; color: var(--sage-dark); }
.pillars p { font-size: 14px; color: var(--ink-2); }

/* ---------- 레이아웃 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: 48px; padding-bottom: 72px; }
.main { min-width: 0; }

/* 목록 제목 */
.list-head { padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.list-title { font-size: 28px; color: var(--wood-dark); margin-top: 6px; }
.list-count { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--sage); margin-left: 6px; vertical-align: middle; }
.list-count::before { content: "· "; }
.list-desc { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.list-desc:empty { display: none; }

/* ---------- 글 카드 ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(60, 45, 20, .05), 0 18px 34px -14px rgba(60, 45, 20, .25); }
.card-thumb {
  display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--sage-tint) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M8 21.5 24 8l16 13.5V37a4 4 0 0 1-4 4H12a4 4 0 0 1-4-4Z' fill='%23F3EDE0' stroke='%236F8F73' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M24 37c-7-4.2-8.2-12.6 0-18 8.2 5.4 7 13.8 0 18Z' fill='%236F8F73'/%3E%3C/svg%3E") center / 64px no-repeat;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-thumb img { transform: scale(1.03); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.card-cate { align-self: flex-start; font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--sage-dark); padding: 3px 10px; border-radius: 999px; background: var(--sage-tint); }
.card-notice .card-cate { background: #F2E6D8; color: var(--wood); }
.card-title { font-size: 19px; margin: 12px 0 8px; }
.card-title a:hover { color: var(--sage-dark); }
.card-summary {
  font-size: 14.5px; color: var(--ink-2); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; gap: 12px; margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--ink-3); }
.card-comments::before { content: "· "; }

/* ---------- 글 본문 ---------- */
.entry { grid-column: 1 / -1; min-width: 0; }
.entry-head { padding-bottom: 26px; margin-bottom: 34px; border-bottom: 1px solid var(--line); }
.entry-cate { display: inline-block; font-size: 12.5px; font-weight: 500; letter-spacing: .08em; color: var(--sage-dark); padding: 3px 12px; border-radius: 999px; background: var(--sage-tint); }
.entry-title { font-size: 34px; margin: 16px 0 14px; color: var(--wood-dark); }
.entry-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--ink-3); }
.entry-author:empty { display: none; }
.entry-admin { margin-left: auto; }
.entry-admin a { margin-left: 10px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

.entry-content { font-size: 17px; line-height: 1.9; color: var(--ink); }
.entry-content p { margin: 0 0 1.3em; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin: 2.2em 0 .8em; color: var(--wood-dark); }
.entry-content h2 { font-size: 26px; padding-bottom: .4em; border-bottom: 1px solid var(--line); }
.entry-content h3 { font-size: 22px; }
.entry-content h4 { font-size: 18px; }
.entry-content a { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(111, 143, 115, .5); }
.entry-content img { margin: 0 auto; border-radius: 10px; }
.entry-content figure { margin: 2em 0; }
.entry-content figcaption { margin-top: 8px; text-align: center; font-size: 13.5px; color: var(--ink-3); }
.entry-content blockquote { margin: 2em 0; padding: 18px 24px; border-left: 4px solid var(--sage); background: var(--sage-tint-2); border-radius: 0 10px 10px 0; color: var(--ink-2); font-family: var(--serif); }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content ul, .entry-content ol { margin: 0 0 1.3em 1.4em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: .35em; }
.entry-content hr { margin: 2.5em auto; width: 64px; border: 0; border-top: 2px solid var(--sage); }
.entry-content table { width: 100%; margin: 1.8em 0; border-collapse: collapse; font-size: 15px; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid var(--line); vertical-align: top; }
.entry-content th { background: var(--paper-2); font-weight: 500; }
.entry-content pre { padding: 18px 20px; overflow-x: auto; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1.6; }
.entry-content code { font-family: Consolas, "D2Coding", monospace; }
.entry-content :not(pre) > code { padding: 2px 6px; border-radius: 4px; background: var(--paper-2); font-size: .92em; color: var(--wood-dark); }

.entry-tags { margin-top: 44px; font-size: 0; }
.entry-tags a { display: inline-block; margin: 0 8px 8px 0; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; color: var(--ink-2); }
.entry-tags a::before { content: "#"; color: var(--sage); margin-right: 2px; }
.entry-tags a:hover { border-color: var(--sage); color: var(--sage-dark); }

/* 관련 글 */
.related { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); }
.related-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.related-list a { display: block; }
.related-thumb { display: block; aspect-ratio: 16 / 10; margin-bottom: 10px; overflow: hidden; border-radius: 10px; background: var(--sage-tint); }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-title { display: block; font-size: 15px; font-weight: 500; line-height: 1.5; }
.related-list a:hover .related-title { color: var(--sage-dark); }
.related-date { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }

/* 댓글 (티스토리 기본 댓글 영역) */
.comments { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); }

/* 보호 글 */
.protected-box { padding: 36px 28px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.protected-box p { margin-bottom: 18px; color: var(--ink-2); }
.protected-form { display: flex; justify-content: center; gap: 8px; }
.protected-form input { width: 200px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); outline: 0; }
.protected-form input:focus { border-color: var(--sage); }

/* 태그 페이지 · 방명록 */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; color: var(--ink-2); }
.tag-list a::before { content: "#"; color: var(--sage); margin-right: 2px; }
.tag-list a:hover { border-color: var(--sage); color: var(--sage-dark); }
.tag-list .cloud1, .tag-list .cloud2 { font-weight: 500; color: var(--sage-dark); border-color: var(--sage-tint); background: var(--sage-tint-2); }
.guestbook .list-head { margin-bottom: 24px; }

/* 페이지 이동 */
.paging { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 48px; font-size: 14px; }
.paging-nums { display: flex; gap: 4px; }
.paging a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 999px; color: var(--ink-2); }
.paging a:hover { background: var(--sage-tint); color: var(--sage-dark); }
.paging a.selected { background: var(--sage-dark); color: #fff; }
.paging .no-more-prev, .paging .no-more-next { opacity: .35; pointer-events: none; }

/* ---------- 사이드바 ---------- */
.sidebar { min-width: 0; }
.widget { margin-bottom: 36px; }
.widget-title { font-size: 15px; letter-spacing: .04em; color: var(--wood-dark); padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--sage-tint); }
.widget-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.55; }
.widget-list li:last-child { border-bottom: 0; }
.widget-list a:hover { color: var(--sage-dark); }
.widget-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.widget ul:empty { display: none; }

/* 프로필 */
.profile { padding: 28px 22px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.profile-img { display: block; width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; overflow: hidden; background: var(--sage-tint); border: 3px solid var(--paper-2); }
.profile-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { display: block; font-family: var(--serif); font-size: 19px; color: var(--wood-dark); }
.profile-desc { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.profile-desc:empty { display: none; }
.profile-links { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.profile-links a { padding: 5px 12px; border-radius: 999px; background: var(--sage-tint-2); font-size: 12.5px; color: var(--sage-dark); }
.profile-links a:hover { background: var(--sage-tint); }

/* 최근 글 · 인기 글 */
.widget-posts li { border-bottom: 1px dashed var(--line); }
.widget-posts li:last-child { border-bottom: 0; }
.widget-posts a { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.widget-thumb { flex: none; width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--sage-tint); }
.widget-thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-post-text { min-width: 0; }
.widget-post-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 500; line-height: 1.5; }
.widget-posts a:hover .widget-post-title { color: var(--sage-dark); }
.widget-post-date { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-3); }

/* 카테고리 트리 */
.widget-category a { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 14px; color: var(--ink); }
.widget-category a:hover { color: var(--sage-dark); }
.widget-category .c_cnt { font-size: 12px; color: var(--ink-3); }
.widget-category .link_tit { font-weight: 500; }
.widget-category .category_list { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 4px; }
.widget-category .category_list > li > a::before { content: ""; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: var(--sage); }
.widget-category .category_list > li > a { justify-content: flex-start; }
.widget-category .category_list > li > a .c_cnt { margin-left: auto; }
.widget-category .sub_category_list { padding-left: 16px; }
.widget-category .link_sub_item { font-size: 13.5px; color: var(--ink-2); }
.widget-category .link_sub_item::before { content: "–"; margin-right: 8px; color: var(--ink-3); }
.widget-category .link_sub_item .c_cnt { margin-left: auto; }

/* 방문자 */
.widget-count dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.widget-count dl > div { padding: 12px 8px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.widget-count dt { font-size: 12px; color: var(--ink-3); }
.widget-count dd { margin: 2px 0 0; font-family: var(--serif); font-size: 17px; color: var(--wood-dark); }

/* ---------- 푸터 ---------- */
#footer { background: var(--paper-2); border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 28px; font-size: 13.5px; color: var(--ink-2); }
.footer-brand { font-family: var(--serif); font-weight: 700; color: var(--wood-dark); }
.footer-brand span { font-family: var(--sans); font-weight: 400; color: var(--ink-3); }

/* ---------- 반응형 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 56px; }
  .sidebar { padding-top: 40px; border-top: 1px solid var(--line); }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 44px; padding-bottom: 44px; }
  .hero-title { font-size: 30px; }
}

@media (max-width: 720px) {
  .inner { padding: 0 18px; }
  .header-row { padding-top: 16px; padding-bottom: 14px; gap: 12px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-title { font-size: 21px; }
  .brand-tagline { display: none; }
  .util-menu { display: none; }
  .menu-toggle { display: block; }
  .nav-bar { display: none; }
  .is-open .nav-bar { display: block; }
  .nav-row { flex-direction: column-reverse; align-items: stretch; gap: 4px; padding-top: 12px; padding-bottom: 14px; }
  .search { width: 100%; }
  .search input { flex: 1; width: auto; }
  #gnb { overflow: visible; }
  #gnb .tt_category > li, #gnb .category_list { flex-direction: column; align-items: stretch; gap: 0; }
  #gnb a { display: block; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
  #gnb .tt_category > li > .link_tit { padding-left: 4px; }
  #gnb a:hover { border-bottom-color: var(--line); }
  .hero-title { font-size: 26px; }
  .pillars li { grid-template-columns: 30px 52px 1fr; padding: 14px 16px; }
  .post-grid { grid-template-columns: 1fr; gap: 22px; }
  .entry-title { font-size: 27px; }
  .entry-content { font-size: 16px; }
  .related-list { grid-template-columns: 1fr; }
  .related-list a { display: flex; gap: 12px; align-items: center; }
  .related-thumb { flex: none; width: 96px; margin: 0; }
  .protected-form { flex-direction: column; align-items: center; }
  .footer-row { flex-direction: column; }
}
