@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 1.3rem;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #00738B;
    line-height: 1.5;
    overflow-x: hidden;
}


#index_main {
    background-color: #f1f1f1;
    padding: 0;
    line-height: 1.8;
    min-height: 90vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* section共用 */

section {
    padding: 100px 80px 80px;
    min-height: auto;
    border-bottom: 1px solid rgba(26, 26, 46, 0.08);
    position: relative;
}

@media screen and (max-width: 768px) {
    section {
    padding: 50px 20px 20px;
}

    /* 標題字級在手機上用 3.5vw 換算出來過大（html 根字級被放大過），
       導致每個中文字自己擠成一行，這裡改回合理的手機字級 */
    section .section-header {
        gap: 16px;
        margin-bottom: 32px;
    }

    section .section-header img {
        height: 64px;
    }

    section .section-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
}

section:nth-child(even) {
    background: #FFF9F0;
}

section:nth-child(odd) {
    background: #F7EAD9;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 52px;
}

.section-header img {
    width: auto;
    height: 120px;
}

.section-title-en {
    font-size: 0.6rem;
    color:#F46700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.section-title {
    font-family: 'Noto Serif TC', serif;
    font-size: clamp(3rem, 3.5vw, 4rem);
    font-weight: 700;
    color: #00738B;
    line-height: 1.5;
    letter-spacing: 0.06em;
}

.section-rule {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #FFCA4F 0%, #A3D009 100%);
    margin-top: 16px;
}

/* SIDE NAV  */
#side-nav {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 200px;
    padding: 28px 0;
    background: #00738B;
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(184, 116, 42, 0.35);
    box-shadow: 4px 0 40px rgba(42, 36, 32, 0.4);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#side-nav.hidden {
    transform: translateY(-50%) translateX(-200px);
}

#side-nav .nav-logo {
    text-align: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(249, 251, 211, 0.2);
    margin-bottom: 12px;
}

#side-nav .nav-logo .nav-title-cn {
    font-family: 'Noto Serif TC', serif;
    font-size: 0.8rem;
    color: #F5EAB7;
    letter-spacing: 0.05em;
    line-height: 1.8;
    font-weight: 500;
}

#side-nav .nav-logo .nav-subtitle {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.12em;
    margin-top: 3px;
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
}

#side-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    text-decoration: none;
}

#side-nav .nav-item:hover {
    background: rgba(249, 251, 211, 0.1);
    border-left-color: rgba(249, 251, 211, 0.5);
}

#side-nav .nav-item.active {
    background: rgba(249, 251, 211, 0.15);
    border-left-color: #F46700;
}

/* #side-nav .nav-item .nav-num {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: rgba(249, 251, 211, 0.6);
    min-width: 18px;
} */

#side-nav .nav-item.active .nav-num {
    color: #F5EAB7;
}

#side-nav .nav-item span:first-child img {
    width: 24px;
    height: 24px;
}

#side-nav .nav-item .nav-label {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.02em;
    font-weight: 400;
    font-family: 'Noto Sans TC', sans-serif;
}

#side-nav .nav-item.active .nav-label {
    color: #fff;
    font-weight: 500;
}

#side-nav .nav-divider {
    height: 1px;
    background: rgba(249, 251, 211, 0.15);
    margin: 8px 20px;
}

#side-nav .nav-cta-group {
    padding: 14px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(249, 251, 211, 0.2);
    margin-top: 10px;
}

/* #side-nav .nav-btn {
    display: block;
    text-align: center;
    padding: 9px 12px;
    font-size: 0.8rem;
    font-family: 'Noto Sans TC', sans-serif;
    letter-spacing: 0.08em;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
} */

/* #side-nav .nav-btn-primary {
    background: #F46700;
    color: #fff;
    border: none;
}

#side-nav .nav-btn-primary:hover {
    background: #EE8841;
    color: #000;
} */

#side-nav .nav-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

#side-nav .nav-btn-secondary:hover {
    border-color: #F46700;
    color: #F5EAB7;
}

#nav-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
    width: 36px;
    height: 80px;
    background: #F46700;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.3s ease, background 0.2s ease;
    box-shadow: 3px 0 16px rgba(0, 115, 139, 0.9);
}

#nav-toggle:hover {
    background: #FFCA4F;
    width: 40px;
}

#nav-toggle.nav-open {
    left: 200px;
    width: 28px;
    background: rgba(255, 202, 79, 0.9);
    box-shadow: 2px 0 8px rgba(0, 115, 139, 0.2);
}

#nav-toggle.nav-open:hover {
    background: rgba(255, 202, 79, 1);
    /* #003f62 */
    width: 28px;
}

#nav-toggle svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

#nav-toggle.nav-open svg {
    transform: rotate(180deg);
}

.toggle-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: #fff;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0.9;
    transform: rotate(180deg);
    transition: opacity 0.2s ease;
}

#nav-toggle.nav-open .toggle-label {
    display: none;
}

/* main content offset */
#main-content {
    margin-left: 0;
    transition: margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#main-content.nav-hidden {
    margin-left: 0;
}

#main-content.nav-open {
    margin-left: 200px;
}

/* 手機版選單遮罩（點擊可關閉選單） */
#nav-backdrop {
    display: none;
}

/* 手機版：漢堡選單改為覆蓋式抽屜，不推擠內容 */
@media screen and (max-width: 768px) {
    .hero-guide-btn {
        display: none;
    }

    body.nav-scroll-lock {
        overflow: hidden;
    }

    #side-nav {
        top: 0;
        width: 78vw;
        max-width: 300px;
        height: 100vh;
        height: 100dvh;
        padding: 24px 0;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        transform: translateX(-100%);
    }

    #side-nav.hidden {
        transform: translateX(-100%);
    }

    #side-nav:not(.hidden) {
        transform: translateX(0);
    }

    #nav-toggle {
        top: 24px;
        transform: none;
    }

    #nav-toggle.nav-open {
        left: 0;
    }

    #main-content.nav-open {
        margin-left: 0;
    }

    #nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 20, 20, 0.55);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #nav-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }
}


/* back-top */
.back-top {
    display: inline-block;
    height: 50px;
    width: 50px;
    position: fixed;
    bottom: 80px;
    right: 5px;
    overflow: hidden;
    /* text-indent: 100%; */
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    -webkit-transition: opacity .3s 0s, visibility 0s .3s;
    -moz-transition: opacity .3s 0s, visibility 0s .3s;
    transition: opacity .3s 0s, visibility 0s .3s;
    z-index: 10;
    background-color: rgba(0, 63, 98, 1);
    border-radius: 30px;
}

.back-top svg {
    margin: 11px 12px 12px 14px;
}

.back-top.back-is-visible,
.back-top.back-fade-out,
.back-top:hover {
    -webkit-transition: opacity .3s 0s, visibility 0s 0s;
    -moz-transition: opacity .3s 0s, visibility 0s 0s;
    transition: opacity .3s 0s, visibility 0s 0s;
}

.back-top.back-is-visible {
    visibility: visible;
    opacity: 1;
}

.back-top.back-fade-out {
    opacity: .5;
}

.back-top:hover {
    opacity: 1;
}

@media screen and (min-width: 768px) {
    .back-top {
        right: 20px;
        bottom: 90px;
    }
}

@media screen and (min-width: 1024px) {
    .back-top {
        height: 50px;
        width: 50px;
        right: 30px;
        bottom: 90px;
    }
}

/* 簡易回到頂端按鈕 */
.back-to-top-btn {
    position: fixed;
    right: 24px;
    bottom: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #F46700;
    border: 2px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 90;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease;
}

.back-to-top-btn:hover {
    background: #FFCA4F;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media screen and (max-width: 768px) {
    .back-to-top-btn {
        right: 16px;
        bottom: 16px;
        width: 38px;
        height: 38px;
    }
}

/* btn */

.bg-lgreen {
    background: rgba(70, 28, 42, 1) !important;
}

.btn {
    border-radius: 2px;
    padding: 16px 2px;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
}

.btn-check:checked+.btn,
:not(.btn-check)+.btn:active,
.btn:first-child:active,
.btn.active,
.btn.show,
.btn-primary:not(:disabled):not(.disabled):active {
    color: #fff;
    background-color: #F46700;
    border-color: #F46700;
}

.btn-primary {
    background: #F46700;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transition: background-color 1s ease-out;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #EE8841;
    color: #000;
    border-color: #EE8841;
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: #EE8841;
    --bs-btn-active-bg: $custom-orange-300;
    transition: background-color 0.1s ease-in;
}

.btn-primary:active {
    background: #EE8841;
    color: #fff;
    border-color: #EE8841;
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background-color 1s ease-out;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #EE8841;
    color: #fff;
    border: 1px solid #F46700;
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: #F46700;
    --bs-btn-active-bg: #F46700;
    transition: background-color 0.1s ease-in;
}

.btn-secondary:active {
    background: #EE8841;
    color: #fff;
    border: 1px solid #F46700;
}

footer {
    background-color: #00738B;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 80px !important;
    /* 預留空間給固定在右下角的回到頂端按鈕，避免遮住頁尾文字。footer 本身有 Bootstrap 的 .py-3 class，會用 !important 蓋掉一般寫法，這裡也要加 !important 才蓋得過 */
}

.footer_logo {
    max-height: 45px;
    width: auto;
    margin-left: 15px;
}

.footer_copyright {
    font-size: 0.7rem;
    color: #eeeeee;
    margin-top: 0.5rem;
}

.footer_nav {
    justify-content: end;
}

@media (max-width: 768px) {
    footer {
        flex-direction: column;
    }

    .footer_logo {
        margin-left: 0px;
    }

    .footer_nav {
        justify-content: center;
        margin-top: 1.5rem;
        padding: 0;
    }

    .footer_nav .nav-item {
        font-size: 0.8rem;
        letter-spacing: normal;
    }
}
