﻿/* 通用設定 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #fff;
}

/* 導覽列 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-weight: bold;
    font-size: 20px;
}

nav {
    position: relative;
}

    nav ul {
        display: flex;
        list-style: none;
        padding: 0 40px 0 0;
        margin: 0;
        align-items: center;
    }

        nav ul li {
            margin-left: 20px;
        }

            nav ul li a {
                text-decoration: none;
                color: #333;
            }

                nav ul li a.active {
                    color: #007bff;
                    font-weight: bold;
                }

/* menu icon */
.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* 語言切換樣式 (內嵌於選單中) */
.lang-switch {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

    .lang-switch a {
        display: inline-block;
        background-color: #499fb7;
        color: white;
        font-weight: bold;
        text-decoration: none;
        padding: 6px 12px;
        border-radius: 50px;
        font-size: 14px;
        transition: background-color 0.3s;
    }

        .lang-switch a:hover {
            background-color: #347a8f;
        }

        .lang-switch a.active {
            background-color: #225c70;
        }

.lang-text::after {
    content: "";
}

/* Hero 區塊 */
.hero {
    background: #f0f5fd;
    padding: 40px 20px;
}

.hero-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    width: 100%;
    max-width: 1400px;
}

.hero-text {
    flex: 1 1 55%;
    padding: 10px;
}

    .hero-text h1 {
        font-size: 28px;
        font-weight: 600;
        margin-bottom: 20px;
        color: #2c3e50;
    }

    .hero-text h2 {
        font-size: 22px;
        font-weight: 500;
        margin-bottom: 20px;
        color: #2c3e50;
    }

    .hero-text p {
        font-size: 16px;
        font-weight: 400;
        line-height: 1.8;
        color: #555;
    }

.hero-img {
    flex: 1 1 45%;
    padding: 10px;
}

    .hero-img img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        display: block;
        margin: 0;
        padding: 0;
    }

/* 課程區塊 */
.course {
    display: flex;
    flex-wrap: wrap;
    padding: 40px 20px;
    gap: 20px;
    align-items: flex-start;
}

.course-img, .course-text {
    flex: 1 1 300px;
}

    .course-img img {
        max-width: 100%;
        border-radius: 8px;
    }

    .course-text h2 {
        font-size: 24px;
        margin-bottom: 15px;
        color: #2c3e50;
    }

    .course-text p {
        font-size: 16px;
        color: #555;
        line-height: 1.8;
    }

/* 新聞區塊 */
.news {
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
}

    .news h2 {
        font-size: 24px;
        margin-bottom: 20px;
        color: #2c3e50;
    }

.news-item {
    display: flex;
    justify-content: center;
}

    .news-item iframe.movie {
        width: 100%;
        max-width: 720px;
        height: 405px;
        border-radius: 8px;
        border: none;
    }

/* 聯絡區塊 */
.contact {
    padding: 40px 20px;
    text-align: center;
    background-color: #e9eff6;
}

    .contact h2 {
        font-size: 24px;
        margin-bottom: 10px;
        color: #2c3e50;
    }

    .contact p {
        max-width: 600px;
        margin: 0 auto 20px;
        font-size: 16px;
        color: #555;
    }

    .contact button {
        background-color: #007bff;
        color: white;
        border: none;
        padding: 12px 30px;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

        .contact button:hover {
            background-color: #0056b3;
        }

/* 影片區塊 */
.video-section {
    background-color: #f7f9fc;
    padding: 40px 20px;
}

.video-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
}

.video-box {
    flex: 1 1 45%;
    max-width: 600px;
    text-align: center;
}

    .video-box h2 {
        margin-bottom: 16px;
        font-size: 20px;
        color: #223a5e;
    }

    .video-box iframe {
        width: 100%;
        height: 315px;
        border-radius: 8px;
        border: none;
    }

/* Major Events 內頁樣式 */
.hero-banner img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 0;
    display: block;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin: 0px 0 10px 0;
    width: 80%;
    margin: auto;
}

    .section-title h1 {
        font-size: 36px;
        font-weight: 500;
        color: #222;
        border-bottom: 2px solid #000;
        display: inline-block;
        padding-top: 10px;
    }

.events-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 60px;
    padding: 20px 60px;
    margin-top: 20px;
}

    .events-grid a {
        flex: 1 1 calc(30% - 40px);
        text-decoration: none;
        display: block;
        color:#000;
    }

.event-card {
    max-width: 100%;
    text-align: left;
    padding: 0 10px;
}

.event-img {
    position: relative;
}

    .event-img img {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        border-radius: 8px;
        display: block;
    }

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #0c72ba;
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: bold;
}

.event-card p, .event-view p {
    margin-top: 10px;
    font-size: 1.2em;
    color: #222;
    line-height: 1.5;
}

.event-view {
    max-width: 80%;
    text-align: left;
    margin: auto;
}

    .event-view img {
        max-width: 80%;
        height: auto;
        margin:auto;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        border-radius: 8px;
        display: block;
    }

.event-img iframe {
    width: 100%;
    height: 315px;
    border: none;
    border-radius: 8px;
}

.video-card {
    flex: 1 1 calc(30% - 40px);
    max-width: calc(30% - 40px);
}


.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 若影片來源是 16:9 改成 56.25% */
    overflow: hidden;
    border-radius: 8px;
    background-color: #000;
}

    .video-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
    }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Arial', sans-serif;
    color: #333;
    line-height: 1.8;
}

.event-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.title-line {
    height: 3px;
    background-color: #007bff;
    border: none;
    width: 100%;
    margin-bottom: 30px;
}

.event-video {
    text-align: center;
    margin-bottom: 30px;
}

.event-description p {
    font-size: 16px;
    text-align: justify;
    margin-bottom: 20px;
}


/* 活動照片樣式 */
.event-photo {
    text-align: center;
    margin-bottom: 30px;
}

.photo-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}


.site-footer {
    background-color: #1a213d;
    color: #fff;
    padding: 40px 20px 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    font-size: 14px;
}

    .site-footer a {
        color: #ccc;
        text-decoration: none;
    }

    .site-footer h1 {
        font-size: 16px;
        margin-bottom: 10px;
        color: #fff;
    }

    .site-footer p {
        margin: 4px 0;
    }

.f_logo, .info, .sitemap, .qrcode {
    flex: 1 1 200px;
    margin-bottom: 20px;
}

    .qrcode img {
        width: 120px;
        height: auto;
    }

.clear {
    clear: both;
}

.copyrights {
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 12px 0;
    border-top: 1px solid #444;
    margin-top: 20px;
    color: #aaa;
}

.carousel-section {
    background-color: #ffffff;
    padding: 40px 20px;
    text-align: center;
}

.carousel-wrapper {
    position: relative;
    max-width: 800px;
    height: 600px;
    margin: 0 auto;
}

.carousel-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 左右按鈕 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 36px;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}

.carousel-btn.left {
    left: 10px;
}

.carousel-btn.right {
    right: 10px;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.manual-carousel-section {
    background-color: #e9eff6;
    padding: 40px 20px;
    text-align: center;
}

.manual-carousel-wrapper {
    position: relative;
    max-width: 900px;
    height: 675px;
    margin: 0 auto;
}

    .manual-carousel-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

.manual-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}


    .manual-carousel-btn.left {
        left: 10px;
    }

    .manual-carousel-btn.right {
        right: 10px;
    }

    .manual-carousel-btn:hover {
        background-color: rgba(0, 0, 0, 0.8);
    }



/* 響應式設定（手機版） */
@media (max-width: 768px) {
    .logo img {
            width: 60%;
        }
    .section-title {
        width: 90%;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 20px;
        z-index: 999;
        overflow-y: auto;
    }

        .nav-links.active {
            display: flex;
        }

        .nav-links li {
            margin: 0;
            padding: 15px 0;
            border-bottom: 1px solid #eee;
            width: 100%;
        }

            .nav-links li a {
                width: 100%;
                display: block;
                font-size: 20px; /* 字變大 */
            }

    .menu-toggle {
        display: block;
    }

    .lang-switch {
        flex-direction: column;
        gap: 4px;
        margin-top: 16px;
        width: 100%;
    }

        .lang-switch a {
            text-align: center;
            width: 100%;
            font-size: 18px; /* 語言字變大 */
            border-radius: 0;
            padding: 10px;
        }

    .lang-text::after {
        content: attr(data-mobile);
    }

    .lang-text {
        font-size: 16px;
        font-weight: normal;
    }

    .hero-container {
        flex-direction: column;
    }

    .hero-text, .hero-img {
        max-width: 100%;
    }

    .hero-img {
        margin-top: 20px;
        text-align: center;
    }

        .hero-img img {
            max-width: 90%;
            height: auto;
        }

    .hero-text, .hero-img,
    .course-img, .course-text {
        max-width: 100%;
    }

    .news-item iframe.movie {
        height: 200px;
    }

    .video-box {
        flex: 1 1 100%;
    }

    /* 改變語言按鈕為文字 */
    .lang-text::after {
        content: attr(data-mobile);
    }

    .lang-text {
        font-size: 18px;
        font-weight: normal;
    }

    .lang-switch a {
        background-color: transparent;
        color: #333;
        border-radius: 0;
        padding: 10px;
    }

    .section-title h1 {
        font-size: 28px;
    }

    .events-grid {
        flex-direction: column;
        align-items: center;
        padding: 0 30px;
    }

    .event-card {
        max-width: 100%;
    }
    .event-view{
        max-width: 100%;
    }
}

.manual-carousel-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* 保持 900x675 的比例 */
}

    .manual-carousel-wrapper img {
        width: 100%;
        height: auto;
        object-fit: contain; /* 避免被裁切 */
    }
