/* idontcommu — 3040 직장인 출근길·짬 시간 SFW 노른자 데일리 (A 정착)
   - 카드 1열 줄줄
   - 카드 안에 콘텐츠 다 (이미지·제목·출처·#순위·★handpick·N곳 동시)
   - 세로 긴 이미지 자동 fold + 클릭 expand (화면 전환 X) */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.55 -apple-system, "Apple SD Gothic Neo", "Segoe UI", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  background: #f5f5f3;
  color: #1a1a1a;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ── topbar ───────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #ececea;
  position: sticky; top: 0; z-index: 10;
  height: 56px;
}
.brand {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  text-decoration: none; color: #1a1a1a;
}
.datenav {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #666;
}
.datenav button {
  width: 32px; height: 32px; border: 1px solid #e0e0dd; background: #fff;
  border-radius: 50%; padding: 0; font-size: 16px; line-height: 1;
  color: #555;
}
.datenav button:disabled { opacity: .35; cursor: default; }
.datenav button:not(:disabled):hover { background: #f5f5f3; }
.datenav span { font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; }

/* ── feed ─────────────────────────────────────────── */
main {
  max-width: 540px;
  margin: 0 auto;
  padding: 12px 12px 80px;
}
.loading, .empty {
  padding: 60px 16px; text-align: center; color: #999; font-size: 14px;
}
.feed-meta {
  padding: 8px 4px 16px;
  font-size: 12px; color: #888;
  display: flex; align-items: center; gap: 8px;
}
.feed-meta .read-progress {
  flex: 1; height: 4px; background: #e8e8e6; border-radius: 2px; overflow: hidden;
}
.feed-meta .read-progress > div {
  height: 100%; background: #1a1a1a; transition: width .3s;
}

/* ── card (A 정착) ────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer;
  transition: opacity .25s, transform .15s;
  position: relative;
}
.card:active { transform: scale(.99); }
.card.read { opacity: .55; }

/* 이미지 영역 — fold/unfold */
.card-image {
  width: 100%;
  background: #f0f0ee;
  position: relative;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: auto;
  display: block;
}
/* fold 상태 — 세로 긴 이미지는 max-height로 잘림 */
.card.fold .card-image {
  max-height: 70vh;          /* 모바일 기준 */
}
.card.fold .card-image::after {
  /* fade + 더보기 hint */
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 80px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.95));
  pointer-events: none;
}
.card.fold .more-hint {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  background: rgba(26,26,26,.92); color: #fff;
  padding: 5px 14px; border-radius: 14px;
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  pointer-events: none;
  white-space: nowrap;
}
.card.expanded .card-image { max-height: none; }
.card.expanded .card-image::after { display: none; }
.card.expanded .more-hint { display: none; }

/* 텍스트 only 카드 */
.card.text-only .card-body { padding: 22px 16px; }
.card.text-only .card-title { font-size: 17px; line-height: 1.45; }

/* 카드 본문 (제목·출처) */
.card-body { padding: 12px 14px 14px; }
.card-title {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  color: #1a1a1a;
  word-break: keep-all;
}
.card-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 11px; color: #888;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.rank-badge {
  display: inline-block;
  background: #1a1a1a; color: #fff;
  padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.handpick-mark { color: #c80; font-weight: 700; }
.diversity-mark {
  background: #eef5e8; color: #3a7;
  padding: 1px 6px; border-radius: 3px; font-size: 11px;
}
.size-hint {
  background: #f0f0ee; color: #888;
  padding: 1px 6px; border-radius: 3px; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.origin-link {
  margin-left: auto; color: #36c; text-decoration: none;
  font-size: 12px; padding: 4px 8px; border-radius: 4px;
}
.origin-link:hover { background: #f0f4fa; }

/* expanded 표시 — 카드 위 작은 ▲ */
.collapse-hint {
  display: none;
  position: absolute; top: 8px; right: 8px;
  background: rgba(26,26,26,.85); color: #fff;
  padding: 4px 10px; border-radius: 12px;
  font-size: 11px;
  pointer-events: none;
}
.card.expanded .collapse-hint { display: inline-block; }

/* ── closure ───────────────────────────────────────── */
.closure {
  padding: 60px 24px 40px;
  text-align: center;
}
.closure h2 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
.closure p { font-size: 13px; color: #666; margin: 4px 0; }
.closure .reset {
  margin-top: 24px;
  padding: 8px 18px; background: transparent; border: 1px solid #ccc;
  border-radius: 20px; font-size: 13px; color: #555;
}

/* ── footer ───────────────────────────────────────── */
footer {
  text-align: center; padding: 24px 16px 32px;
  font-size: 11px; color: #999;
}
footer .tagline { margin: 0 0 4px; line-height: 1.5; }
footer .meta a { color: #999; text-decoration: underline; text-decoration-color: #ddd; }

/* 데스크탑 — 카드 폭만 ↑, 같은 layout */
@media (min-width: 720px) {
  main { max-width: 600px; padding: 20px 16px 80px; }
  .card.fold .card-image { max-height: 800px; }
}
