/* ============================================================
   건강흐름 - 스타일시트
   뉴스/매거진형 건강 포털 레이아웃
   ============================================================ */
:root {
  --primary: #1e73be;
  --primary-dark: #155a94;
  --text: #222;
  --text-soft: #555;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --footer-bg: #23272b;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans KR", "Malgun Gothic", "맑은 고딕", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ── 썸네일 (이미지 없을 때 색상 블록) ── */
.thumb { position: relative; overflow: hidden; background: var(--bg-soft); border-radius: 6px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb--empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 65%, #000 20%));
}
.thumb--empty span { color: #fff; font-weight: 700; font-size: 15px; opacity: .95; letter-spacing: .5px; }

/* ── 광고 영역 ── */
.ad { margin: 0 0 18px; text-align: center; }
.ad--placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px;
  border: 1px dashed #c9ced4; border-radius: 8px;
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f2f4f6 10px, #f2f4f6 20px);
  color: #9aa2ab; font-size: 13px; font-weight: 600;
}

/* ============================================================
   헤더
   ============================================================ */
.topbar { border-bottom: 1px solid var(--line); }
.topbar__inner {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  align-items: center;
  gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.topbar__ad .ad { margin: 0; }
.topbar__ad .ad--placeholder { min-height: 60px; }
.brand { margin: 0; text-align: center; }
.brand a { font-size: 34px; font-weight: 900; letter-spacing: -1px; color: var(--text); }

.search { display: flex; justify-self: end; width: 100%; max-width: 300px;
  border: 2px solid var(--line); border-radius: 24px; overflow: hidden; }
.search input { flex: 1; border: 0; outline: none; padding: 9px 16px; font-size: 14px; background: transparent; }
.search button { border: 0; background: transparent; padding: 0 14px; cursor: pointer; font-size: 15px; }

/* 네비게이션 */
.nav { border-bottom: 1px solid var(--line); background: #fff; }
.nav__inner { display: flex; align-items: center; gap: 10px; height: 50px; }
.nav__menu { display: none; border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.nav__links { display: flex; gap: 4px; flex: 1; }
.nav__link {
  position: relative; padding: 8px 14px; font-size: 16px; font-weight: 700; color: #333; white-space: nowrap;
}
.nav__link:hover { color: var(--primary); }
.nav__link.is-active { color: var(--primary); }
.nav__link--soon { color: #333; }
.nav__link--soon em {
  font-style: normal; font-size: 10px; color: #fff; background: #b8bec5;
  border-radius: 8px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; font-weight: 700;
}
.nav__meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.nav__auth a { color: var(--text-soft); }
.nav__auth a:hover { color: var(--primary); }

/* 톱니(찢긴 종이) 장식 */
.edge {
  height: 10px;
  background:
    linear-gradient(-45deg, transparent 5px, var(--bg-soft) 0) 0 0 / 12px 12px repeat-x,
    linear-gradient(45deg, transparent 5px, var(--bg-soft) 0) 0 0 / 12px 12px repeat-x;
  background-color: transparent;
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   히어로
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
}
.hero--single { grid-template-columns: 1fr; }
.hero--single .thumb--feat { aspect-ratio: 21 / 9; }
.feat { display: block; }
.thumb--feat { aspect-ratio: 16 / 10; }
.feat__title { font-size: 26px; font-weight: 900; line-height: 1.3; margin: 16px 0 8px; color: var(--text); }
.feat:hover .feat__title { color: var(--primary); }
.feat__summary { color: var(--text-soft); font-size: 15px; margin: 0; }

.hero__side { display: flex; flex-direction: column; gap: 16px; }
.hero__smalls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.thumb--hsmall { aspect-ratio: 16 / 10; }
.hsmall__title { font-size: 15px; font-weight: 700; line-height: 1.35; margin: 10px 0 0; }
.hsmall:hover .hsmall__title { color: var(--primary); }

.hero__headlines { display: flex; flex-direction: column; border-top: 2px solid #333; }
.headline {
  font-size: 15px; font-weight: 500; padding: 11px 0 11px 14px; border-bottom: 1px solid var(--line);
  position: relative; color: #333;
}
.headline::before { content: ""; position: absolute; left: 0; top: 18px; width: 4px; height: 4px; border-radius: 50%; background: #999; }
.headline:hover { color: var(--primary); }

/* ============================================================
   본문 2단 (좌: 목록 / 우: 사이드바)
   ============================================================ */
.content { display: grid; grid-template-columns: 1fr 340px; gap: 34px; padding: 30px 0 50px; }

/* 좌측 기사 목록 */
.listitem { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.listitem:first-child { padding-top: 0; }
.thumb--list { aspect-ratio: 4 / 3; }
.listitem__body { min-width: 0; }
.listitem__cat, .listitem__date { display: inline-block; font-size: 12px; }
.listitem__cat { color: #fff; background: var(--c, var(--primary)); border-radius: 4px; padding: 1px 8px; font-weight: 700; margin-bottom: 6px; }
.listitem__title { font-size: 19px; font-weight: 800; line-height: 1.35; margin: 0 0 6px; color: var(--text); }
.listitem:hover .listitem__title { color: var(--primary); }
.listitem__summary { color: var(--text-soft); font-size: 14px; margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listitem__date { color: #9aa2ab; }

/* 우측 사이드바 */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.panel__head { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.badge { font-size: 12px; color: #fff; background: var(--primary); border-radius: 10px; padding: 2px 9px; font-weight: 700; }
.panel__more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--text-soft); }

/* 타임라인 */
.timeline { display: flex; flex-direction: column; }
.tl__item { display: grid; grid-template-columns: 46px 14px 1fr; align-items: start; gap: 6px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.tl__item:last-child { border-bottom: 0; }
.tl__time { font-size: 12px; color: #9aa2ab; padding-top: 1px; }
.tl__dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; border: 2px solid var(--primary); }
.tl__title { font-size: 14px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl__item:hover .tl__title { color: var(--primary); }

/* 카테고리 그리드 */
.gridcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gcard { display: block; }
.thumb--grid { aspect-ratio: 1 / 1; }
.gcard__title { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; margin-top: 7px;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; }
.gcard:hover .gcard__title { color: var(--primary); }

/* 태그 리스트 */
.taglist { display: flex; flex-direction: column; }
.tagitem { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.tagitem:last-child { border-bottom: 0; }
.tag { flex: none; font-size: 11px; color: #fff; background: var(--c, var(--primary)); border-radius: 4px; padding: 2px 7px; font-weight: 700; }
.tagitem__title { font-size: 14px; font-weight: 600; line-height: 1.35;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; }
.tagitem:hover .tagitem__title { color: var(--primary); }

/* 카테고리 페이지 헤더 */
.page-head { padding: 26px 0 6px; border-bottom: 2px solid #333; margin-top: 24px; }
.page-head h2 { margin: 0; font-size: 26px; font-weight: 900; }
.page-head h2::before { content: ""; display: inline-block; width: 6px; height: 22px; background: var(--primary); margin-right: 10px; vertical-align: -3px; border-radius: 2px; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-soft); }
.empty strong { color: var(--text); }
.btn { display: inline-block; margin-top: 16px; background: var(--primary); color: #fff; padding: 9px 22px; border-radius: 22px; font-weight: 700; }
.btn:hover { background: var(--primary-dark); color: #fff; }

/* ============================================================
   글(포스트) 페이지
   ============================================================ */
.article { max-width: 820px; margin: 0 auto; padding: 30px 0 50px; }
.article__cat { display: inline-block; font-size: 13px; color: #fff; background: var(--primary); border-radius: 4px; padding: 2px 10px; font-weight: 700; }
.article__title { font-size: 30px; font-weight: 900; line-height: 1.3; margin: 14px 0 10px; }
.article__meta { font-size: 13px; color: #9aa2ab; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.article__body { font-size: 17px; line-height: 1.85; color: #2b2f33; }
.article__body p { margin: 0 0 20px; }
.article__body h2 { font-size: 22px; font-weight: 800; margin: 34px 0 14px; }
.article__body h3 { font-size: 19px; font-weight: 800; margin: 26px 0 12px; }
.article__body img { border-radius: 8px; margin: 20px auto; }
.article__body ul, .article__body ol { padding-left: 22px; margin: 0 0 20px; }
.article__body li { margin: 6px 0; }
.article__body blockquote { border-left: 4px solid var(--primary); background: var(--bg-soft); margin: 20px 0; padding: 12px 18px; color: var(--text-soft); border-radius: 0 6px 6px 0; }
.article__nav { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.article__lead { font-size: 18px; font-weight: 700; color: #1f2933; line-height: 1.75;
  background: var(--bg-soft); border-left: 5px solid var(--primary); border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 0 0 26px; }

/* 이미지 + 캡션 */
.article__figure { margin: 24px 0; }
.article__figure img { width: 100%; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.article__figure figcaption { font-size: 13px; color: #8a929b; text-align: center; margin-top: 8px; }

/* 핵심 요약 박스 */
.keybox { border: 1px solid #d7e3ef; background: #f3f8fd; border-radius: 12px; padding: 20px 22px; margin: 0 0 30px; }
.keybox h2 { font-size: 18px; margin: 0 0 12px; color: var(--primary-dark); }
.keybox ol { margin: 0; padding-left: 20px; }
.keybox li { margin: 8px 0; font-weight: 600; }

/* 활용법(팁) 박스 */
.tipbox { background: #f0faf5; border: 1px solid #cfe9db; border-radius: 10px; padding: 4px 18px 8px; margin: 16px 0 6px; }
.tipbox h3 { color: #237a53; margin-top: 14px; }

/* 안내(면책) 문구 */
.disclaimer { margin-top: 34px; padding: 14px 16px; background: #fbfbfc; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: #7a828b; line-height: 1.7; }

.article__title small { font-size: 15px; font-weight: 600; color: #9aa2ab; }

/* ============================================================
   푸터 (이미지3)
   ============================================================ */
#site-footer { margin-top: 20px; }
.footer__links { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer__links .wrap { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 16px; padding-bottom: 16px; justify-content: center; }
.footer__link { font-size: 14px; color: #444; }
.footer__link--strong { font-weight: 800; color: #111; }
.footer__link:hover { color: var(--primary); }

.footer__body { background: var(--footer-bg); color: #b7bcc2; padding: 26px 0 34px; }
.footer__grid { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.footer__brand { font-size: 22px; font-weight: 900; color: #fff; }
.footer__info p { margin: 0 0 6px; font-size: 13px; line-height: 1.7; }
.footer__info .sep { color: #555b61; margin: 0 8px; }
.footer__copy { margin-top: 10px !important; color: #8b9198; }
.footer__adminlink { color: inherit; }
.footer__adminlink:hover { color: inherit; }

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 960px) {
  .topbar__inner { grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .topbar__ad { display: none; }
  .search { justify-self: center; max-width: 420px; }
  .hero { grid-template-columns: 1fr; }
  .content { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .brand a { font-size: 28px; }
  .nav__menu { display: block; }
  .nav__links {
    display: none; position: absolute; left: 0; right: 0; top: 50px; z-index: 30;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }
  .nav__links.is-open { display: flex; }
  .nav { position: relative; }
  .nav__inner { justify-content: space-between; }
  .nav__meta { display: none; }
  .nav__link { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .feat__title { font-size: 22px; }
  .hero__smalls { grid-template-columns: 1fr 1fr; }
  .listitem { grid-template-columns: 110px 1fr; gap: 12px; }
  .listitem__title { font-size: 16px; }
}
