/* 專業證照 頁面專用樣式
   命名前綴：cr-（certificates）
   依賴：about-history.css 提供 .ah-inner-header 與 .ah-breadcrumb 樣式
*/

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

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

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

/* ============ HERO ============ */
.cr-hero {
    position: relative;
    background:
        radial-gradient(ellipse 800px 600px at 8% 50%, #F4EFEC 0%, transparent 60%),
        linear-gradient(180deg, #F7F5F2 0%, #FBFAF8 100%);
    overflow: hidden;
    padding: 84px 0 96px;
}
.cr-tower-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .35;
    z-index: 1;
}
.cr-hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}
.cr-hero-grid h1 {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 800;
    font-size: clamp(48px, 6.2vw, 84px);
    line-height: 1.04;
    letter-spacing: -.01em;
    margin: 0 0 28px;
    color: var(--cr-ink);
}
.cr-hero-grid p {
    font-size: 17px;
    line-height: 1.75;
    color: #3F4350;
    max-width: 540px;
    margin: 0 0 18px;
    font-family: 'Noto Sans TC', sans-serif;
}
.cr-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 56px;
    max-width: 540px;
}
.cr-hero-stat .n {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1;
    font-family: 'Manrope', sans-serif;
}
.cr-hero-stat .l {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--cr-muted);
    font-family: 'Noto Sans TC', sans-serif;
}
.cr-hero-art {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
}
.cr-hero-photo {
    background: linear-gradient(180deg, #2A2C32 0%, #16171B 100%);
    aspect-ratio: 4/3.2;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
}
.cr-hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ CERT SECTION ============ */
.cr-cert-main {
    padding: 96px 0 40px;
    background: var(--cr-paper-2);
}
.cr-section-head {
    margin-bottom: 8px;
}
.cr-section-head h2 {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 800;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.1;
    letter-spacing: -.01em;
    margin: 14px 0 0;
    color: var(--cr-ink);
}
.cr-section-head p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--cr-muted);
    font-family: 'Noto Sans TC', sans-serif;
    margin: 14px 0 0;
}
.cr-company-block {
    padding: 56px 0 64px;
    border-top: 1px solid var(--cr-border);
}
.cr-company-block:first-of-type { border-top: none; padding-top: 24px; }
.cr-company-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}
.cr-company-head .cr-lhs { display: flex; align-items: center; gap: 18px; }
.cr-company-mark {
    flex: none;
    width: 56px; height: 56px; border-radius: 14px;
    background: #fff;
    display: grid; place-items: center;
    border: 1px solid var(--cr-border);
}
.cr-company-head h3 {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 800;
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: -.01em;
    color: var(--cr-ink);
    margin: 0;
    line-height: 1.2;
}
.cr-company-head .cr-c-en {
    font-family: 'Manrope', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--cr-muted);
    letter-spacing: .04em;
    margin-top: 4px;
}
.cr-company-head .cr-c-count {
    flex: none;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--cr-red);
    background: var(--cr-red-soft);
    border: 1px solid rgba(224,18,26,.2);
    border-radius: 999px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.cr-company-head .cr-c-count .cr-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cr-red);
}
.cr-cert-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
.cr-cert-card {
    background: #fff;
    border: 1px solid var(--cr-border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: var(--cr-shadow-card);
    transition: transform .22s ease, box-shadow .22s ease, border-color .2s;
    text-align: left;
    padding: 0;
    font: inherit;
    color: inherit;
    width: 100%;
}
.cr-cert-card:hover {
    transform: translateY(-5px);
    border-color: var(--cr-red);
    box-shadow: var(--cr-shadow-card-hover);
}
.cr-cert-card:focus-visible { outline: 3px solid var(--cr-red); outline-offset: 2px; }
.cr-cert-thumb {
    position: relative;
    aspect-ratio: 3/4;
    background: #EFEDE8;
    overflow: hidden;
    display: grid;
    place-items: stretch;
}
.cr-cert-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
/* 縮圖右上角「N 張」標記（多圖證照才會出現） */
.cr-cert-thumb .cr-multi-badge {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    background: var(--cr-ink); color: #fff;
    font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 11px;
    letter-spacing: .04em;
    padding: 5px 9px; border-radius: 6px;
    display: inline-flex; align-items: center; gap: 5px;
}
.cr-cert-thumb .cr-multi-badge svg { width: 12px; height: 12px; }
.cr-cert-paper {
    position: absolute;
    inset: 14px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFAF7 100%);
    border: 1px solid #E4E0D7;
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 10px 24px rgba(15,17,21,.06);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow: hidden;
}
.cr-cert-paper::after {
    content: "";
    position: absolute;
    bottom: 16px; right: 16px;
    width: 38px; height: 38px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, transparent 36%, rgba(224,18,26,.14) 37%, rgba(224,18,26,.14) 45%, transparent 46%),
        conic-gradient(from 0deg, rgba(224,18,26,.22), rgba(224,18,26,.10), rgba(224,18,26,.22));
    border: 1.5px solid rgba(224,18,26,.45);
    opacity: .9;
}
.cr-pl-line { height: 6px; border-radius: 3px; background: #E9E5DC; }
.cr-pl-line.title { height: 11px; width: 62%; background: #D9D4C8; margin-bottom: 4px; }
.cr-pl-line.w80 { width: 80%; }
.cr-pl-line.w65 { width: 65%; }
.cr-pl-line.w70 { width: 70%; }
.cr-pl-tag {
    margin-top: auto;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9.5px;
    color: #B0A99B;
    letter-spacing: .08em;
}
.cr-zoom-hint {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(0deg, rgba(15,17,21,.42) 0%, transparent 42%);
    opacity: 0;
    transition: opacity .22s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
}
.cr-cert-card:hover .cr-zoom-hint { opacity: 1; }
.cr-zoom-hint .cr-pill {
    background: #fff;
    color: var(--cr-ink);
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 12.5px;
    padding: 7px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.cr-zoom-hint .cr-pill svg { width: 14px; height: 14px; }
.cr-cert-meta { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 3px; }
.cr-cert-meta .cr-c-name {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 15.5px;
    color: var(--cr-ink);
    line-height: 1.4;
    letter-spacing: -.005em;
}
.cr-cert-meta .cr-c-sub {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    color: var(--cr-muted-2);
    letter-spacing: .03em;
    font-weight: 500;
}

/* ============ LIGHTBOX ============ */
.cr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15,17,21,.86);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    transition: opacity .25s ease;
}
.cr-lightbox.open { display: flex; opacity: 1; }
.cr-lb-stage {
    position: relative;
    width: min(940px, 92vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    transform: translateY(10px) scale(.985);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.cr-lightbox.open .cr-lb-stage { transform: none; }
.cr-lb-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    color: #fff;
}
.cr-lb-head .cr-lb-eyebrow {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #FCA5AA;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}
.cr-lb-head .cr-lb-eyebrow .cr-bolt-sm {
    width: 11px; height: 11px;
    background: var(--cr-yellow);
    clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 0 100%, 40% 55%, 0 55%);
}
.cr-lb-title {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -.01em;
    line-height: 1.2;
}
.cr-lb-company {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13px;
    color: #B3B6BD;
    margin-top: 5px;
}
.cr-lb-counter {
    flex: none;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    padding: 7px 14px;
    white-space: nowrap;
}
.cr-lb-frame {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.cr-lb-frame img {
    max-width: 100%;
    max-height: calc(88vh - 90px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.cr-lb-placeholder {
    width: 560px;
    max-width: 100%;
    aspect-ratio: 3/4;
    max-height: calc(88vh - 90px);
    background: linear-gradient(180deg, #FFFFFF 0%, #F7F5F0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    padding: 40px;
}
.cr-lb-placeholder .cr-seal {
    width: 92px; height: 92px;
    border-radius: 50%;
    border: 2px dashed rgba(224,18,26,.5);
    display: grid; place-items: center;
    color: var(--cr-red);
}
.cr-lb-placeholder .cr-seal svg { width: 40px; height: 40px; }
.cr-lb-placeholder .cr-pt {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 800;
    font-size: 19px;
    color: var(--cr-ink);
}
.cr-lb-placeholder .cr-ps {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13.5px;
    color: var(--cr-muted);
    line-height: 1.7;
    max-width: 30em;
}
.cr-lb-placeholder .cr-pcode {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--cr-muted-2);
    margin-top: 4px;
    background: #F0EDE6;
    border: 1px solid var(--cr-border);
    border-radius: 6px;
    padding: 6px 12px;
}
.cr-lb-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 4;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    transition: transform .18s ease, background .18s ease;
}
.cr-lb-btn:hover { transform: translateY(-50%) scale(1.08); background: #fff; }
.cr-lb-btn svg { width: 22px; height: 22px; color: var(--cr-ink); }
.cr-lb-btn.prev { left: -26px; }
.cr-lb-btn.next { right: -26px; }
.cr-lb-close {
    position: absolute;
    top: -2px; right: 0;
    transform: translateY(-130%);
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .18s ease, transform .18s ease;
    z-index: 5;
}
.cr-lb-close:hover { background: rgba(255,255,255,.25); transform: translateY(-130%) rotate(90deg); }
.cr-lb-close svg { width: 20px; height: 20px; }
.cr-lb-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.cr-lb-dots .cr-d {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    cursor: pointer;
    transition: background .18s, transform .18s;
}
.cr-lb-dots .cr-d.active { background: var(--cr-red); transform: scale(1.25); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1180px) {
    .cr-cert-grid { grid-template-columns: repeat(3, 1fr); }
    .cr-hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .cr-cert-grid { grid-template-columns: repeat(2, 1fr); }
    .cr-company-head { flex-direction: column; align-items: flex-start; gap: 16px; }
    .cr-lb-btn.prev { left: 8px; }
    .cr-lb-btn.next { right: 8px; }
    .cr-lb-btn { background: rgba(255,255,255,.92); }
}
@media (max-width: 520px) {
    .cr-cert-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
