/* 시스템 폰트 사용 — 외부 폰트 없음 */

:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --black: #18181A;
  --accent: #D94F3D;
  --accent-light: #FDF0EE;
  --gray-100: #EFEDE8;
  --gray-200: #E0DDD6;
  --gray-400: #A8A59E;
  --gray-600: #6E6B65;
  --border: rgba(0,0,0,0.08);
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
  --r: 10px;
  --r-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--black); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 54px; gap: 20px;
}
.nav-logo {
  font-family: var(--font-display); font-size: 19px; color: var(--black);
  white-space: nowrap; letter-spacing: -0.2px; display: flex; align-items: baseline; gap: 1px;
}
.nav-logo .dot { color: var(--accent); font-size: 20px; }
.nav-search {
  flex: 1; max-width: 360px; display: flex; align-items: center; gap: 8px;
  background: var(--gray-100); border-radius: 8px; padding: 0 12px; height: 33px;
  border: 1px solid transparent; transition: border-color 0.2s, background 0.2s;
}
.nav-search:focus-within { background: var(--surface); border-color: var(--gray-200); }
.nav-search input { background: none; border: none; width: 100%; font-size: 13px; color: var(--black); }
.nav-search input::placeholder { color: var(--gray-400); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.btn-ghost { font-size: 13px; font-weight: 500; color: var(--gray-600); padding: 5px 13px; border-radius: 7px; border: 1px solid var(--border); transition: all 0.15s; }
.btn-ghost:hover { background: var(--gray-100); color: var(--black); }
.btn-primary, .btn-accent { font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); padding: 5px 15px; border-radius: 7px; transition: opacity 0.15s, transform 0.1s; white-space: nowrap; border: none; cursor: pointer; font-family: var(--font-body); }
.btn-primary:hover, .btn-accent:hover { opacity: 0.88; }
.btn-primary:active, .btn-accent:active { transform: scale(0.97); }

/* CAT BAR */
.cat-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 32px; display: flex; align-items: center; gap: 2px;
  overflow-x: auto; scrollbar-width: none; height: 42px;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-btn { flex-shrink: 0; font-size: 13px; color: var(--gray-600); padding: 4px 11px; border-radius: 6px; border: 1px solid transparent; transition: all 0.13s; white-space: nowrap; }
.cat-btn:hover { color: var(--black); background: var(--gray-100); }
.cat-btn.active { color: var(--accent); font-weight: 700; background: var(--accent-light); border-color: rgba(217,79,61,0.15); }

/* LAYOUT */
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
@media(max-width:760px){
  /* 전체 레이아웃 */
  .wrap { grid-template-columns: 1fr; padding: 10px 0; }
  .sidebar { display: none; }

  /* 네비 */
  .nav { padding: 0 14px; height: 50px; gap: 10px; }
  .nav-search { display: none; }
  .btn-ghost { font-size: 12px; padding: 5px 10px; }
  .btn-primary { font-size: 12px; padding: 5px 12px; }

  /* 태그/카테고리 바 */
  .cat-bar { padding: 0 14px; }

  /* 피드 */
  .feed-top { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; padding: 0 12px; }
  .sort-btn { font-size: 11px; padding: 3px 7px; }

  /* 포스트 카드 — 왼쪽 잘림 방지 */
  .post-card {
    padding: 12px 12px;
    gap: 10px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 1px;
  }

  /* vote */
  .vote-col { min-width: 28px; flex-shrink: 0; }
  .v-btn { width: 26px; height: 24px; font-size: 10px; }
  .v-num { font-size: 13px; }

  /* 카드 본문 */
  .p-body { min-width: 0; flex: 1; }
  .p-title { font-size: 14px; white-space: normal; line-height: 1.4; }
  .p-preview { font-size: 12px; margin-bottom: 7px; -webkit-line-clamp: 2; }

  /* 썸네일 숨기기 (이미 제거됐지만 혹시 남은 경우) */
  .p-thumb { display: none; }
}

/* FEED TOP */
.feed-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.feed-label { font-size: 12px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.07em; }
.sort-group { display: flex; gap: 2px; }
.sort-btn { font-size: 12px; color: var(--gray-600); padding: 4px 9px; border-radius: 5px; border: 1px solid transparent; transition: all 0.13s; }
.sort-btn.active, .sort-btn:hover { color: var(--black); background: var(--surface); border-color: var(--border); }

/* POST CARD */
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px;
  margin-bottom: 7px; display: flex; gap: 14px; cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  animation: fadeUp 0.28s ease both; height: 120px; align-items: center;
}
.post-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.07); transform: translateY(-1px); border-color: var(--gray-200); }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.post-card:nth-child(1){animation-delay:.03s} .post-card:nth-child(2){animation-delay:.07s}
.post-card:nth-child(3){animation-delay:.11s} .post-card:nth-child(4){animation-delay:.15s}
.post-card:nth-child(5){animation-delay:.19s} .post-card:nth-child(6){animation-delay:.23s}

/* VOTE */
.vote-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 60px; padding-top: 2px; }
.v-btn { width: 27px; height: 23px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg); color: var(--gray-400); font-size: 10px; display: flex; align-items: center; justify-content: center; transition: all 0.13s; }
.v-btn:hover { background: var(--gray-100); color: var(--black); border-color: var(--gray-200); }
.v-btn.up.on { background: var(--accent-light); border-color: rgba(217,79,61,0.25); color: var(--accent); }
.v-btn.down.on { background: var(--gray-100); border-color: var(--gray-200); color: var(--black); }
.v-num { font-size: 13px; font-weight: 700; color: var(--black); }

/* CARD BODY */
.p-body { flex: 1; min-width: 0; }
.p-meta { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.b-일상  { background:#EEF2FF; color:#3730A3; }
.b-직장  { background:#F0FDF4; color:#166534; }
.b-드라마{ background:#FDF4FF; color:#7E22CE; }
.b-관계  { background:#FFF7ED; color:#9A3412; }
.b-동물  { background:#F0FDFA; color:#115E59; }
.b-기타  { background:#F8FAFC; color:#475569; }
.b-hot   { background:var(--accent); color:#fff; }
.p-by { font-size: 12px; color: var(--gray-400); }
.p-title { font-size: 15px; font-weight: 700; color: var(--black); margin-bottom: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-preview { font-size: 13px; color: var(--gray-600); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 9px; }
.p-thumb { flex-shrink: 0; width: 68px; height: 68px; border-radius: var(--r); background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: 24px; align-self: center; }
.p-foot { display: flex; gap: 12px; }
.p-stat { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--gray-400); }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 12px; }
.s-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.s-head { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.08em; }
.rank-row { display: flex; align-items: center; gap: 9px; padding: 8px 14px; cursor: pointer; transition: background 0.12s; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--bg); }
.rank-n { font-size: 12px; font-weight: 700; min-width: 14px; text-align: center; }
.rank-n.hi { color: var(--accent); }
.rank-n.lo { color: var(--gray-400); }
.rank-t { flex: 1; font-size: 13px; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-v { font-size: 11px; color: var(--gray-400); white-space: nowrap; }

/* CTA */
.cta-box { background: var(--black); border-radius: var(--r-lg); padding: 18px 16px; text-align: center; }
.cta-title { font-family: var(--font-display); font-size: 15px; color: #fff; margin-bottom: 4px; }
.cta-sub { font-size: 12px; color: var(--gray-400); margin-bottom: 12px; }
.cta-btn { display: inline-block; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; padding: 7px 20px; border-radius: 7px; transition: opacity 0.13s; }
.cta-btn:hover { opacity: 0.85; }

/* PAGER */
.pager { display: flex; justify-content: center; gap: 3px; margin-top: 18px; }
.pg-btn { min-width: 31px; height: 31px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--gray-600); display: flex; align-items: center; justify-content: center; padding: 0 7px; cursor: pointer; transition: all 0.13s; }
.pg-btn:hover { background: var(--gray-100); color: var(--black); }
.pg-btn.on { background: var(--black); color: #fff; border-color: var(--black); }

/* FAB */
.fab { display: none; position: fixed; bottom: 20px; right: 16px; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; box-shadow: 0 4px 14px rgba(217,79,61,0.35); align-items: center; justify-content: center; z-index: 99; transition: transform 0.15s; }
.fab:hover { transform: scale(1.07); }
@media(max-width:760px){ .fab { display: flex; } }

/* LIKE BUTTON (for posts) */
.c-like-btn { display: flex; align-items: center; gap: 3px; font-size: 24px; color: var(--accent); background: none; border: none; cursor: pointer; font-family: var(--font-body); transition: color 0.13s; padding: 0; }
.c-like-btn:hover, .c-like-btn.liked { color: var(--accent); font-weight: 700; }
