:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #8a8a8a;
  --line: #e6e3dd;
  --accent: #b3261e;        /* 신문 헤더 느낌의 딥 레드 */
  --accent-ink: #7a1a14;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --serif: "Noto Serif KR", Georgia, serif;
  --sans: "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1120px, 92%); margin: 0 auto; }

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: baseline; gap: 18px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 12px; }
.brand-name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.5px;
}
.brand-tagline { margin: 0; color: var(--ink-faint); font-size: 13px; }

/* ---------- Feed header ---------- */
.feed-header { padding: 34px 0 18px; }
.feed-toolbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 14px;
}
.feed-heading {
  font-family: var(--serif); font-weight: 700; font-size: 30px;
  margin: 0; letter-spacing: -0.5px;
}
.feed-meta { margin: 10px 0 0; color: var(--ink-faint); font-size: 13px; }

.sort-tabs { display: flex; gap: 6px; }
.sort-tab {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--ink-soft); border: 1px solid var(--line); background: var(--surface);
  transition: all .15s ease;
}
.sort-tab:hover { border-color: var(--ink-faint); }
.sort-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  padding: 26px 0 10px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link { display: flex; flex-direction: column; height: 100%; }

.card-thumb { aspect-ratio: 16 / 9; background: #ece9e3; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb.noimg { display: none; }
.thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 900; font-size: 30px; color: #c4bfb6;
  background: repeating-linear-gradient(45deg, #f0ede7, #f0ede7 10px, #ece9e3 10px, #ece9e3 20px);
}

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-source {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .4px;
}
.card-title {
  font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.4;
  margin: 0; letter-spacing: -0.3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
  margin: 0; font-size: 14px; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-date { margin-top: auto; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Infinite scroll ---------- */
.sentinel { display: flex; justify-content: center; padding: 30px 0 50px; min-height: 40px; }
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.end-msg { color: var(--ink-faint); font-size: 14px; }

/* ---------- Empty ---------- */
.empty-state { text-align: center; padding: 80px 0; }
.empty-title { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.empty-desc { color: var(--ink-soft); font-size: 15px; }
.empty-desc code { background: #efece6; padding: 2px 7px; border-radius: 5px; font-size: 13px; }

/* ---------- Detail ---------- */
.back-link { display: inline-block; margin: 26px 0 8px; color: var(--ink-soft); font-size: 14px; }
.back-link:hover { color: var(--accent); }

.article { max-width: 760px; margin: 0 auto 60px; }
.article-head { padding: 14px 0 24px; border-bottom: 1px solid var(--line); }
.article-source { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .4px; }
.article-title {
  font-family: var(--serif); font-weight: 900; font-size: 36px; line-height: 1.35;
  margin: 12px 0 16px; letter-spacing: -0.8px;
}
.article-meta { display: flex; gap: 12px; align-items: center; color: var(--ink-faint); font-size: 14px; }
.tag { background: #efece6; padding: 3px 10px; border-radius: 999px; font-size: 13px; color: var(--ink-soft); }

.article-figure { margin: 28px 0; }
.article-figure img { width: 100%; border-radius: var(--radius); display: block; }

.article-body { padding: 8px 0; }
.article-summary {
  font-family: var(--serif); font-size: 20px; line-height: 1.85; color: #2b2b2b;
  margin: 0 0 24px;
}
.article-notice {
  font-size: 13.5px; color: var(--ink-faint); background: #f0ede7;
  padding: 12px 16px; border-radius: 8px; border-left: 3px solid var(--accent);
}

.article-actions { margin-top: 34px; }
.btn-primary {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: background .15s ease;
}
.btn-primary:hover { background: var(--accent-ink); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0; }
.site-footer p { margin: 0; color: var(--ink-faint); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .article-title { font-size: 28px; }
  .feed-heading { font-size: 24px; }
  .card-grid { gap: 16px; }
}
