/* style.css */
/* --- 基礎設定 & 全域變數 --- */
:root {
    --primary-blue: #1A2B4C;   /* 沉穩深藍 */
    --secondary-blue: #111D33; /* 暗藍（頁尾與部分背景） */
    --gold: #B8975E;           /* 高質感金 */
    --light-gold: #F4EFE6;     /* 淺金背景 */
    --text-dark: #333333;      /* 深灰內文 */
    --text-light: #FFFFFF;     /* 白色文字 */
    --bg-light: #F8F9FA;       /* 淺灰網頁背景 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h2.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--gold);
}

section {
    padding: 80px 0;
}

/* --- 1. 導覽列 (Navbar) --- */
header {
    background-color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 1.3rem;
    height: 100%;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-blue);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid var(--gold);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--gold);
}

.btn-consult {
    display: none;
    background-color: var(--gold);
    color: var(--text-light) !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s !important;
}

.btn-consult:hover {
    background-color: #A3824B;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-blue);
    transition: all 0.3s ease;
}

/* --- 2. 大型主視覺 (Hero Section) --- */
.hero {
    background: linear-gradient(rgba(26, 43, 76, 0.75), rgba(26, 43, 76, 0.75)), 
                url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    height: 550px;
    display: flex;
    align-items: center;
    color: var(--text-light);
}

.hero-content {
    max-width: 600px;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #E0E0E0;
}

/* --- 3. 事務所介紹 (About) --- */
.about {
    background-color: var(--text-light);
}

.about-wrapper {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-text h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-text h2 {
    color: var(--primary-blue);
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 20px;
    color: #555;
    text-align: justify;
}

.about-image {
    flex: 1;
    position: relative;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.about-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--gold);
    top: 20px;
    left: -20px;
    z-index: -1;
    border-radius: 4px;
}

/* --- 4. 律師團隊 & 法務介紹 (Team) --- */
.team {
    background-color: var(--bg-light);
}

.lawyer-card {
    background-color: var(--text-light);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    overflow: hidden;
    margin-bottom: 50px;
    border-top: 5px solid var(--gold);
}

.lawyer-img {
    flex: 1;
    max-width: 350px;
    background: #e1e1e1;
}

.lawyer-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lawyer-info {
    flex: 2;
    padding: 40px;
}

.lawyer-info h3 {
    font-size: 1.8rem;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.lawyer-title {
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 25px;
}

.lawyer-details h4 {
    color: var(--primary-blue);
    margin: 15px 0 5px 0;
    font-size: 1.1rem;
}

.lawyer-details ul {
    list-style-position: inside;
    color: #555;
    margin-bottom: 15px;
}

/* 法務區塊（僅姓名與圖片） */
.paralegal-title {
    width: 25%;
    min-width: 180px;
    margin: 40px auto 25px;
    text-align: center;
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.paralegal-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 25px;
}

.paralegal-card {
    flex: 0 0 calc((100% - 75px) / 4);
    max-width: calc((100% - 75px) / 4);
    background-color: var(--text-light);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s;
}

.paralegal-card:hover {
    transform: translateY(-5px);
}

.paralegal-img {
    width: 100%;
    height: 260px;
    background-color: #e1e1e1;
}

.paralegal-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paralegal-card h4 {
    padding: 15px 0;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

/* --- 5. 服務項目 (Services) --- */
.services {
    background-color: var(--text-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--bg-light);
    padding: 40px 30px;
    border-radius: 6px;
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.service-card:hover {
    border-bottom: 3px solid var(--gold);
    background-color: var(--light-gold);
    transform: translateY(-5px);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.service-card h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.service-card p {
    color: #666;
    font-size: 0.95rem;
    text-align: justify;
}

/* --- 6. 營業資訊與聯絡地圖 (Contact) --- */
.contact {
    background-color: var(--secondary-blue);
    color: var(--text-light);
}

.contact h2.section-title {
    color: var(--text-light);
}

/* 警示文字區塊設定 */
.notice-box {
    background-color: rgba(184, 151, 94, 0.15);
    border-left: 4px solid var(--gold);
    padding: 20px;
    margin-bottom: 40px;
    border-radius: 4px;
}

.notice-box p {
    color: #E0E0E0;
    font-size: 1rem;
    line-height: 1.6;
}

.contact-wrapper {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-block {
    margin-bottom: 30px;
}

.info-block h3 {
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.info-block p {
    color: #D1D5DB;
    font-size: 1.1rem;
}

.phone-link-footer {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 700;
}

.contact-map {
    flex: 1;
    height: 350px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--gold);
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Footer 頁尾 --- */
footer {
    background-color: #0B1322;
    color: #778293;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
    border-top: 1px solid #1A2B4C;
}

/* --- 響應式 RWD 行動裝置調整 --- */
@media (max-width: 992px) {
    .about-wrapper, .contact-wrapper {
        flex-direction: column;
    }
    .lawyer-card {
        flex-direction: column;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 680px;
    }
    .lawyer-img {
        max-width: 100%;
        height: 300px;
    }
    .paralegal-title {
        width: 220px;
        min-width: 220px;
        max-width: 90%;
        font-size: 1.3rem;
        margin: 32px auto 20px;
    }
    .paralegal-grid {
        justify-content: center;
    }
    .paralegal-card {
        flex: 0 0 min(280px, 100%);
        max-width: min(280px, 100%);
    }

    /* 手機版漢堡選單結構 */
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 80px;
        right: 0;
        width: 260px;
        height: calc(100vh - 80px);
        background-color: var(--text-light);
        flex-direction: column;
        gap: 0;
        box-shadow: -5px 5px 10px rgba(0,0,0,0.05);
        padding: 20px 0;
        align-items: stretch;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 15px 30px;
        border-bottom: 1px solid #eee;
        color: var(--text-dark) !important;
    }

    .btn-consult {
        display: block;
        margin: 15px 30px;
        text-align: center;
        border-radius: 4px;
        color: var(--text-light) !important;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    .phone-link-footer {
        color: var(--gold);
        text-decoration: underline;
    }
}

/* 律師經歷與著作左右並排佈局 */
.lawyer-meta-grid {
    display: flex;
    gap: 40px;          /* 左右欄位的間距 */
    margin-top: 20px;
    align-items: flex-start; /* 確保標題「經歷」與「著作」齊頭平行 */
}
.lawyer-meta-grid .meta-col {
    flex: 1;            /* 左右兩欄等寬分配 */
    min-width: 0;       /* 防止長文字撐破版面 */
}
/* RDP 手機版自適應：當螢幕太小時，自動彈性切換回上下堆疊，維持手機閱讀體驗 */
@media (max-width: 768px) {
    .lawyer-meta-grid {
        flex-direction: column;
        gap: 20px;
    }
}

/* 專屬導覽列書法 LOGO 樣式控制 */
.navbar-logo {
    height: 60%;          /* 依父元素高度比例縮放 */
    width: auto;          /* 確保等比例縮放，毛筆字絕對不變形 */
    display: block;       /* 清除圖片預設的下方微小間距 */
    max-width: 100%;      /* 確保在極小螢幕的手機上也能自適應縮小 */
    filter: drop-shadow(0px 1px 2px rgba(0,0,0,0.1)); /* 幫招牌字加上一絲絲極輕微的立體陰影，質感更好 */
    align-self: center;   /* 垂直置中 */
}

/* RWD 手機版微調：如果手機畫面上導覽列空間不夠，可以稍微縮小圖片高度 */
@media (max-width: 576px) {
    .navbar-logo {
        height: 60%;      /* 手機版維持父元素 60% */
    }
}