/* 教育訓練 頁面專用樣式
   命名前綴：tn-（training）
   依賴：about-history.css 提供 .ah-inner-header 與 .ah-breadcrumb 樣式
*/

:root {
    --tn-red: #E0121A;
    --tn-red-dark: #B30E14;
    --tn-red-soft: #FEE2E4;
    --tn-ink: #0E0F11;
    --tn-ink-2: #1A1B1F;
    --tn-paper: #F1F1F4;
    --tn-paper-2: #FAFAFB;
    --tn-white: #FFFFFF;
    --tn-muted: #6B7280;
    --tn-muted-2: #9CA3AF;
    --tn-border: #E5E7EB;
    --tn-yellow: #FACC15;
    --tn-shadow-card: 0 1px 2px rgba(15,17,21,.04), 0 8px 24px rgba(15,17,21,.06);
    --tn-shadow-card-hover: 0 6px 12px rgba(15,17,21,.06), 0 24px 48px rgba(15,17,21,.10);
}

/* ============ CONTAINER ============ */
.tn-container {
    width: min(1280px, calc(100% - 80px));
    margin-inline: auto;
}

/* ============ EYEBROW / BOLT ============ */
.tn-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--tn-muted);
    letter-spacing: .05em;
    margin-bottom: 12px;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-bolt {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--tn-red);
    clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 0 100%, 40% 55%, 0 55%);
    flex: none;
}

/* ============ HERO ============ */
.tn-hero {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(135deg, #FAFAFB 0%, #F7F5F2 100%);
}
.tn-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.tn-hero-text h1 {
    font-size: 56px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--tn-ink);
    margin: 24px 0 16px 0;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-hero-text p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--tn-ink-2);
    margin: 24px 0;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-hero-art {
    position: relative;
    min-height: 480px;
    background: linear-gradient(135deg, #F4EFEC 0%, #FAF8F5 100%);
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(14,15,17,.08);
}
.tn-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
}

/* ============ TRAINING AXES ============ */
.tn-axes-section {
    padding: 80px 0;
    background: var(--tn-white);
}
.tn-axes-section h2 {
    font-size: 42px;
    font-weight: 800;
    color: var(--tn-ink);
    margin: 0;
    line-height: 1.3;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-axes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 60px;
}
.tn-axis-card {
    padding: 48px 40px;
    background: linear-gradient(135deg, #FAFAFB 0%, #F7F5F2 100%);
    border: 1px solid var(--tn-border);
    border-radius: 18px;
    transition: all .3s ease;
}
.tn-axis-card:hover {
    border-color: var(--tn-red);
    box-shadow: 0 12px 40px rgba(224,18,26,.12);
    transform: translateY(-4px);
}
.tn-axis-card .tn-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 32px;
}
.tn-axis-card:nth-child(1) .tn-icon { background: #FEE2E4; color: var(--tn-red); }
.tn-axis-card:nth-child(2) .tn-icon { background: #E8F4F8; color: #0891B2; }
.tn-axis-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--tn-ink);
    margin: 0 0 16px 0;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-axis-card p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--tn-muted);
    margin: 0;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-axis-card .tn-programs {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--tn-border);
}
.tn-program-tag {
    display: inline-block;
    background: var(--tn-white);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tn-ink);
    margin: 8px 8px 8px 0;
    border: 1px solid var(--tn-border);
    font-family: 'Noto Sans TC', sans-serif;
}

/* ============ TRAINING PROGRAMS ============ */
.tn-programs-section {
    padding: 100px 0;
    background: var(--tn-paper);
}
.tn-programs-intro {
    max-width: 720px;
    margin-bottom: 60px;
}
.tn-programs-intro h2 {
    font-size: 42px;
    font-weight: 800;
    color: var(--tn-ink);
    margin: 0 0 20px 0;
    line-height: 1.3;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-programs-intro p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--tn-muted);
    font-family: 'Noto Sans TC', sans-serif;
    margin: 0;
}
.tn-programs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.tn-program-card {
    background: var(--tn-white);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--tn-border);
    transition: all .3s ease;
    box-shadow: var(--tn-shadow-card);
}
.tn-program-card:hover {
    border-color: var(--tn-red);
    box-shadow: var(--tn-shadow-card-hover);
    transform: translateY(-6px);
}
.tn-program-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--tn-muted-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    text-align: center;
}
.tn-program-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.tn-program-card-content { padding: 32px; }
.tn-program-card-badge {
    display: inline-block;
    background: #FEE2E4;
    color: var(--tn-red);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    margin-bottom: 16px;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-program-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--tn-ink);
    margin: 0 0 12px 0;
    line-height: 1.4;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-program-card p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--tn-muted);
    margin: 0 0 24px 0;
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-program-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--tn-border);
}
.tn-program-card-meta-item {
    font-size: 13px;
    color: var(--tn-muted-2);
    font-family: 'Noto Sans TC', sans-serif;
}
.tn-program-card-meta-item strong { color: var(--tn-ink); font-weight: 600; }

/* ============ 訓練計畫卡片：hover 放大鏡 ============ */
.tp-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--tn-red);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .22s ease, transform .22s ease, filter .15s;
    z-index: 3;
    box-shadow: 0 6px 18px rgba(224, 18, 26, .35);
}
.tn-program-card:hover .tp-zoom { opacity: 1; transform: none; }
.tp-zoom:hover { filter: brightness(1.1); transform: scale(1.06); }
.tp-zoom:focus-visible { opacity: 1; transform: none; outline: 2px solid #fff; outline-offset: 2px; }
.tp-zoom svg { width: 19px; height: 19px; }

/* ============ 訓練計畫相簿 Modal（本頁專用，獨立命名空間 .tpm-） ============ */
.tpm-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; }
.tpm-modal.open { display: flex; }
.tpm-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 11, .74); }
.tpm-card {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: 92vh;
    background: #fff;
    border-radius: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    /* 黃色外光暈（對照精密儀器 / 客戶實績 Modal） */
    box-shadow: 0 0 0 1px var(--tn-yellow),
                0 0 24px 2px rgba(250, 204, 21, .55),
                0 0 60px 12px rgba(250, 204, 21, .28),
                0 30px 80px rgba(0, 0, 0, .45);
    animation: tpmIn .28s ease;
}
@keyframes tpmIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tpm-info { padding: 40px 38px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; border-radius: 18px 0 0 18px; }
.tpm-ix { display: inline-flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500; letter-spacing: .1em; color: var(--tn-red); }
.tpm-boltmark { width: 12px; height: 12px; background: var(--tn-yellow); clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 0 100%, 40% 55%, 0 55%); flex: none; }
.tpm-info h3 { font-family: 'Noto Sans TC', sans-serif; font-weight: 800; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.3; color: var(--tn-ink); margin: 0; }
.tpm-en { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; letter-spacing: .03em; color: var(--tn-muted); }
.tpm-info p { font-family: 'Noto Sans TC', sans-serif; font-size: 15.5px; line-height: 1.95; color: #2A2C31; margin: 6px 0 0; text-wrap: pretty; }
.tpm-figure { position: relative; background: #0E0F11; display: flex; flex-direction: column; padding: 20px; min-height: 360px; gap: 14px; border-radius: 0 18px 18px 0; }
.tpm-viewer { position: relative; flex: 1 1 auto; min-height: 220px; display: grid; place-items: center; }
/* 圖片區高度依照圖片寬高比自適應（覆寫 Voltz main.css 全域 img max-height:100%） */
.tpm-viewer img { width: 100%; height: auto; max-width: 100%; max-height: 72vh; object-fit: contain; display: none; border-radius: 8px; }
.tpm-figure.has-img .tpm-viewer img { display: block; }
.tpm-empty { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; line-height: 1.7; color: #8C9098; text-align: center; max-width: 80%; }
.tpm-figure.has-img .tpm-empty { display: none; }
/* 切換鈕預設即為品牌紅實心，Modal 一開啟就清楚可見（不再是半透明）
   本頁未載入定義 --red 的 CSS，一律使用本頁自有的 --tn- token */
.tpm-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--tn-red); color: #fff; display: none; place-items: center; cursor: pointer; z-index: 4; transition: background .15s, transform .15s; }
.tpm-viewer.multi .tpm-nav { display: grid; }
.tpm-nav.prev { left: 4px; }
.tpm-nav.next { right: 4px; }
/* hover 須保留 translateY(-50%)，否則按鈕會掉出垂直置中 */
.tpm-nav:hover { background: var(--tn-red-dark, var(--tn-red)); transform: translateY(-50%) scale(1.06); }
.tpm-nav svg { width: 20px; height: 20px; }
.tpm-count { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); z-index: 4; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .06em; color: #fff; background: rgba(0, 0, 0, .4); padding: 3px 9px; border-radius: 999px; }
.tpm-viewer:not(.multi) .tpm-count { display: none; }
.tpm-rail { display: flex; gap: 8px; justify-content: center; flex: none; flex-wrap: wrap; }
.tpm-thumb { width: 84px; height: 60px; max-width: none; max-height: none; display: block; object-fit: cover; cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; border-radius: 8px; transition: outline-color .15s; }
.tpm-thumb.tpm-active { outline-color: var(--tn-yellow); }
.tpm-close { position: absolute; top: -18px; right: -18px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; background: #1A1B1F; border: 2px solid #fff; color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s; }
.tpm-close:hover { background: var(--tn-red); transform: scale(1.06); }
.tpm-close svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
    .tpm-modal { padding: 14px; }
    .tpm-card { grid-template-columns: 1fr; max-height: 90vh; overflow-y: auto; }
    .tpm-info { border-radius: 0 0 18px 18px; padding: 26px 22px; }
    .tpm-figure { min-height: 220px; order: -1; border-radius: 18px 18px 0 0; }
    /* 手機卡片改為可捲動，外露關閉鈕會被裁切→移回卡內右上角 */
    .tpm-close { top: 10px; right: 10px; }
}

/* 直立窄屏手機：縮圖列必定換行擠壓主照片，改為完全不顯示
   （本區塊須排在 760px 之後，否則 min-height 會被上方的 220px 覆蓋） */
@media (max-width: 600px) {
    .tpm-rail { display: none; }
    .tpm-figure { min-height: 260px; }
    /* 放大至 44px 最小點擊目標；仍受 .multi 控制，單張圖不顯示 */
    .tpm-viewer.multi .tpm-nav { display: grid; width: 44px; height: 44px; }
    .tpm-nav.prev { left: 8px; }
    .tpm-nav.next { right: 8px; }
    .tpm-close { top: 8px; right: 8px; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .tn-hero-grid { grid-template-columns: 1fr; gap: 60px; }
    .tn-axes-grid { grid-template-columns: 1fr; }
    .tn-programs-grid { grid-template-columns: 1fr; }
    .tn-hero-text h1 { font-size: 44px; }
    .tn-programs-intro h2 { font-size: 36px; }
}
