/* ==================================== */
/* 0. 基礎設置 (字體大小皆轉換為 REM 或 PX) */
/* ==================================== */
:root {
    --text-color: #2D2D2D;
    --highlight-blue: #005FA3;
    --highlight-teal: #79B8B5;
    --light-gray: #F1F1F1;
    --info-box-gray: #e9e9e9;
    --font-size-36pt: 2.25rem; /* 36pt */
    --font-size-30pt: 1.875rem; /* 30pt */
    --font-size-26pt: 1.625rem; /* 26pt */
    --font-size-12pt: 0.75rem; /* 12pt */
    /* 確保移除 --image-fixed-height */
}

/* 確保容器背景是圖片上的淺灰色 */
.latest-projects-section {
    background-color: var(--light-gray);
    position: relative; 
    overflow: visible;
}
.latest-projects-section .custom-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 頂部標題樣式 */
.section-title {
    color: var(--highlight-blue);
    font-size: var(--font-size-36pt);
    font-weight: 900; 
    padding-bottom: 20px;
    border-bottom: 5px solid var(--highlight-blue); 
}

/* ==================================== */
/* 2. 圖片比例維持 (核心設定) */
/* ==================================== */
.image-slideshow-container {
    position: relative;
    overflow: hidden; 
    height: 100%;
        min-height: 310px;
}

/* **核心比例設定** */
.aspect-ratio-box {
  position: relative;
  width: 100%;
  /* 高度=寬度×(404/688) */
  padding-top: 58.72%;
  background-color: #f1f1f1;
  overflow: hidden;
}

.aspect-ratio-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;              /* ✅ 關鍵：用 flex 讓圖片自然置中 */
  align-items: center;
  justify-content: center;
}

.aspect-ratio-img {
width: 90%;
aspect-ratio: 688 / 404;
    /*height: auto;*/
    object-fit: contain;
    border: 2px solid;
    padding: 20px;       /* ✅ 保持完整顯示 */
    background-color: #FFF;
}


/* 圖片上的文字描述 (overlay) */
.image-overlay-text {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5); 
    width: 100%;
    color: #FFFFFF;
    z-index: 5; 
}

.project-caption-title {
    font-size: var(--font-size-26pt);
    font-weight: bold;
    line-height: 1.2;
}
/* 圖片切換的樣式 - 必須為 absolute 才能讓比例容器正確計算 */
.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; 
    transition: opacity 1s ease-in-out; 
    z-index: 1;
}
.slideshow-slide.active-slide {
    opacity: 1;
    z-index: 2; 
}

/* ==================================== */
/* 3. 工程資訊區塊 (右側) - (未變動) */
/* ==================================== */
.project-info-box {
    /*background-color: var(--info-box-gray); */
    padding: 50px 30px !important; 
}

.project-name {
    font-weight: bold;
    font-size: var(--font-size-36pt); 
    color: var(--text-color);
    line-height: 1.2;
    border-top: 2px solid #2D2D2D;
    padding: 30px 0 ;
}

.info-label{
    font-size: 18px; 
    color: var(--text-color);
    font-weight: normal; 
    line-height: 1.5;
}

.info-value {
    font-size: 16px; 
    color: var(--text-color);
    font-weight: normal; 
    line-height: 1.5;
}

.info-label {
    text-align: center;
    min-width: 120px; 
    margin-right: 15px;
    color: #FFF;
    background-color: #2D2D2D;
}

/* ==================================== */
/* 4. 外部工程切換箭頭樣式 (修正定位和箭頭繪製) */
/* ==================================== */
.carousel {
    position: relative;
    overflow: visible; 
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    opacity: 1;
    border: none;
    z-index: 10;
}

/* **箭頭定位** */
.carousel-control-prev {
    left: -35px; 
}
.carousel-control-next {
    right: -35px; 
    left: auto;
}

/* 圓形背景 */
.carousel-control-prev::before,
.carousel-control-next::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white; 
    border: 2px solid #333; 
    border-radius: 50%; 
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4); 
    z-index: -1; 
}

/* 箭頭圖標容器 */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-image: none !important;
    display: inline-block;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

/* 向左箭頭 (Previous) */
.carousel-control-prev-icon::before {
    content: "";
    display: block;
    width: 10px; 
    height: 10px; 
    border-left: 3px solid #333; 
    border-bottom: 3px solid #333; 
    border-right: none;
    border-top: none;
    transform: rotate(45deg);
    position: absolute;
    top: calc(50% - 5px); 
    left: 45%; 
}

/* 向右箭頭 (Next) */
.carousel-control-next-icon::before {
    content: "";
    display: block;
    width: 10px; 
    height: 10px; 
    border-right: 3px solid #333; 
    border-top: 3px solid #333; 
    border-left: none;
    border-bottom: none;
    transform: rotate(45deg); 
    position: absolute;
    top: calc(50% - 5px); 
    left: 35%; 
}

/* 互動效果 */
.carousel-control-prev:hover::before ,.carousel-control-next:hover::before {
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.6);
    cursor: pointer;
}
.carousel-control-prev:active::before,.carousel-control-next:active::before {
    box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.5);
    transform: translateY(1px);
}


/* ==================================== */
/* 5. RWD 樣式調整 (確保比例正確) */
/* ==================================== */
@media (max-width: 991.98px) {
    /* 圖片現在由比例控制，無需固定高度 */
    
    /* 其他 RWD 樣式... */
    .section-title, .project-name {
        font-size: 1.8rem; 
    }
    .info-label, .info-value {
        font-size: 1.1rem; 
        line-height: 1.4;
    }
    .project-caption-title {
        font-size: 1.2rem;
    }
    .project-caption-note {
        font-size: 0.7rem;
    }
    .project-info-box {
        padding: 60px 35px !important; 
    }

}

@media (max-width: 777px) {
    /* 先把箭頭絕對定位改成針對圖片容器 */
.current-project-item {
    position: relative; /* 確保箭頭是相對於圖片容器定位 */
}


    
    /* 箭頭位置調整：收回輪播內部 */
    .carousel-control-prev {
        left: 0; 
    }
    .carousel-control-next {
        right: 0; 
    }

    /* 箭頭大小調整 */
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    position: absolute;
    top: 50%; /* 只針對圖片置中 */
    transform: translateY(-50%);
    }
    
    .carousel-control-prev::before,
    .carousel-control-next::before {
        box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
        border-width: 1px;
    }
    
    /* 箭頭圖標大小和位置調整 */
    .carousel-control-prev-icon::before,
    .carousel-control-next-icon::before {
        width: 8px;
        height: 8px;
        border-width: 2px;
        top: calc(50% - 4px);
    }
    
    .carousel-control-prev-icon::before {
        left: 45%;
    }
    
    .carousel-control-next-icon::before {
        left: 35%;
    }
}


    .project-image-wrapper{
            height: 100%;
        display: flex;
        align-items: center;
    }