@import url('/fonts/pretendard-dynamic-subset.css');

/* 웹툰 목록 화면 (5안). 공용 규칙은 v5.css. */
.hero2 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; max-width: var(--wrap); margin: 0 auto; padding: 36px 24px 0; }
.hero2 .tx { grid-column: 1 / 3; display: flex; flex-direction: column; min-height: 400px; height: auto; padding-right: 24px; }
.hero2 h1 { display: -webkit-box; margin: 12px 0 0; overflow: hidden; font-size: clamp(28px, 2.7vw, 40px); font-weight: 700; line-height: 1.18; letter-spacing: var(--tracking-title); cursor: pointer; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.hero2 p { display: -webkit-box; margin: 20px 0 0; font-size: 16px; line-height: 1.65; color: var(--ink-2); -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero2 .acts { display: flex; gap: 8px; margin-top: auto; }
.reel { grid-column: 3 / 7; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reel a { display: block; min-width: 0; }
.reel img { display: block; width: 100%; height: 400px; object-fit: cover; object-position: top; border-radius: var(--r); background: var(--sunken); }
.reel .sk { height: 400px; border-radius: var(--r); background: var(--sunken); }
.sk-line { height: 18px; margin-top: 14px; border-radius: 2px; background: var(--sunken); }
.sk-line.big { height: 46px; }
.sk-line.short { width: 40%; }

.ul { display: flex; gap: 32px; margin-top: 36px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; color: var(--ink-3); }
.ul button { padding-bottom: 14px; margin-bottom: -1px; white-space: nowrap; font-weight: 600; color: inherit; }
.ul button.active { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
#cartoonCount { display: inline-block; min-width: 1.5em; text-align: left; font-variant-numeric: tabular-nums; }
.is-tab-page .ul { margin-top: 36px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.tab { display: flex; align-items: center; gap: 5px; height: 32px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tab.active { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
#mainContent:not([data-subtab="all"]) .sort-wrap { display: none; }
#mainContent[data-subtab="ranking"] .bar,
#mainContent[data-subtab="library"] .bar { display: none; }
#mainContent[data-subtab="library"] .empty { border-top: 0; }

.result-line { margin-top: 24px; font-size: 14px; color: var(--ink-2); }
.result-line b { color: var(--ink); font-weight: 700; }
.works { margin-top: 24px; }

.poster .fav { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); opacity: 0; }
.poster .cap { position: relative; display: block; }
.poster .m { padding-right: 26px; }
.poster:hover .fav, .poster .fav:focus-visible { opacity: 1; }
.poster .fav:hover { color: var(--ink); }
.poster .fav.active { opacity: 1; color: var(--accent-d); }
.poster .fav.active svg { fill: currentColor; }
.rank-no { position: absolute; left: 8px; bottom: 8px; font-size: 72px; font-weight: 800; line-height: .8; letter-spacing: var(--tracking-title); color: #fff; -webkit-text-stroke: 1.5px var(--ink); }

.rank-bar { display: flex; gap: 20px; margin: 18px 0 24px; }
.lib-sec { margin-top: 40px; }
.lib-sec .works { margin-top: 0; }
.rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row img { flex: none; width: 50px; height: 66px; object-fit: cover; border-radius: 2px; background: var(--sunken); }
.row .x { flex: 1; min-width: 0; }
.row .t { margin: 0; min-height: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .go { flex: none; font-size: 13px; font-weight: 600; color: var(--accent-d); }
.row .rm { flex: none; color: var(--ink-3); font-size: 13px; }
.row .rm:hover { color: var(--ink); }
.txt-btn { font-size: 13px; color: var(--ink-2); }
.txt-btn:hover { color: var(--ink); }

@media (hover: none) {
  .poster:hover .fav { opacity: 0; }
  .poster .fav.active { opacity: 1; }
}

@media (max-width: 700px) {
  .hero2 { display: flex; flex-direction: column-reverse; gap: 12px; padding: 16px 16px 0; }
  .hero2 .tx { min-height: 0; height: auto; padding: 0; gap: 6px; }
  .is-hero-loading .hero2 .tx { min-height: 174px; height: 174px; overflow: hidden; }
  .is-hero-loading .sk-line { height: 14px; margin-top: 8px; }
  .is-hero-loading .sk-line.big { height: 32px; }
  .hero2 h1 { margin-top: 4px; font-size: 24px; -webkit-line-clamp: 2; }
  .hero2 p { margin-top: 6px; font-size: 14px; line-height: 1.5; -webkit-line-clamp: 2; }
  .hero2 .acts { margin-top: 12px; }
  .hero2 .acts .btn { flex: 1; height: 44px; padding: 0 12px; }
  .reel { display: block; }
  .reel img, .reel .sk { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .reel a + a, .reel .sk + .sk { display: none; }
  .ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 18px; margin-top: 20px; font-size: 15px; }
  .ul::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .bar { flex-wrap: wrap; gap: 10px; }
  .bar .tabs { flex-wrap: wrap; width: 100%; gap: 10px 14px; overflow-x: visible; }
  .sort-wrap { margin-left: auto; }
  .works { margin-top: 18px; }
  .rank-no { left: 6px; bottom: 6px; font-size: 52px; }
  .rows { grid-template-columns: 1fr; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero2 { padding-top: 12px; gap: 14px; }
  .hero2 .tx { min-height: 0; height: 200px; padding-right: 10px; }
  .hero2 h1 { font-size: var(--fs-h3); margin-top: 4px; -webkit-line-clamp: 2; }
  .hero2 p { font-size: var(--fs-small); margin-top: 6px; -webkit-line-clamp: 2; }
  .reel img, .reel .sk { height: 200px; }
  .hero2 .acts .btn { height: 38px; padding: 0 14px; font-size: var(--fs-small); }
}
