/* ============================================================
   list.css — /articles, /topics, /topics/{section}, /image-credits
   Agent D. 공용 토큰·컴포넌트(app.css)는 DESIGN-CONTRACT §2·§3을 소비만 한다.
   ============================================================ */

/* ── 목록 페이지 히어로 (텍스트 전용, 밀도 우선) ───────────── */

.list-hero {
  border-bottom: 1px solid var(--line-soft);
}

.list-hero__title {
  margin: 10px 0 0;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.list-hero__lede {
  max-width: 62ch;
  margin: 14px 0 0;
}

.list-hero__meta {
  margin: 16px 0 0;
}

/* ── 주제 점프 내비 (/articles 상단) ───────────────────────── */

.list-jump {
  margin-top: 22px;
}

.list-jump .chip {
  gap: 6px;
}

.list-jump__count {
  font-weight: 800;
  color: var(--sage-deep);
  opacity: 0.85;
}

/* 앵커 이동 시 sticky 헤더에 가리지 않게 */
.list-group {
  scroll-margin-top: 92px;
}

/* ── 주제 그룹 헤더 (/articles) ────────────────────────────── */

.list-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(18px, 2.4vw, 26px);
}

.list-group__intro {
  max-width: 60ch;
}

.list-group__intro h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.list-group__intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.list-group__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  white-space: nowrap;
}

/* ── 주제 허브 카드 (/topics) ──────────────────────────────── */

.topic-grid {
  align-items: stretch;
}

.topic-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card-warm);
  box-shadow: var(--shadow-1);
}

.topic-card__main {
  display: block;
  padding: clamp(22px, 3vw, 30px);
  transition: background-color 0.2s var(--ease);
}

.topic-card__main:hover,
.topic-card__main:focus-visible {
  background: var(--sage-soft);
}

.topic-card__title {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.topic-card__desc {
  display: block;
  margin-top: 9px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.6;
}

.topic-card__count {
  display: block;
  margin-top: 14px;
  color: var(--sage-deep);
  font-size: 14px;
  font-weight: 800;
}

.topic-card__picks {
  margin-top: auto;
  padding: 16px clamp(22px, 3vw, 30px) 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--card);
}

.topic-card__picks-label {
  margin: 0 0 6px;
  color: var(--terracotta-deep);
  font-size: 13px;
  font-weight: 800;
}

.topic-card__picks ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-card__picks li + li {
  border-top: 1px solid var(--line-soft);
}

.topic-card__picks a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  transition: color 0.18s var(--ease);
}

.topic-card__pick-title {
  color: var(--body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.topic-card__picks a:hover .topic-card__pick-title,
.topic-card__picks a:focus-visible .topic-card__pick-title {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic-card__pick-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

/* ── 다른 주제 블록 (/topics/{section} 하단) ───────────────── */

.list-others__title {
  margin: 0 0 clamp(16px, 2.4vw, 24px);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.other-topic {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.other-topic:hover,
.other-topic:focus-visible {
  border-color: var(--sage);
  background: var(--card-warm);
}

.other-topic strong {
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.other-topic__desc {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.other-topic__count {
  margin-top: 12px;
  color: var(--sage-deep);
  font-size: 13px;
  font-weight: 800;
}

/* ── 전체 글로 가는 CTA ────────────────────────────────────── */

.list-cta {
  margin: clamp(26px, 4vw, 38px) 0 0;
  text-align: center;
}

/* ── 이미지 출처 (/image-credits) ──────────────────────────── */

.credit {
  margin: 0;
}

.credit img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--paper-edge);
}

.credit figcaption {
  padding: 10px 2px 0;
  font-size: 14px;
  line-height: 1.55;
}

.credit figcaption strong {
  display: block;
  color: var(--ink);
}

.credit figcaption span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.credit figcaption .text-link {
  display: inline-block;
  margin-top: 7px;
  font-size: 13px;
}

/* ── 빈 상태 (번역 로케일: 글 0~수편) ──────────────────────── */

.list-empty {
  margin: 0;
}

.list-empty p {
  margin: 0;
  color: var(--body);
}

.list-empty--narrow {
  max-width: var(--reading);
  margin-inline: auto;
}

/* ── 반응형 보정 ───────────────────────────────────────────── */

@media (max-width: 680px) {
  .list-group__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-group__meta {
    white-space: normal;
  }

  .topic-card__picks a {
    flex-wrap: wrap;
    gap: 4px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topic-card__main,
  .topic-card__picks a,
  .other-topic {
    transition: none;
  }
}
