/* idontcommu — 사용자 외형 (라이트박스 기반)
   - 카드 1열 줄줄, 절대 max-height로 일관
   - 클릭 → 라이트박스 overlay에 원본 비율 그대로
   - fold·expanded 로직 제거 (긴 이미지 = 라이트박스로 펼쳐 봄) */

* { 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;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand-logo {
  height: 28px; width: auto; display: block;
}
/* logo.png 미배치 시 부드러운 placeholder — onerror로 img → span 대체 */
.brand-logo-text {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 12px;
  background: linear-gradient(135deg, #1a1a1a 0%, #404040 100%);
  border-radius: 6px;
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: lowercase;
}
.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 ────────────────────────────────── */
.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;
  /* tier 좌측 색 띠 — V1 디자인 톤 회수. 숫자 rank 폐기. */
  border-left: 4px solid transparent;
}
.card:active { transform: scale(.99); }
.card.read { opacity: .55; }

/* tier ladder — 깊이감을 색으로만 표시 (V1 패턴) */
.card.tier-top { border-left-color: #e67e22; }   /* rank 1~15 — 주황 */
.card.tier-mid { border-left-color: #94a3b8; }   /* rank 16+ — 슬레이트 */

/* 이미지 영역 — 절대 max-height. 비율 유지. */
.card-image {
  width: 100%;
  background: #f0f0ee;
  position: relative;
  overflow: hidden;
  max-height: 480px;
}
.card-image img {
  width: 100%;
  height: auto;
  display: block;
}
/* 카드 안 이미지가 max-height 넘으면 잘리고 fade hint */
.card-image::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.85));
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
/* 이미지가 max-height 도달했는지는 JS 없이 CSS contain만으로 안 됨 — 단순화: 항상 살짝 fade */
.card.has-fade .card-image::after { opacity: 1; }

/* 텍스트 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;
}
.handpick-mark { color: #c80; font-weight: 700; }
.diversity-mark {
  background: #eef5e8; color: #3a7;
  padding: 1px 6px; border-radius: 3px; font-size: 11px;
}
.origin-link {
  margin-left: auto; color: #36c; text-decoration: none;
  font-size: 12px; padding: 4px 8px; border-radius: 4px;
}
.origin-link:hover { background: #f0f4fa; }

/* ── lightbox ───────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: flex-start;        /* 긴 이미지 위부터 보이게 */
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 20px;
  overflow: auto;
}
.lightbox img {
  /* PC에서도 모바일 폼팩터 유지 — max 500px, 가운데 정렬.
     모바일은 95vw로 화면 꽉 채움. */
  max-width: min(500px, 95vw);
  width: auto;
  height: auto;
  margin: 0 auto;
  cursor: default;
  background: #fff;
  border-radius: 4px;
  /* max-height 없음 — 긴 이미지는 자연 height로 풀고 .lightbox 자체 overflow:auto로 스크롤 */
}
.lightbox .lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  z-index: 1001;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.25); }


/* ── 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; }

/* 데스크탑 */
@media (min-width: 720px) {
  main { max-width: 600px; padding: 20px 16px 80px; }
  .card-image { max-height: 600px; }
}
