/* === HOMEPAGE SPECIFIC STYLES === */

/* --- 1. 首頁 Body 布局重置 --- */
body.home-page {
    display: block;
    height: auto;
    overflow: visible;
}

body.menu-open {
    overflow: hidden;
}

/* --- 2. 首頁導覽列 (Site Header) --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background-color: var(--surface-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 500;
    position: relative;
    padding: 10px 0;
    text-decoration: none;
    transition: color 0.3s;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* 手機版遮罩 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 80px);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* --- 3. 全螢幕主視覺 (Hero Immersive) --- */
.hero-immersive {
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px;
    box-sizing: border-box;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('https://images.unsplash.com/photo-1543351368-0414336065e9?q=80&w=2070&auto-format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-immersive h1 {
    font-size: 3.8em;
    color: #fff;
    margin-bottom: 20px;
}

.hero-immersive p {
    font-size: 1.2em;
    color: #f0f0f0;
    max-width: 700px;
    margin: 0 auto 40px;
}

.hero-immersive .btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.hero-immersive .btn:hover {
    background-color: var(--primary-color-hover);
    transform: scale(1.05);
}

/* --- 4. 內容區塊與卡片 (Sections & Cards) --- */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 50px;
    color: var(--text-primary);
}

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

.card {
    display: flex;
    flex-direction: column;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 220px;
    background-color: var(--bg-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-image img {
    --img-scale: 0.9;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
    box-sizing: border-box;
    transform: scale(var(--img-scale, 0.9));
    transition: transform 0.4s ease;
}

.card:hover .card-image img {
    transform: scale(calc(var(--img-scale, 0.9) * 1.05)) !important;
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.card-link-text {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: auto;
    transition: color 0.3s, transform 0.3s;
}

.card:hover .card-link-text {
    color: var(--primary-color-hover);
    transform: translateX(4px);
}

/* --- 5. 骨架屏載入動畫 (Skeleton Shimmer) --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.card-skeleton {
    height: 340px;
    background: linear-gradient(90deg, var(--surface-color) 25%, var(--border-color) 50%, var(--surface-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    pointer-events: none;
}

/* --- 6. 首頁頁尾 (Footer) --- */
.footer {
    background-color: var(--surface-color);
    color: var(--text-primary);
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
}

.footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.footer-about,
.footer-contact {
    flex: 1;
    min-width: 280px;
}

.footer h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.footer p,
.footer ul li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    color: var(--text-secondary);
}

/* --- 7. 首頁響應式設計 --- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 1.5rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transform: translateY(-8px);
        transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease, padding 0.3s ease, visibility 0.3s;
        z-index: 95;
    }

    .site-header.nav-open .nav-links {
        max-height: 280px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        padding: 0.5rem 1.5rem 1.25rem 1.5rem;
        pointer-events: auto;
    }

    .nav-links a {
        padding: 0.85rem 0;
        font-size: 1.1em;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a::after {
        display: none;
    }

    .hero-immersive {
        background-attachment: scroll; /* 手機端避免 fixed 背景卡頓 */
    }

    .hero-immersive h1 {
        font-size: 2.5em;
    }

    .hero-immersive p {
        font-size: 1em;
    }

    .section-title {
        font-size: 2em;
    }
}
