/* Church Project CSS - Version V2.2.50 */
@font-face { font-family: 'ChenYuluoyan'; src: url('../font/ChenYuluoyan-2.0-Thin.ttf') format('truetype'); }

:root {
    --panel-main-text-size: clamp(1rem, 1.2vw, 1.5rem);
    --panel-main-line-height: 1.8;
    --gallery-gap: 0.75rem;
    --section3-bg-color: #968a78;
    --pattern-color: #999999;
    --pattern-opacity: 0.25;
    --pattern-size: 40px;
    --pattern-thickness: 1px;
}

html { font-size: 16px; } 
@media (min-width: 1921px) { html { font-size: 16px; } }
@media (max-width: 1920px) { html { font-size: 14.222px; } }
@media (max-width: 1440px) { html { font-size: 13px; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft JhengHei", sans-serif; font-size: 0.75rem; color: white; background-color: #000; overflow: hidden; touch-action: none; }

#main-container { opacity: 1; transition: opacity 1s ease-in-out; }
#main-container.initial-load { opacity: 0; }

.navbar { position: fixed; top: 0; width: 100%; height: 6.25rem; display: flex; align-items: center; justify-content: space-between; padding: 0 2.5rem; background: transparent; z-index: 10000; white-space: nowrap; }
.nav-side { display: flex; align-items: center; flex: 0 0 auto; }
.nav-left { justify-content: flex-start; gap: 3rem; }
.nav-right { justify-content: flex-end; } 

.logo-group { display: flex; flex-direction: column; align-items: flex-start; }
.logo-area { cursor: pointer; flex-shrink: 0; }
.logo-area img { height: 3.125rem; width: auto; display: block; }

.nav-links { display: flex; list-style: none; gap: 1.875rem; pointer-events: auto; flex-shrink: 0; }
.nav-item, .nav-item-special { height: 1.6rem; line-height: 1.6rem; overflow: hidden; cursor: pointer; display: block; position: relative; flex-shrink: 0; }
.nav-item.active { border-bottom: 2px solid white; cursor: default; }
.nav-external { text-decoration: none !important; color: white !important; display: block; width: 100%; height: 100%; }

.flip-text { display: flex; flex-direction: column; transition: transform 0.5s cubic-bezier(0.45, 0, 0.55, 1); height: 3.2rem; }
.flip-text span { display: block; height: 1.6rem; line-height: 1.6rem; text-align: center; color: #ffffff; transition: opacity 0.4s, color 0.4s; font-size: 1.125rem; font-weight: 500; }
.flip-text .ch { opacity: 0; }
.flip-text .en { opacity: 1; }
.nav-item:hover .flip-text, .nav-item.active .flip-text, .nav-item-special:hover .flip-text { transform: translateY(-1.6rem); }
.nav-item:hover .en, .nav-item.active .en, .nav-item-special:hover .en { opacity: 0; }
.nav-item:hover .ch, .nav-item.active .ch, .nav-item-special:hover .ch { opacity: 1; }

.static-text { display: block; height: 1.6rem; color: #ffffff; text-align: center; transition: color 0.4s; font-size: 1.125rem; font-weight: 500; }
.nav-item:not(.active):hover .static-text, .nav-item:not(.active):hover .flip-text span.ch, .nav-item-special:hover .flip-text span.ch { color: #FFB11B !important; }

.icon-area { display: flex; gap: 1.25rem; align-items: center; flex-shrink: 0; }
.mobile-only-icons { display: none; } 

.icon-item { position: relative; width: 1.5625rem; height: 1.5625rem; cursor: pointer; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.icon-item img { height: 1.5625rem !important; width: 1.5625rem !important; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transition: 0.2s; }
.icon-hover { opacity: 0; }
.icon-item:hover .icon-orig { opacity: 0; }
.icon-item:hover .icon-hover { opacity: 1; }
.icon-label { position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%); font-size: 0.75rem; white-space: nowrap; opacity: 0; transition: 0.4s; pointer-events: none; text-align: center; background: rgba(0, 0, 0, 0.7); padding: 0 0.5rem; border-radius: 4px; }
.icon-item:hover .icon-label { opacity: 1; }

.hamburger { display: none; width: 30px; height: 20px; flex-direction: column; justify-content: space-between; cursor: pointer; z-index: 10001; }
.hamburger span { display: block; width: 100%; height: 3px; background-color: white; border-radius: 3px; transition: 0.3s; }
.hamburger.active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Section 1 */
.main-title { font-size: clamp(5rem, 8vw, 9rem); text-align: center; width: 100%; line-height: 1.2; }
.sub-title { font-size: clamp(2.5rem, 4vw, 5rem); text-align: center; width: 100%; font-weight: 300; line-height: 1.4; }
#section1 .special-font { font-family: 'ChenYuluoyan', cursive; opacity: 0; }
#section1 .special-font.font-ready { animation: textFadeIn 1.5s ease-out forwards; }
@keyframes textFadeIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

.parallax-bg-text { position: absolute; left: 150px; top: 50%; font-size: clamp(150px, 15vw, 270px); font-weight: 1000; font-family: "Microsoft JhengHei", sans-serif; color: rgba(255, 255, 255, 0.2); white-space: nowrap; pointer-events: none; z-index: 1; line-height: 1; transform-origin: center center; transform: translate(-50%, -50%) rotate(-90deg); will-change: transform; transition: transform 1.2s cubic-bezier(0.45, 0, 0.55, 1); }
#section3 .parallax-bg-text { z-index: 6; color: rgba(255, 255, 255, 0.1); }

/* Section 2 Panel */
#section2 { position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.panel-container { position: relative; left: 25%; width: 45%; max-width: 1200px; height: 75vh; background-color: rgba(255, 255, 255, 0.4); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 1.875rem; padding: clamp(2rem, 6vh, 9rem) clamp(2rem, 5vw, 6rem) 1.5rem clamp(2rem, 5vw, 6rem); display: flex; justify-content: center; align-items: flex-start; opacity: 0; overflow: hidden; z-index: 2; }
.content-wrapper { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; }
.panel-content { display: flex; flex-direction: row; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; flex-shrink: 0; }
.title-group-internal { flex: 0 0 auto; transform: translateY(4rem); opacity: 0; }
.panel-text { flex: 1 1 auto; transform: translateY(4rem); opacity: 0; padding-top: 0.5rem; display: flex; flex-direction: column; }
.panel-title { font-size: clamp(2.5rem, 4vw, 5rem); font-weight: 800; margin-bottom: 0.5rem; color: #ffffff; line-height: 1.1; }
.panel-subtitle { font-size: clamp(1rem, 1.5vw, 2rem); font-weight: 300; color: #333; letter-spacing: 2px; margin-bottom: 1rem; }
.time-highlight { font-size: var(--panel-main-text-size); line-height: var(--panel-main-line-height); font-weight: bold; border-bottom: 2px solid rgba(255, 255, 255, 0.3); display: inline-block; padding-bottom: 0.3125rem; margin-bottom: 1.25rem; }
.scripture-quote { margin-bottom: 1.25rem; }
.quote-content { font-size: var(--panel-main-text-size); line-height: var(--panel-main-line-height); color: #ffffff; font-style: italic; margin-bottom: 0; }
.quote-source { font-size: calc(var(--panel-main-text-size) * 0.75); font-style: italic; color: #ffffff; text-align: right; margin-top: 0px; }
.location-link { margin-top: 7rem; color: #0b4e8d !important; text-decoration: none !important; font-size: clamp(1.2rem, 1.2vw, 1.5rem); font-weight: bold; display: inline-block; transition: 0.3s; }
.location-link:hover { opacity: 0.8; transform: translateX(5px); }

/* Gallery V2.2.44 優化：防止裁切與自動縮放 */
.video-frame-area { width: 100%; max-width: 100%; flex: 1 1 auto; min-height: 0; background-color: transparent; display: flex; flex-direction: column; justify-content: center; align-items: center; transform: translateY(4rem); opacity: 0; margin-top: auto; overflow: hidden; }
.gallery-video-area { width: 100%; max-height: 100%; position: relative; overflow: hidden; display: flex; align-items: center; }
.video-track { display: flex; transition: transform 0.5s ease-in-out; will-change: transform; width: 100%; }
.video-item { flex: 0 0 33.333%; padding: 0 var(--gallery-gap); box-sizing: border-box; transition: flex 0.3s; display: flex; justify-content: center; }
.show-2 .video-item { flex: 0 0 50% !important; }
.show-1 .video-item { flex: 0 0 100% !important; }

.video-card { background: rgba(255, 255, 255, 0.1); border-radius: 0.75rem; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.2); width: 100%; max-width: 100%; backdrop-filter: blur(5px); display: flex; flex-direction: column; }
.video-card iframe { width: 100%; aspect-ratio: 16 / 9; border: none; background: #000; display: block; flex: 0 0 auto; }
.video-info { padding: 0.7rem 0.9375rem; flex: 1 1 auto; display: flex; align-items: center; }
.video-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; max-height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #fff; }

.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.8); border: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; transition: 0.3s; }
.nav-btn:hover { background: #fff; transform: translateY(-50%) scale(1.1); }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
.prev { left: 0.3125rem; } .next { right: 0.3125rem; }

/* Animations Section 2 */
#section2.panel-active .panel-container { opacity: 1; transition: opacity 1.2s ease-in-out; }
#section2.panel-active .title-group-internal { transform: translateY(0); opacity: 1; transition: 1.2s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: 0.4s; }
#section2.panel-active .panel-text { transform: translateY(0); opacity: 1; transition: 1.2s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: 0.7s; }
#section2.panel-active .video-frame-area { transform: translateY(0); opacity: 1; transition: 1.2s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: 1s; }

/* Section 3 Split */
.split-section { display: flex; flex-direction: row; position: relative; overflow: hidden !important; justify-content: flex-start !important; align-items: stretch !important; padding: 0 !important; z-index: 10; }
.split-left { flex: 0 0 60vw; width: 60vw; background-color: var(--section3-bg-color); height: 100%; z-index: 5; margin: 0; position: relative; }
.split-left::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(45deg, transparent 48%, var(--pattern-color) 49%, var(--pattern-color) 51%, transparent 52%), linear-gradient(-45deg, transparent 48%, var(--pattern-color) 49%, var(--pattern-color) 51%, transparent 52%); background-size: var(--pattern-size) var(--pattern-size); opacity: var(--pattern-opacity); pointer-events: none; }
.split-right { position: absolute; right: 0; top: 0; width: 100%; height: 100%; background-image: url('../img/section3.jpg'); background-size: cover; background-position: center; z-index: 1; }

@media (min-width: 1025px) {
    .split-left { transform: translateX(-100%); } 
    .split-section.do-slide-in .split-left { animation: slideFromLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
}

/* 漢堡選單 RWD */
@media (max-width: 1024px) {
    .navbar { height: auto; padding: 1.5rem 2.5rem; align-items: flex-start; }
    .nav-links { 
        display: none; 
        position: fixed; top: 0; right: 0; width: 250px; height: 100vh; 
        background: rgba(0,0,0,0.9); flex-direction: column; padding: 80px 30px; gap: 2.2rem; 
        z-index: 10000; border-left: 1px solid rgba(255,255,255,0.1);
        transition: transform 0.4s ease; transform: translateX(100%);
    }
    .nav-links.active { display: flex; transform: translateX(0); }
    
    .mobile-only-icons { 
        display: flex; 
        justify-content: flex-start; 
        gap: 1.5rem; 
        padding-bottom: 1.5rem; 
        margin-bottom: 0.5rem;
    }

    .nav-links .nav-item, .nav-links .nav-item-special { height: auto; line-height: 1.2; }
    .nav-links .static-text { text-align: left; font-size: 1.5rem; height: auto; opacity: 0.7; }
    .nav-links .nav-item.active .static-text { opacity: 1; }
    .nav-links .flip-text { height: auto; }
    .nav-links .flip-text span { text-align: left; font-size: 1.5rem; height: auto; }
    .nav-links .flip-text .ch { opacity: 1; display: block; position: relative; color: #fff; margin-top: 5px; font-size: 1rem; }
    .nav-links .flip-text .en { opacity: 0.7; font-size: 1.5rem; }
    .nav-links .nav-item:hover .flip-text, .nav-links .nav-item.active .flip-text, .nav-links .nav-item-special:hover .flip-text{ transform: none; }
    
    .desktop-icons { display: none; }
    .hamburger { display: flex; margin-top: 10px; } 

    #section2 .panel-container { position: relative; left: 0; top: 0; transform: none; width: 90%; height: 75%; padding: 2rem; display: flex; flex-direction: column; justify-content: center; align-items: center; }
    #parallax-worship { display: none !important; }
    .split-section { flex-direction: column-reverse; } 
    .split-left { flex: 0 0 50%; width: 100%; height: 50%; transform: translateY(100%); }
    .split-right { position: relative; flex: 0 0 50%; width: 100%; height: 50%; }
    #section3 .parallax-bg-text { display: none !important; }
    .split-section.do-slide-in .split-left { animation: slideFromBottom 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    .split-section .title-group { left: 50% !important; top: 75% !important; transform: translate(-50%, -50%); }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    #section2 .panel-title { font-size: calc(clamp(2.5rem, 4vw, 5rem) * 1.5); }
    #section2 .panel-subtitle { font-size: calc(clamp(1rem, 1.5vw, 2rem) * 1.5); }
}

@keyframes slideFromLeft { 0% { transform: translateX(-100%); } 100% { transform: translateX(0); } }
@keyframes slideFromBottom { 0% { transform: translateY(100%); } 100% { transform: translateY(0); } }

.split-section .title-group { position: absolute; left: 35%; top: 50%; transform: translate(-50%, calc(-50% + 4rem)); z-index: 10; width: 100%; opacity: 0; transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease-out; }
.split-section.do-slide-in .title-group { opacity: 1; transform: translate(-50%, -50%); transition-delay: 0.5s; }

/* Section 4 */
#section4 .title-group { opacity: 0; transform: translateY(4rem); transition: opacity 0.9s ease, transform 0.9s ease; }
#section4.do-slide-up .title-group { animation: slideUpFade 1.6s cubic-bezier(0.3, 1, 0.3, 1) forwards; }
#section4.is-static .title-group { opacity: 1 !important; transform: translateY(0) !important; animation: none !important; }
@keyframes slideUpFade { 0% { opacity: 0; transform: translateY(4rem); } 100% { opacity: 1; transform: translateY(0); } }

/* Components */
.learn-more-area { margin-top: 2rem; text-align: center; }
.learn-more-btn { display: inline-flex; align-items: center; gap: 0.6rem; color: white; text-decoration: none; font-size: 1.25rem; font-weight: 500; transition: 0.3s; padding: 0.5rem 1rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 2rem; }
.learn-more-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }
.learn-more-btn .arrow { transition: transform 0.3s; }
.learn-more-btn:hover .arrow { transform: translateX(5px); }

/* Layout */
.full-page { width: 100%; height: 100vh; background-size: cover; background-position: center; display: flex; justify-content: center; align-items: center; flex-shrink: 0; position: relative; overflow: hidden; }
#section1 { background-image: url('../img/section1.jpg'); }
#section2 { background-image: url('../img/section2.jpg'); }
#section4 { background-image: url('../img/section4.jpg'); }

.scroll-wrapper { transform: translate3d(0, 0, 0); transition: transform 1.2s cubic-bezier(0.45, 0, 0.55, 1); display: flex; flex-direction: column; }
.side-dots { position: fixed; right: 1.25rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.9375rem; z-index: 999; }
.dot { width: 0.375rem; height: 0.375rem; background-color: white; border-radius: 50%; transition: 0.5s; cursor: pointer; }
.dot.active { height: 0.75rem; width: 0.75rem; }

/* Footer */
.footer-section { height: 250px; background-color: black; display: flex; justify-content: center; align-items: center; padding: 2rem 0; flex-shrink: 0; }
.footer-container { width: 90%; max-width: 1200px; display: flex; justify-content: center; align-items: flex-start; text-align: left; transition: all 0.5s ease; gap: clamp(2rem, 12.2vw, 15.625rem); }
.footer-left { flex: 0 1 auto; display: flex; flex-direction: column; gap: 0.5rem; color: #bbb; font-size: 0.9rem; min-width: 300px; }
.footer-right { flex: 0 1 auto; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; height: 100%; color: #888; min-width: 250px; }
.work-time { display: flex; align-items: flex-start; margin-top: 0.5rem; }
.work-time .label { white-space: nowrap; }
.work-time .time-details { display: flex; flex-direction: column; }
.back-btn { cursor: pointer; margin-top: 1rem; align-self: flex-end; display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; transition: 0.3s; }
.arrow-up { width: 10px; height: 10px; border-top: 3px solid rgba(255, 255, 255, 0.7); border-left: 3px solid rgba(255, 255, 255, 0.7); transform: rotate(45deg); transition: 0.3s; }
.back-btn:hover .arrow-up { border-color: rgba(255, 255, 255, 1); transform: rotate(45deg) translate(-5px, -5px); }

@media (max-width: 768px) {
    .footer-section { height: auto; min-height: 300px; }
    .footer-container { flex-direction: column; align-items: center; gap: 2.5rem; text-align: center; }
    .footer-left { align-items: flex-start; text-align: left; min-width: unset; width: fit-content; max-width: 240px; margin: 0 auto; }
    .footer-right { align-items: center; height: auto; width: 100%; min-width: unset; }
    .copyright { text-align: center; width: 100%; }
    .back-btn { align-self: center; margin-top: 1rem; }
}

/* Popout */
.popout-fixed-wrapper { position: fixed; bottom: 1.25rem; right: -21.875rem; z-index: 10001; transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.popout-fixed-wrapper.active { transform: translateX(-24.375rem); }
.popout-container { position: relative; width: 18.75rem; height: 25rem; }
.popout-content { position: relative; width: 100%; height: 100%; border-radius: 0.625rem; overflow: hidden; background-color: #fff; box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.4); padding: 0.9375rem; }
.popout-content img { width: 100%; height: 100%; object-fit: contain; }
.close-hitbox { position: absolute; top: 0.9375rem; right: 0.9375rem; width: 1.875rem; height: 1.875rem; cursor: pointer; background: #000; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 30; }
.close-symbol::before, .close-symbol::after { content: ''; position: absolute; width: 0.875rem; height: 0.09rem; background-color: #fff; top: 50%; left: 50%; }
.close-symbol::before { transform: translate(-50%, -50%) rotate(45deg); }
.close-symbol::after { transform: translate(-50%, -50%) rotate(-45deg); }