/* =====================================================
   track-cards.css — 메인 홈(index.html) 전용 트랙 카드 스타일
   원본: curriculum-page.css 의 트랙 카드 블록 (수정 시 양쪽 동기화 필요)
   변수는 .home-tracks 범위에만 정의해 styles.css 와 충돌하지 않는다.
   ===================================================== */

.home-tracks {
  --navy: #14264f;
  --navy-deep: #0c1a3a;
  --navy-soft: #23407e;
  --gold: #c4972a;
  --gold-light: #dcb35e;
  --ink: #1d1d1f;
  --sub: #71737a;
  --hairline: rgba(29, 29, 31, 0.09);
  --paper: #ffffff;
  --paper-warm: #fafaf7;
  --paper-alt: #f5f5f2;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 1px 2px rgba(20, 30, 60, 0.03), 0 10px 34px rgba(20, 30, 60, 0.06);
  --shadow-lift: 0 2px 6px rgba(20, 30, 60, 0.05), 0 22px 54px rgba(20, 30, 60, 0.12);
  --pink: #f5457a;
  --serif: "MaruBuri", "Noto Serif KR", "Nanum Myeongjo", serif;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  --eng: "Marcellus", "Montserrat", "Pretendard", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  max-width: 1200px;
  margin: 56px auto 0;
  padding: 0 24px;
  text-align: left;
}

/* ── 중등부/고등부 전환 ── */
.ht-switch {
  display: flex; width: max-content; margin-inline: auto; gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.05);
  border: 1px solid rgba(29, 29, 31, 0.08);
  margin-bottom: 8px;
}
.ht-dept {
  border: 0; cursor: pointer;
  padding: 10px 30px;
  border-radius: 999px;
  background: none;
  font-family: "Pretendard", sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: #6e6e73;
  transition: all 0.25s ease;
}
.ht-dept:hover { color: #1d1d1f; }
.ht-dept.is-active {
  background: #14264f; color: #fff;
  box-shadow: 0 4px 14px rgba(20, 38, 79, 0.25);
}
.ht-panel { display: none; }
.ht-panel.is-active { display: block; animation: htIn 0.45s ease both; }
@keyframes htIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.ht-more { margin-top: 28px; text-align: center; }
.ht-more a {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14.5px; font-weight: 700; color: var(--navy);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(20, 38, 79, 0.35);
  padding-bottom: 2px;
  transition: opacity 0.25s ease;
}
.ht-more a:hover { opacity: 0.7; }

/* 카드 안 칩 — styles.css 의 .chip 과 다른 홈페이지 전역 칩을 덮어쓴다 */
.home-tracks .chip {
  font-size: 12.5px; font-weight: 600; color: var(--navy);
  background: var(--paper);
  border: 1px solid rgba(20, 38, 79, 0.18);
  border-radius: 999px; padding: 5px 14px;
}
.home-tracks .chip--gold { color: #9a7620; border-color: rgba(196, 151, 42, 0.45); }

/* 트랙 헤드 라벨 타이포 (curriculum-page.css 공통 규칙에서 발췌) */
.home-tracks .track-head .en { font-family: var(--sans); font-weight: 700; letter-spacing: 0.16em; text-transform: none; }
.home-tracks .tk-h5 { font-family: var(--sans); }

/* =====================================================
   트랙별 심층 프로필
   ===================================================== */
.tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.track {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--hairline);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.track:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.track-head {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--navy-deep) 0%, #1a3168 100%);
  color: #fff;
  padding: 30px 96px 26px 30px;
}
.track-head::after {
  content: "";
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  width: 58px; aspect-ratio: 1 / 1.06;
  background: url("./logo-final.png") center / contain no-repeat;
  opacity: 0.95;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.track--top .track-head {
  background:
    radial-gradient(ellipse 90% 90% at 90% -10%, rgba(236, 199, 118, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, #4f3c0c 0%, #a37c1d 130%);
}
.track-head .en {
  font-family: var(--eng); font-size: 10px; font-weight: 700;
  letter-spacing: 0.26em; color: rgba(255, 255, 255, 0.66);
  display: block; margin-bottom: 10px;
}
.track-head h3 { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.3; letter-spacing: -0.01em; }
.track-head .yrs { font-size: 12.5px; color: rgba(255, 255, 255, 0.66); margin-left: 9px; font-weight: 500; }
.track-head .one { margin-top: 9px; font-size: 13.8px; font-weight: 300; color: rgba(255, 255, 255, 0.9); }
.track-body { padding: 30px 30px 28px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.track-sec h5 {
  font-family: var(--eng); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.22em; color: var(--gold);
  margin-bottom: 10px;
}
.track-sec p { font-size: 14.5px; color: #454850; line-height: 1.78; }
.track-sec p strong { color: var(--navy); font-weight: 600; }
.track-sec ul { list-style: none; display: grid; gap: 9px; }
.track-sec li { position: relative; padding-left: 21px; font-size: 14.2px; color: #454850; line-height: 1.65; }
.track-sec li::before {
  content: "✓"; position: absolute; left: 0; top: 1px;
  color: var(--navy); font-weight: 700; font-size: 12px;
}
.track--top .track-sec li::before { color: var(--gold); }
.track-badges {
  margin-top: auto; padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; gap: 7px;
}

/* =====================================================
   반 상세 카드 v3 — 카드 안에서 소개/커리큘럼/교재/시간표 전환
   기존 .track 헤드 디자인은 그대로 두고, 본문만 탭 구조로 확장한다.
   ===================================================== */

.track--rich { --tk-accent: var(--navy); }
.track--rich.track--top { --tk-accent: #9a7620; }

/* 헤드: 세 카드 높이를 맞추고, 개설 현황 배지를 얹는다 */
.track--rich .track-head { display: flex; flex-direction: column; min-height: 174px; padding-bottom: 20px; }
.tk-open {
  margin-top: auto; padding-top: 0;
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}
.tk-open .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.22);
}

/* 탭 바 */
.tk-tabs {
  display: flex; gap: 2px;
  padding: 8px 10px 0;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto; scrollbar-width: none;
}
.tk-tabs::-webkit-scrollbar { display: none; }
.tk-tab {
  position: relative; flex: 1 0 auto;
  padding: 11px 8px 12px;
  border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: 12.8px; font-weight: 600;
  color: var(--sub); white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.tk-tab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px 2px 0 0;
  background: var(--tk-accent);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.tk-tab:hover { color: var(--ink); }
.tk-tab[aria-selected="true"] { color: var(--tk-accent); }
.tk-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* 패널 */
.tk-panels { flex: 1; display: flex; flex-direction: column; min-height: 398px; }
.tk-panel { display: none; padding: 22px 24px 20px; }
.tk-panel[data-on] { display: block; animation: tkIn 0.4s var(--ease) both; }
@keyframes tkIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tk-h5 {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.2em; color: var(--gold);
  margin-bottom: 10px;
}
.tk-lede { font-size: 14.5px; color: #454850; line-height: 1.78; }
.tk-lede strong { color: var(--navy); font-weight: 600; }
.track--top .tk-lede strong { color: #7d5f14; }
.tk-list { list-style: none; display: grid; gap: 9px; margin-top: 4px; }
.tk-list li { position: relative; padding-left: 21px; font-size: 14.2px; color: #454850; line-height: 1.65; }
.tk-list li::before {
  content: "✓"; position: absolute; left: 0; top: 1px;
  color: var(--tk-accent); font-weight: 700; font-size: 12px;
}
.tk-block + .tk-block { margin-top: 22px; }

/* 소개 탭 — 한눈 사실 3줄 */
.tk-facts { display: grid; gap: 1px; background: var(--hairline); border-radius: 12px; overflow: hidden; }
.tk-fact {
  display: flex; align-items: baseline; gap: 12px;
  padding: 11px 14px; background: var(--paper-warm);
}
.tk-fact dt {
  flex: none; width: 68px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--sub);
}
.tk-fact dd { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.tk-fact dd em { font-style: normal; color: var(--tk-accent); }

/* 커리큘럼 탭 — 미니 스텝 */
.tk-steps { display: grid; gap: 10px; }
.tk-step {
  position: relative; padding: 13px 15px 13px 46px;
  border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--paper);
}
.tk-step .no {
  position: absolute; left: 14px; top: 13px;
  width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--tk-accent); color: #fff;
  font-size: 11px; font-weight: 700;
}
.tk-step .t { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tk-step .d { display: block; margin-top: 3px; font-size: 12.8px; color: var(--sub); line-height: 1.6; }

/* 교재 탭 */
.tk-books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
.tk-book { text-align: center; }
.tk-book-cover {
  position: relative; aspect-ratio: 3 / 4.1; border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(170deg, #f7f7f4, #ecedea);
  border: 1px solid var(--hairline);
  box-shadow: 0 6px 16px rgba(20, 30, 60, 0.07);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.tk-book:hover .tk-book-cover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(20, 30, 60, 0.13); }
.tk-book-cover::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(180deg, var(--navy-soft), var(--navy-deep));
}
.track--top .tk-book-cover::before { background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.tk-book-cover img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tk-book-cover .ph-logo { height: 20px; width: auto; opacity: 0.38; }
.tk-book-cover .ph-text { font-size: 10.5px; color: #a9abb2; line-height: 1.5; }
.tk-book .name { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--navy); }
.track--top .tk-book .name { color: #7d5f14; }
.tk-book .sub { margin-top: 2px; font-size: 11.5px; color: var(--sub); line-height: 1.45; }
.tk-note { margin-top: 16px; font-size: 12px; color: var(--sub); line-height: 1.6; }

/* 시간표 탭 */
.tk-sched {
  display: grid; gap: 8px;
  max-height: 372px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 4px; margin-right: -4px;
  scrollbar-width: thin;
}
.tk-sched.is-scrollable {
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 34px), transparent 100%);
}
.tk-scroll-hint { margin-top: 8px; font-size: 11.5px; color: var(--sub); }
.tk-sched::-webkit-scrollbar { width: 4px; }
.tk-sched::-webkit-scrollbar-thumb { background: rgba(29, 29, 31, 0.18); border-radius: 4px; }
.tk-dayrow {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  padding: 9px 11px; border-radius: 12px;
  border: 1px solid var(--hairline); background: var(--paper);
}
.tk-dayrow > b {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--paper-alt); color: var(--ink);
  font-size: 12.5px; font-weight: 700;
}
.tk-classes { display: grid; }
.tk-class {
  display: grid; grid-template-columns: 8px 46px 1fr; gap: 9px; align-items: center;
  padding: 6px 2px; font-size: 12.6px; line-height: 1.4;
}
.tk-class + .tk-class { border-top: 1px dashed rgba(29, 29, 31, 0.08); }
.tk-class .seat { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.tk-class--few .seat { background: #f59e0b; }
.tk-class--new .seat { background: var(--pink); }
.tk-class .time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tk-class .meta { color: var(--sub); font-weight: 500; }
.tk-class .meta b { color: var(--tk-accent); font-weight: 700; }
.tk-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 13px; font-size: 11.5px; color: var(--sub); }
.tk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tk-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.tk-empty { padding: 18px 0; font-size: 13.5px; color: var(--sub); line-height: 1.7; }
.tk-sched-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 12.8px; font-weight: 700; color: var(--tk-accent);
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
.tk-updated { margin-top: 10px; font-size: 11.5px; color: var(--sub); }

/* 카드 하단 */
.tk-foot {
  margin-top: auto; padding: 18px 28px 24px;
  border-top: 1px solid var(--hairline);
  display: grid; gap: 14px;
}
.tk-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tk-cta {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--tk-accent); color: #fff;
  font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}
.tk-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20, 30, 60, 0.2); filter: brightness(1.08); }

@media (max-width: 900px) {
  .tk-panel { padding: 22px 20px 20px; }
  .tk-foot { padding: 16px 20px 20px; }
  .track--rich .track-head { min-height: 0; }
  .track--rich .track-head .one { min-height: 0; }
  .tk-open { margin-top: 16px; }
  .tk-panels { min-height: 0; }
}
@media (max-width: 520px) {
  .tk-books { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .tk-tab { font-size: 12px; padding: 10px 6px 11px; }
}


/* ── 홈 임베드 반응형 ── */
@media (max-width: 1060px) {
  .home-tracks .tracks { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .home-tracks { margin-top: 40px; }
}

/* =====================================================
   자체 디자인 교재 표지 — 실물 촬영본이 없는 교재용
   (curriculum-page.css / track-cards.css 양쪽 동기화)
   ===================================================== */
.tk-book-cover.tk-cov {
  justify-content: flex-start; align-items: flex-start;
  padding: 15px 13px 12px 20px; gap: 0; text-align: left;
}
.tk-cov .cov-band {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.2em;
  opacity: 0.72; white-space: nowrap;
}
.tk-cov .cov-title {
  margin-top: 13px;
  font-family: var(--serif); font-size: 17.5px; font-weight: 700;
  line-height: 1.32; letter-spacing: -0.01em;
}
.tk-cov .cov-line { display: block; width: 22px; height: 2px; margin-top: 10px; background: currentColor; opacity: 0.45; }
.tk-cov .cov-sub { margin-top: 8px; font-size: 9.5px; line-height: 1.55; opacity: 0.78; }
.tk-cov .cov-crest { position: absolute; right: 10px; bottom: 10px; height: 21px; width: auto; }
.tk-cov--navy { background: linear-gradient(165deg, #1d366e 0%, #0c1a3a 100%); color: #f2f4fa; }
.tk-cov--gold { background: linear-gradient(165deg, #b98c22 0%, #7d5f14 100%); color: #fdf8ec; }
.tk-cov--cream { background: linear-gradient(170deg, #faf7ef 0%, #ece5d3 100%); color: #4a4436; }
.tk-cov--rose { background: linear-gradient(165deg, #d64b77 0%, #9c2350 100%); color: #fdf1f5; }
.track--top .tk-book-cover.tk-cov::before { background: linear-gradient(180deg, var(--gold-light), var(--gold)); }

/* 실물 교재 표지 — 클릭 확대 */
.tk-book-cover img.cover { cursor: zoom-in; }
.tk-lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(10, 16, 32, 0.84);
  display: flex; align-items: center; justify-content: center;
  padding: 32px; cursor: zoom-out;
  animation: tkIn 0.22s ease both;
}
.tk-lightbox img {
  max-width: min(520px, 92vw); max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* ── 시간표 v2: 학년별 그룹 (양쪽 CSS 동기화) ── */
.tk-grade {
  border: 1px solid var(--hairline); border-radius: 12px;
  overflow: hidden; background: var(--paper);
}
.tk-grade-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 13px;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--hairline);
}
.tk-grade-head b { font-size: 13.2px; font-weight: 700; color: var(--tk-accent, var(--navy)); }
.tk-grade-head span { font-size: 11px; color: var(--sub); }
.tk-row {
  display: grid; grid-template-columns: 8px 24px 46px 1fr;
  gap: 9px; align-items: center;
  padding: 7px 13px; font-size: 12.8px; line-height: 1.4;
}
.tk-row + .tk-row { border-top: 1px dashed rgba(29, 29, 31, 0.08); }
.tk-row .seat { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.tk-row--few .seat { background: #f59e0b; }
.tk-row--new .seat { background: var(--pink); }
.tk-row .d { font-weight: 700; color: var(--ink); }
.tk-row .t { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tk-row .m { color: var(--sub); font-weight: 500; }
.tk-row .m b { color: var(--tk-accent, var(--navy)); font-weight: 700; }
.tk-sched-note {
  margin-top: 12px; padding: 10px 13px;
  border-radius: 10px;
  background: var(--paper-warm); border: 1px solid var(--hairline);
  font-size: 12px; color: #454850; line-height: 1.6;
}
