/* styles.css - modern, responsive layout */
:root {
    --site-header-height: 80px;
    --container: 1200px;
    --blue1: #0f4c81;
    --blue2: #2b75b4;
    --muted: #9fb3c9;
    --card-bg: #ffffff;
    --soft-shadow: 0 10px 30px rgba(20,40,60,0.06);
    --glass: rgba(255,255,255,0.06);
    --radius: 22px;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

html {
    overflow-x: hidden;
}

body {
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, Arial;
    margin: 0;
    color: #1f2d3d;
    background: #f3f6f8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    scroll-padding-top: 90px;
}

    body.has-fixed-header {
        padding-top: var(--site-header-height);
    }

/* container */
.container {
    width: min(var(--container), 92%);
    margin: 0 auto;
}

/* Header / hero */
.site-div {
    background: linear-gradient(180deg, #0b365a 0%, #2f79b8 100%);
    color: #fff;
    position: relative;
    padding-bottom: 60px;
    padding-top: 40px;
    margin-top: 100px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
}

.brand {
    display: flex;
    gap: 18px;
    align-items: center;
}

.logo-thumb {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.08);
}

.brand-text .eyebrow {
    letter-spacing: 6px;
    text-transform: uppercase;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.brand-text h1 {
    margin: 6px 0 0;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 1px;
}

/* hero paragraph and stats */
.hero {
    margin-top: 24px;
    padding: 24px 0 0 0;
}

.lead {
    color: rgba(255,255,255,0.92);
    max-width: 820px;
    font-size: 18px;
    margin: 8px 0 28px;
}

.stats {
    display: flex;
    gap: 22px;
    align-items: stretch;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 20px 28px;
    min-width: 220px;
    box-shadow: 0 6px 20px rgba(10,30,50,0.08);
}

    .stat-card .small {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 4px;
        color: rgba(255,255,255,0.85);
    }

    .stat-card .big {
        margin-top: 8px;
        font-weight: 700;
        font-size: 28px;
        color: #fff;
    }

    .stat-card .sub {
        color: rgba(255,255,255,0.8);
        margin-top: 6px;
        font-size: 14px;
    }



/* --- 公司沿革（左右卡片） --- */
.section-head {
    display: block;
    text-align: left;
    margin-bottom: 20px;
}

    .section-head .eyebrow {
        display: block;
        color: var(--muted);
        letter-spacing: 6px;
        text-transform: uppercase;
        font-size: 13px;
        margin-bottom: 8px;
    }

    .section-head h2 {
        margin: 0;
        font-size: 32px;
        color: #0e2640;
    }

/* grid：桌面兩欄、手機一欄 */
.history-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-top: 12px;
}

/* 單張卡 */
.history-card {
    background: #fff;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 14px 30px rgba(18,36,60,0.06);
    min-height: 140px;
}

/* 卡片上方資訊：年代 / 民國X年 / 分隔符號 */
.card-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 14px;
}

    .card-meta .era {
        font-weight: 500;
    }

    .card-meta .dash {
        opacity: 0.6;
    }

    .card-meta .year {
        font-weight: 700;
        color: #0e2640;
        font-size: 24px;
    }

/* 標題與說明 */
.history-card h3 {
    margin: 6px 0 8px;
    font-size: 20px;
    color: #10283f;
}

.history-card p {
    margin: 0;
    color: #556676;
    line-height: 1.7;
}

/* 響應式：小螢幕改單欄 */
@media (max-width: 960px) {
    .history-grid {
        grid-template-columns: 1fr;
    }

    .section-head h2 {
        font-size: 28px;
    }
}

/* sections */
.section {
    margin: 40px auto;
    padding: 24px 0;
}

/* headings */
.section-head {
    display: block;
    text-align: left;
    margin-bottom: 12px;
}

    .section-head .eyebrow {
        display: block;
        color: var(--muted);
        letter-spacing: 6px;
        text-transform: uppercase;
        font-size: 13px;
        margin-bottom: 6px; /* 增加行距 */
    }

    .section-head h2 {
        margin: 0;
        font-size: 32px;
        color: #0e2640;
    }

.section-desc {
    color: #6e8296;
    margin: 12px 0 28px;
}

/* cards grid */
.cards-grid {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
/* --- 認證與獎項卡片懸浮動畫 --- */
.certs-grid .card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    min-width: 280px;
    flex: 1 1 30%;
    box-shadow: var(--soft-shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

    /* 圖片部分加平滑縮放 */
    .certs-grid .card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.5s ease, filter 0.5s ease;
    }

    /* 標題文字 */
    .certs-grid .card h3 {
        padding: 18px;
        font-size: 18px;
        margin: 0;
        text-align: center;
        color: #10283f;
        transition: color 0.4s ease;
    }

    /* 懸浮效果 */
    .certs-grid .card:hover {
        transform: translateY(-10px);
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.15);
    }

        .certs-grid .card:hover img {
            transform: scale(1.08);
            filter: brightness(1.1);
        }

        .certs-grid .card:hover h3 {
            color: var(--blue2);
        }

.card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block
}

.card h3 {
    padding: 18px;
    font-size: 18px;
    margin: 0
}

/* timeline grid (two column) */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-top: 18px;
}

.timeline-item {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--soft-shadow);
    display: flex;
    flex-direction: column;
}

    .timeline-item .meta {
        color: var(--muted);
        font-size: 14px;
        margin-bottom: 10px;
    }

    .timeline-item .year {
        font-weight: 700;
        font-size: 28px;
        margin-bottom: 8px;
    }

    .timeline-item h4 {
        margin: 0 0 8px 0
    }

    .timeline-item p {
        color: #556676;
        margin: 0
    }

/* two-column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.info-card, .map-card, .contact-card, .faq-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--soft-shadow);
}

.contact-card,
.faq-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.map-frame {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    height: 320px
}

    .map-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block
    }

.map-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    text-align: center;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    padding: 8px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* contact card special styles */
.contact-card {
    background: linear-gradient(180deg,#07193a,#0f2b56);
    color: #fff;
    border-radius: 20px;
    padding: 26px;
}

    .contact-card h3 {
        margin-top: 0;
        color: #fff
    }

    .contact-card .bigphone {
        font-size: 22px;
        font-weight: 700;
        margin: 8px 0;
    }

/* policy grid */
.policy-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 28px;
    margin-top: 18px;
}

.policy-card {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--soft-shadow);
}

    .policy-card h3 {
        margin-top: 0
    }

/* footer */
.site-footer {
    background: linear-gradient(180deg,#0e2b53,#0c274a);
    color: #fff;
    padding: 24px 0;
    margin-top: 28px;
}

    .site-footer p {
        margin: 0;
        text-align: center
    }

/* responsive */
@media (max-width: 960px) {
    .brand-text h1 {
        font-size: 28px;
    }

    .timeline-grid {
        grid-template-columns: 1fr;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .policy-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
    }
}

.site-header {
    position: fixed !important;
    top: auto;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #002855;
}


/* 響應式：桌面 -> 3, 平板 -> 2, 手機 -> 1 */
@media (max-width: 1100px) {
    .certs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .certs-grid {
        grid-template-columns: 1fr;
    }
}

/* 卡片基礎 */
/* --- 認證與獎項區塊 --- */
.certs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-top: 20px;
    align-items: flex-start;
    padding: 0 12px;
}

    .certs-grid .card {
        background: var(--card-bg, #fff);
        border-radius: 18px;
        box-shadow: var(--soft-shadow, 0 4px 12px rgba(0,0,0,0.06));
        overflow: visible;
        cursor: pointer;
        flex: 1 1 300px;
        max-width: 340px;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        transition: box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        will-change: box-shadow;
        align-self: flex-start;
    }

        /* 圖片外層：用 max-height 控制展開 */
        .certs-grid .card .img-wrap {
            width: 100%;
            max-height: 220px; /* 初始高度 */
            overflow: hidden;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            transition: max-height 0.6s cubic-bezier(.2,.9,.2,1);
            will-change: max-height;
            background: var(--card-bg, #fff);
            display: flex;
            transition: max-height 1.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.8s ease;
        }

        /* 一般圖片設定（預設顯示完整） */
        .certs-grid .card img {
            display: block;
            width: 100%;
            height: auto;
            object-fit: contain;
            transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), max-width 1s cubic-bezier(0.22, 1, 0.36, 1), max-height 1s cubic-bezier(0.22, 1, 0.36, 1);
            will-change: transform;
            min-height: 120px;
        }

        /* 一般懸浮（其它卡片） */
        .certs-grid .card:hover {
            box-shadow: 0 20px 48px rgba(16, 40, 63, 0.12);
        }

            .certs-grid .card:hover .img-wrap {
                max-height: 600px;
            }

            .certs-grid .card:hover img {
                transform: scale(1.03);
            }

        /* 其餘樣式（標題、響應式）保留 */
        .certs-grid .card h3 {
            padding: 16px 0 20px;
            font-size: 18px;
            margin: 0;
            text-align: center;
            color: #10283f;
            transition: color 0.28s ease;
        }

        .certs-grid .card:hover h3 {
            color: var(--blue2, #0066cc);
        }

@media (min-width: 961px) {
    .certs-grid .card {
        flex: 1 1 30%;
        max-width: 360px;
    }
}
