/* 메인페이지 컴포넌트: .home 안에서만 적용 */

.home .sec { margin-top: 48px; }
.home .hero + .sec, .home > .sec:first-child { margin-top: 40px; }
.home .sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.home .sec-title { margin: 0; font-family: var(--font-display); font-size: 21px; line-height: 1.3; }
.home .sec-more { color: var(--muted); font-size: 14px; }
.home .empty { margin: 0; padding: 24px; color: var(--muted); text-align: center; }

/* 히어로 */
.home .hero { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 40px; align-items: center; padding: 36px; border-radius: var(--r-xl); background: var(--surface); }
.home .hero-title { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.3; }
.home .hero-meta { margin: 12px 0 0; color: var(--muted); }
.home .hero-summary { max-width: 46ch; margin: 12px 0 0; color: var(--text-2); line-height: 1.75; }
.home .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.home .btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border: 1px solid var(--line); border-radius: var(--r-pill); font-weight: 500; }
.home .btn-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.home .hero-art .cover { border-radius: var(--r-lg); }
.home .hero-art .cover-glyph { font-size: 64px; }

/* 표지 · 카드 */
.home .cover { position: relative; display: block; aspect-ratio: var(--ratio, 5/7); overflow: hidden; border-radius: var(--r-md); background: var(--tint, #33415C); }
.home .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home .cover-glyph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 44px; font-weight: 700; }
.home .badge-new { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.home .row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; align-items: start; }
.home .card { display: block; min-width: 0; }
.home .card-title { display: block; margin-top: 10px; overflow: hidden; font-size: 15px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.home .card-meta { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* 탭 */
.home .tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.home .tabs button { height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.home .tabs [aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.home [role="tabpanel"][hidden] { display: none; }

/* 이어보기 · 즐겨찾기 소식 · 음악: 가로로 긴 카드 */
.home .resume-row, .home .feed, .home .tracks { display: grid; gap: 12px; }
.home .resume-row { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.home .feed { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.home .tracks { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.home .resume, .home .feed-item, .home .track { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: var(--surface); }
.home .resume .cover { width: 76px; flex: none; }
.home .feed-item .cover { width: 44px; flex: none; }
.home .track .cover { width: 56px; flex: none; }
.home .resume-body, .home .feed-body, .home .track-body { flex: 1; min-width: 0; }
.home .resume .card-title, .home .feed-item .card-title, .home .track .card-title { margin-top: 0; }
.home .pill { padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.home .track { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.home .track-play { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.home .track-play svg { width: 14px; height: 14px; fill: currentColor; }

/* 랭킹: 순서가 의미 있는 목록이라 큰 번호를 붙인다 */
.home .rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.home .rank-item { display: flex; align-items: flex-end; gap: 2px; }
.home .rank-no { flex: none; width: 44px; padding-bottom: 56px; color: transparent; font-size: 72px; font-weight: 700; line-height: .85; text-align: right; -webkit-text-stroke: 2px var(--accent); }
.home .rank-card { flex: 1; min-width: 0; }

/* 커뮤니티 새 글 */
.home .boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.home .board { padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); }
.home .board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.home .board-name { margin: 0; font-size: 16px; }
.home .board-list { margin: 0; padding: 0; list-style: none; }
.home .board-list li + li { border-top: 1px solid var(--line-soft); }
.home .board-list a { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; }
.home .board-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .board-count { color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.home .board-date { color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  .home .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px; }
  .home .hero-art { order: -1; width: 140px; }
  .home .row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
}

/* 관리자 도구 줄 (관리자에게만 출력됨) */
.home .admin-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.home .admin-bar a { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--muted); font-size: 13px; }
.home .admin-bar a:hover { color: var(--text); }
