@charset "UTF-8";

/* --- 1. 全局基礎設定 --- */
body { 
    margin: 0; padding: 0; 
    font-family: "Microsoft JhengHei", sans-serif; 
    color: #333; 
    line-height: 1.8; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
    overflow-x: hidden; 
}
html { overflow-x: hidden; } 

a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* 品牌變數 */
:root { --primary-color: #a68b6d; --text-dark: #333; --text-light: #888; --bg-light: rgba(255, 255, 255, 0.95); --padding-top-safe: 150px; }

/* --- 2. 導覽列 --- */
nav { 
    background: var(--bg-light); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 50px; 
    position: fixed; 
    width: 100%; 
    top: 0; left: 0; 
    z-index: 1000; 
    border-bottom: 1px solid #f0f0f0; 
    height: 100px; 
    box-sizing: border-box; 
}
.logo-img { height: 70px !important; width: auto; display: block; }

.hamburger { display: none; font-size: 1.5rem; cursor: pointer; color: var(--text-dark); padding: 10px; z-index: 1002; }

/* 電腦版選單 */
.menu { display: flex; align-items: center; }
.menu a { color: var(--text-dark); margin-left: 30px; font-size: 1rem; font-weight: 500; letter-spacing: 1px; }
.menu a:hover, .menu a.active, .dropdown:hover .dropbtn { color: var(--primary-color); }

/* --- 3. 下拉選單 (電腦版) --- */
.dropdown { position: relative; display: inline-block; margin-left: 30px; }
.dropbtn { padding-bottom: 10px; cursor: pointer; }
.dropdown-content { display: none; position: absolute; background-color: var(--bg-light); min-width: 140px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 1001; top: 100%; left: 50%; transform: translateX(-50%); border-top: 2px solid var(--primary-color); padding: 5px 0; }
.dropdown-content a { color: #555; padding: 12px 15px; display: block; font-size: 0.9rem; text-align: center; white-space: nowrap; margin-left: 0; }
.dropdown-content a:hover { background-color: #f9f9f9; color: var(--primary-color); }
.dropdown:hover .dropdown-content { display: block; }

/* --- 4. 內容容器 --- */
.container, .case-container, .article-container { 
    padding-top: var(--padding-top-safe) !important; 
    padding-bottom: 80px; 
    padding-left: 20px;  /* ★ 新增：左右安全距離，避免手機版文字貼齊邊緣 */
    padding-right: 20px; /* ★ 新增：左右安全距離，避免手機版文字貼齊邊緣 */
    box-sizing: border-box; 
    width: 100%; 
    flex: 1; 
}
body:has(.hero-slider) .container { padding-top: 0 !important; }

/* --- 5. 內頁排版 --- */
.page-title h1, .page-title p { text-align: center !important; }
.case-container * { text-align: center !important; } 
.case-container { max-width: 1000px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.case-title { font-size: 2.2rem; margin-bottom: 15px; font-weight: 400; color: #222; letter-spacing: 2px; }
.case-tags { justify-content: center !important; display: flex; margin-bottom: 40px; color: var(--text-light); }

.case-details-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 40px 20px; margin-bottom: 60px; background: #fdfdfd; border: 1px solid #eee; justify-items: center !important; text-align: center !important; }
.detail-item { display: flex; flex-direction: column; align-items: center !important; justify-content: center; }
.detail-item h4 { font-size: 0.8rem; color: #aaa; margin-bottom: 8px; font-weight: 400; text-transform: uppercase; }
.detail-item p { font-size: 1.05rem; color: var(--text-dark); font-weight: 500; margin: 0; }
.detail-full { grid-column: 1 / -1; border-top: 1px solid #f0f0f0; padding-top: 20px; margin-top: 10px; width: 80%; margin-left: auto; margin-right: auto; }

.case-desc { text-align: center !important; max-width: 700px; margin: 0 auto 60px auto !important; line-height: 2.2; color: #555; font-size: 1rem; }

.back-btn, .btn { display: inline-block; padding: 12px 40px; border: 1px solid var(--text-dark); color: var(--text-dark); transition: 0.3s; font-size: 0.9rem; margin-top: 30px; background: transparent; }
.back-btn:hover, .btn:hover { background: var(--text-dark); color: #fff; }

/* --- 6. 頁尾 (精緻版) --- */
.site-footer { 
    background: var(--bg-light); 
    border-top: 1px solid #f0f0f0; 
    padding: 32px 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    margin-top: auto; 
    width: 100%;
    box-sizing: border-box;
}
.social-icons { margin-bottom: 16px; }
.social-icons a { color: #aaa; font-size: 1.1rem; margin: 0 12px; transition: 0.3s; }
.social-icons a:hover { color: var(--primary-color); }

/* footer 五行統一樣式 */
.footer-address,
.footer-meta,
.footer-year,
.copyright {
    font-size: 0.68rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: #bbb;
    text-align: center;
    display: block;
    margin-top: 5px;
    line-height: 1.9;
}
.footer-address {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-top: 0;
}
.footer-address span {
    font-size: 0.68rem;
    color: #bbb;
    letter-spacing: 1px;
    line-height: 1.9;
}

/* --- 7. RWD & 手機版選單邏輯 (修正版) --- */
@media (max-width: 768px) {
    nav { padding: 10px 20px; height: 80px; } 
    .logo-img { height: 60px !important; } 
    .container, .case-container, .article-container { padding-top: 100px !important; } 
    .case-details-grid { grid-template-columns: repeat(2, 1fr); }
    .hamburger { display: block; }

    /* 全螢幕選單容器 */
    .menu {
        position: fixed; top: 0; left: 0; 
        width: 100%; height: 100vh;
        background: #fff; 
        flex-direction: column; 
        justify-content: center; /* 垂直置中 */
        align-items: center;     /* 水平置中 */
        padding-top: 0;
        transform: translateX(100%); 
        transition: transform 0.4s ease; 
        border-top: none;
        z-index: 1001; 
    }
    .menu.mobile-active { transform: translateX(0); }
    
    /* 選單項目樣式：強制置中 */
    .menu a, .dropbtn { 
        margin: 0;
        padding: 15px 0;
        font-size: 1.2rem; 
        text-align: center; 
        display: flex;       /* 使用 Flex */
        justify-content: center; /* 內容水平置中 */
        align-items: center; /* 內容垂直置中 */
        width: 100%; 
        border-bottom: 1px solid #f5f5f5; /* 淡灰色分隔線 */
    }
    
    /* ★ 手機版 dropdown 設定 ★ */
    .dropdown { 
        margin: 0; 
        width: 100%; 
        text-align: center; 
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* 下拉按鈕：箭頭微調 */
    .dropbtn { 
        cursor: pointer;
        color: #333 !important;
        font-weight: 700; 
        letter-spacing: 2px;
        background: transparent;
        border: none;
        width: 100%;
    }
    
    /* 箭頭圖示 (預設顯示) */
    .dropbtn i { 
        display: inline-block !important; 
        margin-left: 10px;
        font-size: 0.8em;
        transition: transform 0.3s;
    }

    /* ★ 關鍵修正：預設隱藏子選單 (拿掉原本的 !important block) ★ */
    .dropdown-content { 
        display: none; /* 預設關閉 */
        width: 100%;
        background: #fafafa; /* 淺灰背景區隔 */
        position: static; 
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); 
        padding: 0; 
        transform: none; 
        border-top: none;
    }

    /* ★ JS 控制：當加上 .mobile-open 時才顯示 ★ */
    .dropdown.mobile-open .dropdown-content { 
        display: block !important;
        animation: slideDown 0.3s ease;
    }

    /* JS 控制：當打開時，箭頭旋轉 */
    .dropdown.mobile-open .dropbtn i {
        transform: rotate(180deg);
    }

    /* 子選單連結樣式 */
    .dropdown-content a { 
        padding: 12px 0; 
        color: #666; 
        font-size: 1rem; 
        font-weight: 400;
        border-bottom: 1px dashed #eee;
    }
    .dropdown-content a:last-child { border-bottom: none; }
    .dropdown-content a:active { color: var(--primary-color); background: #f0f0f0; }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-5px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .blog-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 500px) { 
    .case-details-grid { grid-template-columns: 1fr; } 
    .detail-full { border-top: none; } 
}

/* --- 8. 其他元件樣式 --- */
.comp-container { position: relative; width: 100%; max-width: 1000px; margin: 0 auto 50px auto; overflow: hidden; line-height: 0; cursor: col-resize; user-select: none; }
.img-after { display: block; width: 100%; height: auto; }
.img-before { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; border-right: 3px solid #fff; box-shadow: 2px 0 10px rgba(0,0,0,0.3); z-index: 2; will-change: width; }
.img-before img { width: auto !important; height: 100% !important; max-width: none !important; display: block; }
.comp-label { position: absolute; top: 20px; padding: 6px 12px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.85rem; border-radius: 4px; pointer-events: none; z-index: 3; }
.label-before { left: 20px; } .label-after { right: 20px; }

.lightbox-overlay { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.lightbox-overlay.show { display: flex; opacity: 1; }
.lightbox-content { position: relative; width: 90%; max-width: 960px; background: #000; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.lightbox-close-btn { position: absolute; top: -45px; right: 0; color: #fff; font-size: 35px; font-weight: 300; cursor: pointer; transition: 0.2s; line-height: 1; }
.lightbox-close-btn:hover { color: var(--primary-color); transform: scale(1.1); }

/* --- 9. 作品列表與內頁圖片排版 --- */
.gallery-grid {
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px;
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 50px 30px; 
}

.gallery-item, .project-card {
    display: block; 
    text-align: left; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px; 
}

.gallery-item:hover, .project-card:hover {
    transform: translateY(-10px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.gallery-item:hover h3, .project-card:hover h3 {
    color: var(--primary-color);
}

.gallery-item .img-box, .project-card .project-img {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    aspect-ratio: 4 / 3; 
    position: relative;
    background: #f0f0f0; 
}

.gallery-item img, .project-card img {
    width: 100%;
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.6s ease;
}

.gallery-item:hover img, .project-card:hover img {
    transform: scale(1.1);
}

.gallery-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #222;
    transition: 0.3s;
}

.card-cat {
    font-size: 0.9rem;
    color: #999;
    margin: 0 0 12px 0;
    font-weight: 400;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; 
}

.card-tags span {
    display: inline-block;
    background-color: #f4f4f4; 
    color: #666;              
    padding: 4px 10px;        
    border-radius: 4px;       
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: 0.2s;
}
.card-tags span:hover {
    background-color: #e0e0e0; 
}

/* RWD 回應式 */
@media (max-width: 1024px) { 
    .gallery-grid { grid-template-columns: repeat(2, 1fr); } 
}
@media (max-width: 768px) { 
    .gallery-grid { grid-template-columns: 1fr; } 
    .gallery-item, .project-card { margin-bottom: 20px; }
}

/* --- 10. 預約丈量頁面 (Booking Page) --- */

.booking-card {
    max-width: 500px;
    margin: 0 auto 60px auto; 
    background: #fff;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); 
    text-align: center;
    border: 1px solid #f9f9f9;
}

.booking-header h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 500;
    letter-spacing: 2px;
}
.booking-header p {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
}

.booking-divider {
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 30px auto;
}

.booking-info {
    list-style: none;
    padding: 0;
    margin-bottom: 40px;
    text-align: left; 
    display: inline-block; 
}
.booking-info li {
    margin-bottom: 15px;
    color: #555;
    font-size: 1rem;
    display: flex;
    align-items: center;
}
.booking-info li i {
    color: var(--primary-color);
    width: 25px; 
    text-align: center;
    margin-right: 10px;
}

.qr-box {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px auto;
    border: 1px solid #eee;
    padding: 10px; 
    border-radius: 8px;
}
.qr-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scan-hint {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.line-btn {
    display: block;
    width: 100%;
    padding: 15px 0;
    background-color: #06c755; 
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px; 
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(6, 199, 85, 0.3); 
    letter-spacing: 1px;
}
.line-btn:hover {
    background-color: #05b54d; 
    transform: translateY(-3px); 
    color: #fff;
}
.line-btn i {
    margin-right: 8px;
    font-size: 1.3rem;
}

@media (max-width: 500px) {
    .booking-card {
        padding: 40px 25px;
        box-shadow: none; 
        border: none;
    }
    .booking-header h3 { font-size: 1.5rem; }
}

/* --- 11. 部落格圖片修正 --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s;
}
.blog-card:hover { transform: translateY(-5px); }

.blog-card .blog-img {
    width: 100%;
    aspect-ratio: 4 / 3; 
    overflow: hidden;
    background: #f0f0f0;
}

.blog-card .blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.5s ease;
}
.blog-card:hover .blog-img img { transform: scale(1.05); }

/* 手機版 RWD */
@media (max-width: 900px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
}

/* --- 12. 全站懸浮 LINE 按鈕 --- */
.float-line-btn {
    position: fixed;
    bottom: 30px;      
    right: 25px;       
    width: 60px;
    height: 60px;
    background-color: #06c755; 
    color: #fff;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 9999;     
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;   
    transition: transform 0.3s;
    text-decoration: none;
    animation: pulse-green 2s infinite;
}

.float-line-btn:hover {
    transform: scale(1.1); 
    color: #fff;
}

.float-line-btn i {
    margin-top: 2px; 
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(6, 199, 85, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(6, 199, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(6, 199, 85, 0); }
}

@media (max-width: 768px) {
    .float-line-btn {
        width: 55px;
        height: 55px;
        font-size: 28px;
        bottom: 20px;
        right: 20px;
    }
}