/* 顯示 sm 隱藏 lg */
.show_sm {
    display: block;
}
.show_lg {
    display: none;
}
/* SM 以上 */
@media (min-width: 768px) {
}
/* MD 以上 */
@media (min-width: 992px) {
    .show_sm {
        display: none;
    }
    .show_lg {
        display: block;
    }
}
header {
    transition: all 0.6s ease;
    opacity: 1;
}
body.scroll_down header.show_lg {
    opacity: 0;
    top: 0;
    transform: translateY(-150%);
}
header li {
    padding: 0 0.25rem;
    height: 100%;
}
header a {
    color: #ffffff !important;
    font-weight: lighter;
    line-height: 1;
    letter-spacing: 0.5em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    padding: 0.5rem;
    height: 100%;
    width: 100%;
    font-weight: 400;
}
header a span {
    white-space: nowrap;
}
header.show_lg a::before {
    content: '●';
    transform: scale(0.5);
}
header.show_sm a {
    letter-spacing: 0.25em;
    line-height: 1.3;
}
footer {
    position: relative;
    z-index: 10;
}
img + small {
    color: #ffffff;
    position: absolute;
    left: 0;
    bottom: 0.5rem;
    margin: 0.5rem;
    z-index: 5;
    width: 100%;
    text-align: center;
    font-weight: normal;
}
.h_full {
    min-height: max(100svh, 600px);
}
.picture_frame::after {
    content: '';
    background-color: var(--color_ci);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 0 2rem 2rem 2rem;
}
.picture_frame img {
    z-index: 2;
    border-radius: 2rem;
    transform: scale(1.2);
}
.case_name {
    letter-spacing: 0.5em;
    font-weight: normal;
}
.section_name {
    letter-spacing: 0.25em;
    font-weight: normal;
}
.cover_float_name {
    letter-spacing: 0.25em;
    font-weight: normal;
    position: absolute;
    z-index: 2;
    left: 0;
    top: calc(20px + 2vw);
    background-color: var(--color_ci);
    padding: 0.3rem 0.5rem 0.3rem 15%;
    border-radius: 0 5px 5px 0;
}
.mask_overlay {
    position: relative;
}
.mask_overlay img {
    opacity: 0.9;
}
.mask_overlay.mask_bottom::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 2.5%, rgba(0, 0, 0, 0.5) 15%, rgba(0, 0, 0, 0) 30%);
}
.mask_image {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, transparent 10%, black 50%, transparent 90%, transparent 100%);
    opacity: 0.5;
}
.text_blend {
    color: #ffffff;
    mix-blend-mode: difference;
}

.text_float_left {
    margin-left: 0;
    margin-right: auto;
}
.flex-lg-row-reverse .text_float_left {
    margin-left: auto;
    margin-right: 0;
}
/* SM only */
@media (max-width: 767.98px) {
    .sm_h_1x1 {
        aspect-ratio: 1 / 1 !important;
    }
    .sm_h_100 {
        height: calc(100svh - 70px) !important;
    }
    .sm_left_top {
        bottom: auto !important;
        top: 15px !important;
        left: 0 !important;
        transform: translate(0, 0) !important;
    }
    .flex-lg-row-reverse .text_float_left {
        margin-left: 0;
        margin-right: auto;
    }
}
/* =========================================
    Case Modal (全螢幕建案詳情)
========================================= */
#case_modal {
    position: fixed;
    inset: 0; /* top:0, right:0, bottom:0, left:0 */
    background-color: rgba(0, 0, 0, 0.9); /* 深黑背景 */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* 隱藏時不阻擋點擊 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease; /* 背景慢慢浮現 */
    padding: 1.5rem;
}

#case_modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* 內容容器：圖片在上、資訊卡在下，桌機/手機共用同一套堆疊邏輯 */
.modal_content {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--color_ci_3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.85) translateY(20px);
    opacity: 0; /* 內容先隱藏 */
    transition:
        transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.5s ease;
    transition-delay: 0.1s;
}
#case_modal.show .modal_content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 可捲動內容區：包住圖片與資訊卡，關閉鈕留在外層才會固定不跟著捲動 */
.modal_scroll {
    overflow-y: auto;
}

/* 圖片區：只用來承載照片與左上角 logo/案名疊字 */
.modal_media {
    position: relative;
}

/* 關閉按鈕 */
.modal_close_btn {
    position: absolute;
    display: inline-block;
    top: 0;
    right: 0;
    padding: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-weight: lighter;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.modal_media .img_info_header {
    position: absolute;
    z-index: 3;
    left: 10px;
    top: 10px;
    display: flex;
    align-items: center;
}

/* 資訊卡：脫離照片，改為不透明淺色卡片，一般文件流排列 */
.modal_content .img_info_footer {
    padding: 1.25rem 1.5rem 1.5rem;
    color: var(--color_dark);
}

/* 欄位資訊：用 Bootstrap 的 row/col 排版，最後一欄（建築規劃）用 col 自動吃滿剩餘寬度 */
.modal_meta {
    margin-bottom: 1rem;
}
.modal_meta span {
    display: block;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 簡介段落：與欄位資訊分隔，字級與行高加大，方便長文閱讀 */
.modal_desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color_gray);
}

@media (max-width: 767.98px) {
    #case_modal {
        padding: 0;
    }
    .modal_content {
        max-height: 100vh;
        border-radius: 0;
    }
    .modal_content .img_info_footer {
        padding: 1rem 1.25rem 1.25rem;
    }
}
/* ===============================
    表單
=============================== */
form input:not([type='checkbox']),
form select {
    border: none !important;
    padding: 0;
    width: 100%;
    text-align: center;
    text-align-last: center; /* 手機有效 */
    background: none;
    font-weight: lighter;
}
form label {
    white-space: nowrap;
    margin: 0;
    display: inline-block;
    text-align-last: justify;
    text-align: justify;
    width: 6em !important;
}
.form-control:focus {
    background: none;
}
.form_item {
    border-bottom: 1px solid #3f3b3a;
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    position: relative;
}
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
/* ===============================
    Swiper
=============================== */
/* 針對 Swiper 內的所有圖片強制 GPU 渲染 */
.swiper-slide img {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0); /* 騙過瀏覽器，強制啟動 3D 渲染層 */
}
.swiper-button-next,
.swiper-button-prev {
    width: min(50px, 10vw);
    height: 100%;
    background-image: url('images/icon_arrow_right_slim.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}
.swiper-button-next::after,
.swiper-button-prev::after {
    display: none;
}
.swiper-button-prev {
    transform: translateY(-50%) rotate(180deg);
}
.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.75);
}
/* 手機版 */
@media (max-width: 767.98px) {
}
