/* 돈풍돈풍 — 에디토리얼 · 그레이 & 올리브
   색/폰트/폭은 아래 :root 값만 고치면 전체에 반영됩니다.
   모바일 퍼스트: 기본 스타일 = 모바일(1열 세로쌓임), min-width 미디어쿼리로 데스크톱 레이아웃을 "추가"한다. */

:root {
  --paper: #faf9f5;        /* 페이지 배경 */
  --ink: #1d1f20;          /* 본문 글자 */
  --olive-deep: #33351f;   /* 제목 색면 */
  --olive: #7d8055;        /* 솔리드 썸네일 */
  --olive-text: #5a5c3c;   /* 라벨·링크 */
  --olive-quote: #45472e;
  --tint-pale: #e9e8dc;    /* 옅은 올리브 썸네일 */
  --tint-grey: #e4e4e0;    /* 그레이 썸네일 */
  --tint-band: #f2f2ea;    /* 인용 밴드 */
  --hero: #e6e5d8;         /* 대표 이미지 자리 */
  --line: rgba(29, 31, 32, 0.16);
  --muted: rgba(29, 31, 32, 0.55);
  --muted-soft: rgba(29, 31, 32, 0.45);

  --font-head: "Barlow Condensed", "Noto Sans KR", system-ui, sans-serif;
  --font-body: "Noto Sans KR", system-ui, sans-serif;

  --wrap: 1180px;
  --pad: 20px;
  --measure: 68ch;   /* 본문 한 줄 최대 길이 */
}

* { box-sizing: border-box; }

body { margin: 0; background: #f4f3ee; color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--olive-text); text-decoration: none; }
a:hover { color: var(--olive-deep); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
::selection { background: rgba(125, 128, 85, 0.24); }

.sheet {
  max-width: var(--wrap); margin: 0 auto; min-height: 100vh;
  background: var(--paper); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}

/* ── 상단 바 (기본 = 모바일: 2열 + 카테고리 줄바꿈) ─────── */
.topbar {
  display: grid; grid-template-columns: 1fr auto; row-gap: 10px; align-items: center;
  padding: 14px var(--pad); border-bottom: 1px solid var(--line);
}
.topbar__nav { order: 3; grid-column: 1 / -1; display: flex; gap: 20px; }
.topbar__nav a, .topbar__aside { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(29,31,32,.6); }
.topbar__nav a:hover, .topbar__nav a[aria-current="page"] { color: var(--ink); }
.wordmark { font-family: var(--font-head); font-size: 19px; letter-spacing: .06em; color: var(--ink); }
.topbar__aside { justify-self: end; }

/* ── 히어로 (기본 = 모바일 높이) ────────────────────── */
.hero { height: 240px; background: var(--hero); display: grid; place-items: center; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero__hint, .thumb__hint { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--olive-text); }

.headline-bar { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); }
.headline-bar__title { background: var(--olive-deep); color: var(--paper); padding: var(--pad); display: flex; align-items: center; }
.headline-bar__title h1 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 25px; line-height: 1.1; letter-spacing: .01em; }
.headline-bar__cta { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0; display: grid; place-items: center; }
.btn-outline {
  border: 1px solid var(--olive-deep); padding: 9px 20px;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
  transition: background .2s, color .2s;
}
.btn-outline:hover { background: var(--olive-deep); color: var(--paper); }

/* ── 섹션 라벨 ──────────────────────────── */
.section-label {
  padding: 17px var(--pad) 10px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(29,31,32,.7);
}

/* ── 카드 그리드 (기본 = 모바일 1열) ────────────────── */
.grid-3 { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.cell { display: flex; flex-direction: column; border-left: 0; border-top: 1px solid var(--line); color: inherit; }
.cell:first-child { border-top: 0; }
.cell:hover .cell__title { color: var(--olive-text); }

.thumb {
  aspect-ratio: 3 / 2; margin: 20px 14px 0; display: grid; place-items: center;
  border-radius: 4px;
  overflow: hidden; background: var(--tint-grey);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb--olive { background: var(--olive); }
.thumb--olive .thumb__hint { color: var(--paper); }
.thumb--pale { background: var(--tint-pale); }

.cell__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-top: 1px solid var(--line);
}
.cell__cat { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cell__date { font-size: 10.5px; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.cell__title {
  margin: 0; padding: 0 14px 20px;
  font-family: var(--font-head); font-weight: 600; font-size: 21px; line-height: 1.28; text-wrap: pretty;
}

/* ── 인용 밴드 (기본 = 모바일 1열) ──────────────────── */
.quote-band { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-band__text { padding: 40px 24px; display: grid; place-items: center; background: var(--tint-band); }
.quote-band__text p { margin: 0; max-width: 30ch; text-align: center; font-size: 13px; line-height: 2; letter-spacing: .04em; color: var(--olive-quote); }
.quote-band__img { border-left: 0; min-height: 220px; background: var(--olive); display: grid; place-items: center; overflow: hidden; }
.quote-band__img img { width: 100%; height: 100%; object-fit: cover; }
.quote-band__img .thumb__hint { color: var(--paper); }

/* ── 목록 페이지 빈 상태 ────────────────── */
.empty-state { padding: 60px var(--pad); text-align: center; color: var(--muted); font-size: 14px; }

/* ── 본문 · 사이드바 2단 레이아웃 (기본 = 모바일: 세로 쌓임) ── */
.page-layout { display: flex; flex-direction: column; gap: 40px; padding-bottom: 10px; }
.site-main { min-width: 0; }

/* ── 사이드바 위젯 ──────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 28px; padding: 0 var(--pad); }
.widget { display: flex; flex-direction: column; gap: 4px; }
.widget__title {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(29,31,32,.7);
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.widget__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.widget__item {
  padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
}
.widget__item:first-child { border-top: 0; }
.widget__item a { color: var(--ink); font-size: 15px; line-height: 1.4; text-wrap: pretty; }
.widget__item a:hover { color: var(--olive-text); }
.widget__date { font-size: 11px; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.widget__item--empty { color: var(--muted); font-size: 13px; }
.widget--tags .tags { padding-top: 4px; }

/* 광고 자리: 실제 광고 코드가 아직 없어 자리만 확보한 플레이스홀더.
   애드센스 승인 후에는 scripts/build-site.mjs의 adSlotHtml() 안 주석 자리에 코드만 넣으면 된다. */
.ad-slot {
  min-height: 250px; display: grid; place-items: center;
  border: 1px dashed var(--line); border-radius: 4px; background: var(--tint-band);
}
.ad-slot__label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* ── 글 페이지 (기본 = 모바일 1열) ──────────────────── */
.article-wrap { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 34px var(--pad) 0; }
.article-side { position: static; display: flex; flex-direction: row; flex-wrap: wrap; gap: 20px; margin: 0; font-size: 11.5px; color: var(--muted); }
.article-side dt { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-soft); }
.article-side dd { margin: 5px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; padding: 3px 9px; font-size: 11px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); }
a.tag:hover { border-color: var(--olive); color: var(--olive-text); }

.article h1 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 29px; line-height: 1.12; text-wrap: pretty; }
.article__figure { margin: 28px 0; aspect-ratio: 16 / 9; background: var(--hero); display: grid; place-items: center; overflow: hidden; border-radius: 4px; }
.article__figure img { width: 100%; height: 100%; object-fit: cover; }
.article p { margin: 0 0 20px; font-size: 16.5px; line-height: 1.9; text-wrap: pretty; }
.article h2 {
  margin: 40px 0 14px; padding-top: 20px; border-top: 1px solid var(--line);
  font-family: var(--font-head); font-weight: 600; font-size: 27px; line-height: 1.25;
}
.article ul, .article ol { font-size: 16.5px; line-height: 1.9; padding-left: 1.2em; }

.callout { margin: 28px 0; padding: 20px; background: var(--tint-band); border-radius: 4px; }
.callout__label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--olive-text); }
.callout__grid { margin-top: 14px; display: grid; grid-template-columns: 1fr; gap: 20px; }
.callout__term { font-family: var(--font-head); font-weight: 600; font-size: 22px; }
.callout__desc { margin-top: 5px; font-size: 13.5px; color: rgba(29,31,32,.72); }

/* ── 참고링크 박스 (기존 파이프라인 기능 · 새 디자인 톤으로 재작업) ── */
.post-detail-reflinks {
  margin: 28px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.reflink-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--tint-band);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: border-color .2s, background .2s;
}
.reflink-card:hover { border-color: var(--olive); background: var(--tint-pale); }
.reflink-favicon { width: 28px; height: 28px; border-radius: 2px; flex-shrink: 0; }
.reflink-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reflink-name { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--ink); }
.reflink-domain { font-size: 11.5px; letter-spacing: .04em; color: var(--olive-text); }

/* ── 본문 하단 해시태그 목록 (article-side의 pill 태그와는 별개) ── */
.post-hashtags { margin: 28px 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.post-hashtags a { font-size: 13px; color: var(--muted); }
.post-hashtags a:hover { color: var(--olive-text); }

/* ── 같이 보면 좋은 글 (관련글 위젯) ────────── */
.related-posts { margin: 12px 0 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.related-posts__title {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(29,31,32,.7);
  padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.related-posts__grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.related-card { display: flex; align-items: center; gap: 12px; color: inherit; }
.related-card:hover .related-card__title { color: var(--olive-text); }
.related-card__thumb {
  width: 84px; aspect-ratio: 4 / 3; flex-shrink: 0; border-radius: 4px; overflow: hidden;
  background: var(--tint-grey);
}
.related-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-card__meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.related-card__title { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; line-height: 1.3; text-wrap: pretty; }
.related-card__date { font-size: 11px; color: var(--muted-soft); font-variant-numeric: tabular-nums; }

/* ── 참고 출처 (.callout 재활용) ────────── */
.post-detail-sources { margin-top: 28px; }
.post-detail-sources ul { margin: 12px 0 0; padding-left: 1.1em; font-size: 13.5px; line-height: 1.8; color: rgba(29,31,32,.72); }
.post-detail-sources li { margin-bottom: 4px; }
.post-detail-sources a { word-break: break-all; }

.back { display: inline-block; margin: 24px var(--pad) 0; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }

/* ── 푸터 (기본 = 모바일 2열) ───────────────────────── */
.site-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 34px var(--pad) 42px; border-top: 1px solid var(--line); margin-top: 54px; }
.site-footer__desc { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.footer-col { display: flex; flex-direction: column; gap: 7px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.footer-col a { color: rgba(29,31,32,.6); }
.footer-col a:hover { color: var(--ink); }
.subscribe__label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(29,31,32,.6); }
.subscribe__row { margin-top: 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.subscribe__row input { flex: 1; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--ink); }
.subscribe__row input::placeholder { color: var(--muted-soft); }
.subscribe__row button { border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--olive-text); }

/* ── 데스크톱 (860px 이상): 여기서부터 2단/가로형 레이아웃을 "추가"한다 ── */
@media (min-width: 860px) {
  .topbar { grid-template-columns: 1fr auto 1fr; row-gap: 0; }
  .topbar__nav { order: 0; grid-column: auto; }
  .hero { height: 380px; }
  .headline-bar { grid-template-columns: 1fr 240px; }
  .headline-bar__title h1 { font-size: 34px; }
  .headline-bar__cta { border-left: 1px solid var(--line); border-top: 0; padding: 0; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .cell { border-left: 1px solid var(--line); border-top: 0; }
  .cell:first-child { border-left: 0; }
  .thumb { aspect-ratio: 4 / 5; }
  .quote-band { grid-template-columns: 1fr 1fr; }
  .quote-band__text { padding: 68px 54px; }
  .quote-band__img { border-left: 1px solid var(--line); min-height: 320px; }

  .page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 40px; padding-bottom: 0; }
  .sidebar { padding: 34px 0 0; }

  .article-wrap { grid-template-columns: 160px minmax(0, var(--measure)); gap: 40px; }
  .article-side { position: sticky; top: 24px; flex-direction: column; flex-wrap: nowrap; gap: 18px; }
  .article h1 { font-size: 44px; }
  .callout__grid { grid-template-columns: 1fr 1fr; }
  .post-detail-reflinks { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .related-posts__grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer { grid-template-columns: 1.2fr 1fr 1fr 1.6fr; }
}
