/* ==========================================
   LAYOUT BASE
   적용대상: 모든 *_layout.ejs
========================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

html {
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Pretendard', 'Jost', sans-serif;
    color: #222;
    background: #fff;
}

/* -------------------------------
   SUBPAGE WRAPPER
-------------------------------- */
.layout {
    padding-top: 0;
}

.page-body {
    margin: 5rem auto;
    line-height: 1.8;
}

/* -------------------------------
   SUB BANNER
-------------------------------- */
.sub-banner {
    position: relative;
    width: 100%;
    height: 95vh;
    min-height: 520px;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    margin-top: -80px;

    /* 페이드 인 + 위로 슬라이드 효과 */
    opacity: 0;
    transform: translateY(30px);
    will-change: opacity, transform;
    animation: fadeUp 1.2s ease-out forwards;
    animation-fill-mode: forwards;
    backface-visibility: hidden;
}

/* 어두운 오버레이 */
.sub-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 0;
}

/* 텍스트 */
.sub-banner h1 {
    position: relative;
    z-index: 2;
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.sub-banner p {
    position: relative;
    z-index: 2;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.03em;
    margin: 0;
}

/* 배너 등장 애니메이션 */
@keyframes fadeUp {
    0% {
        opacity: 0.01;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 하단 스크롤 인디케이터 */
.scroll-indicator {
    position: absolute;
    left: 50%;
    bottom: 20%;
    transform: translateX(-50%);
    text-align: center;
    color: #fff;
    z-index: 5;
}
.scroll-indicator .scroll-arrows {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.scroll-indicator .scroll-arrows span {
    font-size: clamp(16px, 2vw, 22px);
    color: #ffffff;
    animation: arrow-bounce 1.2s infinite;
}
.scroll-indicator .scroll-arrows span:nth-child(2){ animation-delay:.2s; }
.scroll-indicator .scroll-arrows span:nth-child(3){ animation-delay:.4s; }

@keyframes arrow-bounce {
    0%,100% { transform: translateY(0); opacity: 1; }
    50%     { transform: translateY(6px); opacity: .7; }
}

/* -------------------------------
   TAB MENU (밑줄 슬라이드형)
-------------------------------- */
.sub-tab {
    background: #fff;
    position: relative;
    display: flex;
    justify-content: center;
    padding: 2.5rem 0;
}

.sub-tab ul {
    display: flex;
    gap: 3rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sub-tab li a {
    position: relative;
    color: #444;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

/* 밑줄 애니메이션 */
.sub-tab li a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #1b6331;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

/* hover / active 시 */
.sub-tab li a:hover::after,
.sub-tab li a.active::after {
    width: 100%;
}

.sub-tab li a:hover,
.sub-tab li a.active {
    color: #1b6331;
}

/* 페이지 전환 시 살짝 부드럽게 */
body.page-transition {
    opacity: 0.95;
    transition: opacity 0.1s ease;
}

/* -------------------------------
   RESPONSIVE DESIGN
-------------------------------- */
/* ------------------------------
   1500px ~ 1025px : 기본 비례 축소
------------------------------ */
@media (max-width: 1900px) {
    .scroll-indicator {
        display: none !important;
    }
}
@media (max-width: 1500px) {
    .sub-banner {
        height: 80vh;
        min-height: 460px;
    }

    .sub-banner h1 {
        font-size: clamp(1.9rem, 3vw, 2.4rem);
    }

    .sub-banner p {
        font-size: clamp(0.9rem, 1.6vw, 1.1rem);
    }

    .sub-tab ul {
        gap: 5rem;
    }
}

/* ------------------------------
   1024px 이하 : 일반 노트북 ~ 태블릿
------------------------------ */
@media (max-width: 1024px) {
    .page-body {
        margin-bottom: 0;
    }
    .sub-banner {
        height: 65vh;
        min-height: 400px;
        margin-top: -70px;
    }

    .sub-banner h1 {
        font-size: clamp(1.6rem, 4vw, 2rem);
        margin-bottom: 0.6rem;
    }

    .sub-banner p {
        font-size: clamp(0.8rem, 1.5vw, 1rem);
    }

    .sub-tab {
        padding: 2rem 0;
    }

    .sub-tab ul {
        gap: 4rem;
        flex-wrap: wrap;
    }

    .sub-tab li a {
        font-size: 0.95rem;
        padding: 0.5rem 0;
    }

    .scroll-indicator {
        bottom: 12%;
    }
}

/* ------------------------------
   800px 이하 : 모바일 전환 시작
------------------------------ */
@media (max-width: 800px) {
    .sub-banner {
        height: 55vh;
        min-height: 360px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .sub-banner h1 {
        font-size: clamp(1.5rem, 4.5vw, 1.8rem);
        margin: 0;
    }

    .sub-banner p {
        display: none;
    }

    .scroll-indicator {
        bottom: 10%;
    }

    .sub-tab {
        padding: 1.5rem 0;
    }

    .sub-tab ul {
        gap: 3rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sub-tab li a {
        font-size: 0.9rem;
    }
}

/* ------------------------------
   600px 이하 : 작은 모바일 대응
------------------------------ */
@media (max-width: 600px) {
    .sub-banner {
        height: 50vh;
        min-height: 300px;
        margin-top: -60px;
    }

    .sub-banner h1 {
        font-size: clamp(1.3rem, 5vw, 1.6rem);
    }

    .scroll-indicator {
        bottom: 8%;
    }

    .sub-tab {
        padding: 1.2rem 0;
    }

    .sub-tab ul {
        gap: 2rem;
    }

    .sub-tab li a {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
}

/* ------------------------------
   400px 이하 : 최소 대응
------------------------------ */
@media (max-width: 400px) {
    .sub-banner {
        height: 45vh;
        min-height: 260px;
    }

    .sub-banner h1 {
        font-size: 1.2rem;
    }

    .sub-tab li a {
        font-size: 0.8rem;
        padding: 0.3rem 0.2rem;
    }

    .scroll-indicator {
        bottom: 6%;
    }
}