/* ===== courses.css — 記憶之河課程頁面 ===== */


/* 關掉 scroll-snap */
html:has(.courses-page) {
    scroll-snap-type: none;
}

/* 頁面淡入 */
.upcoming-courses,
.all-courses {
    animation: pageFadeIn 0.5s ease forwards;
}

/* ===== 全域最大寬度 ===== */
.upcoming-courses__list {
    max-width: 1440px;
    margin: 0 auto;
}

/* ===== Section 1：近期課程 ===== */
.upcoming-courses {
    padding: 120px 10% 80px;
    box-sizing: border-box;
    height: auto;
}

.upcoming-course-item {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    padding: 3rem 0;
    border-top: 1px solid rgba(197, 160, 89, 0.3);
}

.upcoming-course-item__meta {
    flex-shrink: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.upcoming-course-item__date {
    font-size: 1.2rem;
    color: var(--faint-gold);
    letter-spacing: 0.1em;
}

.upcoming-course-item__time,
.upcoming-course-item__location {
    font-size: 1.2rem;
    opacity: 0.6;
    letter-spacing: 0.05em;
    line-height: 1.8;
}

.upcoming-course-item__content {
    border: 1px solid var(--faint-gold);
    padding: 2rem 2.5rem;
}

.upcoming-course-item__title {
    font-size: 1.1rem;
    font-weight: 200;
    letter-spacing: 0.1em;
    margin-bottom: 1.2rem;
    color: var(--foggy-white);
    opacity: 0.9;
    line-height: 1.8;
}

.upcoming-course-item__desc {
    font-size: 0.9rem;
    line-height: 2.2;
    opacity: 0.65;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.upcoming-course-item__cta {
    font-size: 0.85rem;
    color: var(--faint-gold);
    letter-spacing: 0.2em;
    border-bottom: 1px solid var(--faint-gold);
    padding-bottom: 2px;
    transition: opacity 0.3s ease;
}

.upcoming-course-item__cta:hover {
    opacity: 0.6;
}

/* ===== 近期課程選擇器 ===== */
.upcoming-courses__hint {
    font-size: 0.95rem;
    opacity: 0.6;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.course-dropdown {
    position: relative;
    display: inline-block;
    min-width: 320px;
    margin-bottom: 3rem;
}

.course-dropdown__trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border: 1px solid rgba(197, 160, 89, 0.3);
    color: var(--foggy-white);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.course-dropdown__trigger:hover {
    border-color: var(--faint-gold);
}

.course-dropdown__arrow {
    font-size: 0.75rem;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.course-dropdown__trigger[aria-expanded="true"] .course-dropdown__arrow {
    transform: rotate(180deg);
}

.course-dropdown__list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0f2438;
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-top: none;
    z-index: 100;
    display: none;
}

.course-dropdown__list.is-open {
    display: block;
}

.course-dropdown__list li {
    padding: 0.9rem 1.2rem;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1.6;
}

.course-dropdown__list li:last-child {
    border-bottom: none;
}

.course-dropdown__list li:hover {
    background: rgba(197, 160, 89, 0.08);
    color: var(--faint-gold);
}

.course-dropdown__list li.is-selected {
    color: var(--faint-gold);
}

.course-dropdown__list .dropdown-item__date {
    display: block;
    font-size: 0.78rem;
    opacity: 0.5;
    margin-top: 0.2rem;
    letter-spacing: 0.03em;
}

/* ===== 展示區 ===== */
.upcoming-courses__display {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    padding-top: 3rem;
    border-top: 1px solid rgba(197, 160, 89, 0.3);
    margin-bottom: 1rem;
}

.upcoming-course-item__body {
    font-size: 0.9rem;
    line-height: 2.2;
    opacity: 0.65;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

/* ===== 過渡區塊 ===== */
.courses-divider {
    padding: 80px 10% 60px;
    box-sizing: border-box;
    text-align: center;
    max-width: 1440px;
    margin: 0 auto;
}

.courses-divider__text {
    font-size: 1.1rem;
    font-weight: 200;
    line-height: 2.4;
    letter-spacing: 0.15em;
    opacity: 0.7;
    color: var(--foggy-white);
    margin-bottom: 4rem;
}

.courses-divider__line {
    width: 60px;
    height: 1px;
    background: var(--faint-gold);
    opacity: 0.5;
    margin: 0 auto;
}

/* ===== Section 2：九個課程 ===== */
.all-courses {
    padding: 0 0 30px;
    box-sizing: border-box;
}

.course-block {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 60px 10%;
    box-sizing: border-box;
    overflow: hidden;
    border-top: 1px solid rgba(197, 160, 89, 0.1);
    max-width: 1440px;
    margin: 0 auto;
}

.course-block__name {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 3.5rem;
    font-weight: 200;
    letter-spacing: 0.3em;
    color: transparent;
    -webkit-text-stroke: 1px var(--faint-gold);
    opacity: 0.12;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    z-index: 0;
}

.course-block__name--left {
    left: 18%;
}

.course-block__name--right {
    right: 18%;
}

.course-block__content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.course-block__content--left {
    margin-right: auto;
    margin-left: 8%;
}

.course-block__content--right {
    margin-left: auto;
    margin-right: 12%;
}

.course-block__number {
    font-size: 0.75rem;
    letter-spacing: 0.5em;
    color: var(--faint-gold);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.course-block__title {
    font-size: 1.8rem;
    font-weight: 200;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--foggy-white);
}

.course-block__desc {
    font-size: 1rem;
    line-height: 2.4;
    opacity: 0.75;
    letter-spacing: 0.05em;
    max-width: 520px;
}

.course-block__name span {
    display: inline-block;
    animation-name: char-glow;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}

.course-block__name span:nth-child(1) { animation-delay: 0s; }
.course-block__name span:nth-child(2) { animation-delay: 0.8s; }
.course-block__name span:nth-child(3) { animation-delay: 1.6s; }
.course-block__name span:nth-child(4) { animation-delay: 2.4s; }
.course-block__name span:nth-child(5) { animation-delay: 3.2s; }

@keyframes char-glow {
    0%, 8% {
        color: transparent;
        text-shadow: none;
    }
    4% {
        color: #D4F9F5;
        text-shadow: 0 0 8px rgba(212, 249, 245, 1),
                     0 0 20px rgba(154, 234, 226, 0.85),
                     0 0 36px rgba(154, 234, 226, 0.5),
                     0 0 56px rgba(111, 209, 201, 0.3);
    }
    100% {
        color: transparent;
        text-shadow: none;
    }
}

#course-2 .course-block__name span {
    animation-duration: 8s;
}

#course-1 .course-block__name span,
#course-3 .course-block__name span,
#course-6 .course-block__name span,
#course-8 .course-block__name span {
    animation-duration: 10s;
}

#course-4 .course-block__name span,
#course-5 .course-block__name span,
#course-7 .course-block__name span,
#course-9 .course-block__name span {
    animation-duration: 11s;
}

/* ===== 右側浮動導覽 ===== */
.course-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.course-nav__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

.course-nav__item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    flex-direction: row-reverse;
}

.course-nav__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--foggy-white);
    opacity: 0.25;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.course-nav__label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--foggy-white);
    opacity: 0.3;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.course-nav__item:hover .course-nav__label {
    opacity: 1;
    transform: translateX(0);
}

.course-nav__item:hover .course-nav__dot {
    opacity: 0.8;
    background: var(--faint-gold);
}

.course-nav__item.active .course-nav__dot {
    background: var(--faint-gold);
    opacity: 1;
    width: 8px;
    height: 8px;
}

.course-nav__item.active .course-nav__label {
    color: var(--faint-gold);
    opacity: 1;
}

.course-nav-mobile {
    display: none;
}

/* ===== 認證區塊 ===== */
.about-section-title {
    font-size: 1.3rem;
    color: var(--faint-gold);
}

.certification-section {
    padding: 80px 10% 100px;
    box-sizing: border-box;
    border-top: 1px solid rgba(197, 160, 89, 0.15);
    position:relative;
}

.certification-section__inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.certification-section__left {
    flex: 1;
    min-width: 0;
}

.certification-section__desc {
    font-size: 1rem;
    line-height: 2.4;
    opacity: 0.7;
    letter-spacing: 0.08em;
    margin-top: 10px;
}

.certification-section__right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cert-level {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 0;
    padding-left: 1rem;
    border-bottom: 1px solid rgba(197, 160, 89, 0.15);
    transition: all ease 0.4s;
}

.cert-level:hover {
    transform: scale(1.05);
    background: rgba(197, 160, 89, 0.05);
}

.cert-level:first-child {
    border-top: 1px solid rgba(197, 160, 89, 0.15);
}

.cert-level__code {
    font-size: 1.5rem;
    font-weight: 200;
    letter-spacing: 0.2em;
    flex-shrink: 0;
    width: 60px;
}

.cert-level__name {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
    opacity: 0.9;
}

.cert-level__desc {
    font-size: 0.8rem;
    opacity: 0.45;
    letter-spacing: 0.08em;
    line-height: 1.6;
}

.cert-level--ch .cert-level__code {
    color: rgba(130, 150, 200, 0.85);
}

.cert-level--cht .cert-level__code {
    color: rgba(120, 170, 140, 0.85);
}

.cert-level--chi .cert-level__code {
    color: rgba(200, 150, 120, 0.85);
}

.cert-level--chss .cert-level__code {
    color: rgba(210, 160, 130, 0.85);
}

/* ===== 手機版 RWD ===== */
@media (max-width: 768px) {

    .course-nav__list {
        display: none;
    }

    .course-nav-mobile {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        width: 100%;
        z-index: 900;
        background: rgba(11, 29, 46, 0.95);
        backdrop-filter: blur(8px);
        box-sizing: border-box;
    }

    .course-nav-mobile.visible {
        display: block;
    }

    .course-nav-mobile__bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.7rem 8%;
    }

    .course-nav-mobile__current {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .course-nav-mobile__name {
        font-size: 0.85rem;
        letter-spacing: 0.15em;
        color: var(--faint-gold);
    }

    .course-nav-mobile__arrow {
        font-size: 0.85rem;
        color: var(--faint-gold);
        opacity: 0.7;
        transition: transform 0.3s ease;
        display: inline-block;
    }

    .course-nav-mobile.open .course-nav-mobile__arrow {
        transform: rotate(180deg);
    }

    .course-nav-mobile__progress-text {
        font-size: 0.75rem;
        opacity: 0.4;
        letter-spacing: 0.15em;
        color: var(--foggy-white);
    }

    .course-nav-mobile__progress-bar {
        height: 1px;
        background: rgba(197, 160, 89, 0.2);
        width: 100%;
    }

    .course-nav-mobile__progress-fill {
        height: 100%;
        background: var(--faint-gold);
        width: 11.11%;
        transition: width 0.4s ease;
    }

    .course-nav-mobile__menu {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease;
    }

    .course-nav-mobile.open .course-nav-mobile__menu {
        max-height: 500px;
        opacity: 1;
    }

    .course-nav-mobile__item {
        padding: 0.85rem 8%;
        font-size: 0.85rem;
        letter-spacing: 0.15em;
        opacity: 0.6;
        color: var(--foggy-white);
        cursor: pointer;
        border-bottom: 1px solid rgba(197, 160, 89, 0.08);
        transition: opacity 0.2s ease, color 0.2s ease;
    }

    .course-nav-mobile__item:active {
        opacity: 1;
        color: var(--faint-gold);
    }

    .course-nav-mobile__item.active {
        opacity: 1;
        color: var(--faint-gold);
    }

    .courses-divider {
        padding: 60px 8% 40px;
    }

    .courses-divider__text {
        font-size: 1rem;
    }

    .course-dropdown {
        min-width: 100%;
    }

    .upcoming-courses__display {
        flex-direction: column;
        gap: 1.5rem;
        padding-top: 2rem;
    }

    .upcoming-courses {
        padding: 100px 8% 60px;
    }

    .upcoming-course-item {
        flex-direction: column;
        gap: 1.5rem;
    }

    .upcoming-course-item__meta {
        width: 100%;
    }

    .course-block {
        flex-direction: row;
        padding: 50px 8%;
        min-height: unset;
    }

    .course-block--reverse {
        flex-direction: column;
    }

    .course-block__name {
        font-size: 3rem;
        opacity: 0.08;
    }

    .course-block__content {
        max-width: 100%;
        margin: 0 !important;
    }

    .course-block__title {
        font-size: 1.4rem;
    }

    .certification-section {
        padding: 60px 8% 80px;
    }

    .certification-section__inner {
        flex-direction: column;
        gap: 3rem;
    }

}

.footer-section {
    transform: translateY(20px)
}