/*
Theme Name: HealthNote
Theme URI: https://myhealthnote.kr
Author: myhealthnote
Description: 건강/웰니스 수익형 블로그 커스텀 테마 - 애드센스 최적화, 쿠팡파트너스 제품박스, TOC 자동생성, 카테고리별 색상
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: healthnote
*/

/* =========================================================
   CSS Variables & Reset
   ========================================================= */
:root {
  --color-primary:    #2E7D32;
  --color-primary-light: #4CAF50;
  --color-primary-pale: #E8F5E9;
  --color-accent:     #F57F17;
  --color-text:       #1a1a1a;
  --color-text-muted: #6b7280;
  --color-bg:         #fafafa;
  --color-surface:    #ffffff;
  --color-border:     #e5e7eb;

  /* 카테고리 색상 */
  --cat-diet:        #2E7D32;
  --cat-supplement:  #1565C0;
  --cat-exercise:    #E65100;
  --cat-sleep:       #6A1B9A;
  --cat-mental:      #00838F;
  --cat-recipe:      #AD1457;

  --font-heading: 'Noto Serif KR', 'Georgia', serif;
  --font-body:    'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;

  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13);

  --sidebar-width: 300px;
  --content-max: 1180px;
  --gap: 28px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-light); }

/* =========================================================
   Layout
   ========================================================= */
.site-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--gap);
  padding: 32px 0 60px;
  align-items: start;
}

@media (max-width: 900px) {
  .content-area {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .sidebar.open { display: block; }
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.site-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--color-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}
.site-logo span { color: var(--color-text); }

/* 네비게이션 */
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background .15s, color .15s;
}
.site-nav a:hover, .site-nav a.current-menu-item {
  background: var(--color-primary-pale);
  color: var(--color-primary);
}

/* 모바일 햄버거 */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 6px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--color-text); border-radius: 2px;
  margin: 5px 0;
  transition: transform .25s, opacity .25s;
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--color-surface);
    flex-direction: column; align-items: stretch;
    padding: 12px 20px 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 14px; }
}

/* =========================================================
   Category Nav Bar
   ========================================================= */
.category-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.category-bar-inner {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.category-bar-inner::-webkit-scrollbar { display: none; }
.category-bar a {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  font-size: .83rem; font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.category-bar a:hover, .category-bar a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.category-bar .cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* =========================================================
   Hero / Featured Post
   ========================================================= */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1B5E20 100%);
  padding: 48px 0;
  margin-bottom: 0;
}
.hero-section .site-container { display: flex; align-items: center; gap: 40px; }
.hero-text { flex: 1; color: #fff; }
.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,.2);
  color: #fff;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-text h2 {
  font-family: var(--font-heading);
  font-size: 1.9rem; line-height: 1.4;
  margin-bottom: 12px;
}
.hero-text p { opacity: .88; font-size: .95rem; margin-bottom: 20px; }
.hero-text .btn-hero {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--color-primary);
  padding: 10px 22px; border-radius: 8px;
  font-weight: 700; font-size: .9rem;
  transition: transform .15s, box-shadow .15s;
}
.hero-text .btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.hero-image { width: 380px; border-radius: 16px; overflow: hidden; flex-shrink: 0; }
.hero-image img { width: 100%; height: 240px; object-fit: cover; }
@media (max-width: 768px) {
  .hero-section .site-container { flex-direction: column; }
  .hero-image { width: 100%; }
  .hero-text h2 { font-size: 1.4rem; }
}

/* =========================================================
   Post Cards Grid
   ========================================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.post-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--color-border);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.post-card-thumb {
  position: relative;
  padding-top: 56%;
  overflow: hidden;
}
.post-card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-cat {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 4px;
  font-size: .72rem; font-weight: 700;
  color: #fff; letter-spacing: .02em;
  white-space: nowrap;
  line-height: 1.4;
  display: inline-block;
  writing-mode: horizontal-tb;
  width: auto; height: auto;
}

.post-card-body { padding: 16px 18px 18px; }
.post-card-inline-cat {
  display: inline-block;
  padding: 2px 10px; border-radius: 4px;
  font-size: .7rem; font-weight: 700;
  color: #fff; margin-bottom: 8px;
  letter-spacing: .02em;
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-title a { color: var(--color-text); }
.post-card-title a:hover { color: var(--color-primary); }

.post-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; color: var(--color-text-muted);
}
.post-card-meta .sep { opacity: .4; }

/* =========================================================
   Single Post Layout
   ========================================================= */
.single-post-header {
  margin-bottom: 28px;
}
.single-post-cat {
  display: inline-block;
  padding: 4px 14px; border-radius: 20px;
  font-size: .78rem; font-weight: 700;
  color: #fff; margin-bottom: 14px;
}
.single-post-title {
  font-family: var(--font-heading);
  font-size: 2rem; line-height: 1.4;
  margin-bottom: 14px;
  color: var(--color-text);
}
.single-post-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: .85rem; color: var(--color-text-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}
.single-post-meta svg { width: 14px; height: 14px; }

.single-post-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}
.single-post-thumb img { width: 100%; max-height: 420px; object-fit: cover; }

/* =========================================================
   TOC - 목차
   ========================================================= */
.toc {
  background: var(--color-primary-pale);
  border: 1px solid rgba(46,125,50,.2);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}
.toc-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .95rem;
  color: var(--color-primary);
  margin-bottom: 14px;
  cursor: pointer; user-select: none;
}
.toc-title::before { content: "📋"; }
.toc-list {
  list-style: none;
  counter-reset: toc;
}
.toc-list li {
  counter-increment: toc;
  padding: 4px 0;
}
.toc-list li::before {
  content: counter(toc) ". ";
  font-weight: 700; color: var(--color-primary);
  font-size: .85rem;
}
.toc-list a {
  font-size: .88rem; color: var(--color-text);
  border-bottom: 1px dashed rgba(0,0,0,.15);
  transition: color .15s;
}
.toc-list a:hover { color: var(--color-primary); border-bottom-style: solid; }
.toc-list .toc-h3 { padding-left: 18px; font-size: .83rem; }

/* =========================================================
   Post Content Typography
   ========================================================= */
.entry-content {
  font-size: 1rem; line-height: 1.9;
  color: var(--color-text);
}
.entry-content h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem; font-weight: 700;
  color: var(--color-primary);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-pale);
  scroll-margin-top: 80px;
}
.entry-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem; font-weight: 700;
  margin: 28px 0 10px;
  scroll-margin-top: 80px;
}
.entry-content p { margin-bottom: 18px; }
.entry-content ul, .entry-content ol {
  margin: 14px 0 18px 22px;
}
.entry-content li { margin-bottom: 6px; }
.entry-content strong { color: var(--color-primary); font-weight: 700; }
.entry-content u { text-decoration-color: var(--color-primary-light); }
.entry-content blockquote {
  background: var(--color-primary-pale);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 22px 0;
  font-style: italic;
  color: #2d4a2e;
}
.entry-content table {
  width: 100%; border-collapse: collapse;
  margin: 22px 0; font-size: .9rem;
}
.entry-content table th {
  background: var(--color-primary);
  color: #fff; padding: 10px 14px;
  text-align: left;
}
.entry-content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}
.entry-content table tr:nth-child(even) td { background: var(--color-primary-pale); }
.entry-content img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 10px 0;
}

/* =========================================================
   애드센스 광고 영역
   ========================================================= */
.ad-block {
  background: #f8f9fa;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  padding: 12px;
  margin: 28px 0;
  text-align: center;
  overflow: hidden;
}
.ad-block-label {
  font-size: .7rem; color: #9ca3af;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 8px;
}
/* 상단 배너 728x90 (PC) / 320x50 (모바일) */
.ad-block-top { min-height: 90px; }
@media (max-width: 768px) { .ad-block-top { min-height: 50px; } }
/* 본문 중간 336x280 */
.ad-block-mid { min-height: 280px; }
/* 사이드바 300x250 */
.ad-block-sidebar { min-height: 250px; }
/* 본문 하단 728x90 */
.ad-block-bottom { min-height: 90px; }

/* =========================================================
   쿠팡파트너스 제품박스
   ========================================================= */
.coupang-box {
  border: 2px solid var(--color-primary-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}
.coupang-box-header {
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 700;
}
.coupang-box-header::before { content: "🛒"; }
.coupang-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background .15s;
}
.coupang-item:last-child { border-bottom: none; }
.coupang-item:hover { background: var(--color-primary-pale); }
.coupang-item-img {
  width: 80px; height: 80px;
  object-fit: cover; border-radius: 8px;
  flex-shrink: 0;
}
.coupang-item-info { flex: 1; }
.coupang-item-name {
  font-weight: 700; font-size: .92rem;
  margin-bottom: 4px; color: var(--color-text);
}
.coupang-item-price {
  font-size: 1.05rem; font-weight: 700;
  color: var(--color-primary);
}
.coupang-item-price .original {
  font-size: .82rem; color: var(--color-text-muted);
  text-decoration: line-through; font-weight: 400;
  margin-left: 6px;
}
.coupang-item-badge {
  display: inline-block;
  background: #ffeb3b; color: #333;
  font-size: .7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  margin-bottom: 4px;
}
.coupang-item-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #E53935; color: #fff;
  padding: 7px 16px; border-radius: 6px;
  font-size: .82rem; font-weight: 700;
  flex-shrink: 0;
  transition: opacity .15s;
}
.coupang-item-btn:hover { opacity: .88; color: #fff; }
.coupang-disclosure {
  font-size: .72rem; color: var(--color-text-muted);
  padding: 8px 16px;
  background: #f8f9fa;
  border-top: 1px solid var(--color-border);
}

/* =========================================================
   카테고리 색상 시스템
   ========================================================= */
.cat-diet       { background: var(--cat-diet); }
.cat-supplement { background: var(--cat-supplement); }
.cat-exercise   { background: var(--cat-exercise); }
.cat-sleep      { background: var(--cat-sleep); }
.cat-mental     { background: var(--cat-mental); }
.cat-recipe     { background: var(--cat-recipe); }

/* border 버전 */
.cat-dot-diet       { background: var(--cat-diet); }
.cat-dot-supplement { background: var(--cat-supplement); }
.cat-dot-exercise   { background: var(--cat-exercise); }
.cat-dot-sleep      { background: var(--cat-sleep); }
.cat-dot-mental     { background: var(--cat-mental); }
.cat-dot-recipe     { background: var(--cat-recipe); }

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar { position: sticky; top: 80px; }
.widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
}
.widget-title {
  font-family: var(--font-heading);
  font-size: .95rem; font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary-pale);
}

/* 사이드바 최신글 */
.sidebar-post-list { list-style: none; }
.sidebar-post-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex; gap: 10px; align-items: flex-start;
}
.sidebar-post-list li:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-post-list .thumb {
  width: 64px; height: 48px;
  border-radius: 6px; overflow: hidden; flex-shrink: 0;
}
.sidebar-post-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-post-list .meta { flex: 1; }
.sidebar-post-list .meta a {
  font-size: .83rem; font-weight: 600; color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.45;
}
.sidebar-post-list .meta a:hover { color: var(--color-primary); }
.sidebar-post-list .date { font-size: .72rem; color: var(--color-text-muted); margin-top: 3px; }

/* 카테고리 위젯 */
.cat-widget-list { list-style: none; }
.cat-widget-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
}
.cat-widget-list li:last-child { border-bottom: none; }
.cat-widget-list a {
  display: flex; align-items: center; gap: 8px;
  font-size: .88rem; color: var(--color-text);
}
.cat-widget-list a:hover { color: var(--color-primary); }
.cat-widget-list .count {
  font-size: .75rem; color: var(--color-text-muted);
  background: var(--color-bg); padding: 1px 8px; border-radius: 20px;
}

/* =========================================================
   Post Navigation
   ========================================================= */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin: 40px 0;
}
.post-nav-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.post-nav-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.post-nav-label { font-size: .73rem; color: var(--color-text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.post-nav-title { font-size: .9rem; font-weight: 600; color: var(--color-text); line-height: 1.4; }
.post-nav-item.prev .post-nav-label::before { content: "← "; }
.post-nav-item.next { text-align: right; }
.post-nav-item.next .post-nav-label::after { content: " →"; }

/* =========================================================
   Related Posts
   ========================================================= */
.related-posts { margin: 40px 0; }
.related-posts-title {
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.related-posts-title::before { content: "📌"; }
.related-posts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 600px) {
  .related-posts-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: #1B2631;
  color: rgba(255,255,255,.7);
  padding: 48px 0 24px;
}
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; margin-bottom: 32px;
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
.footer-brand .logo { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.footer-brand p { font-size: .85rem; line-height: 1.7; }
.footer-col-title { color: #fff; font-weight: 700; font-size: .9rem; margin-bottom: 12px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 7px; }
.footer-links a { font-size: .85rem; color: rgba(255,255,255,.6); transition: color .15s; }
.footer-links a:hover { color: var(--color-primary-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  font-size: .8rem;
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-disclaimer {
  font-size: .75rem; line-height: 1.6;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
}

/* =========================================================
   Utilities
   ========================================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* 읽기 진행 바 */
#reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: var(--color-primary);
  transform-origin: left; transform: scaleX(0);
  z-index: 999; transition: transform .1s linear;
}

/* 맨 위로 버튼 */
#back-to-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: 50%;
  cursor: pointer; font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { transform: translateY(-3px); }

/* 페이지네이션 */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin: 40px 0;
}
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  font-size: .9rem; font-weight: 600;
  border: 1px solid var(--color-border);
  color: var(--color-text); background: var(--color-surface);
  transition: all .15s;
}
.pagination .current, .pagination a:hover {
  background: var(--color-primary); color: #fff;
  border-color: var(--color-primary);
}

/* =========================================================
   Google Fonts Import
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&family=Noto+Serif+KR:wght@600;700&display=swap');

/* =========================================================
   HOMEPAGE STYLE — 뉴스형 홈페이지
   ========================================================= */

/* ── 레이아웃 오버라이드 ─────────────────────────────────── */
.hn-page-body {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
    padding: 36px 0 60px;
    align-items: start;
}
@media (max-width: 900px) {
    .hn-page-body { grid-template-columns: 1fr; }
    .hn-page-body .sidebar { display: none; }
}

/* ── 히어로 배너 ─────────────────────────────────────────── */
.hn-hero {
    position: relative;
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 60%, #388E3C 100%);
    background-size: cover;
    background-position: center;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
}
@media (max-width: 768px) { .hn-hero { min-height: 360px; } }

.hn-hero__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.82) 0%,
        rgba(0,0,0,.45) 50%,
        rgba(0,0,0,.15) 100%
    );
}

.hn-hero__inner {
    position: relative; z-index: 1;
    padding: 56px 0 48px;
    width: 100%;
}

.hn-hero__content { max-width: 680px; }

.hn-hero__cat {
    display: inline-block;
    padding: 4px 14px; border-radius: 20px;
    font-size: .75rem; font-weight: 700;
    color: #fff; letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hn-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700; line-height: 1.35;
    color: #fff; margin-bottom: 14px;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hn-hero__excerpt {
    color: rgba(255,255,255,.85);
    font-size: 1rem; line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.hn-hero__meta {
    color: rgba(255,255,255,.65);
    font-size: .83rem; margin-bottom: 22px;
    display: flex; align-items: center; gap: 8px;
}
.hn-hero__meta .sep { opacity: .5; }

.hn-hero__btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; color: var(--color-primary);
    padding: 12px 26px; border-radius: 8px;
    font-weight: 700; font-size: .92rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transition: transform .18s, box-shadow .18s;
}
.hn-hero__btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    color: var(--color-primary);
}

/* ── 티커 (뉴스 자막 바) ──────────────────────────────────── */
.hn-ticker {
    background: var(--color-primary);
    padding: 10px 0;
    overflow: hidden;
}
.hn-ticker__inner {
    display: flex; align-items: center; gap: 16px;
    overflow: hidden;
}
.hn-ticker__label {
    background: #fff; color: var(--color-primary);
    padding: 2px 10px; border-radius: 4px;
    font-size: .72rem; font-weight: 800;
    letter-spacing: .08em; flex-shrink: 0;
}
.hn-ticker__track {
    display: flex; gap: 48px;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    color: rgba(255,255,255,.92);
    font-size: .84rem;
}
.hn-ticker__track span { flex-shrink: 0; }
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── 카테고리 섹션 ────────────────────────────────────────── */
.hn-cat-section {
    margin-bottom: 44px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
}

.hn-section-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: #fafafa;
}
.hn-section-head__left {
    display: flex; align-items: center; gap: 10px;
}
.hn-section-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.hn-section-title {
    font-family: var(--font-heading);
    font-size: 1rem; font-weight: 700; margin: 0;
}
.hn-section-count {
    font-size: .75rem; color: var(--color-text-muted);
    background: var(--color-border);
    padding: 2px 8px; border-radius: 10px;
}
.hn-section-more {
    font-size: .82rem; font-weight: 600;
    opacity: .8; transition: opacity .15s;
}
.hn-section-more:hover { opacity: 1; }

.hn-section-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: auto;
}
@media (max-width: 640px) {
    .hn-section-body { grid-template-columns: 1fr; }
}

/* 피처드 카드 (섹션 첫 번째 글) */
.hn-featured-card {
    grid-row: 1 / span 4; /* 리스트 4개 높이만큼 */
    border-right: 1px solid var(--color-border);
    display: flex; flex-direction: column;
    transition: background .15s;
}
.hn-featured-card:hover { background: var(--color-primary-pale); }
@media (max-width: 640px) {
    .hn-featured-card { grid-row: auto; border-right: none; border-bottom: 1px solid var(--color-border); }
}

.hn-featured-card__thumb {
    position: relative;
    padding-top: 56%; overflow: hidden; display: block;
}
.hn-featured-card__thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s;
}
.hn-featured-card:hover .hn-featured-card__thumb img { transform: scale(1.04); }
.hn-thumb-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}

.hn-featured-card__cat {
    position: absolute; top: 12px; left: 12px;
    padding: 3px 10px; border-radius: 20px;
    font-size: .72rem; font-weight: 700; color: #fff;
}

.hn-featured-card__body {
    padding: 18px 20px 20px; flex: 1;
    display: flex; flex-direction: column;
}
.hn-featured-card__title {
    font-family: var(--font-heading);
    font-size: 1.05rem; font-weight: 700; line-height: 1.5;
    margin-bottom: 10px; flex: 1;
}
.hn-featured-card__title a { color: var(--color-text); }
.hn-featured-card__title a:hover { color: var(--color-primary); }
.hn-featured-card__excerpt {
    font-size: .87rem; color: var(--color-text-muted);
    line-height: 1.6; margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hn-featured-card__meta {
    font-size: .78rem; color: var(--color-text-muted);
    display: flex; align-items: center; gap: 6px; margin-top: auto;
}
.hn-featured-card__meta .sep { opacity: .4; }

/* 리스트형 서브 카드 */
.hn-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    transition: background .15s;
}
.hn-list-item:last-child { border-bottom: none; }
.hn-list-item:hover { background: var(--color-primary-pale); }

.hn-list-item__thumb {
    width: 72px; height: 52px;
    border-radius: 6px; overflow: hidden; flex-shrink: 0; display: block;
}
.hn-list-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.hn-list-item__body { flex: 1; min-width: 0; }
.hn-list-item__title {
    font-size: .88rem; font-weight: 600; line-height: 1.45;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hn-list-item__title a { color: var(--color-text); }
.hn-list-item__title a:hover { color: var(--color-primary); }
.hn-list-item__meta {
    font-size: .75rem; color: var(--color-text-muted);
    display: flex; gap: 6px; align-items: center;
}
.hn-list-item__meta .sep { opacity: .4; }

/* =========================================================
   Archive Card — 썸네일 없을 때도 깔끔한 전용 카드
   ========================================================= */
.arc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.arc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.arc-card__thumb {
  display: block;
  position: relative;
  padding-top: 56%;
  overflow: hidden;
}
.arc-card__thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.arc-card:hover .arc-card__thumb img { transform: scale(1.04); }

.arc-card__body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.arc-card__cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: .02em;
  align-self: flex-start;
}

.arc-card__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
  flex: 1;
}
.arc-card__title a { color: var(--color-text); }
.arc-card__title a:hover { color: var(--color-primary); }

.arc-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: auto;
}
.arc-card__meta .sep { opacity: .4; }
