/* style.css - 概念性 CSS */
:root {
    --primary-color: #0A2342; /* 深藍色 - 參考範例 */
    --secondary-color: #B08D57; /* 類似金色的點綴色，可調整 */
    --accent-color: #E0E0E0; /* 淺灰色或米色背景 */
    --text-color-light: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-subtle: #555555;
    --font-family-heading: 'Noto Serif TC', serif;
    --font-family-body: 'Noto Sans TC', sans-serif;
    --container-width: 1100px;
    --spacing-unit: 1rem; /* 8px or 10px base */
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-body);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    color: var(--text-color-dark);
    background-color: #FFFFFF;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--primary-color);
    margin-top: 0;
    line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); } /* 響應式字體 */
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.75rem); }

p {
    margin-bottom: var(--spacing-unit);
    color: var(--text-color-subtle);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover, a:focus {
    color: var(--primary-color);
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: calc(var(--spacing-unit) * 1.5);
    padding-right: calc(var(--spacing-unit) * 1.5);
}

/* 頁首 */
.main-header {
    background-color: var(--text-color-light); /* 或 var(--primary-color) 配淺色 logo/文字 */
    padding: var(--spacing-unit) 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.logo:hover, .logo:focus {
    color: var(--secondary-color);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

.main-nav a {
    color: var(--primary-color);
    font-weight: bold;
    padding: 0.5rem 0;
    position: relative;
}
.main-nav a::after { /* 底線動效 */
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}
.main-nav a:hover::after, .main-nav a:focus::after {
    width: 100%;
}

.nav-toggle { /* 手機版漢堡選單按鈕 */
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.5rem;
}
.hamburger-icon {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    position: relative;
    transition: transform 0.3s ease-out;
}
.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}
.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { bottom: -8px; }

.nav-toggle[aria-expanded="true"] .hamburger-icon {
    transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger-icon::before {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger-icon::after {
    transform: rotate(-90deg) translate(8px);
}


/* Hero Section */
.hero {
    position: relative; /* 為了絕對定位子元素 (video, overlay) */
    overflow: hidden; /* 確保影片不會超出邊界 */
    /* background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('path/to/your/hero-image.jpg'); */
    /* background-size: cover; */
    /* background-position: center; */
    padding: calc(var(--spacing-unit) * 6) 0;
    text-align: center;
    /* background-color: var(--accent-color); /* 可以移除或作為影片載入失敗的備用背景 */
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2; /* 確保在內容和覆蓋層之下 */
    transform: translateX(-50%) translateY(-50%);
    background-size: cover; /* 若影片無法播放，poster圖片的顯示方式 */
    background-position: center center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 35, 66, 0.4); /* 深藍色半透明覆蓋層，可調整顏色和透明度 */
    z-index: -1; /* 在影片之上，在內容之下 */
}

.hero .container {
    position: relative; /* 確保內容在 video 和 overlay 之上 */
    z-index: 1;
}

.hero h1 {
    margin-bottom: var(--spacing-unit);
    color: var(--text-color-light); /* 調整標題顏色以適應深色背景/影片 */
}

.cta-button {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    padding: calc(var(--spacing-unit) * 1.2) calc(var(--spacing-unit) * 3);
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) * 2.5);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color-light); /* 調整段落文字顏色以適應深色背景/影片 */
}

.cta-button:hover, .cta-button:focus {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    transform: translateY(-2px);
}

/* Content Sections */
.content-section {
    padding: calc(var(--spacing-unit) * 4) 0;
}
.content-section.bg-light {
    background-color: var(--accent-color);
}
.content-section h2 {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

/* Specific styling for About Us section */
#about.content-section {
    position: relative; /* For overlay and content positioning */
    overflow: hidden;
    background-image: url('resource/pic1.jpg'); /* 請替換成您的背景圖片路徑 */
    background-size: cover;
    background-position: center;
    color: var(--text-color-light); /* Default text color for this section */
}

.about-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 35, 66, 0.65); /* 深藍色半透明覆蓋層，可調整顏色和透明度 (0.65 = 65% 透明度) */
    z-index: 0; /* 在背景圖之上，內容之下 */
}

#about.content-section .container {
    position: relative; /* Ensure content is above the overlay */
    z-index: 1;
}

#about.content-section h2,
#about.content-section p {
    color: var(--text-color-light); /* Ensure headings and paragraphs are light against the dark overlay/background */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: calc(var(--spacing-unit) * 2.5);
}
.service-item {
    background-color: #fff;
    padding: calc(var(--spacing-unit) * 2);
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.service-item h3 {
    margin-bottom: var(--spacing-unit);
}

/* 頁尾 */
.main-footer {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    text-align: center;
    padding: calc(var(--spacing-unit) * 2.5) 0;
    margin-top: calc(var(--spacing-unit) * 3);
}
.main-footer p {
    margin-bottom: 0;
    color: var(--accent-color);
}

/* 輔助類 */
.sr-only { /* For screen readers only */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* 響應式設計 Media Queries */
@media (max-width: 768px) {
    .main-nav ul {
        position: fixed; /* 或 absolute */
        inset: 0 0 0 30%; /* 從右側滑出效果 */
        flex-direction: column;
        padding: min(20vh, 10rem) 2em;
        background: hsl(0 0% 100% / 0.9); /* 半透明背景 */
        backdrop-filter: blur(1rem);
        transform: translateX(100%);
        transition: transform 350ms ease-out;
        gap: calc(var(--spacing-unit) * 2.5);
    }

    .main-nav ul[data-visible="true"] {
        transform: translateX(0%);
    }
    
    .nav-toggle {
        display: block;
        z-index: 9999; /* 確保在導航之上 */
    }

    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 1rem;
    }
}
