/*
 * training-render.css — 師資展示（training.html ＋ 後台預覽）專用樣式
 *
 * 版面關鍵規則（詳細頁左右比例、卡片、輪播、影片區、燈箱）全部寫在這裡，
 * 不依賴 Tailwind 有沒有編譯到 md:w-1/3 這類 class——staging 曾因 CSS 缺規則導致照片把介紹擠成窄欄。
 * 斷點：sm 640 / md 768 / lg 1024，與 Tailwind 預設一致。
 */

.kt-root { color: #1e293b; }
.kt-root *:focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; border-radius: 6px; }
.kt-wrap { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.kt-wrap--md { max-width: 64rem; }
.kt-sec { padding: 5rem 0; }
.kt-sec--soft { background: #f8fafc; }
.kt-sec--white { background: #fff; }

/* ── 首屏 ─────────────────────────────────────────────── */
.kt-hero { position: relative; min-height: 82vh; display: flex; align-items: center; overflow: hidden; background: #1e3a8a; }
.kt-hero-bg { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; }
.kt-hero-bg--plain { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); }
.kt-hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30, 58, 138, 0.88), rgba(30, 64, 175, 0.65) 55%, rgba(30, 64, 175, 0) 100%); }
.kt-hero-inner { position: relative; z-index: 1; width: 100%; max-width: 80rem; margin: 0 auto; padding: 6rem 3rem; }
.kt-hero-eyebrow { color: #bfdbfe; font-size: 1rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 0.75rem; }
.kt-hero-title { color: #fff; font-size: 4.5rem; line-height: 1.15; font-weight: 800; margin: 0 0 1.5rem; overflow-wrap: anywhere; }
.kt-hero-hl { color: #7dd3fc; }
.kt-hero-sub { color: #dbeafe; font-size: 1.25rem; line-height: 1.7; max-width: 32rem; margin: 0 0 2.5rem; }
.kt-hero-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 1rem 2rem; border-radius: 9999px; background: #38bdf8; color: #fff; font-weight: 700; font-size: 1.125rem; text-decoration: none; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.18); transition: background 0.2s, transform 0.2s; }
.kt-hero-btn:hover { background: #7dd3fc; transform: scale(1.04); }
@media (max-width: 639px) {
  .kt-hero { min-height: 70vh; }
  .kt-hero-shade { background: linear-gradient(180deg, rgba(30, 58, 138, 0.78), rgba(30, 58, 138, 0.88)); }
  .kt-hero-inner { padding: 4rem 1.25rem; }
  .kt-hero-title { font-size: 3rem; }
  .kt-hero-sub { font-size: 1.0625rem; }
}

/* ── 區塊標題 ─────────────────────────────────────────── */
.kt-sec-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.kt-sec-head--center { text-align: center; align-items: center; margin-bottom: 3.5rem; }
@media (min-width: 640px) { .kt-sec-head:not(.kt-sec-head--center) { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
.kt-eyebrow { color: #2563eb; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.875rem; margin: 0 0 0.375rem; }
.kt-sec-title { font-size: 1.875rem; font-weight: 800; color: #1e293b; margin: 0; }
.kt-sec-desc { color: #64748b; margin: 0.5rem 0 0; font-size: 0.875rem; }
.kt-more { color: #2563eb; font-weight: 700; font-size: 0.875rem; white-space: nowrap; text-decoration: none; }
.kt-more:hover { text-decoration: underline; }
.kt-empty { text-align: center; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 1.5rem; padding: 3rem 1.5rem; font-size: 0.9375rem; }

/* ── 圖片 ─────────────────────────────────────────────── */
.kt-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kt-img-missing { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #94a3b8; font-size: 0.8125rem; font-weight: 600; }
.kt-img-broken { visibility: hidden; }
.kt-tag { position: absolute; top: 1rem; left: 1rem; color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: 9999px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); max-width: calc(100% - 2rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 老師輪播 ─────────────────────────────────────────── */
.kt-carousel { position: relative; }
.kt-track { overflow: hidden; touch-action: pan-y; }
.kt-slides { display: flex; gap: 16px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.kt-slide { flex-shrink: 0; display: flex; }
.kt-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; border-radius: 9999px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); display: none; align-items: center; justify-content: center; color: #64748b; cursor: pointer; z-index: 2; }
.kt-arrow:hover:not(:disabled) { color: #2563eb; }
.kt-arrow:disabled { opacity: 0.3; cursor: default; }
.kt-arrow svg { width: 1.25rem; height: 1.25rem; }
.kt-arrow--prev { left: -1.75rem; }
.kt-arrow--next { right: -1.75rem; }
@media (min-width: 640px) { .kt-carousel.has-nav .kt-arrow { display: flex; } }
.kt-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; min-height: 0.5rem; }
.kt-dot-btn { height: 0.5rem; width: 0.5rem; border-radius: 9999px; background: #cbd5e1; border: 0; padding: 0; cursor: pointer; transition: all 0.3s; }
.kt-dot-btn.is-on { width: 1.5rem; background: #2563eb; }
/* 點擊範圍放大到 24px，圓點本身維持原尺寸 */
.kt-dot-btn { position: relative; }
.kt-dot-btn::after { content: ""; position: absolute; inset: -8px -4px; }

/* ── 老師卡片 ─────────────────────────────────────────── */
.kt-tcard { display: flex; flex-direction: column; width: 100%; background: #fff; border: 1px solid #e2e8f0; border-radius: 1.5rem; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); text-decoration: none; color: inherit; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s; }
.kt-tcard:hover { transform: translateY(-6px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12); }
.kt-tcard-photo { position: relative; height: 16rem; background: #f1f5f9; flex-shrink: 0; }
.kt-tcard-body { padding: 1.75rem; min-width: 0; display: flex; flex-direction: column; }
.kt-tcard-name { font-size: 1.5rem; font-weight: 700; color: #1e293b; margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.kt-tcard-quote { font-size: 0.875rem; font-style: italic; margin: 0 0 1rem; }
.kt-tcard-summary { color: #64748b; font-size: 0.875rem; line-height: 1.7; margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.kt-tcard-more { margin-top: auto; padding-top: 1.25rem; font-weight: 700; font-size: 0.875rem; }
@media (min-width: 768px) {
  .kt-tcard { flex-direction: row; }
  .kt-tcard-photo { width: 40%; height: auto; min-height: 300px; }
  .kt-tcard-body { width: 60%; padding: 2rem; }
}
.kt-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.kt-badge { border: 1px solid; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 700; }

/* ── 花絮 ─────────────────────────────────────────────── */
.kt-ggrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 768px) { .kt-ggrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kt-ggrid--all { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .kt-ggrid--all { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kt-gtile { position: relative; display: block; width: 100%; height: 11rem; border: 0; padding: 0; border-radius: 1rem; overflow: hidden; background: #e2e8f0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); cursor: zoom-in; transition: transform 0.3s, box-shadow 0.3s; }
@media (min-width: 640px) { .kt-gtile { height: 16rem; } }
.kt-gtile:hover { transform: translateY(-4px); box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.12); }
.kt-gtile:disabled { cursor: default; }
.kt-gcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem 0.875rem; color: #fff; font-size: 0.75rem; font-weight: 700; text-align: left; background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.75)); opacity: 0; transition: opacity 0.3s; }
.kt-gtile:hover .kt-gcap, .kt-gtile:focus-visible .kt-gcap, .kt-gcap.is-shown { opacity: 1; }
@media (hover: none) { .kt-gcap { opacity: 1; } }

/* ── 作品 ─────────────────────────────────────────────── */
.kt-wgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 768px) { .kt-wgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kt-wgrid--all { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .kt-wgrid--all { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kt-wcard { background: #fff; padding: 1rem; border-radius: 1.5rem; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); min-width: 0; transition: transform 0.3s, box-shadow 0.3s; }
.kt-wcard:hover { transform: translateY(-4px); box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.1); }
.kt-wimg { position: relative; display: block; width: 100%; height: 14rem; border: 0; padding: 0; border-radius: 1rem; overflow: hidden; background: #f1f5f9; margin-bottom: 1rem; cursor: zoom-in; }
.kt-wimg:disabled { cursor: default; }
.kt-wtitle { font-weight: 700; color: #1e293b; margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.kt-wlabel { font-size: 0.75rem; font-weight: 700; margin: 0 0 0.75rem; }
.kt-wdesc { font-size: 0.75rem; color: #475569; line-height: 1.7; font-style: italic; padding: 0.75rem; border-radius: 0.75rem; margin: 0; overflow-wrap: anywhere; }

/* ── 詳細頁 ───────────────────────────────────────────── */
.kt-detail { max-width: 64rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.kt-back { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 1rem; border-radius: 9999px; border: 1px solid #cbd5e1; background: #fff; color: #334155; font-weight: 700; font-size: 0.875rem; text-decoration: none; margin-bottom: 1.75rem; transition: color 0.2s, border-color 0.2s; }
.kt-back:hover { color: #2563eb; border-color: #93c5fd; }
.kt-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.kt-detail-photo { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 24rem; border-radius: 1.5rem; overflow: hidden; background: #f1f5f9; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12); }
.kt-detail-info { min-width: 0; }
.kt-detail-name { font-size: 1.875rem; font-weight: 800; color: #0f172a; margin: 0 0 0.75rem; line-height: 1.25; overflow-wrap: anywhere; }
.kt-detail-name:focus { outline: none; }
.kt-detail-quote { font-size: 1.125rem; font-style: italic; border-left: 4px solid; padding-left: 1rem; margin: 0 0 1.5rem; overflow-wrap: anywhere; }
.kt-bio { color: #475569; line-height: 1.85; margin-bottom: 2rem; overflow-wrap: anywhere; }
.kt-bio p { margin: 0 0 0.875rem; }
.kt-bio ul, .kt-bio ol { margin: 0 0 0.875rem 1.25rem; }
.kt-bio ul { list-style: disc; }
.kt-bio ol { list-style: decimal; }
.kt-bio a { color: #2563eb; text-decoration: underline; }
.kt-bio blockquote { border-left: 3px solid #cbd5e1; padding-left: 0.875rem; color: #64748b; margin: 0 0 0.875rem; }
.kt-highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.kt-highlights li { display: flex; align-items: flex-start; gap: 0.75rem; color: #334155; font-size: 0.875rem; line-height: 1.6; overflow-wrap: anywhere; }
.kt-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; flex-shrink: 0; margin-top: 0.45rem; }
@media (min-width: 768px) {
  .kt-detail { padding: 2.5rem 1.5rem 5rem; }
  /* 照片約占三分之一，介紹取得其餘寬度；minmax(0,…) 讓長字串不會撐開欄寬 */
  .kt-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 3rem; align-items: start; }
  .kt-detail-photo { aspect-ratio: 3 / 4; max-height: none; }
  .kt-detail-name { font-size: 2.25rem; }
}
@media (max-width: 639px) {
  .kt-detail { padding: 1.25rem 1rem 3rem; }
  .kt-wrap { padding: 0 1rem; }
  .kt-sec { padding: 3.5rem 0; }
}

/* ── 影片 ─────────────────────────────────────────────── */
.kt-videos { margin-top: 3.5rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 1.5rem; padding: 2rem; }
.kt-videos-head { display: flex; align-items: center; gap: 0.75rem; font-size: 1.5rem; font-weight: 700; color: #1e293b; margin: 0 0 1.5rem; }
.kt-videos-head > span:first-child { color: #ef4444; }
.kt-vcount { font-size: 0.8125rem; font-weight: 600; color: #64748b; margin-left: auto; }
.kt-videos-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 1024px) { .kt-videos-body.has-list { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }
.kt-vmain { min-width: 0; }
.kt-player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 1rem; overflow: hidden; background: #0f172a; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15); }
.kt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kt-vmain-title { font-size: 1.0625rem; font-weight: 700; color: #1e293b; margin: 1rem 0 0.25rem; overflow-wrap: anywhere; }
.kt-vmain-desc { font-size: 0.875rem; color: #475569; line-height: 1.7; margin: 0.25rem 0 0; overflow-wrap: anywhere; }
.kt-vfallback { font-size: 0.75rem; color: #94a3b8; margin: 0.625rem 0 0; }
.kt-vfallback a { color: #64748b; text-decoration: underline; }
.kt-vlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; min-width: 0; }
@media (min-width: 1024px) { .kt-vlist { max-height: 30rem; overflow-y: auto; padding-right: 0.25rem; } }
.kt-vitem { display: flex; align-items: flex-start; gap: 0.75rem; width: 100%; padding: 0.5rem; border-radius: 0.75rem; border: 1px solid transparent; background: transparent; text-align: left; cursor: pointer; color: #334155; transition: background 0.2s, border-color 0.2s; }
.kt-vitem:hover { background: #fff; border-color: #e2e8f0; }
.kt-vitem.is-on { background: #fff; border-color: #93c5fd; box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15); }
.kt-vthumb { position: relative; width: 7.5rem; aspect-ratio: 16 / 9; border-radius: 0.5rem; overflow: hidden; background: #cbd5e1; flex-shrink: 0; }
.kt-vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kt-vplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.875rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.kt-vtitle { font-size: 0.875rem; font-weight: 600; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.kt-vnow { display: block; margin-top: 0.25rem; font-size: 0.6875rem; font-weight: 700; color: #2563eb; }
@media (max-width: 639px) {
  /* 手機：減少巢狀內距，讓播放器取得最大寬度 */
  .kt-videos { margin-top: 2.5rem; padding: 1rem 0.75rem; border-radius: 1rem; }
  .kt-videos-head { font-size: 1.25rem; margin-bottom: 1rem; }
  .kt-player { border-radius: 0.625rem; }
  .kt-vthumb { width: 6.5rem; }
}

/* ── 總覽頁／頁面切換 ─────────────────────────────────── */
.kt-view { display: none; }
.kt-view.is-active { display: block; animation: ktFade 0.3s ease; }
@keyframes ktFade { from { opacity: 0; } to { opacity: 1; } }
.kt-overview { max-width: 72rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.kt-overview-title { font-size: 1.875rem; font-weight: 800; color: #1e293b; margin: 0 0 0.5rem; }
.kt-overview-desc { color: #64748b; font-size: 0.875rem; margin: 0 0 2rem; }
@media (max-width: 639px) { .kt-overview { padding: 1.25rem 1rem 3rem; } .kt-overview-title { font-size: 1.5rem; } }

/* ── 圖片放大 ─────────────────────────────────────────── */
.kt-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.92); display: none; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 1rem 2rem; }
.kt-lightbox.is-open { display: flex; }
.kt-lightbox img { max-width: 92vw; max-height: 80vh; border-radius: 1rem; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); object-fit: contain; }
.kt-lightbox-cap { color: #e2e8f0; font-size: 0.875rem; margin-top: 1rem; text-align: center; max-width: 40rem; }
.kt-lightbox-close { position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(15, 23, 42, 0.6); color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.kt-lightbox-close:hover { background: rgba(225, 29, 72, 0.85); }

/* ── 進場動畫 ─────────────────────────────────────────── */
.kt-fade { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.kt-fade.is-visible { opacity: 1; transform: none; }
.kt-no-js .kt-fade { opacity: 1; transform: none; }

/* ── 預覽標示（後台預覽／草稿預覽） ───────────────────── */
.kt-preview-flag { display: inline-block; margin-left: 0.5rem; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 700; vertical-align: middle; background: #fef3c7; color: #92400e; }

@media (prefers-reduced-motion: reduce) {
  .kt-fade { opacity: 1; transform: none; transition: none; }
  .kt-slides, .kt-tcard, .kt-gtile, .kt-wcard, .kt-hero-btn { transition: none; }
  .kt-tcard:hover, .kt-gtile:hover, .kt-wcard:hover, .kt-hero-btn:hover { transform: none; }
  .kt-view.is-active { animation: none; }
}
