/* ===================================
   第五區塊：持續學習
   =================================== */

.continuous-learning-section {
    position: relative;
    min-height: 1055px;
    overflow: visible;  /* 改為 visible 確保 footer 可見 */
    background: #ffffff;
    padding: 80px 0 0 0;
    display: flex;
    flex-direction: column;
}

/* 背景層 */
.learning-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.learning-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}


/* 主要內容容器 */
.continuous-learning-section .main-container {
    position: relative;
    width: 75vw;
    max-width: 1440px;
    margin: 0 auto;
    z-index: 4;
    padding-top: 87px;
}

/* 左側內容 */
.left-content {
    padding-right: 40px;
    padding-top: 0px;
}

.content-wrapper {
    max-width: 462px;
}

/* 主標題 - 使用 clamp() 讓字體隨螢幕流暢變化 */
.section-title {
    font-family: 'AR FangXinShuH7B5Std', 'Noto Sans TC', sans-serif;
    font-size: clamp(36px, 5vw, 64px); /* 最小36px, 理想5vw, 最大70px */
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 1.4px;
    color: #0b5b7c;
    margin: 0 0 30px 0;
}

/* 說明文字 - 使用 clamp() 讓字體隨螢幕流暢變化 */
.section-description {
    font-family: 'Inter', 'Noto Sans JP', 'Noto Sans TC', sans-serif;
    font-size: clamp(16px, 1.8vw, 26px); /* 最小16px, 理想1.8vw, 最大26px */
    font-weight: 400;
    line-height: 1.8;
    color: #161616;
}

.section-description p {
    margin: 0;
}

/* 右側照片網格 */
.right-content {
    padding-left: 20px;
}

.photos-grid {
    display: flex;
    flex-direction: column;
    gap: 3%;
    width: 100%;
}

/* 第一排：2張圖 */
.photos-row-1 {
    display: flex;
    gap: 3%;
    width: 100%;
}

.photo-large {
    width: 58%;  /* 基於右側容器的百分比 */
    aspect-ratio: 370 / 289;  /* 保持原始比例 */
}

.photo-medium {
    width: 39%;  /* 基於右側容器的百分比 */
    aspect-ratio: 267 / 289;  /* 保持原始比例 */
}

/* 第二排：3張小圖 */
.photos-row-2 {
    display: flex;
    gap: 2.5%;
    width: 100%;
}

.photo-small {
    width: 31.67%;  /* 基於右側容器的百分比，3張均分 */
    aspect-ratio: 203 / 165;  /* 保持原始比例 */
}

.photo-small:nth-child(2) {
    width: 31.67%;
}

/* 照片樣式 */
.photo-item {
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* CTA 按鈕區塊 */
.cta-section-wrapper {
    position: relative;
    margin-top: auto;  /* 推到最下方 */
    min-height: 350px;
    width: 100%;
}

/* 底部建築物裝飾 */
.footer-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw;  /* 使用 100vw 確保填滿整個螢幕寬度 */
    margin-left: calc(-50vw + 50%);  /* 置中對齊並延伸到螢幕邊緣 */
    height: auto;
    z-index: 1;
}

.footer-decoration img {
    width: 100%;
    height: auto;
    display: block;
}

/* CTA 按鈕容器 */
.cta-button-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 145px;
    width: auto;
    max-width: 90%;
    z-index: 3;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.cta-button-container:hover {
    transform: translateX(-50%) scale(1.05);
}

.cta-button-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* 平板尺寸 (768px ~ 1290px) - 保持左右排列佈局,只縮小尺寸 */
@media (max-width: 1290px) and (min-width: 768px) {
    .continuous-learning-section {
        min-height: auto;
    }

    .continuous-learning-section .main-container {
        width: 90vw;
        padding-top: 40px;
    }

    /* 左側內容 - 字體已由 clamp() 自動調整 */
    .left-content {
        padding-right: 20px;
    }

    /* 右側照片網格 - 已使用百分比,自動適應 */
    .right-content {
        padding-left: 10px;
    }

    /* 照片尺寸已由百分比控制,不需要額外設定 */

    .cta-section-wrapper {
        margin-top: 50px;
        height: 280px;
    }

    .cta-button-container {
        width: 450px;
        bottom: 110px;
    }
}

/* 手機尺寸 (< 768px) - 標題置中，圖片保持平板佈局 */
@media (max-width: 767px) {
    .continuous-learning-section {
        min-height: auto;
        padding: 50px 0;
    }

    .continuous-learning-section .main-container {
        width: 95vw;
    }

    /* 標題區域置中 */
    .left-content {
        padding-right: 0;
        text-align: center;
        margin-bottom: 40px;
    }

    .content-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .section-title {
        text-align: center;
    }

    /* 小螢幕下隱藏標題中的換行符 */
    .section-title br {
        display: none;
    }

    .section-description br {
        display: none;
    }

    .section-description {
        text-align: center;
    }

    /* 右側照片區域 - 保持平板的左右排列佈局 */
    .right-content {
        padding-left: 0;
        padding-right: 0;
    }

    .photos-grid {
        margin-top: 40px;
    }

    /* 第一排：保持 2 張圖左右排列 */
    .photos-row-1 {
        display: flex;
        gap: 3%;
        width: 100%;
    }

    .photo-large {
        width: 58%;
        aspect-ratio: 370 / 289;
    }

    .photo-medium {
        width: 39%;
        aspect-ratio: 267 / 289;
    }

    /* 第二排：保持 3 張小圖左右排列 */
    .photos-row-2 {
        display: flex;
        gap: 2.5%;
        width: 100%;
    }

    .photo-small {
        width: 31.67%;
        aspect-ratio: 203 / 165;
    }

    .cta-section-wrapper {
        margin-top: 50px;
        height: 250px;
    }

    .cta-button-container {
        width: 90%;
        max-width: 400px;
        bottom: 100px;
    }
}
