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

:root {
  --primary: #c8415d;
  --primary-dark: #a83350;
  --bg: #ffffff;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #ebebeb;
  --comment-bg: #f9f9f9;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

h1, h2, h3,
.logo,
.article-card h3,
.article-detail-header h1,
.article-detail-header h2 {
  font-family: 'Noto Serif KR', serif;
}

/* ── Hero Section (심플 배너로 교체) ── */
.hero-section {
  background: linear-gradient(135deg, #fff0f3 0%, #fff5f7 100%);
  border-bottom: 1px solid var(--border);
  padding: 40px 20px 36px;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 600;
}
.hero-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 12px;
}
.hero-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero-cta {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 24px;
  transition: background 0.2s;
}
.hero-cta:hover { background: var(--primary-dark); }
@media (max-width: 768px) {
  .hero-section { padding: 28px 20px; }
  .hero-title { font-size: 22px; }
  .hero-desc br { display: none; }
}

/* ── Features Section (숨김) ── */
.features-section { display: none; }

/* ── 카테고리 아이콘 스트립 ── */
.cat-strip {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 20px 20px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip-inner {
  display: flex;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  justify-content: center;
  flex-wrap: nowrap;
}
.cat-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 72px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  transition: color 0.2s;
}
.cat-strip-item:hover, .cat-strip-item.active { color: var(--primary); }
.cat-strip-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: #f7f7f7;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.cat-strip-item:hover .cat-strip-icon,
.cat-strip-item.active .cat-strip-icon {
  border-color: var(--primary);
  background: #fff0f3;
}
@media (max-width: 768px) {
  .cat-strip-inner { justify-content: flex-start; padding-bottom: 4px; }
  .cat-strip-icon { width: 48px; height: 48px; font-size: 18px; }
  .cat-strip-item { min-width: 60px; font-size: 11px; }
}

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Category Nav ── */
.cat-nav {
  background: #fff;
  border-bottom: 2px solid var(--border);
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
}

.cat-btn {
  padding: 14px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-btn:hover { color: var(--text); }
.cat-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Main Layout ── */
.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ── Shorts-style Article+Comment ── */
.shorts-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  height: calc(100vh - 140px);
  position: sticky;
  top: 128px;
}

.article-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow-y: auto;
  padding: 36px;
}

.comment-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Article List ── */
.article-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 600px) {
  .article-list { grid-template-columns: 1fr; gap: 14px; }
}

.article-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.article-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.article-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f0f0f0;
}
.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.article-card-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-thumb { margin-bottom: 24px; }
.article-thumb-img {
  width: 100%;
  border-radius: 0;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.image-credit {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
}
.image-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}
.image-credit a:hover { color: var(--primary); }
@media (max-width: 768px) {
  .article-thumb-img { max-height: 220px; }
}
.article-card:hover .article-card-img img {
  transform: scale(1.05);
}
.article-card-body {
  padding: 16px;
  flex: 1;
  min-width: 0;
}
.article-card.active {
  box-shadow: 0 0 0 2px var(--primary);
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cat-badge {
  font-size: 11px;
  padding: 0;
  border-radius: 0;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: none !important;
  text-transform: uppercase;
}

.source-name {
  font-size: 12px;
  color: var(--text-muted);
}

.pub-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.article-card h2 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}

.article-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.comment-count {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Article Detail Panel ── */
.article-detail-header {
  margin-bottom: 24px;
}

.article-detail-header h1,
.article-detail-header h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 14px;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.original-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 9px 18px;
  background: none;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.original-link:hover { background: var(--primary); color: #fff; }

.article-summary {
  font-size: 16px;
  line-height: 1.85;
  margin: 24px 0;
  padding: 22px 24px;
  background: var(--comment-bg);
  border-radius: 0;
  border-left: 3px solid var(--primary);
}
.article-body {
  font-size: 16px;
  line-height: 1.9;
  margin: 24px 0;
  color: var(--text-main);
}
.article-body h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--primary);
}
.article-body p {
  margin-bottom: 16px;
}
.article-body ul,
.article-body ol {
  margin: 10px 0 16px 22px;
  line-height: 1.85;
}
.article-body li {
  margin-bottom: 6px;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── FAQ accordion ── */
.article-body details {
  background: var(--comment-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  margin: 6px 0;
  overflow: hidden;
}
.article-body details[open] {
  background: var(--comment-bg);
}
.article-body details summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  color: var(--text);
}
.article-body details summary::-webkit-details-marker { display: none; }
.article-body details summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--primary);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.article-body details[open] summary::before {
  transform: rotate(90deg);
}
.article-body details > p {
  padding: 14px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  background: var(--comment-bg);
  color: var(--text);
  border-top: 1px solid var(--border);
}

/* ── Table ── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}
.article-body th {
  background: var(--comment-bg);
  color: var(--text);
  font-weight: 700;
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.article-body td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.article-body tr:nth-child(even) td {
  background: #fbfaf7;
}

/* ── Banner wrapper (responsive) ── */
.banner-wrap {
  text-align: left;
  margin: 16px 0;
  overflow: hidden;
  max-width: 100%;
  display: block;
}
.banner-wrap iframe {
  display: block;
  border: 0;
  max-width: none; /* JS가 transform으로 제어 */
}
.article-panel, .article-body, .shorts-container {
  overflow-x: hidden;
}
@media (max-width: 768px) {
  .banner-wrap iframe {
    transform-origin: top left;
  }
}

/* ── RSS Panel ── */
.rss-panel {
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}
.rss-section { margin-bottom: 14px; }
.rss-section:last-child { margin-bottom: 0; }
.rss-site-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.rss-site-label a {
  color: var(--text-muted);
  text-decoration: none;
}
.rss-site-label a:hover { color: var(--primary); }
.rss-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rss-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.4;
}
.rss-list li:last-child { border-bottom: none; }
.rss-list a {
  color: var(--text-main);
  text-decoration: none;
  display: block;
}
.rss-list a:hover { color: var(--primary); }

/* ── Comments ── */
.comment-panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  font-family: 'Noto Serif KR', serif;
}

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.comment-item {
  padding: 14px;
  border-radius: 0;
  background: var(--comment-bg);
  margin-bottom: 8px;
}

.comment-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-nick {
  font-weight: 600;
  font-size: 13px;
}

.comment-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.comment-content {
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.comment-form {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 13px;
  margin-bottom: 8px;
  font-family: inherit;
  resize: none;
  background: var(--bg);
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.comment-submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s;
}
.comment-submit-btn:hover { background: var(--primary-dark); }

/* ── Category Colors (muted editorial ink tones) ── */
.cat-정치 { color: #7a2e2e; }
.cat-경제 { color: #2f5d4f; }
.cat-사회 { color: #2c4a63; }
.cat-생활문화 { color: #8a5a2e; }
.cat-세계 { color: #5b4a7a; }
.cat-IT과학 { color: #2e6b66; }
.cat-부동산 { color: #8a5328; }
.cat-헬스건강 { color: #2e7a6a; }
.cat-스포츠 { color: #2c5a73; }
.cat-연예 { color: #8a3550; }
.cat-자동차 { color: #5a5650; }
.cat-날씨 { color: #355b73; }
.cat-가상화폐 { color: #8a6a28; }
.cat-주식 { color: #3e6b3a; }
.cat-육아 { color: #8a3d63; }
.cat-여행 { color: #2e6b5e; }
.cat-게임 { color: #5e3d7a; }
.cat-패션뷰티 { color: #8a3d5e; }
.cat-음식맛집 { color: #8a4528; }
.cat-교육 { color: #344f7a; }
.cat-환경 { color: #2e6b3e; }
.cat-법률 { color: #4a3268; }
.cat-취업직장 { color: #34406b; }
.cat-반려동물 { color: #8a5a28; }
.cat-영화 { color: #6b2e4f; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px 0;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) {
  background: var(--comment-bg);
}
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Main Index 2-column layout ── */
.main-index-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}
.index-article-col { min-width: 0; }
.index-sidebar { position: sticky; top: 80px; }

.sidebar-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
.sidebar-box-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.sidebar-ad { background: var(--comment-bg); }

.popular-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.popular-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}
.popular-list li:last-child { border-bottom: none; }
.popular-list a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.popular-list a:hover { color: var(--primary); }
.popular-num {
  font-weight: 700;
  color: var(--primary);
  min-width: 16px;
  flex-shrink: 0;
  font-family: 'Noto Serif KR', serif;
}
.popular-cnt {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .shorts-container {
    grid-template-columns: 1fr;
    height: auto;
    position: static;
  }

  .article-panel {
    height: auto;
    overflow-y: visible;
    padding: 24px;
  }

  .comment-panel {
    height: auto;
    overflow: visible;
  }

  .comment-panel .rss-panel,
  .comment-panel-header,
  .comment-form {
    flex-shrink: 0;
  }

  .comment-list {
    max-height: 320px;
    overflow-y: auto;
  }

  .main-wrap {
    padding: 16px;
  }

  .main-index-layout {
    grid-template-columns: 1fr;
  }
  .index-sidebar { position: static; }
}

/* ── Category Sections (Homepage horizontal scroll) ── */
.cat-sections {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0 48px;
}

.cat-section {
  padding: 32px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.cat-section:last-child { border-bottom: none; }

.cat-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cat-section-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat-section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-section-more:hover { color: var(--primary); }

/* ── Horizontal Scroll Row ── */
.h-scroll-wrap {
  position: relative;
}
.h-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.2s, opacity 0.2s;
  color: var(--text);
  line-height: 1;
}
.h-scroll-btn:hover { background: var(--primary); color: #fff; }
.h-scroll-btn.prev { left: -14px; }
.h-scroll-btn.next { right: -14px; }
.h-scroll-btn[disabled] { opacity: 0; pointer-events: none; }
.h-scroll-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.h-scroll-row::-webkit-scrollbar { display: none; }

/* ── Horizontal Card ── */
.h-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-bg);
  transition: box-shadow 0.2s, transform 0.2s;
}
.h-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.h-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
}
.h-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.h-card:hover .h-card-img img { transform: scale(1.05); }
.h-card-img--placeholder { display: flex; align-items: center; justify-content: center; }
.h-card-body {
  padding: 12px 14px;
  flex: 1;
}
.h-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.h-card h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Noto Serif KR', serif;
}

/* ── Filtered Category View ── */
.filtered-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

@media (max-width: 768px) {
  .cat-section { padding: 24px 16px 8px; }
  .cat-section-title { font-size: 18px; }
  .h-card { flex: 0 0 160px; }
  .h-card-img { aspect-ratio: 3/2; }
  .h-card h3 { font-size: 13px; }
  .filtered-wrap { padding: 16px; }
}

/* ── Footer ── */
.site-footer {
  background: var(--text);
  color: #b8b3a8;
  padding: 36px 20px;
  margin-top: 48px;
  font-size: 13px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-bottom: 14px;
}
.footer-links a {
  color: #d8d3c8;
  text-decoration: none;
}
.footer-links a:hover { color: #fff; }
.footer-info { margin-bottom: 8px; }
.footer-copy { color: #8a857a; }
