/*
Theme Name: kpopsite
Theme URI: https://kpopsite.com
Author: 케이팝사이트
Description: 콘서트·공연 예매정보 통합 조회 서비스 전용 커스텀 테마. 공연 캘린더 + 티켓오픈 D-day가 본체인 데이터 서비스 UI. 클래식 테마, 페이지빌더/jQuery 미사용.
Version: 0.2.0
Requires PHP: 8.3
Text Domain: kpopsite
*/

/* ==========================================================
   디자인 시스템 — CSS 변수
   ========================================================== */
:root {
  /* 색 */
  --c-bg: #ffffff;
  --c-surface: #f6f6fa;
  --c-line: #e6e6ee;
  --c-text: #17171c;
  --c-muted: #62626e;
  --c-accent: #6d28d9;        /* 보라 — 브랜드 */
  --c-accent-weak: #f1eafd;
  --c-hot: #dc2626;           /* 임박 D-day */
  --c-ok: #059669;            /* 예매중 */
  --c-end: #9ca3af;           /* 종료 */
  /* 타이포 — 시스템 폰트 스택 (웹폰트 금지: LCP 예산) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard Variable", Pretendard, "Malgun Gothic", "맑은 고딕",
    "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  /* 치수 */
  --w-max: 1080px;
  --gap: 16px;
  --radius: 10px;
  --touch: 44px;              /* 최소 터치 타깃 */
}

/* ==========================================================
   리셋(최소) + 베이스 — 모바일 퍼스트
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  word-break: keep-all;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.wrap { max-width: var(--w-max); margin: 0 auto; padding: 0 var(--gap); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--c-accent); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 0; }

/* ==========================================================
   헤더 / 내비게이션
   ========================================================== */
.site-header { border-bottom: 1px solid var(--c-line); background: var(--c-bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.brand {
  margin: 0; padding: 12px 0;
  font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em;
}
.brand a { color: var(--c-text); }
.brand a b { color: var(--c-accent); }
.gnb { flex: 1 1 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gnb::-webkit-scrollbar { display: none; }
.gnb ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.gnb a {
  display: flex; align-items: center;
  min-height: var(--touch); padding: 0 14px;
  color: var(--c-text); font-weight: 600; font-size: .95rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.gnb a:hover, .gnb .current-menu-item a { color: var(--c-accent); text-decoration: none; box-shadow: inset 0 -2px 0 var(--c-accent); }

/* ==========================================================
   공통 컴포넌트
   ========================================================== */
.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head .more { font-size: .875rem; white-space: nowrap; }
.card {
  background: var(--c-bg); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 14px 16px;
}
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; vertical-align: middle;
}
.badge-dday { background: var(--c-accent-weak); color: var(--c-accent); }
.badge-hot { background: #fde8e8; color: var(--c-hot); }
.badge-open { background: #e7f6ef; color: var(--c-ok); }
.badge-end { background: var(--c-surface); color: var(--c-end); }
.notice-empty {
  padding: 28px 16px; text-align: center; color: var(--c-muted);
  background: var(--c-surface); border-radius: var(--radius); font-size: .95rem;
}
.src-note { font-size: .8rem; color: var(--c-muted); margin-top: 8px; }

/* 포스터 — 지정 비율 컨테이너로 CLS 방지 (KOPIS 포스터 표준 비율) */
.poster { aspect-ratio: 3 / 4; background: var(--c-surface); border-radius: var(--radius); overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================
   티켓오픈 D-day 목록
   ========================================================== */
.dday-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dday-item { display: flex; align-items: center; gap: 12px; min-height: var(--touch); }
.dday-item .d { flex: 0 0 64px; text-align: center; font-weight: 800; }
.dday-item .d .num { font-size: 1.05rem; color: var(--c-accent); }
.dday-item .d.hot .num { color: var(--c-hot); }
.dday-item .info { flex: 1 1 auto; min-width: 0; }
.dday-item .info .t { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dday-item .info .m { font-size: .825rem; color: var(--c-muted); }
.dday-item .count { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: .825rem; color: var(--c-muted); }

/* ==========================================================
   공연 캘린더 (실제 <table> — §SEO 시맨틱)
   ========================================================== */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav a, .cal-nav strong {
  display: flex; align-items: center; justify-content: center;
  min-width: var(--touch); min-height: var(--touch); padding: 0 10px;
  border-radius: var(--radius); font-weight: 700;
}
.cal-nav a { background: var(--c-surface); }
.cal-wrap { overflow-x: auto; }
table.calendar { table-layout: fixed; min-width: 640px; border: 1px solid var(--c-line); }
table.calendar caption { text-align: left; font-weight: 700; margin-bottom: 6px; }
table.calendar th {
  padding: 8px 6px; font-size: .8rem; color: var(--c-muted);
  border-bottom: 1px solid var(--c-line); background: var(--c-surface);
}
table.calendar th.sun, table.calendar td.sun .day { color: var(--c-hot); }
table.calendar td {
  vertical-align: top; height: 88px; padding: 6px;
  border: 1px solid var(--c-line); font-size: .8rem;
}
table.calendar td.out { background: var(--c-surface); }
table.calendar .day { font-weight: 700; display: block; margin-bottom: 4px; }
table.calendar td.today { outline: 2px solid var(--c-accent); outline-offset: -2px; }
table.calendar ul { list-style: none; margin: 0; padding: 0; }
table.calendar li { margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.calendar li a { color: var(--c-text); }
table.calendar li.ev-open::before { content: "🎫"; margin-right: 2px; }

/* ==========================================================
   공연 상세 / 허브
   ========================================================== */
.perf-layout { display: grid; gap: var(--gap); }
.perf-meta th {
  width: 96px; text-align: left; padding: 9px 8px;
  color: var(--c-muted); font-weight: 600; font-size: .875rem;
  border-bottom: 1px solid var(--c-line); vertical-align: top;
}
.perf-meta td { padding: 9px 8px; border-bottom: 1px solid var(--c-line); font-size: .95rem; }
.btn-book {
  display: flex; align-items: center; justify-content: center;
  min-height: var(--touch); padding: 0 20px; margin-top: 10px;
  background: var(--c-accent); color: #fff; font-weight: 700;
  border-radius: var(--radius);
}
.btn-book:hover { text-decoration: none; opacity: .92; }
.perf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); list-style: none; margin: 0; padding: 0; }
.perf-grid .t { font-weight: 700; font-size: .9rem; margin-top: 6px; display: block; }
.perf-grid .m { font-size: .8rem; color: var(--c-muted); }

/* ==========================================================
   본문(매거진/허브/정적) — 시맨틱 계층
   ========================================================== */
.entry-content { max-width: 760px; }
.entry-content h2 { margin-top: 1.6em; padding-bottom: .3em; border-bottom: 1px solid var(--c-line); }
.entry-content h3 { margin-top: 1.3em; }
.entry-content table th, .entry-content table td { border: 1px solid var(--c-line); padding: 8px 10px; font-size: .925rem; }
.entry-content table th { background: var(--c-surface); }
.entry-content img { border-radius: var(--radius); }
.entry-meta { color: var(--c-muted); font-size: .85rem; margin-bottom: 20px; }

/* ==========================================================
   푸터
   ========================================================== */
.site-footer { margin-top: 48px; border-top: 1px solid var(--c-line); background: var(--c-surface); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 32px; }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: 2px 18px; list-style: none; margin: 0 0 14px; padding: 0; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: var(--touch); color: var(--c-text); font-size: .875rem; font-weight: 600; }
.footer-note { font-size: .8rem; color: var(--c-muted); line-height: 1.7; margin: 0; }

/* ==========================================================
   데스크탑 (768px+)
   ========================================================== */
@media (min-width: 768px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.4rem; }
  .site-header .wrap { flex-wrap: nowrap; }
  .gnb { flex: 1 1 auto; }
  .perf-layout { grid-template-columns: 300px 1fr; align-items: start; }
  .perf-grid { grid-template-columns: repeat(4, 1fr); }
  .dday-list { gap: 6px; }
  .front-hero { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
}
