:root{
  --bg:#faf6f0; --surface:#fffdf9; --ink:#3a322c; --muted:#8a7d6f;
  --accent:#b5654a; --accent2:#7a8450; --line:#ece3d6; --soft:#f3ebdf;
}
*{margin:0;padding:0;box-sizing:border-box}
img{display:block;max-width:100%}
a{text-decoration:none;color:inherit}
ul{list-style:none}
body{background:var(--bg);color:var(--ink);font-family:'Pretendard',sans-serif;font-size:16px;-webkit-font-smoothing:antialiased}
/* 인덱스 전용 영역(상단 히어로·상황별 / 하단 제철·재료·치트시트·원칙)은
   알려진 비-인덱스 페이지에서만 숨긴다. 기본=표시라 body id가 없어도 홈이 안 비는 fail-safe 유지.
   ⚠️ 검색/카테고리/태그/아카이브도 포함 — 안 그러면 결과 0건일 때 히어로만 덩그러니 남는다. */
:is(body#tt-body-page,body#tt-body-search,body#tt-body-tag,body#tt-body-category,body#tt-body-archive,body#tt-body-guestbook) :is(#home-top,#home-bottom){display:none}
.serif{font-family:'Fraunces','Noto Serif KR',serif}

/* ===== 타이포그래피 스케일 ===== */
.eyebrow{color:var(--accent);font-weight:600;font-size:13px;letter-spacing:.12em;text-transform:uppercase}
h1,h2,h3,h4,h5,h6{letter-spacing:-.01em}

/* ===== 헤더 ===== */
header{background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50}
.topbar{max-width:1120px;margin:0 auto;padding:18px 24px;display:flex;align-items:center;gap:28px}
.logo{font-family:'Fraunces','Noto Serif KR',serif;font-weight:600;font-size:23px;letter-spacing:-.01em;white-space:nowrap}
.logo span{color:var(--accent)}
nav.main ul{display:flex;gap:24px;font-size:15px;font-weight:500}
nav.main a:hover{color:var(--accent)}
/* 헤더 검색 폼(동작함). s_search 래퍼는 레이아웃 투명 처리 */
s_search{display:contents}
.search{margin-left:auto;display:flex;align-items:center;gap:7px;background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:7px 15px;transition:.18s}
.search:focus-within{border-color:var(--accent)}
.search .ico{color:var(--muted);font-size:16px;line-height:1}
.search input{border:0;background:transparent;outline:0;font-family:inherit;font-size:14px;color:var(--ink);width:150px}
.search input::placeholder{color:var(--muted)}

/* ===== 푸터 ===== */
footer{background:var(--surface);border-top:1px solid var(--line);margin-top:24px}
.foot{max-width:1120px;margin:0 auto;padding:42px 24px;display:flex;gap:48px;flex-wrap:wrap;color:var(--muted);font-size:14px}
.foot h4{font-family:'Fraunces','Noto Serif KR',serif;color:var(--ink);font-size:18px;margin-bottom:12px}
.foot a{display:block;padding:5px 0}
.foot a:hover{color:var(--accent)}

/* ===== 홈 — 히어로 ===== */
.hero{max-width:1120px;margin:0 auto;padding:44px 24px 8px;display:grid;grid-template-columns:1.15fr 1fr;gap:44px;align-items:center}
.hero .pic{aspect-ratio:4/3;border-radius:18px;overflow:hidden;box-shadow:0 24px 48px -24px rgba(120,70,40,.35)}
/* 이미지 없을 때(썸네일 없는 글·정적 히어로) 크림 placeholder — 업로드 파일 불필요, 깨진 아이콘 방지 */
.hero .pic,.card .pic,.hero-img .pic{background:var(--soft) url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='80'%20height='80'%20viewBox='0%200%2080%2080'%3E%3Ccircle%20cx='40'%20cy='40'%20r='22'%20fill='none'%20stroke='%23cdb79a'%20stroke-width='3'/%3E%3Ccircle%20cx='40'%20cy='40'%20r='9'%20fill='none'%20stroke='%23cdb79a'%20stroke-width='3'/%3E%3C/svg%3E") center/56px no-repeat}
.hero .pic img{width:100%;height:100%;object-fit:cover}
.hero h1{font-family:'Fraunces','Noto Serif KR',serif;font-weight:600;font-size:44px;line-height:1.16;margin:14px 0 16px;letter-spacing:-.01em}
.hero p{color:var(--muted);font-size:17px;line-height:1.75;max-width:42ch}
.meta{display:flex;gap:18px;margin-top:22px;font-size:14px;color:var(--muted)}
.meta b{color:var(--ink)}
.btn{display:inline-block;background:var(--accent);color:#fff;font-weight:600;font-size:15px;padding:13px 26px;border-radius:999px;cursor:pointer;border:0}
.btn:hover{filter:brightness(.94)}
.hero .btn{margin-top:24px}
.btn.ghost{background:var(--soft);color:var(--accent);font-weight:600}
.btn.ghost:hover{filter:brightness(.96)}

/* ===== 홈 — 섹션 + pills ===== */
.sec{max-width:1120px;margin:0 auto;padding:48px 24px}
.sec-head{display:flex;align-items:baseline;gap:14px;margin-bottom:24px}
.sec-head h2{font-family:'Fraunces','Noto Serif KR',serif;font-size:28px;font-weight:600}
.sec-head .all{margin-left:auto;color:var(--accent);font-weight:600;font-size:14px}
.sec-head .all:hover{opacity:.8}
.pills{display:flex;gap:10px;margin-bottom:28px;flex-wrap:wrap;align-items:center}
/* [##_category_list_##]의 ul/li를 투명 처리 → 각 카테고리 <a>가 pill 칩이 됨 (중첩 카테고리도 평탄화) */
.pills ul,.pills li{display:contents}
.pills a,.pill{font-size:14px;padding:8px 16px;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--muted);white-space:nowrap;line-height:1.4}
.pills a:hover,.pill:hover{border-color:var(--accent);color:var(--accent)}
.pill.on{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ===== 글 영역 컨테이너 ===== */
/* 기본=카드 그리드(인덱스·목록), 글 상세에서만 단일 컬럼 블록 (fail-safe) */
.article-area{max-width:1120px;margin:0 auto;padding:0 24px 48px;display:grid;grid-template-columns:repeat(3,1fr);gap:26px}
/* 티스토리 반복 래퍼 태그는 레이아웃 투명 처리: 라이브에선 엔진이 제거, 프리뷰에선 그리드를 통과시킴 */
s_article_rep,s_index_article_rep,s_permalink_article_rep{display:contents}
/* 글 상세: 그리드 해제, 읽기 컬럼 */
body#tt-body-page .article-area{display:block;max-width:760px}
/* 댓글 영역(티스토리 위젯이 자체 스타일) — 읽기 컬럼 폭·상단 여백만 */
.area-reply{max-width:760px;margin:48px auto 0;padding:0 24px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden;transition:.18s}
.card:hover{transform:translateY(-4px);box-shadow:0 22px 40px -22px rgba(120,70,40,.3)}
.card .pic{aspect-ratio:4/3;position:relative}
.card .pic img{width:100%;height:100%;object-fit:cover;display:block}
.card .tag{position:absolute;top:12px;left:12px;background:rgba(255,253,249,.92);color:var(--accent);font-size:12px;font-weight:600;padding:5px 11px;border-radius:999px}
.cbody{padding:18px 18px 22px}
.card h3{font-family:'Fraunces','Noto Serif KR',serif;font-size:20px;font-weight:600;line-height:1.35;margin-bottom:8px}
.card .sub{color:var(--muted);font-size:14px;line-height:1.6;margin-bottom:14px}
.card .info{display:flex;gap:14px;font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:13px}
.card .info span::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent2);margin-right:6px;vertical-align:middle}
.card a{color:inherit;display:block}

/* ===== 상세 — 헤더부 (Task 4) ===== */
.article{max-width:760px;margin:0 auto;padding:36px 24px 0}
.crumb{font-size:13px;color:var(--muted);margin-bottom:18px}
.crumb a:hover{color:var(--accent)}
.crumb .sep{margin:0 7px;opacity:.5}
.article h1{font-family:'Fraunces','Noto Serif KR',serif;font-weight:600;font-size:40px;line-height:1.2;letter-spacing:-.01em;margin:10px 0 16px}
.byline{display:flex;align-items:center;gap:14px;color:var(--muted);font-size:14px;margin-bottom:26px;flex-wrap:wrap}
.byline .stars{color:var(--accent)}
.byline .dot{opacity:.4}
.hero-img{max-width:980px;margin:0 auto;padding:0 24px}
.hero-img .pic{aspect-ratio:16/10;border-radius:18px;overflow:hidden;box-shadow:0 28px 56px -28px rgba(120,70,40,.4)}
.hero-img .pic img{width:100%;height:100%;object-fit:cover;display:block}
.body-txt{max-width:680px;margin:0 auto;padding:8px 24px;font-size:17px;line-height:1.85;color:#4a4138}
.body-txt p{margin:18px 0}

/* ===== 레시피 박스 (본문 삽입용 콘텐츠 컴포넌트) ===== */
.recipe-box{max-width:760px;margin:36px auto;padding:0 24px}
.recipe-box .inner{background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden}
.rb-head{background:var(--soft);padding:24px 30px;border-bottom:1px solid var(--line)}
.rb-head .k{color:var(--accent);font-weight:600;font-size:12px;letter-spacing:.12em;text-transform:uppercase}
.rb-head h2{font-family:'Fraunces','Noto Serif KR',serif;font-size:26px;font-weight:600;margin:6px 0 4px}
.rb-stats{display:flex;flex-wrap:wrap;gap:26px;padding:22px 30px;border-bottom:1px solid var(--line)}
.rb-stats .st{display:flex;flex-direction:column;gap:3px}
.rb-stats .st .lbl{font-size:12px;color:var(--muted);letter-spacing:.04em}
.rb-stats .st .val{font-family:'Fraunces','Noto Serif KR',serif;font-size:20px;font-weight:600}
.rb-sec{padding:26px 30px}
.rb-sec h3{font-family:'Fraunces','Noto Serif KR',serif;font-size:20px;font-weight:600;margin-bottom:16px;display:flex;align-items:center;gap:9px}
.rb-sec h3::before{content:"";width:22px;height:3px;background:var(--accent);border-radius:2px}
.ing{columns:2;column-gap:34px}
.ing li{break-inside:avoid;display:flex;gap:11px;padding:9px 0;border-bottom:1px dashed var(--line);font-size:15px;line-height:1.5}
.ing li input{margin-top:3px;accent-color:var(--accent)}
.ing li .amt{margin-left:auto;color:var(--muted);font-size:14px;white-space:nowrap}
.steps{counter-reset:step}
.steps li{position:relative;padding:0 0 24px 52px;border-left:2px solid var(--line);margin-left:16px}
.steps li:last-child{border-left-color:transparent;padding-bottom:4px}
.steps li::before{counter-increment:step;content:counter(step);position:absolute;left:-17px;top:-2px;width:32px;height:32px;border-radius:50%;background:var(--accent);color:#fff;font-family:'Fraunces',serif;font-weight:600;display:flex;align-items:center;justify-content:center;font-size:15px}
.steps li .txt{font-size:16px;line-height:1.75}
.steps li .shot{margin-top:12px;border-radius:12px;overflow:hidden;aspect-ratio:16/9;max-width:380px}
.steps li .shot img{width:100%;height:100%;object-fit:cover;display:block}
.tip{margin:0 30px 28px;background:var(--soft);border-radius:14px;padding:20px 22px}
.tip .k{font-family:'Fraunces','Noto Serif KR',serif;font-weight:600;color:var(--accent);margin-bottom:6px}
.tip p{font-size:15px;line-height:1.7;color:#5a4f45}
.rb-foot{display:flex;gap:12px;padding:0 30px 28px}

/* ===== 홈 하위 섹션 (07-홈-섹션-확장-제안) ===== */
.sec-head .sec-sub{color:var(--muted);font-size:14px}
.sec-lead{color:var(--muted);font-size:15px;margin:-14px 0 20px}

/* ① 상황별 진입 */
.situ{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.situ a{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:20px 22px;display:block;transition:.18s}
.situ a:hover{border-color:var(--accent);transform:translateY(-3px);box-shadow:0 18px 34px -22px rgba(120,70,40,.3)}
.situ .emo{font-size:24px;display:block;margin-bottom:10px}
.situ b{font-family:'Fraunces','Noto Serif KR',serif;font-size:18px;font-weight:600;display:block;margin-bottom:5px}
.situ i{font-style:normal;color:var(--muted);font-size:13.5px;line-height:1.5}

/* pills가 섹션의 마지막 요소면 아래 여백이 이중(28+48)으로 붙어 섹션 사이가 휑해진다 */
.sec>.pills:last-child{margin-bottom:0}
/* 하단부는 본문(카드 그리드)이 아니라 탐색 보조 영역 — 상단 48px보다 촘촘하게 */
#home-bottom .sec{padding-top:38px;padding-bottom:38px}

/* ④ 치트시트 */
.cheat{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.cheat-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:24px;display:flex;flex-direction:column}
a.cheat-card{transition:.18s}
a.cheat-card:hover{border-color:var(--accent);transform:translateY(-3px)}
.cheat-card h3{font-size:19px;font-weight:600;margin-bottom:14px}
.cheat-card p{color:var(--muted);font-size:14px;line-height:1.65}
/* 카드 높이가 그리드에 맞춰 늘어나도 링크는 항상 바닥에 붙는다 */
.cheat-card .go{color:var(--accent);font-weight:600;font-size:14px;display:inline-block;margin-top:auto;padding-top:16px}
.cheat-card dl div{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px dashed var(--line);font-size:15px}
.cheat-card dl div:last-child{border-bottom:0}
.cheat-card dt{color:var(--muted)}
.cheat-card dd{font-family:'Fraunces','Noto Serif KR',serif;font-weight:600}

/* ⑤ 원칙 + 구독 */
.creed{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:34px 36px;display:grid;grid-template-columns:1.6fr 1fr;gap:40px;align-items:center}
.creed h2{font-size:26px;font-weight:600;margin:8px 0 18px}
.creed ul{display:grid;gap:11px}
.creed li{font-size:15px;line-height:1.6;color:var(--muted);padding-left:20px;position:relative}
.creed li::before{content:"";position:absolute;left:0;top:9px;width:7px;height:7px;border-radius:50%;background:var(--accent2)}
.creed li b{color:var(--ink);margin-right:6px}
.creed-sub{border-left:1px solid var(--line);padding-left:36px}
.creed-sub h3{font-size:19px;font-weight:600;margin-bottom:8px}
.creed-sub p{color:var(--muted);font-size:14px;line-height:1.6;margin-bottom:16px}

/* ===== 목록 페이지 헤더 · 빈 상태 · 페이징 ===== */
.list-head{max-width:1120px;margin:0 auto;padding:40px 24px 8px}
.list-head h2{font-family:'Fraunces','Noto Serif KR',serif;font-size:30px;font-weight:600}
/* 건수는 본문과 같은 크기·액센트로 — muted 17px는 옆에 붙으면 거의 안 읽힌다(실측) */
.list-head .cnt{color:var(--accent);font-size:20px;font-weight:600;margin-left:2px}
.list-head .cnt::before{content:"("}
.list-head .cnt::after{content:")"}
.list-empty .inner .recover{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:22px}
.list-empty .inner .recover .pill{background:var(--bg)}
/* 카드도 상세글도 없을 때 = 결과 0건. :has() 미지원 브라우저에선 계속 숨김(회귀 없음) */
.list-empty{display:none}
body:not(:has(.card)):not(:has(.detail-article)) .list-empty{display:block;max-width:1120px;margin:0 auto;padding:20px 24px 60px}
.list-empty .inner{background:var(--surface);border:1px dashed var(--line);border-radius:18px;padding:48px 24px;text-align:center}
.list-empty .serif{font-family:'Fraunces','Noto Serif KR',serif;font-size:22px;font-weight:600;margin-bottom:8px}
.list-empty .sub{color:var(--muted);font-size:15px;margin-bottom:22px}

.paging{max-width:1120px;margin:0 auto;padding:8px 24px 16px;display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.pg{min-width:38px;height:38px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--muted);font-size:14px;display:inline-flex;align-items:center;justify-content:center}
.pg:hover{border-color:var(--accent);color:var(--accent)}
.pg.selected,.pg[class*="selected"]{background:var(--accent);color:#fff;border-color:var(--accent)}
/* [##_no_more_prev_##]/[##_no_more_next_##]가 붙여주는 비활성 클래스 */
.pg.no_more_prev,.pg.no_more_next{opacity:.35;pointer-events:none}

/* ===== 반응형 ===== */
@media(max-width:880px){
  .situ,.cheat{grid-template-columns:repeat(2,1fr)}
  .creed{grid-template-columns:1fr;gap:28px;padding:28px}
  .creed-sub{border-left:0;border-top:1px solid var(--line);padding:24px 0 0}
}
@media(max-width:560px){
  .situ,.cheat{grid-template-columns:1fr}
}

@media(max-width:880px){
  nav.main ul{gap:16px}
  .hero{grid-template-columns:1fr;gap:24px}
  .article-area{grid-template-columns:repeat(2,1fr)}
  .article h1{font-size:32px}
  .ing{columns:1}
}
@media(max-width:640px){
  /* ⚠️ 좁은 폭에서 로고+메뉴+검색폼을 한 줄에 욱여넣으면 로고가 2줄로 쪼개지고
     메뉴 글자가 세로로 쌓인다(360px 실측). → 검색은 둘째 줄 풀폭, 메뉴는 가로 스크롤. */
  .topbar{padding:12px 16px;gap:10px 14px;flex-wrap:wrap}
  .logo{order:1;font-size:20px}
  nav.main{order:2;margin-left:auto;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  nav.main::-webkit-scrollbar{display:none}
  nav.main ul{gap:14px;font-size:14px;flex-wrap:nowrap}
  nav.main a{white-space:nowrap}
  .search{order:3;width:100%;margin-left:0;padding:8px 14px}
  .search input{width:100%}
  .foot{gap:28px}
  .hero h1{font-size:32px}
}
@media(max-width:560px){
  .article-area{grid-template-columns:1fr}
  .rb-stats{gap:18px}
}
