/* 載入 Noto Sans TC 字體（含 Medium 權重） */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500&display=swap');


html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 設定整體字體為 Noto Sans TC，一般字為 400 權重 */
body,
.front-page {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 400;
}

/* 標題文字使用 Medium 權重（500） */
.front-page h1,
.front-page h2,
.front-page h3,
.front-page h4,
.front-page h5,
.front-page h6,
.front-page .block > b,
.front-page .block > strong {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 500;
}


/* 全站通用設定 */
.front-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.front-page body {
    font-family: 'Segoe UI', sans-serif;
    background: #f5f5f5;
}

/* Header */
.front-page .header {
    width: 100vw;
    background: #ffffff;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1vh 2vw;
}

.front-page .logo {
    font-size: 2vw;
}

.front-page .search-bar input {
    padding: 0.6vh 1vw;
    border-radius: 2vw;
    border: 1px solid #ccc;
    width: 20vw;
}

.front-page .search-bar button {
    padding: 0.6vh 1vw;
    border-radius: 2vw;
    border: none;
    margin-left: 1vw;
}

/* Hero */
.front-page .hero {
    background: linear-gradient(to bottom, #061529, #25477f);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 64vw;
    margin: 0 auto;
    padding: 5vh 0;
}

.front-page .hero-logo {
    font-size: 3vw;
    margin-bottom: 2vh;
}

.front-page .hero-logo img {
    width: 18vw;
    height: auto;
}

.front-page .hero-search input {
    padding: 1vh 2vw;
    border-radius: 2vw;
    border: none;
    width: 50vw;
}

/* 主內容 */
.front-page .main-grid {
    width: 64vw;
    margin: auto;
}

.front-page .row {
    display: flex;
    width: 100%;
    min-height: 20vh;
}

/* 3:7 比例設定 */
.front-page .block {
    width: 30%;
}

.front-page .section {
    width: 70%;
}

.front-page .block,
.front-page .section {
    padding: 3vh 2vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    font-size: 1vw;
}

.front-page .block {
    position: relative; /* 開啟定位參考點 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 子連結移到右下角 */
.front-page .block-link {
    position: absolute;
    right: 2vw;
    bottom: 2vh;
}

.front-page .block a {
    text-decoration: none; /* 去掉底線 */
    color: white; /* 設定文字為白色 */
}

.front-page .block a:hover {
    text-decoration: underline; /* 滑過時若想加底線可保留這行，否則也可移除 */
    color: #ddd; /* 滑過時顏色可微調 */
}




/* 左側小區塊配色 */
.front-page .block[data-index="0"] {
    background: linear-gradient(to bottom, #0f2774, #1c47d3);
}
.front-page .block[data-index="1"] {
    background: linear-gradient(to bottom, #264247, #4a828b);
}
.front-page .block[data-index="2"] {
    background: linear-gradient(to bottom, #29745e, #41ba96);
}
.front-page .block[data-index="3"] {
    background: linear-gradient(to bottom, #b24b00, #f27317);
}
.front-page .block[data-index="4"] {
    background: linear-gradient(to bottom, #ff4319, #ff947c);
}

/* 右側主區塊配色 */
.front-page .section-0 {
    background: linear-gradient(to right, #7f91d6, #2b4b8a);
}
.front-page .section-1 {
    background: linear-gradient(to right, #85c6c3, #2a6a69);
    position: relative;
    min-height: 12vh;
    overflow: hidden;
    padding: 2vh 2vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}
.front-page .section-2 {
    background: linear-gradient(to right, #80d1b4, #15846b);
    position: relative;
    min-height: 12vh;
    overflow: hidden;
    padding: 2vh 2vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}
.front-page .section-3 {
    background: linear-gradient(to right, #f5b18f, #f17227);
    position: relative;
    min-height: 12vh;
    overflow: hidden;
    padding: 2vh 2vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}
.front-page .section-4 {
    background: linear-gradient(to right, #f5a3a2, #e55757);
    position: relative;
    min-height: 12vh;
    overflow: hidden;
    padding: 2vh 2vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}

/* 世界地圖列設定 */
.front-page .map-text {
    flex: 2.5;
    font-size: 1.1vw;
    color: white;
    z-index: 2;
    text-align: left;
}

.front-page .world-map-img {
    flex: 7.5;
    height: 9vw;
    width: auto;
    opacity: 0.8;
    object-fit: contain;
    padding-right: 3vw;
}

/* Feature區域 */
.front-page .section-2 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    padding: 2vh 2vw;
    min-height: 12vh;
    color: white;
}

.front-page .left-box {
    flex: 6;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.front-page .feature-title {
    font-size: 1vw;
    margin-bottom: 1vh;
}

.front-page .feature-image img {
    width: 14.5vw;
    height: auto;
    padding-left: 2vw;
}

.front-page .right-box {
    flex: 4;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #1f2a30;
    font-size: 1vw;
    padding-left: 2vw;
}

/* 課程 Lesson 區域 */
.front-page .section-3 {
    position: relative;
    min-height: 12vh;
    overflow: hidden;
    padding: 2vh 2vw;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
}

.front-page .lesson-title {
    flex: 3;
    font-size: 1.1vw;
    color: white;
    z-index: 2;
    text-align: left;
}

.front-page .lesson-content img {
    flex: 7;
    height: 8.5vw;
    width: auto;
    opacity: 0.8;
    object-fit: contain;
    padding-right: 3vw;
}

/* Footer */
.front-page .footer {
    background: #1e2a45;
    color: white;
    text-align: center;
    padding: 2vh;
    font-size: 1vw;
}

/* Overlay 浮層區 */
/* Overlay 避免一開始在頂端閃退浮動區塊 */
.front-page .overlay-container {
    display: none; /* 預設完全不顯示、不繪製 */
    /* opacity: 0; */
    /* visibility: hidden; 不佔位又完全不顯示 */
    /* transition: opacity 0.3s ease; */
    /* position: absolute; */
    /* top: 0; */
    /* left: 0; */
    /* width: 100vw; */
    /* pointer-events: none; */
    /* z-index: 10; */
    /* transition: top 0.3s ease; */
}

body.overlay-ready .overlay-container {
    display: block; /* JS 計算完位置才顯示 */
    /* opacity: 1; */
    /* visibility: visible; */
    /* transition-delay: 0s; 立即出現 */
}

.front-page .overlay {
    position: absolute;
    /* left: 17.5vw;  */
    width: 19.2vw;
    padding: 3vh 2vw;
    font-size: 1vw;
    font-weight: bold;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: auto;
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.front-page .overlay.hover-out {
    transform: translateX(-100%);
    opacity: 1;    /* 若要跑出變透明就設為0*/
}

/* Overlay各index高度設定 */
.front-page .overlay[data-index="0"] { background: linear-gradient(to bottom, #7f91d6, #2b4b8a); }
.front-page .overlay[data-index="1"] { background: linear-gradient(to bottom, #85c6c3, #2a6a69); }
.front-page .overlay[data-index="2"] { background: linear-gradient(to bottom, #80d1b4, #15846b); }
.front-page .overlay[data-index="3"] { background: linear-gradient(to bottom, #f5b18f, #f17227); }
.front-page .overlay[data-index="4"] { background: linear-gradient(to bottom, #f5a3a2, #e55757); }

/* 頁尾樣式 */
.custom-footer {
    width: 100vw;
    background-color: #1d3557;
    text-align: center;
}

.custom-footer img {
    max-width: 100px;
    height: auto;
    display: inline-block;
}

/* 響應式RWD */
@media (max-width: 768px) {

    /* 移除頁面預設邊距 */
    body {
        margin: 0;
        padding: 0;
    }

    .front-page {
        margin: 0;
        padding: 0;
    }

    /* hero 與主區域滿版 */
    .front-page .hero,
    .front-page .main-grid {
        width: 100%;
        margin: 0;
    }

    /* row 不重排 保持左右結構 */
    .front-page .row {
        display: flex;
        width: 100%;
    }

    /* 左右比例微調為 40 60 比較舒服 */
    .front-page .block {
        width: 40%;
    }

    .front-page .section {
        width: 60%;
    }

    /* 左側文字縮小 */
    .front-page .block {
        font-size: 0.85rem;
    }

    /* 右側文字正常大小 */
    .front-page .section {
        font-size: 1rem;
    }

    /* 移除 padding 造成左右空隙 */
    .front-page .block,
    .front-page .section {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* 圖片滿版 */
    .front-page .world-map-img,
    .front-page .feature-image img,
    .front-page .lesson-content img {
        width: 100%;
        height: auto;
    }

    /* 關閉 hover overlay 手機不需要 */
    .front-page .overlay-container,
    .front-page .overlay {
        display: none !important;
    }

     /*
        footer 本體
        增加上下內距
        讓深藍底更厚
    */
    .custom-footer {
        padding-top: 2vh;
        padding-bottom: 2vh;
    }

    /*
        footer logo
        原本 max-width 100px
        手機改為約兩倍
        同時保留自動縮放避免超出
    */
    .custom-footer img {
        max-width: none;
        width: 20vw !important;
        height: auto;
        margin-top: 0;
    }

}