/* ================= ROOT ================= */
:root {
    --primary-blue: #005780;
    --primary-teal: #00a4b4;
    --bg-light: #f9fbfd;
    --naver-green: #03C75A;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', sans-serif;
    color: #333;
    scroll-behavior: smooth;
}

/* ================= HEADER ================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #eee;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.header-logo {
    position: absolute;
    left: 20px;
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--primary-blue);
    text-decoration: none;
}

.header-logo span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-teal);
}

/* ================= NAV ================= */
header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    position: relative;
    padding: 8px 14px;
    border-radius: 22px;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary-blue);
    transition: all 0.3s ease;
}

header nav a:hover {
    background: rgba(0, 164, 180, 0.12);
    color: var(--primary-teal);
    transform: translateY(-2px);
}

header nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-blue));
    box-shadow: 0 6px 18px rgba(0, 164, 180, 0.35);
}

/* ================= MOBILE MENU ================= */
.menu-toggle {
    display: none;
    position: absolute;
    right: 20px;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--primary-blue);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    header nav {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 18px 0;
        display: none;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    }

    header nav.open {
        display: flex;
    }

    .header-logo {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ================= HERO ================= */
.hero {
    min-height: 100vh;
    padding: 100px 20px 80px;
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;

    background: url("hero_bg.jpg") center / cover no-repeat;
}

.hero img {
    width: 260px;
    max-width: 80%;
    margin-bottom: 30px;
}

/* ================= MOBILE HERO SAFE STACK ================= */
@media (max-width: 768px) {

    .hero {
        min-height: auto;
        /* 100vh 제거 */
        padding-top: 90px;
        padding-bottom: 130px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* verse / vision / worship 전부 흐름으로 */
    .verse-slider,
    .vision-box,
    .worship-info {
        position: relative;
        top: auto;
        bottom: auto;
        transform: none;
        margin-left: auto;
        margin-right: auto;
        width: 92%;
    }

    .verse-slider {
        margin-bottom: 22px;
        position: static !important;
        /* absolute 완전 차단 */
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        z-index: 1 !important;
        order: 1;

        margin: 0 auto 22px;
        padding: 16px 18px;
        width: 92%;
        max-width: 520px;
        text-align: center;
    }

    .vision-box {
        margin-bottom: 26px;
        padding: 26px 24px;
        position: relative;
        z-index: 2;
        order: 2;
        margin-bottom: 26px;
    }

    .worship-info {
        margin-top: 12px;
        position: relative;
        z-index: 2;
        order: 3;
        margin-top: 0;
    }
}

@media (max-width: 360px) {
    .vision-main {
        font-size: 1.25rem;
    }

    .vision-desc {
        font-size: 0.95rem;
    }

    .worship-info {
        font-size: 0.95rem;
        padding: 18px 20px;
    }
}

/* ================= HERO CONTENT ================= */
.vision-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    padding: 30px 36px;
    border-radius: 20px;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.vision-title {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.vision-main {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-teal);
    margin-bottom: 14px;
}

.vision-desc {
    line-height: 1.7;
    color: #555;
}

.worship-info {
    margin-top: 24px;
    padding: 20px 26px;
    border-radius: 22px;
    background: linear-gradient(135deg,
            rgba(0, 164, 180, 0.35),
            rgba(0, 87, 128, 0.35));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
}

.worship-info-title {
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ================= SECTION COMMON ================= */
.latest-video,
.location {
    padding: 100px 20px 80px;
    text-align: center;
}

.location {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.latest-video h2,
.location h2 {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 30px;
}

/* ================= VIDEO ================= */
.video-wrapper {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.video-wrapper iframe {
    width: 100%;
    height: 420px;
    border: none;
}

@media (max-width: 768px) {
    .video-wrapper iframe {
        height: 240px;
    }
}

/* ================= LOCATION ================= */
.map-box {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.map-box iframe {
    width: 100%;
    height: 420px;
    border: none;
}

/* ================= BUTTON ================= */
.naver-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #03C75A, #00a14b);
    box-shadow: 0 10px 26px rgba(3, 199, 90, 0.35);
}

/* ================= NOTICE ================= */
/* ================= INTRO ================= */
.intro-section {
    padding: 100px 20px 80px;
    text-align: center;
    background: var(--bg-light);
}

.intro-section h2 {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 40px;
}

.intro-box {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 50, 100, 0.08); /* Subtle blue tinted shadow */
    border: 1px solid rgba(0, 87, 128, 0.05);
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 24px;
    word-break: keep-all;
}

.intro-text.highlight {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 32px 0;
    font-family: 'Pretendard', serif; /* Optional: if you want a slightly different feel */
}

.intro-sign {
    margin-top: 40px;
    display: flex;
    justify-content: flex-end; /* Right align the signature */
    align-items: center;
    gap: 10px;
    padding-right: 20px;
}

.sign-role {
    font-size: 0.95rem;
    color: #666;
}

.sign-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #333;
    font-family: 'Pretendard', sans-serif;
}

@media (max-width: 768px) {
    .intro-box {
        padding: 30px 20px;
    }
    
    .intro-text {
        font-size: 1rem;
    }

    .intro-text.highlight {
        font-size: 1.15rem;
    }
}

/* ================= FOOTER ================= */
footer {
    padding: 60px 20px;
    background: var(--primary-blue);
    color: #fff;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ================= LIVE BUTTON ================= */
.live-button {
    position: fixed;
    right: 18px;
    top: 150px;
    z-index: 1000;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 14px 20px;
    border-radius: 28px;

    background: #ff0000;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 아이콘 */
.live-icon {
    font-size: 1rem;
}

/* hover */
.live-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

/* ===== 자동 강조 (예배 시간 근접) ===== */
.live-button.highlight {
    animation: live-pulse 1.8s infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
    }

    70% {
        box-shadow: 0 0 0 18px rgba(255, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* ================= MOBILE FAB ================= */
@media (max-width: 480px) {
    .live-button {
        padding: 14px;
        border-radius: 50%;
        gap: 0;
    }

    .live-text {
        display: none;
    }

    .live-icon {
        font-size: 1.2rem;
    }
}

/* ================= LIVE AUTO HIGHLIGHT ================= */
.live-button.highlight {
    animation: live-pulse 1.4s infinite;
    box-shadow: 0 0 0 rgba(255, 0, 0, 0.7);
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(255, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* ================= LIVE TALKING ================= */
.live-button.talk {
    animation: live-talk 1.2s infinite;
}

@keyframes live-talk {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-2px);
    }

    100% {
        transform: translateX(0);
    }
}

/* LIVE 진행 중 상태 */
.live-button.onair {
    background: linear-gradient(135deg, #ff4d4d, #ff0000);
}

.live-button.onair .live-text::after {
    content: " (LIVE)";
    font-weight: 800;
}

/* 종료 후 숨김 */
.live-button.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

/* ================= LIVE 1MIN ALERT ================= */
.live-button.alert {
    animation: live-alert 1.2s ease-out 1;
}

@keyframes live-alert {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 22px rgba(255, 0, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* 알림 텍스트 상태 */
.live-button.alert .live-text {
    font-weight: 800;
}

/* ================= SCROLL REVEAL (FINAL) ================= */
.reveal {
    opacity: 1;
    transform: none;
}

/* JS 있을 때만 */
.js .reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ================= LOADING OVERLAY ================= */
#loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading.hide {
    opacity: 0;
    visibility: hidden;
}

.loading-inner {
    text-align: center;
}

.loading-logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-blue);
    margin-bottom: 18px;
}

.loading-bar {
    width: 140px;
    height: 4px;
    background: rgba(0, 87, 128, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loading-bar::after {
    content: "";
    position: absolute;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--primary-teal),
            var(--primary-blue));
    animation: loading-move 1.4s infinite ease-in-out;
}

@keyframes loading-move {
    0% {
        left: -40%;
    }

    100% {
        left: 100%;
    }
}

/* ================= LOADING SVG LOGO ================= */
.loading-logo-svg {
    width: 220px;
    height: 60px;
    margin-bottom: 18px;
}

.loading-logo-svg text {
    font-family: 'Pretendard', sans-serif;
    font-size: 42px;
    font-weight: 900;
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 2;
    stroke-dasharray: 420;
    stroke-dashoffset: 420;
    animation: logo-draw 1.6s ease forwards;
}

@keyframes logo-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (max-width: 768px) {
    .loading-logo-svg {
        display: none;
    }

    .loading-bar {
        width: 120px;
    }
}

/* ================= HERO VERSE SLIDER ================= */
.verse-slider {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 720px;
    text-align: center;
    pointer-events: none;
}

.verse {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.verse span {
    display: block;
    margin-top: 6px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.verse.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .verse-slider {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 92%;
        margin-top: 0;
        order: 4;
    }

    .verse {
        position: relative !important;
        inset: auto !important;
        opacity: 1 !important;
        margin-bottom: 12px;
        padding: 16px 18px;
        font-size: 0.95rem;
        color: #333;
        background: linear-gradient(135deg,
                rgba(0, 164, 180, 0.35),
                rgba(0, 87, 128, 0.35));
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(8px);
    }

    .verse span {
        margin-top: 4px;
        font-size: 0.85rem;
        color: var(--primary-teal);
        opacity: 1;
    }

    .verse.active {
        display: block;
    }

    .verse:not(.active) {
        display: none;
    }
}

/* ================= WORSHIP DAY HIGHLIGHT ================= */
.worship-day {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.3s ease, color 0.3s ease;
}

.worship-day.active {
    background: var(--primary-teal);
    color: #fff;
}

