/* ==============================================
   와우커뮤니케이션 - WowHome 커스텀 스타일
   피그마 디자인 시스템 기반 (Pretendard & Paperlogy)
   ============================================== */

/* Pretendard 폰트 임포트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* --- 디자인 토큰 (CSS 변수) --- */
:root {
    /* 색상 토큰 */
    --wow-gray-900: #121212;   /* Gary/900 - 최다크, 푸터 배경(메인), Contact 버튼 */
    --wow-gray-800: #1F1F1F;   /* Gary/800 - 다크 카드 배경 */
    --wow-gray-700: #2D2D2D;   /* Gary/700 - 구분선, 다크 배경 보조 */
    --wow-gray-600: #383838;   /* Gary/600 - 상담버튼, 서브 텍스트 */
    --wow-gray-50:  #FAFAFA;   /* Gary/50  - 서브 페이지 배경 */
    --wow-gray-100: #F2F2F2;   /* Gary/100 - 서브 푸터 배경, 카드 구분선 */
    --wow-gray-200: #E4E4E4;   /* Gary/200 - 서브 푸터 구분선 */
    --wow-gray-300: #CECECE;   /* Gary/300 - GNB 링크 색, 모바일 햄버거(서브) */
    --wow-gray-400: #A6A6A6;   /* Gary/400 - 푸터 값, Contact 텍스트 */
    --wow-gray-500: #656565;   /* Gary/500 - 푸터 레이블, 보조 텍스트 */
    --wow-white:    #FFFFFF;   /* Primary/WT - 배너 텍스트, 아웃라인 버튼 */
    --wow-theme-500: #184ED7;  /* Theme/500 - 브랜드 블루 */
    --wow-theme-200: #E3E9F6;  /* Theme/200 - 브랜드 블루 라이트 */

    /* 레이아웃 변수 */
    --wow-header-height: 100px;
    --wow-header-m-height: 64px;
    --wow-side-padding: 80px;
    --wow-side-padding-m: 28px;
}

/* --- 전역 스타일 --- */
html, body {
    height: 100%;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--wow-gray-900);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* 컨테이너 좌우 여백 최적화 (cms-common.css 재정의) */
.cms-container {
    padding: 0 var(--wow-side-padding) !important;
    overflow-x: hidden; /* 전체 가로 스크롤 방지 */
}

/* 콘텐츠 오버플로우 방지 리셋 */
.cms-container img,
.cms-container video,
.cms-container iframe {
    max-width: 100% !important;
    height: auto !important;
}

.cms-container table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed; /* 테이블 너비 고정 해제 */
    word-break: break-all;
}

/* 테이블 가로 스크롤이 필요한 경우를 위한 래퍼 권장 스타일 */
.cms-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 모든 요소의 강제 너비 제한 (인라인 px 대응) */
.cms-container * {
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
}

/* ==============================================
   게시판 공통 (TUI Grid Style)
   ============================================== */

.cms-btn-write {
    display: inline-block;
    background: var(--wow-theme-500);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s;
}

.cms-btn-write:hover {
    background: var(--wow-gray-900);
}

/* 테이블 게시판 - TUI 스타일 정밀화 */
.cms-board-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid var(--wow-gray-900);
    table-layout: fixed; /* 설정 너비 엄격 준수 */
}

.cms-board-table thead tr {
    background: #f8f9fa; /* TUI 스타일 연한 배경 */
    border-bottom: 1px solid var(--wow-gray-200);
}

.cms-board-table th {
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    border-right: 1px solid var(--wow-gray-100); /* 컬럼간 구분선 */
}

.cms-board-table th:last-child { border-right: none; }

.cms-board-table td {
    padding: 12px 8px; /* 패딩 축소 (타이트하게) */
    font-size: 14px;
    color: #555;
    text-align: center;
    border-bottom: 1px solid var(--wow-gray-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cms-board-table .col-title {
    text-align: left;
    padding-left: 15px;
    white-space: normal; /* 제목은 여러줄 허용 */
}

.cms-board-table .col-title a {
    color: #222;
    font-weight: 500;
}

.cms-board-table tr:hover {
    background: #fcfcfc;
}

/* 공지사항 뱃지 */
.badge-notice {
    display: inline-block;
    background: #fff;
    color: var(--wow-theme-500);
    border: 1px solid var(--wow-theme-500);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    font-weight: 600;
}

/* 갤러리 게시판 스타일 복구 */
.cms-gallery-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.cms-gallery-item {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--wow-gray-100);
    transition: 0.3s;
}

.cms-gallery-item:hover {
    opacity: 0.8;
}

.cms-gallery-item__thumb {
    width: 320px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--wow-gray-50);
}

.cms-gallery-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cms-gallery-item__info {
    flex: 1;
}

.cms-gallery-item__date {
    font-size: 14px;
    color: var(--wow-gray-400);
    margin-bottom: 8px;
}

.cms-gallery-item__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--wow-gray-900);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .cms-gallery-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .cms-gallery-item__thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .cms-gallery-item__title {
        font-size: 18px;
    }
}

/* --- 게시판 모바일 최적화 (카드 타입 변환) --- */
@media (max-width: 768px) {
    .cms-board-table { table-layout: auto !important; width: 100% !important; } 
    .cms-board-table-wrap { border-top: 1px solid var(--wow-gray-900); }
    .cms-board-table thead { display: none; }
    .cms-board-table tbody, 
    .cms-board-table tr, 
    .cms-board-table td { 
        display: block !important; 
        width: 100% !important; /* 인라인 px 너비 무력화 */
    }
    .cms-board-table tr { padding: 16px 0; border-bottom: 1px solid var(--wow-gray-100); }
    .cms-board-table td { padding: 0 !important; border: none; text-align: left; overflow: visible; white-space: normal; }

    .cms-board-table td.col-title {
        padding-bottom: 8px;
        font-size: 16px;
        font-weight: 600;
    }

    .cms-board-table td:not(.col-title) {
        display: flex;
        gap: 10px;
        font-size: 12px;
        color: var(--wow-gray-500);
        padding: 2px 0;
    }

    .cms-board-table td:not(.col-title)::before {
        content: attr(data-label);
        width: 60px;
        color: var(--wow-gray-400);
        flex-shrink: 0;
    }

    .cms-board-table td[data-label="번호"],
    .cms-board-table td[data-label="조회수"] { display: none; }
}

/* 서브 페이지 콘텐츠 상단 여백 (헤더 가림 방지) */
body.is-sub main {
    padding-top: var(--wow-header-height);
}

@media (max-width: 768px) {
    .cms-container {
        padding: 0 var(--wow-side-padding-m) !important;
    }
    body.is-sub main {
        padding-top: var(--wow-header-m-height);
    }
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; margin: 0; padding: 0; }

/* ==============================================
   헤더 (Wow Header)
   ============================================== */
.wow-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--wow-header-height);
    padding: 0 var(--wow-side-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.3s, border 0.3s;
}

/* 헤더 상태별 스타일 */
.wow-header.is-main { background: transparent; }
.wow-header.is-main.scrolled { background: rgba(18, 18, 18, 0.85); }
.wow-header.is-sub { background: var(--wow-white); border-bottom: 1px solid var(--wow-gray-200); }

/* 로고 */
.wow-header__logo img {
    width: 170px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

/* GNB */
.wow-gnb {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wow-gnb__list {
    display: flex;
    flex-direction: row;
    gap: 60px;
    align-items: center;
}

.wow-gnb__link {
    font-size: 16px;
    font-weight: 400;
    color: var(--wow-gray-300);
    letter-spacing: -0.32px;
    height: 32px;
    display: flex;
    align-items: center;
}

.wow-header.is-sub .wow-gnb__link { color: var(--wow-gray-600); }
.wow-gnb__link:hover { color: var(--wow-white); }
.wow-header.is-sub .wow-gnb__link:hover { color: var(--wow-theme-500); }

/* PC 서브메뉴 스타일 추가 */
.wow-gnb__item { position: relative; }
.wow-gnb__submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wow-white);
    border: 1px solid var(--wow-gray-200);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.wow-gnb__item:hover > .wow-gnb__submenu {
    opacity: 1;
    visibility: visible;
}

.wow-gnb__submenu .wow-gnb__link {
    color: var(--wow-gray-600);
    padding: 8px 20px;
    font-size: 14px;
    height: auto;
}

.wow-gnb__submenu .wow-gnb__link:hover {
    background: var(--wow-gray-50);
    color: var(--wow-theme-500);
}

/* Contact 버튼 */
.wow-header__contact {
    background: var(--wow-gray-900);
    border-radius: 8px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.wow-header__contact-text {
    font-size: 16px;
    color: var(--wow-gray-400);
    font-weight: 400;
}

.wow-header__contact-divider {
    width: 1px;
    height: 12px;
    background: var(--wow-gray-700);
}

.wow-header__contact-icons {
    display: flex;
    gap: 8px;
    color: var(--wow-gray-400);
}

/* ==============================================
   히어로 배너 (#mainBanner)
   ============================================== */
#mainBanner {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#mainBanner .carousel-inner,
#mainBanner .carousel-item {
    height: 100%;
}

.main-banner-content {
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.wow-banner-overlay {
    position: absolute;
    left: 159px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wow-white);
    max-width: 800px;
}

.wow-banner__title {
    font-size: 60px;
    font-weight: 700;
    line-height: 90px;
    letter-spacing: -1.2px;
    margin-bottom: 24px;
}

.wow-banner__desc {
    font-size: 24px;
    font-weight: 400;
    line-height: 36px;
    letter-spacing: -0.48px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.wow-btn-outline {
    display: inline-block;
    border: 1px solid var(--wow-white);
    border-radius: 60px;
    padding: 16px 32px;
    color: var(--wow-white);
    font-size: 20px;
    font-weight: 500;
    background: transparent;
    transition: 0.3s;
}

.wow-btn-outline:hover {
    background: var(--wow-white);
    color: var(--wow-gray-900);
}

/* 캐러셀 인디케이터 */
.carousel-indicators {
    bottom: 100px !important;
    gap: 12px;
}

.carousel-indicators button {
    width: 16px !important;
    height: 8px !important;
    border-radius: 4px !important;
    background-color: var(--wow-white) !important;
    opacity: 0.2 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: width 0.3s, opacity 0.3s;
}

.carousel-indicators button.active {
    width: 48px !important;
    opacity: 1 !important;
}

/* ==============================================
   푸터 (Wow Footer)
   ============================================== */
.wow-footer {
    background: var(--wow-gray-900);
    padding: 36px var(--wow-side-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
}

.wow-footer__logo {
    display: flex;
    align-items: center;
    width: 180px;
}

.wow-footer__logo img {
    width: 170px;
    height: 20px;
    object-fit: contain;
}

.wow-footer__info {
    display: flex;
    gap: 40px;
    align-items: center;
}

.wow-footer__item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-style: normal;
}

.wow-footer__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--wow-gray-500);
    letter-spacing: -0.26px;
}

.wow-footer__divider {
    width: 1px;
    height: 12px;
    background: var(--wow-gray-500);
}

.wow-footer__value {
    font-size: 13px;
    font-weight: 400;
    color: var(--wow-gray-400);
    letter-spacing: -0.26px;
}

.wow-footer__copy {
    font-size: 12px;
    font-weight: 500;
    color: var(--wow-gray-500);
    letter-spacing: -0.24px;
    margin: 0;
}

/* 서브 푸터 스타일 */
.wow-footer.is-sub {
    background: var(--wow-gray-100);
}

.wow-footer.is-sub .wow-footer__divider { background: var(--wow-gray-200); }
.wow-footer.is-sub .wow-footer__label { color: var(--wow-gray-600); }
.wow-footer.is-sub .wow-footer__value { color: var(--wow-gray-500); }
.wow-footer.is-sub .wow-footer__copy { color: var(--wow-gray-400); }

/* ==============================================
   반응형 및 모바일 전용
   ============================================== */

/* 모바일 햄버거 버튼 */
.wow-header__hamburger {
    display: none;
    width: 28px;
    height: 28px;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 2001;
}

.wow-hamburger__line {
    position: absolute;
    height: 2px;
    left: 16.67%;
    right: 16.67%;
    background: var(--wow-white);
    border-radius: 6px;
    transition: 0.3s;
}

.wow-header.is-sub .wow-hamburger__line,
.wow-header__hamburger.is-active .wow-hamburger__line { 
    background: var(--wow-gray-600); 
}

/* 햄버거 버튼 애니메이션 (X자) */
.wow-header__hamburger.is-active .wow-hamburger__line--top { top: 13px; transform: rotate(45deg); }
.wow-header__hamburger.is-active .wow-hamburger__line--mid { opacity: 0; }
.wow-header__hamburger.is-active .wow-hamburger__line--bot { top: 13px; transform: rotate(-45deg); }

.wow-hamburger__line--top { top: 6px; }
.wow-hamburger__line--mid { top: 13px; }
.wow-hamburger__line--bot { top: 20px; }

/* 모바일 메뉴 오버레이 */
.wow-mobile-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: var(--wow-white);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    padding: 80px 28px;
    display: flex;
    flex-direction: column;
}

.wow-mobile-menu.is-open { transform: translateX(0); }

.wow-mobile-menu__list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wow-mobile-menu__item {
    border-bottom: 1px solid var(--wow-gray-100);
}

.wow-mobile-menu__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wow-mobile-menu__link {
    font-size: 18px;
    font-weight: 500;
    color: var(--wow-gray-900);
    display: block;
    padding: 16px 0;
    flex: 1;
}

.wow-mobile-menu__toggle-btn {
    width: 40px;
    height: 44px;
    background: transparent;
    border: none;
    position: relative;
}

.wow-mobile-menu__toggle-btn::before,
.wow-mobile-menu__toggle-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: var(--wow-gray-400);
    transform: translate(-50%, -50%);
    transition: 0.3s;
}

.wow-mobile-menu__toggle-btn::after { transform: translate(-50%, -50%) rotate(90deg); }

/* 아코디언 펼침 상태 */
.wow-mobile-menu__item.is-expanded > .wow-mobile-menu__row .wow-mobile-menu__toggle-btn::after {
    transform: translate(-50%, -50%) rotate(0);
}

.wow-mobile-menu__submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--wow-gray-50);
    padding-left: 20px;
}

.wow-mobile-menu__item.is-expanded > .wow-mobile-menu__submenu {
    max-height: 1000px; /* 충분한 높이 */
}

.wow-mobile-menu__submenu .wow-mobile-menu__link {
    font-size: 16px;
    font-weight: 400;
    color: var(--wow-gray-600);
    padding: 12px 0;
}

/* 페이지네이션 공통 */
.cms-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 60px;
}

.cms-pagination__pages {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cms-pagination__btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--wow-gray-200);
    background: #fff;
    color: var(--wow-gray-600);
    font-size: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.cms-pagination__btn.active {
    background: var(--wow-theme-500);
    color: #fff;
    border-color: var(--wow-theme-500);
    font-weight: 600;
}

.cms-pagination__btn:hover:not(.active) {
    background: #f8f9fa;
    border-color: var(--wow-gray-300);
}

.cms-pagination__arrow {
    width: 34px;
    height: 34px;
    border: 1px solid var(--wow-gray-200);
    background: #fff;
    color: var(--wow-gray-400);
    font-size: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.cms-pagination__arrow:hover:not([disabled]) {
    background: #f8f9fa;
    color: var(--wow-gray-900);
}

.cms-pagination__arrow[disabled] {
    cursor: default;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .cms-pagination { gap: 8px; margin-top: 40px; }
    .cms-pagination__btn { min-width: 30px; height: 30px; font-size: 13px; }
    .cms-pagination__arrow { width: 30px; height: 30px; }
}

@media (max-width: 768px) {
    .wow-header {
        height: var(--wow-header-m-height);
        padding: 0 var(--wow-side-padding-m);
    }

    .wow-gnb, .wow-header__contact { display: none; }
    .wow-header__hamburger { display: block; }

    /* 배너 반응형 */
    .wow-banner-overlay {
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        width: 90%;
    }

    .wow-banner__title {
        font-size: 28px;
        line-height: 36px;
        letter-spacing: -0.56px;
        margin-bottom: 16px;
    }

    .wow-banner__desc {
        font-size: 14px;
        line-height: 22px;
        letter-spacing: -0.28px;
        opacity: 0.6;
        margin-bottom: 24px;
    }

    .wow-btn-outline {
        font-size: 14px;
        padding: 12px 20px;
    }

    .carousel-indicators {
        bottom: 60px !important;
        gap: 6px;
    }

    .carousel-indicators button {
        width: 8px !important;
        height: 4px !important;
    }

    .carousel-indicators button.active {
        width: 24px !important;
    }

    /* 푸터 반응형 */
    .wow-footer {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding: 24px var(--wow-side-padding-m);
        gap: 20px;
    }

    .wow-footer__logo {
        display: none !important;
    }

    .wow-footer__info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .wow-footer__item { width: 100%; }
    .wow-footer__label { width: 40px; flex-shrink: 0; }
}
