/* ============================================================
   BEAUDOC post-detail.css — 모바일 최적화 완전판
   ============================================================ */
:root {
  --bg: #FFFFFF; --bg-soft: #FAF9F6; --panel: #F5F3EE;
  --line: rgba(20,20,20,0.09); --line-strong: rgba(20,20,20,0.16);
  --ink: #17181A; --ink-dim: rgba(23,24,26,0.62); --ink-faint: rgba(23,24,26,0.40);
  --gold: #B5896A;
  --coupang: #1E88E5; --iherb: #2E9E6C;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Pretendard', 'Noto Sans KR', sans-serif; -webkit-font-smoothing: antialiased; }
.serif { font-family: 'Playfair Display', 'Noto Serif KR', serif; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

/* ── 래퍼 ── */
.wrap { max-width: var(--max-w, 1560px); margin: 0 auto; padding: 0 var(--pad-x, 3vw); }

/* ── 포스트 히어로 (제목 영역, 전체 너비) ── */
.post-hero-wrap {
  background: var(--bg); padding: 44px 0 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.post-hero-inner {
  max-width: var(--max-w, 1560px); margin: 0 auto; padding: 0 var(--pad-x, 3vw);
}

/* ── 대표이미지 전체 너비 ── */
.hero-img-full {
  width: 100%; max-height: 520px; overflow: hidden;
  background: var(--panel); margin-bottom: 0;
  display: block;
}
.hero-img-full img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; max-height: 520px;
}

/* ── 브레드크럼 ── */
.breadcrumb { padding: 0 0 16px; font-size: 12px; color: var(--ink-faint); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.breadcrumb a { text-decoration: none; color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--ink); }

/* ── 포스트 헤더 ── */
.post-cat-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 5px 13px; border-radius: 999px; margin-bottom: 10px; }
.post-title {
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
  font-size: clamp(28px, 4.5vw, 56px); font-weight: 700; line-height: 1.25;
  word-break: keep-all; overflow-wrap: break-word;
  margin: 12px 0 20px; color: var(--ink);
}
.post-meta-row {
  display: flex; gap: 10px; margin-top: 0; padding-bottom: 0;
  font-size: 12.5px; color: var(--ink-faint);
  align-items: center; flex-wrap: wrap;
}
.author-badge { display: flex; align-items: center; gap: 7px; }
.author-badge .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #E8C4A8, #B5896A); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-family: 'Playfair Display', 'Noto Serif KR', serif; font-weight: 700;
}

/* 면책 고지 */
.health-disclaimer {
  margin-top: 16px; padding: 12px 16px; border-radius: 10px;
  background: #FEF9E7; border: 1px solid #F5CBA7;
  font-size: 12px; color: #7D6608; line-height: 1.6;
}

/* ── 대표 이미지 ── */
.hero-img {
  width: 100%; aspect-ratio: 16/8; overflow: hidden; margin: 28px 0;
  border-radius: 16px; background: var(--panel);
}
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* ── 레이아웃: 본문 + 목차 ── */
.content-layout { display: block; margin-top: 44px; }


/* ── 목차 ── */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px 28px;
  margin-bottom: 40px; max-width: 100%;
}
.toc-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--ink-faint); text-transform: uppercase; margin-bottom: 12px;
}
.toc ol { list-style: none; padding: 0; }
.toc ol li { margin-bottom: 2px; }
.toc a {
  display: block; font-size: 12.5px; color: var(--ink-dim);
  text-decoration: none; padding: 6px 0 6px 12px;
  border-left: 2px solid var(--line); transition: .2s; line-height: 1.45;
}
.toc a:hover, .toc a.active { border-left-color: var(--gold); color: var(--gold); }

/* ── 아티클 ── */
.article { max-width: 100%; padding-bottom: 20px; }
.ad-inline {
  margin: 32px 0; text-align: center;
}
.ad-inline:empty { display: none; }

/* 본문 타이포 */
.post-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { opacity: 0.8; }

.post-body h2 {
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
  font-size: 24px; font-weight: 800; margin: 52px 0 18px; scroll-margin-top: 80px;
  line-height: 1.3;
}
.post-body h3 {
  font-size: 20px; font-weight: 600; margin: 36px 0 14px; scroll-margin-top: 80px;
  line-height: 1.4;
}
.post-body p { font-size: 17px; line-height: 2.0; color: var(--ink); margin-bottom: 22px; }
.post-body p.lead { font-size: 17.5px; color: var(--ink-dim); font-weight: 300; }
.post-body ul, .post-body ol { padding-left: 22px; margin-bottom: 18px; }
.post-body li { font-size: 15.5px; line-height: 1.8; margin-bottom: 6px; }
.post-body blockquote {
  border-left: 3px solid var(--gold); padding: 4px 0 4px 20px; margin: 24px 0;
  font-style: normal;
  color: var(--ink-dim);
  font-family: 'Playfair Display', 'Noto Serif KR', serif; font-size: 17px;
}
.post-body table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px;
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.post-body th { background: var(--panel); padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 700; border: 1px solid var(--line); white-space: nowrap; }
.post-body td { padding: 10px 14px; border: 1px solid var(--line); line-height: 1.6; }
.post-body img { width: 100%; border-radius: 12px; margin: 22px 0; }
.post-body .caption { font-size: 11.5px; color: var(--ink-faint); text-align: center; margin-top: -14px; margin-bottom: 20px; }
.inline-img { width: 100%; border-radius: 12px; margin: 24px 0; overflow: hidden; }
.inline-img img { width: 100%; display: block; }

/* ── 제품 카드 ── */
.product-card {
  display: flex; gap: 18px; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; margin: 28px 0; align-items: center;
}
.product-card .p-img { width: 100px; height: 100px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--bg-soft); }
.product-card .p-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .p-body { flex: 1; min-width: 0; }
.product-source { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-bottom: 7px; color: #fff; }
.src-coupang { background: var(--coupang); }
.src-iherb { background: var(--iherb); }
.p-name { font-size: 15px; font-weight: 600; margin-bottom: 5px; line-height: 1.4; }
.p-desc { font-size: 12px; color: var(--ink-faint); line-height: 1.6; margin-bottom: 9px; }
.p-price { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 11px; }
.p-btn { display: inline-block; font-size: 12px; font-weight: 600; padding: 9px 20px; border-radius: 999px; text-decoration: none; touch-action: manipulation; }
.btn-coupang { background: var(--coupang); color: #fff; }
.btn-iherb { background: var(--iherb); color: #fff; }
.partner-disclosure { font-size: 10px; color: var(--ink-faint); margin-top: 9px; line-height: 1.5; }
.iherb-notice { font-size: 11px; color: var(--ink-faint); background: var(--bg-soft); padding: 10px 13px; border-radius: 9px; margin-top: 10px; line-height: 1.6; }

/* ── 공유 버튼 ── */
.share-row { display: flex; gap: 8px; margin: 36px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.share-btn {
  font-size: 12px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-dim); font-weight: 500;
  background: none; cursor: pointer; touch-action: manipulation; transition: .2s;
}
.share-btn:hover { background: var(--panel); }

/* ── 태그 ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 32px; }
.tag-chip { font-size: 12px; padding: 6px 13px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-dim); transition: .2s; }
.tag-chip:hover { background: var(--panel); color: var(--ink); }

/* ── 출처 박스 ── */
.source-box { font-size: 12px; color: var(--ink-faint); line-height: 1.8; margin-bottom: 36px; padding: 14px 18px; background: var(--bg-soft); border-radius: 10px; border: 1px solid var(--line); }
.source-box strong { color: var(--ink-dim); }

/* ── 관련 글 ── */
.related-title { font-family: 'Playfair Display', 'Noto Serif KR', serif; font-size: 20px; font-weight: 600; margin: 0 0 20px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 44px; }
.related-card { text-decoration: none; color: inherit; display: block; }
.related-img { width: 100%; aspect-ratio: 4/2.6; border-radius: 10px; overflow: hidden; margin-bottom: 9px; background: var(--bg-soft); }
.related-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.related-card:hover .related-img img { transform: scale(1.04); }
.related-t { font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--ink); }

/* ── 이전/다음 ── */
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 52px; }
.pn-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: inherit; transition: .2s; }
.pn-item:hover { background: var(--bg-soft); }
.pn-label { font-size: 11px; color: var(--ink-faint); margin-bottom: 5px; }
.pn-title { font-size: 13.5px; font-weight: 600; line-height: 1.45; }

footer { padding: 44px 5vw; text-align: center; font-size: 11.5px; color: var(--ink-faint); border-top: 1px solid var(--line); background: var(--panel); margin-top: 36px; }

/* ════════════════════════════════════════════
   반응형 — 태블릿 이하 (≤980px)
   ════════════════════════════════════════════ */
@media (max-width: 980px) {
  .post-hero-wrap { padding: 28px 0 24px; }
  .hero-img-full { max-height: 260px; }
  .hero-img-full img { max-height: 260px; }
  .content-layout { margin-top: 28px; }
  .toc { margin: 0 0 24px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .prevnext { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   반응형 — 모바일 (≤768px)
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
  .wrap { padding: 0 4.5vw; }
  .post-head { padding-top: 18px; }
  .post-title { font-size: clamp(22px, 6.5vw, 32px); }
  .post-meta-row { gap: 8px; font-size: 12px; }
  .hero-img { margin: 20px 0; border-radius: 12px; aspect-ratio: 16/9; }

  /* 본문 가독성 */
  .post-body h2 { font-size: 19px; margin: 32px 0 13px; }
  .post-body h3 { font-size: 16px; margin: 22px 0 10px; }
  .post-body p { font-size: 15.5px; line-height: 1.9; margin-bottom: 16px; }
  .post-body li { font-size: 15px; }
  .post-body blockquote { font-size: 15px; padding-left: 16px; }

  /* 제품카드 세로 배치 */
  .product-card { flex-direction: column; align-items: flex-start; }
  .product-card .p-img { width: 100%; height: 200px; border-radius: 10px; }
  .p-btn { width: 100%; text-align: center; padding: 13px; font-size: 14px; }

  /* 공유 버튼 */
  .share-row { gap: 7px; }
  .share-btn { font-size: 11.5px; padding: 8px 13px; }

  /* 관련글 */
  .related-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .related-t { font-size: 12.5px; }
  .related-title { font-size: 18px; }

  /* 광고 영역 */
  .ad-inline { margin: 24px 0; padding: 12px; }

  input, textarea, select, button { font-size: 16px !important; }
}

/* ════════════════════════════════════════════
   반응형 — 소형 (≤390px)
   ════════════════════════════════════════════ */
@media (max-width: 390px) {
  .post-title { font-size: 21px; }
  .post-body h2 { font-size: 18px; }
  .post-body p { font-size: 15px; }
  .related-grid { grid-template-columns: 1fr; }
  .prevnext { gap: 8px; }
  .pn-item { padding: 13px 14px; }
  .pn-title { font-size: 13px; }
}
