/* 홈 화면 (front/main.php). 사이트 테마와 이름이 겹치지 않게 .p202-home 안에서만 쓴다. */

.p202-home {
  --thumb-w: 148px;     /* 2~5위·공개/종료 예정 썸네일 공통 */
  --thumb-logo: 20px;   /* 썸네일 좌상단 N 로고 */
  --ink: #303642;
  --muted: #7a8291;
  --line: #ececef;
  --line-soft: #f2f3f5;
  --paper: #fff;
  --bg: #f6f7f9;
  --accent-ink: #a64233;
  --accent-soft: #fef4f2;
  --accent-border: #f7c2b7;
  --coming: #3f78e0;
  --down: #e2626b;
  --thumb-bg: #e3e6ec;
  background: var(--bg);
  color: var(--ink);
}
@media (max-width: 768px) {
  .p202-home { --thumb-w: 104px; --thumb-logo: 16px; }
}

/* 섹션 공통 */
.p202-home .m-section { padding: 40px 0; }
.p202-home .m-section + .m-section { padding-top: 8px; }
.p202-home .hero-top { padding-top: 32px; }
.p202-home .m-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.p202-home .m-head a.more { font-size: 14px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.p202-home .m-head a.more:hover { color: var(--accent-ink); }
.p202-home .m-head h3.sub-title { font-size: 18px; font-weight: 500; margin: 0; }
.p202-home .m-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }

/* 대표 섹션(넷플릭스·일본어 뉴스·소식) 제목: 메뉴 대표 이미지 + 같은 크기 */
.p202-home .sec-head { align-items: center; margin-bottom: 20px; }
.p202-home .sec-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p202-home .sec-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; }
.p202-home .sec-head h1,
.p202-home .sec-head h2 { font-size: 24px; font-weight: 500; margin: 0; letter-spacing: -.02em; }
.p202-home .week-chip { white-space: nowrap; display: inline-flex; align-items: center; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--ink); }
@media (max-width: 575px) {
  .p202-home .sec-head { flex-wrap: wrap; }
  .p202-home .sec-avatar { width: 36px; height: 36px; }
  .p202-home .sec-head h1,
  .p202-home .sec-head h2 { font-size: 20px; }
  .p202-home .week-chip { font-size: 13px; padding: 5px 12px; }
}

/* 새 소식 한 줄 */
.p202-home .notice-strip { background: #fff; border-bottom: 1px solid var(--line); }
.p202-home .notice-strip .container { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; font-size: 14px; }
.p202-home .notice-strip .tag { flex: none; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.p202-home .notice-strip a.text { color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p202-home .notice-strip a.text:hover { color: var(--accent-ink); }
.p202-home .notice-strip .date { color: var(--muted); }
.p202-home .notice-strip .close { flex: none; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; }

/* 이번 주 TOP 5 */
.p202-home .top-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 991px) { .p202-home .top-grid { grid-template-columns: 1fr; } }

.p202-home .feature { position: relative; overflow: hidden; border-radius: 16px; min-height: 460px; display: flex; align-items: flex-end; color: #fff; text-decoration: none; background: #1b1b22; }
.p202-home .feature .feature-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.p202-home .feature:hover .feature-img { transform: scale(1.05); }
.p202-home .feature .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,20,0) 25%, rgba(10,10,20,.55) 55%, rgba(10,10,20,.92) 100%); }
.p202-home .feature .n-orig { position: absolute; top: 16px; left: 18px; height: 26px; }
.p202-home .feature .body { position: relative; padding: 24px 28px 28px; width: 100%; }
.p202-home .feature .rank-tag { display: flex; align-items: baseline; gap: 10px; line-height: 1; margin-bottom: 6px; }
.p202-home .feature .rank-tag .big { font-size: 64px; font-weight: 100; color: #fff; }
/* 어두운 이미지 위라 상승(↑) 색만 밝게 */
.p202-home .feature .rank-tag .text-aqua { color: #6fe3e6 !important; }
.p202-home .feature h3 { color: #fff; font-size: 30px; font-weight: 500; margin: 0; letter-spacing: -.03em; }
.p202-home .feature h3 .badge { font-size: 13px; vertical-align: 6px; }
.p202-home .feature .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.p202-home .feature .facts span { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); border-radius: 999px; padding: 4px 12px 4px 8px; }
.p202-home .feature .facts img.trophy { height: 20px; }

.p202-home .rank-list { display: flex; flex-direction: column; padding: 4px 0 0; overflow: hidden; }
.p202-home .rank-row { flex: 1; display: flex; align-items: center; gap: 14px; padding: 14px 18px 14px 10px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
/* 마우스 오버: 이미지가 있는 카드는 이미지만 1.05배 확대 (N 로고는 그대로), 글자 링크는 글자색 변경 */
.p202-home .rank-row:hover .thumb img:first-child { transform: scale(1.05); }
.p202-home .rank-row .no { flex: none; min-width: 3.2rem; text-align: center; font-weight: 100; font-size: 1.8rem; line-height: 1.1; color: var(--ink); }
.p202-home .rank-row .info { flex: 1; min-width: 0; }
.p202-home .rank-row .t { font-weight: 500; font-size: 15px; margin-bottom: 2px; }
.p202-home .rank-list-foot { display: flex; align-items: center; justify-content: center; height: 52px; margin-top: auto; font-size: 14px; font-weight: 400; line-height: 1; color: var(--muted); border-top: 1px solid var(--line); }
.p202-home .rank-list-foot:hover { color: var(--accent-ink); }

/* 16:9 썸네일 공통 (좌상단은 N 로고 자리) */
.p202-home .thumb { position: relative; flex: none; width: var(--thumb-w); aspect-ratio: 16/9; border-radius: .4rem; overflow: hidden; background: var(--thumb-bg); }
.p202-home .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.p202-home .thumb .n-orig-s { position: absolute; left: 6px; top: 6px; width: auto; height: var(--thumb-logo); }

.p202-home .trophies { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--ink); }
.p202-home .trophies img.trophy { height: 18px; }

@media (max-width: 768px) {
  .p202-home .feature { min-height: 400px; }
  .p202-home .feature .rank-tag .big { font-size: 48px; }
  .p202-home .feature h3 { font-size: 24px; }
  .p202-home .rank-row { gap: 10px; padding: 12px 14px 12px 4px; }
  .p202-home .rank-row .no { min-width: 2.4rem; font-size: 1.4rem; }
  .p202-home .rank-row .t { font-size: 14px; }
  .p202-home .rank-row .t .inline-with-badge { display: block; top: 0; margin-top: 3px; }
}

/* 공개 / 종료 예정 */
.p202-home .two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
@media (max-width: 767px) { .p202-home .two-col { grid-template-columns: minmax(0,1fr); } }
.p202-home .sched { display: flex; flex-direction: column; padding: 20px 20px 0; }
.p202-home .sched-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.p202-home .sched-head h3 { font-size: 17px; font-weight: 500; margin: 0; }
.p202-home .sched-head .count { font-size: 28px; font-weight: 800; line-height: 1; }
.p202-home .sched-head .count small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.p202-home .sched.coming .count,
.p202-home .sched.coming .d b { color: var(--coming); }
.p202-home .sched.end .count,
.p202-home .sched.end .d b { color: var(--down); }
.p202-home .sched-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.p202-home a.sched-item:hover .thumb img:first-child { transform: scale(1.05); }
.p202-home .sched-item .d { flex: none; width: 64px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.3; }
.p202-home .sched-item .d b { display: block; font-size: 16px; }
.p202-home .sched-item .info { flex: 1; min-width: 0; }
.p202-home .sched-item .t { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p202-home .sched-item .hist { display: inline-flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; max-width: 100%; gap: 3px; margin-top: 5px; font-size: 12px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px 2px 8px; }
.p202-home .sched-item .hist .lab { font-weight: 700; }
.p202-home .sched-item .hist .weeks::before { content: "·"; margin: 0 5px; }
.p202-home .sched-item .hist .go { margin-left: 4px; font-size: 14px; line-height: 1; }
.p202-home .sched-foot { display: flex; align-items: center; justify-content: center; height: 52px; margin: auto -20px 0; font-size: 14px; font-weight: 400; line-height: 1; color: var(--muted); border-top: 1px solid var(--line); }
.p202-home .sched-foot:hover { color: var(--accent-ink); }
@media (max-width: 575px) {
  .p202-home .sched-item { gap: 10px; }
  .p202-home .sched-item .d { width: 50px; }
  .p202-home .sched-item .d b { font-size: 14px; white-space: nowrap; }
  .p202-home .sched-item .t { font-size: 14px; white-space: normal; }
  .p202-home .sched-item .t .inline-with-badge { display: block; top: 0; margin-top: 3px; }
  .p202-home .sched-item .hist { font-size: 11px; padding: 2px 8px; }
  .p202-home .sched-item .hist .weeks::before { margin: 0 3px; }
  .p202-home .sched-item .hist .go { display: none; }
}

/* 이번 주 새로 들어왔어요 (가로 넘김) */
.p202-home .h-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 64px) / 5); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.p202-home .h-scroll::-webkit-scrollbar { display: none; }
.p202-home .h-scroll > a { scroll-snap-align: start; }
@media (max-width: 1199px) { .p202-home .h-scroll { grid-auto-columns: calc((100% - 48px) / 4); } }
@media (max-width: 991px) { .p202-home .h-scroll { grid-auto-columns: calc((100% - 32px) / 3); } }
@media (max-width: 767px) { .p202-home .h-scroll { grid-auto-columns: 62%; } }
.p202-home .w-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-decoration: none; color: var(--ink); }
.p202-home .w-card .art { position: relative; aspect-ratio: 16/9; background: var(--thumb-bg); overflow: hidden; }
.p202-home .w-card .art > img:first-child { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.p202-home .w-card:hover .art > img:first-child { transform: scale(1.05); }
.p202-home .w-card .art .n-orig-s { position: absolute; left: 10px; top: 10px; height: 26px; width: auto; }
.p202-home .w-card .b { flex: 1; display: flex; flex-direction: column; padding: 12px 14px 14px; }
.p202-home .w-card .t { font-weight: 500; font-size: 15px; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p202-home .w-card .trophies { margin-top: auto; }
.p202-home .carousel-wrap { position: relative; }
.p202-home .carousel-btn { position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 26px; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; box-shadow: 0 4px 14px #30364222; transition: opacity .2s, background .15s; }
.p202-home .carousel-btn.prev { left: -22px; }
.p202-home .carousel-btn.next { right: -22px; }
.p202-home .carousel-btn:hover { background: var(--accent-soft); }
.p202-home .carousel-btn:disabled { opacity: 0; pointer-events: none; }
.p202-home .carousel-btn[hidden] { display: none; }
@media (max-width: 767px) { .p202-home .carousel-btn { display: none; } }

/* 오늘의 일본어 뉴스 */
.p202-home .cat { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); overflow: hidden; }
.p202-home .cat .today { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-right: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.p202-home .cat .today .img { flex: none; width: 458px; max-width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--thumb-bg); }
.p202-home .cat .today .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.p202-home .cat .today:hover .img img { transform: scale(1.05); }
.p202-home .cat .today h3 { font-weight: 500; font-size: 18px; margin: 2px 0 4px; }
.p202-home .cat .cat-label { display: block; font-size: 14px; color: var(--muted); }
.p202-home .cat ul { list-style: none; margin: 0; padding: 6px 20px; display: flex; flex-direction: column; justify-content: center; }
.p202-home .cat li { flex: 1; display: flex; min-width: 0; }
.p202-home .cat li a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 14px; }
.p202-home .cat li:last-child a { border-bottom: 0; }
.p202-home .cat li .thumb { width: 128px; }
.p202-home .cat li a:hover .thumb img { transform: scale(1.05); }
.p202-home .cat li .info { flex: 1; min-width: 0; }
.p202-home .cat li .t { display: block; font-weight: 500; font-size: 15px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
  .p202-home .cat { grid-template-columns: minmax(0,1fr); }
  .p202-home .cat .today { border-right: 0; border-bottom: 1px solid var(--line); }
  .p202-home .cat .today .img { width: 100%; }
}
@media (max-width: 575px) { .p202-home .cat li .thumb { width: 96px; } }

/* PLACE202 소식 */
.p202-home .news-section { padding-bottom: 64px; }
.p202-home .news-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.p202-home .news-card { display: flex; gap: 14px; align-items: center; padding: 12px; text-decoration: none; color: var(--ink); }
.p202-home .news-card .thumb { width: 176px; }
.p202-home .news-card:hover .thumb img { transform: scale(1.05); }
.p202-home .news-card .t { font-weight: 500; font-size: 15px; margin-top: 2px; }
.p202-home .news-card .s { font-size: 14px; color: var(--muted); }
@media (max-width: 1199px) { .p202-home .news-card .thumb { width: 140px; } }
@media (max-width: 767px) {
  .p202-home .news-grid { grid-template-columns: 1fr; }
  .p202-home .news-card .thumb { width: 136px; }
}
