/* ==========================================================================
   新培教育 —— 首頁專用樣式（上堂相、時間線、畢業生牆、燈箱）
   只喺 index.html 載入。想改相片／文字，改 index.html 就得。
   ========================================================================== */

/* ---------- 1. Hero：右邊直向相片流（桌面版） ---------- */
.hero-reel {
  position: absolute;
  inset: -40px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 0 14px;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 38%, #000 70%);
  mask-image: linear-gradient(100deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 38%, #000 70%);
}
.hero-reel .col { display: flex; flex-direction: column; gap: 14px; animation: reelUp 70s linear infinite; }
.hero-reel .col:nth-child(even) { animation-direction: reverse; animation-duration: 84s; margin-top: -160px; }
.hero-reel img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  filter: saturate(0.9) brightness(0.85);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, rgba(11,31,58,0.92) 0%, rgba(11,31,58,0.7) 42%, rgba(11,31,58,0.25) 100%);
}
@keyframes reelUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (max-width: 940px) { .hero-reel { display: none; } }

/* ---------- 2. 上堂實況：雙行跑馬燈 ---------- */
.reel-sec { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 48px); overflow: hidden; }
.reel-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 28px;
  margin-bottom: 26px;
}
.reel-head h2 { margin: 0; }
.reel-head p { margin: 0; color: var(--muted); max-width: 46ch; }
.reel-track {
  --gap: 16px;
  display: flex;
  gap: var(--gap);
  width: max-content;
  animation: slideL 70s linear infinite;
  padding: 6px 0 12px;
}
.reel-track.rev { animation-name: slideR; animation-duration: 82s; }
.reel-mask {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.reel-mask:hover .reel-track { animation-play-state: paused; }
.reel-track .ph { width: clamp(240px, 28vw, 360px); aspect-ratio: 4 / 3; flex: 0 0 auto; }
.reel-track.rev .ph { width: clamp(200px, 22vw, 280px); }
@keyframes slideL { from { transform: translateX(0); } to { transform: translateX(calc(-50% - var(--gap) / 2)); } }
@keyframes slideR { from { transform: translateX(calc(-50% - var(--gap) / 2)); } to { transform: translateX(0); } }

/* ---------- 2b. 精華短片 ---------- */
.hl-video {
  position: relative; margin: 0 auto 28px; max-width: 980px;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--navy);
  box-shadow: 0 30px 60px -28px rgba(11, 31, 58, 0.55);
  aspect-ratio: 16 / 9;
}
.hl-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hl-video figcaption {
  position: absolute; left: 16px; top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: rgba(11, 31, 58, 0.75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-size: 0.86rem; font-weight: 700;
}
.hl-video .dot { width: 8px; height: 8px; border-radius: 50%; background: #FF4D4D; box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.25); animation: recDot 1.6s ease-in-out infinite; }
@keyframes recDot { 50% { opacity: 0.3; } }

/* ---------- 3. 新培背景：拼貼 + 數字 ---------- */
.story {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 900px) { .story { grid-template-columns: 1fr; } }
.collage { position: relative; aspect-ratio: 1 / 0.92; }
.collage .ph { position: absolute; }
.collage .c1 { left: 0; top: 4%; width: 72%; aspect-ratio: 4 / 3; z-index: 1; }
.collage .c2 { right: 0; top: 0; width: 46%; aspect-ratio: 4 / 3; z-index: 2; transform: rotate(3deg); border: 6px solid #fff; }
.collage .c3 { right: 6%; bottom: 0; width: 58%; aspect-ratio: 4 / 3; z-index: 3; transform: rotate(-2.5deg); border: 6px solid #fff; }
.collage-badge {
  position: absolute; left: 4%; bottom: 6%; z-index: 4;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.collage-badge strong { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--brand-light); }
.collage-badge span { font-size: 0.86rem; line-height: 1.45; color: #C9D6E8; }
.story-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin: 26px 0 22px;
}
.story-stats div {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.story-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: var(--navy);
}
.story-stats strong em { font-style: normal; color: var(--brand); }
.story-stats > div > span { font-size: 0.88rem; color: var(--muted); }
.story-stats strong span { font: inherit; color: inherit; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.42em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- 4. 一堂點上：相片 + 步驟 ---------- */
.process {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 900px) { .process { grid-template-columns: 1fr; } }
.process-media { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 14px; }
.process-media .big { aspect-ratio: 4 / 3.2; }
.process-media .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.process-media .row .ph { aspect-ratio: 4 / 3; }
@media (max-width: 900px) { .process-media { position: static; } }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 23px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(var(--brand), var(--brand-tint));
  transform-origin: top; transform: scaleY(var(--prog, 0));
  transition: transform 1.4s cubic-bezier(.2,.7,.2,1);
}
.steps.in { --prog: 1; }
.steps li { position: relative; padding: 0 0 26px 70px; }
.steps li:last-child { padding-bottom: 0; }
.steps .n {
  position: absolute; left: 0; top: 0;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 2px solid var(--brand);
  color: var(--brand); font-weight: 900; font-size: 1rem;
  box-shadow: 0 0 0 6px var(--bg);
}
.steps h3 { margin: 6px 0 4px; font-size: 1.12rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.kit {
  margin-top: 34px; padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: #C9D6E8;
}
.kit h3 { color: #fff; font-size: 1.05rem; margin: 0 0 14px; }
.kit ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 560px) { .kit ul { grid-template-columns: 1fr; } }
.kit li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.94rem; line-height: 1.55; }
.kit li svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--brand-light); margin-top: 1px; }

/* ---------- 5. 全年課程時間編排 ---------- */
.plan-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 30px; flex-wrap: wrap; }
.plan-tabs button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 10px 20px; border-radius: var(--radius-full);
  font: 700 0.96rem var(--font-sans); cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.plan-tabs button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.plan { display: none; }
.plan.on { display: block; }
.plan-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), 1fr);
  gap: 14px;
  padding-top: 38px;
}
.plan-track::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 13px; height: 3px; border-radius: 3px;
  background: var(--line);
}
.plan-track::after {
  content: ""; position: absolute; left: 4%; right: 4%; top: 13px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transform-origin: left; transform: scaleX(0);
  transition: transform 1.6s cubic-bezier(.2,.7,.2,1);
}
.plan.on.in .plan-track::after { transform: scaleX(1); }
.plan-step {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.plan-step::before {
  content: ""; position: absolute; top: -32px; left: 50%; translate: -50% 0;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--c, var(--brand));
}
.plan-step .when { display: inline-block; font-size: 0.8rem; font-weight: 800; color: var(--c, var(--brand)); letter-spacing: 0.04em; }
.plan-step h3 { font-size: 1.05rem; margin: 2px 0 4px; }
.plan-step p { font-size: 0.88rem; color: var(--muted); margin: 0; line-height: 1.6; }
.plan-step.hot { background: var(--brand-soft); border-color: var(--brand-tint); }
.plan-note { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 22px; }
@media (max-width: 820px) {
  .plan-track { grid-template-columns: 1fr; padding-top: 0; padding-left: 34px; gap: 12px; }
  .plan-track::before, .plan-track::after { left: 11px; right: auto; top: 6px; bottom: 6px; width: 3px; height: auto; }
  .plan-track::after { transform: scaleY(0); transform-origin: top; }
  .plan.on.in .plan-track::after { transform: scaleY(1); }
  .plan-step::before { top: 20px; left: -31px; translate: 0 0; }
}

/* ---------- 6. 畢業生牆 ---------- */
.grads-sec {
  position: relative;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(232, 89, 12, 0.22), transparent 60%),
    linear-gradient(170deg, #0B1F3A 0%, #12305A 100%);
  color: #C9D6E8;
  overflow: hidden;
}
.grads-sec h2 { color: #fff; }
.grads-sec .section-head p { color: #A9BDD6; }
.grads-sec .eyebrow { color: var(--brand-light); }
.grads-sec .section-head.center .eyebrow { background: rgba(255, 138, 61, 0.1); border-color: rgba(255, 138, 61, 0.35); }
.grads-sec .section-head h2 { color: #fff; }
.wall {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(70px, 8vw, 104px);
  gap: 14px;
}
.wall .ph { box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.6); }
.wall .g-big { grid-column: span 6; grid-row: span 3; }
.wall .g-sm { grid-column: span 4; grid-row: span 2; }
.wall .yr {
  position: absolute; right: 10px; top: 10px;
  padding: 2px 10px; border-radius: var(--radius-full);
  background: var(--brand); color: #fff;
  font-weight: 900; font-size: 0.82rem; letter-spacing: 0.04em;
}
@media (max-width: 760px) {
  .wall { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .wall .ph { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 4 / 3; }
  .wall .g-big { grid-column: span 2 !important; }
}
.grads-foot { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin-top: 30px; color: #A9BDD6; font-size: 0.92rem; }
.grads-foot b { color: #fff; }

/* ---------- 7b. 揀你嘅學校 ---------- */
.school-pick { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .school-pick { grid-template-columns: 1fr; } }
.school-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.school-chips button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 9px 15px; border-radius: var(--radius-full);
  font: 700 0.92rem var(--font-sans); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.school-chips button:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.school-chips button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.school-chips button .star { color: var(--gold); margin-left: 4px; }
.school-panel {
  min-height: 260px; padding: 24px 26px;
  border-radius: var(--radius-lg); background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: panelIn 0.35s ease;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } }
.school-panel h3 { margin: 0 0 4px; color: var(--navy); font-size: 1.25rem; }
.school-panel .sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 16px; }
.sp-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 12px 0; border-top: 1px dashed var(--line); }
.sp-row dt { font-weight: 800; color: var(--ink); font-size: 0.92rem; }
.sp-row dd { margin: 0; font-size: 0.95rem; }
.sp-grades { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-grades span { padding: 3px 10px; border-radius: var(--radius-full); background: var(--navy-soft); color: var(--navy); font-weight: 700; font-size: 0.85rem; }
.sp-grades span.g55 { background: var(--brand); color: #fff; }
.sp-grades span.g5s { background: var(--brand-tint); color: var(--brand-dark); }
.sp-hist summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); font-size: 0.9rem; }
.sp-hist[open] summary { margin-bottom: 8px; }
.sp-year { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 6px 0; border-top: 1px dotted var(--line); }
.sp-year b { font-size: 0.85rem; color: var(--muted); padding-top: 3px; }
.sp-year .sp-grades + .sp-grades { margin-top: 5px; }
.sp-excl { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 0.85rem; margin-right: 6px; }
.school-panel .btn { margin-top: 16px; }
.school-panel .note { font-size: 0.8rem; color: var(--muted-2); margin: 12px 0 0; }

/* ---------- 7c. 小學部 ---------- */
.primary-band { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .primary-band { grid-template-columns: 1fr; } }
.primary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 8px; }
.primary-stats div { padding: 16px 18px; border-radius: var(--radius); background: #fff; border: 1px solid var(--brand-tint); }
.primary-stats strong { display: block; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.1; color: var(--brand); }
.primary-stats span { font-size: 0.88rem; color: var(--muted); }
.primary-stages { display: grid; gap: 14px; }
.pstage { position: relative; padding: 18px 20px 18px 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-left: 4px solid var(--navy-2); }
.pstage.hot { border-left-color: var(--brand); box-shadow: var(--shadow); }
.pstage-lv { font-size: 0.8rem; font-weight: 800; color: var(--brand); letter-spacing: 0.04em; }
.pstage h3 { margin: 2px 0 4px; font-size: 1.08rem; }
.pstage p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ---------- 8. 燈箱 ---------- */
.lb {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  background: rgba(7, 17, 33, 0.92);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 24px;
}
.lb.open { opacity: 1; visibility: visible; }
.lb figure { margin: 0; max-width: min(1100px, 100%); text-align: center; }
.lb img {
  max-width: 100%; max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.96); transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
}
.lb.open img { transform: none; }
.lb figcaption { color: #E4ECF6; margin-top: 14px; font-weight: 700; }
.lb button {
  position: absolute; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.5rem; line-height: 1;
  display: grid; place-items: center;
  transition: background 0.2s;
}
.lb button:hover { background: rgba(255, 255, 255, 0.24); }
.lb .x { top: 18px; right: 18px; }
.lb .prev { left: 18px; top: 50%; translate: 0 -50%; }
.lb .next { right: 18px; top: 50%; translate: 0 -50%; }
@media (max-width: 600px) { .lb .prev, .lb .next { top: auto; bottom: 18px; translate: none; } }

/* ---------- 9. 減少動態效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-reel .col, .reel-track { animation: none; }
  .reel-mask { overflow-x: auto; }
  .ph img, .steps::before, .plan-track::after { transition: none; }
}
@media (max-width: 560px) {
  .collage-badge { left: 0; bottom: 30%; padding: 9px 12px; gap: 8px; }
  .collage-badge strong { font-size: 1.45rem; }
  .collage-badge span { font-size: 0.74rem; }
}

/* --------------------------------------------------------------------------
   最新消息（#news）— 項目過期由 main.js initNews 收起
   -------------------------------------------------------------------------- */
.news-sec { padding-block: clamp(48px, 7vw, 80px); }
.news-sec .section-head { margin-bottom: clamp(20px, 3vw, 32px); }
.news-feature {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 3.5vw, 44px);
  padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-lg); background: var(--bg-warm);
  border: 1px solid var(--brand-tint); box-shadow: var(--shadow);
}
.news-feature + .news-feature { margin-top: clamp(16px, 2.5vw, 24px); }
.news-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 0.9rem; color: var(--muted); }
.news-tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-full); background: var(--brand-cta); color: #fff;
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; white-space: nowrap;
}
.news-feature h3 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 900; color: var(--navy); margin-bottom: 10px; }
.news-feature p { color: var(--ink-2); }
.mock-days {
  list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0;
}
.mock-days li { display: flex; gap: 14px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-weight: 700; color: var(--ink); }
.mock-days b { min-width: 6.6em; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.news-note { font-size: 0.95rem; }
.news-feature .btn-row { margin-top: 18px; }
.news-fine { margin-top: 14px; font-size: 0.82rem; color: var(--muted) !important; }
.news-posters {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 14px; align-self: start;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; overscroll-behavior-x: contain;
}
.news-posters img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); scroll-snap-align: start;
  box-shadow: var(--shadow); cursor: zoom-in; background: var(--line-soft);
}
.news-media { min-width: 0; align-self: start; }
.news-hint { margin-top: 6px; text-align: center; font-size: 0.82rem; color: var(--muted); }
.news-row {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px 20px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.news-row:hover { border-color: var(--brand); transform: translateY(-2px); }
.news-row-text { flex: 1; min-width: 0; }
.news-row-text b { margin-right: 10px; color: var(--navy); }
.news-row-go { font-size: 1.3rem; color: var(--brand); }
@media (max-width: 860px) {
  .news-feature { grid-template-columns: 1fr; }
  .news-posters { grid-auto-columns: 72%; }
}
@media (max-width: 480px) {
  .news-feature .btn-row .btn { width: 100%; justify-content: center; }
  .news-row { flex-wrap: wrap; gap: 8px 12px; }
  .news-row-text { flex-basis: 100%; order: 3; }
  .news-row-go { margin-left: auto; }
}
