/* ==============================================
   씨엠에스곳간 - default 사이트 커스텀 스타일
   피그마 디자인 시스템 기반 (Pretendard 네이비 테마)
   ============================================== */

/* Pretendard 폰트 임포트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* --- 디자인 토큰 (CSS 변수) --- */
:root {
    /* gary */
    --gary-50: 250 250 250;
    --gary-100: 242 242 242;
    --gary-200: 228 228 228;
    --gary-300: 206 206 206;
    --gary-400: 166 166 166;
    --gary-500: 101 101 101;
    --gary-600: 56 56 56;
    --gary-700: 45 45 45;
    --gary-800: 31 31 31;
    --gary-900: 18 18 18;

    /* primary */
    --primary-WT: 255 255 255;
    --primary-BK: 0 0 0;

    /* theme */
    --theme-50: 245 246 248;
    --theme-100: 232 232 238;
    --theme-200: 201 201 215;
    --theme-500: 158 158 174;
    --theme-600: 115 115 129;
    --theme-700: 70 70 81;
    --theme-800: 46 46 58;
    --theme-900: 35 35 40;

    /* theme2 */
    --theme2-50: 246 248 255;
    --theme2-200: 230 235 255;
    --theme2-450: 96 111 170;
    --theme2-600: 25 91 215;
    --theme2-800: 10 54 135;

    /****** 사이즈 변수 (1rem = 16px 기준, margin, padding, gap, font-size ...) ******/
    --size-1: 0.0625rem;   /* 1px */
    --size-2: 0.125rem;    /* 2px */
    --size-3: 0.1875rem;   /* 3px */
    --size-4: 0.25rem;     /* 4px */
    --size-5: 0.3125rem;   /* 5px */
    --size-6: 0.375rem;    /* 6px */
    --size-7: 0.4375rem;   /* 7px */
    --size-8: 0.5rem;      /* 8px */
    --size-9: 0.5625rem;   /* 9px */
    --size-10: 0.625rem;   /* 10px */
    --size-11: 0.6875rem;  /* 11px */
    --size-12: 0.75rem;    /* 12px */
    --size-13: 0.8125rem;  /* 13px */
    --size-14: 0.875rem;   /* 14px */
    --size-15: 0.9375rem;  /* 15px */
    --size-16: 1rem;       /* 16px */
    --size-17: 1.0625rem;  /* 17px */
    --size-18: 1.125rem;   /* 18px */
    --size-19: 1.1875rem;  /* 19px */
    --size-20: 1.25rem;    /* 20px */
    --size-21: 1.3125rem;  /* 21px */
    --size-22: 1.375rem;   /* 22px */
    --size-23: 1.4375rem;  /* 23px */
    --size-24: 1.5rem;     /* 24px */
    --size-25: 1.5625rem;  /* 25px */
    --size-26: 1.625rem;   /* 26px */
    --size-27: 1.6875rem;  /* 27px */
    --size-28: 1.75rem;    /* 28px */
    --size-29: 1.8125rem;  /* 29px */
    --size-30: 1.875rem;   /* 30px */
    --size-31: 1.9375rem;  /* 31px */
    --size-32: 2rem;       /* 32px */
    --size-33: 2.0625rem;  /* 33px */
    --size-34: 2.125rem;   /* 34px */
    --size-35: 2.1875rem;  /* 35px */
    --size-36: 2.25rem;    /* 36px */
    --size-37: 2.3125rem;  /* 37px */
    --size-38: 2.375rem;   /* 38px */
    --size-39: 2.4375rem;  /* 39px */
    --size-40: 2.5rem;     /* 40px */
    --size-41: 2.5625rem;  /* 41px */
    --size-42: 2.625rem;   /* 42px */
    --size-43: 2.6875rem;  /* 43px */
    --size-44: 2.75rem;    /* 44px */
    --size-45: 2.8125rem;  /* 45px */
    --size-46: 2.875rem;   /* 46px */
    --size-47: 2.9375rem;  /* 47px */
    --size-48: 3rem;       /* 48px */
    --size-49: 3.0625rem;  /* 49px */
    --size-50: 3.125rem;   /* 50px */
    --size-51: 3.1875rem;  /* 51px */
    --size-52: 3.25rem;    /* 52px */
    --size-53: 3.3125rem;  /* 53px */
    --size-54: 3.375rem;   /* 54px */
    --size-55: 3.4375rem;  /* 55px */
    --size-56: 3.5rem;     /* 56px */
    --size-57: 3.5625rem;  /* 57px */
    --size-58: 3.625rem;   /* 58px */
    --size-59: 3.6875rem;  /* 59px */
    --size-60: 3.75rem;    /* 60px */
    --size-61: 3.8125rem;  /* 61px */
    --size-62: 3.875rem;   /* 62px */
    --size-63: 3.9375rem;  /* 63px */
    --size-64: 4rem;       /* 64px */
    --size-65: 4.0625rem;  /* 65px */
    --size-66: 4.125rem;   /* 66px */
    --size-67: 4.1875rem;  /* 67px */
    --size-68: 4.25rem;    /* 68px */
    --size-69: 4.3125rem;  /* 69px */
    --size-70: 4.375rem;   /* 70px */
    --size-71: 4.4375rem;  /* 71px */
    --size-72: 4.5rem;     /* 72px */
    --size-73: 4.5625rem;  /* 73px */
    --size-74: 4.625rem;   /* 74px */
    --size-75: 4.6875rem;  /* 75px */
    --size-76: 4.75rem;    /* 76px */
    --size-77: 4.8125rem;  /* 77px */
    --size-78: 4.875rem;   /* 78px */
    --size-79: 4.9375rem;  /* 79px */
    --size-80: 5rem;       /* 80px */
    --size-81: 5.0625rem;  /* 81px */
    --size-82: 5.125rem;   /* 82px */
    --size-83: 5.1875rem;  /* 83px */
    --size-84: 5.25rem;    /* 84px */
    --size-85: 5.3125rem;  /* 85px */
    --size-86: 5.375rem;   /* 86px */
    --size-87: 5.4375rem;  /* 87px */
    --size-88: 5.5rem;     /* 88px */
    --size-89: 5.5625rem;  /* 89px */
    --size-90: 5.625rem;   /* 90px */
    --size-91: 5.6875rem;  /* 91px */
    --size-92: 5.75rem;    /* 92px */
    --size-93: 5.8125rem;  /* 93px */
    --size-94: 5.875rem;   /* 94px */
    --size-95: 5.9375rem;  /* 95px */
    --size-96: 6rem;       /* 96px */
    --size-97: 6.0625rem;  /* 97px */
    --size-98: 6.125rem;   /* 98px */
    --size-99: 6.1875rem;  /* 99px */
    --size-100: 6.25rem;   /* 100px */

    /* 스크린 사이즈 */
    --screen-1920: 120rem;
    --screen-1440: 90rem;
    --screen-1280: 80rem;
    --screen-1024: 64rem;
    --screen-768: 48rem;
    --screen-360: 22.5rem;

    --cms-primary:      #25336e;
    --cms-accent:       #76bc05;
    --cms-hero-from:    #83ff25;
    --cms-hero-to:      #b9ff15;

    --cms-gray-900:     #121212;
    --cms-gray-700:     #2D2D2D;
    --cms-gray-600:     #383838;
    --cms-gray-500:     #656565;
    --cms-gray-200:     #E4E4E4;
    --cms-gray-100:     #F4F4F4;
    --cms-gray-50:      #FAFAFA;

    --cms-radius-card:  20px;
    --cms-radius-btn:   6px;
    --cms-container:    1520px;
    --cms-px:           200px;
}

/* ==============================================
   헤더 (피그마 Frame 2/3/7 공통)
   ============================================== */
/* 모바일 GNB(.cms-nav-container)가 top:100%; left:0; 절대 위치로 헤더 바로 아래에
   붙으려면, 기준이 되는 상위 요소에 position이 지정되어 있어야 함.
   지정돼 있지 않아 엉뚱한 위치(또는 화면 밖)로 밀려나 보이지 않던 문제 수정 */
.cms-header {
    position: relative;
}

.cms-header .header-inner {
    width: 100%;
    max-width: var(--screen-1440);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 6.25rem;
}

.cms-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 210; /* 토글 메뉴보다 위로 */
}

.cms-header__mobile-actions {
    display: none;
    align-items: center;
    gap: var(--size-8);
    flex: 0 0 auto;
}

/* 토글 버튼 (모바일) */
.cms-header__toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 210;
}

.cms-header__toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cms-primary);
    position: relative;
    transition: background .2s;
}

.cms-header__toggle-icon::before,
.cms-header__toggle-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--cms-primary);
    left: 0;
    transition: transform .2s, top .2s;
}

.cms-header__toggle-icon::before { top: -8px; }
.cms-header__toggle-icon::after { top: 8px; }

/* 토글 활성화 시 아이콘 애니메이션 */
.cms-header__toggle:not(.collapsed) .cms-header__toggle-icon { background: transparent; }
.cms-header__toggle:not(.collapsed) .cms-header__toggle-icon::before { top: 0; transform: rotate(45deg); }
.cms-header__toggle:not(.collapsed) .cms-header__toggle-icon::after { top: 0; transform: rotate(-45deg); }

/* GNB 컨테이너 */
.cms-nav-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* 모바일 전용 영역 (데스크톱에서 숨김) */
.cms-nav-mobile-auth { display: none; }

/* 데스크톱 전용 영역 */
.cms-header__auth-desktop {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 메인 GNB */
.cms-nav {
    display: flex;
    gap: 40px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.cms-nav > li { position: relative; }

.cms-nav a {
    font-size: 16px;
    font-weight: 500;
    color: rgb(var(--theme-600));
    letter-spacing: -0.32px;
    line-height: 26px;
    padding: 8px 0;
    display: block;
    transition: color .2s;
    white-space: nowrap;
}

.cms-nav a:hover,
.cms-nav li.active > a { color: var(--cms-primary); font-weight: 700; }

/* 드롭다운 (기본은 숨김, JS(common.js)에서 hover 시 .show 클래스를 추가/제거하여 노출) */
.cms-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--cms-gray-200);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 8px;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    z-index: 200;
    list-style: none;
}

.cms-nav .dropdown-menu.show {
    display: block;
}

.cms-nav .dropdown-menu a {
    padding: 8px 20px;
    font-size: 14px;
    color: var(--cms-gray-600);
}

.cms-nav .dropdown-menu a:hover { background: var(--cms-gray-50); color: var(--cms-primary); }

/* 로그인/로그아웃 버튼 */
.cms-header__login {
    font-size: var(--size-14);
    font-weight: 500;
    color: rgb(var(--primary-WT));
    padding: var(--size-9) var(--size-16);
    border-radius: var(--size-20);
    background-color: rgb(var(--theme2-600));
    transition: background .2s, color .2s;
    cursor: pointer;
    white-space: nowrap;
}

.cms-header__login:hover { background: var(--cms-primary); color: #fff; }

.cms-header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--cms-gray-600);
}

.cms-header__logout {
    font-size: 13px;
    color: var(--cms-gray-500);
    border: 1px solid var(--cms-gray-200);
    padding: 4px 12px;
    border-radius: var(--cms-radius-btn);
    background: transparent;
    cursor: pointer;
    transition: background .2s;
}

.cms-header__logout:hover { background: var(--cms-gray-50); }

/* ==============================================
   페이지 공통 본문
   ============================================== */
.cms-main {
    min-height: calc(100vh - 80px - 120px);
}

.cms-container {
    max-width: var(--screen-1440);
    margin: 0 auto var(--size-80);
}

/* ==============================================
   [Frame 2] 메인 히어로 배너
   ============================================== */
.cms-main-wrap {
    display: flex;
    flex-direction: column;
}

/* 히어로 배너 (그린 그라디언트) */
.cms-hero {
    background: linear-gradient(135deg, var(--cms-hero-from), var(--cms-hero-to));
    border-radius: var(--cms-radius-card);
    height: 400px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.cms-hero--gray {
    background: linear-gradient(180deg, var(--cms-gray-100) 0%, #f5f5f5 100%);
}

.cms-hero__text {
    position: absolute;
    left: 50%;
    transform: translateX(calc(-50% - 219px));
    top: 127px;
    width: 704px;
}

.cms-hero__title {
    font-size: 40px;
    font-weight: 800;
    color: var(--cms-gray-900);
    letter-spacing: -0.8px;
    line-height: 54px;
    margin-bottom: 13px;
}

.cms-hero__desc {
    font-size: 16px;
    font-weight: 400;
    color: var(--cms-gray-900);
    letter-spacing: -0.32px;
    line-height: 26px;
}

/* 배너 이전/다음 버튼 */
.cms-hero__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,.55);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 5;
    font-size: 20px;
    color: var(--cms-gray-700);
}

.cms-hero__btn:hover { background: rgba(255,255,255,.9); }
.cms-hero__btn--prev { left: 40px; }
.cms-hero__btn--next { right: 40px; }

/* ==============================================
   [Frame 2] 메인 게시판 섹션 (카드 슬라이드)
   ============================================== */
.cms-board-section { width: 100%; }

.cms-board-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    margin-bottom: 32px;
}

.cms-board-section__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--cms-gray-900);
    letter-spacing: -0.64px;
    line-height: 44px;
}

.cms-board-section__more {
    font-size: 20px;
    font-weight: 600;
    color: var(--cms-gray-500);
    transition: color .2s;
}

.cms-board-section__more:hover { color: var(--cms-primary); }

/* 카드 그리드 */
.cms-card-grid {
    display: flex;
    gap: 24px;
    overflow: hidden;
}

.cms-card-item {
    flex: 0 0 calc((100% - 96px) / 5);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: transform .2s;
}

.cms-card-item:hover { transform: translateY(-4px); }

.cms-card-item__thumb {
    width: 100%;
    aspect-ratio: 2;
    background: var(--cms-gray-100);
    border-radius: var(--cms-radius-card);
    overflow: hidden;
}

.cms-card-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.cms-card-item__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--cms-gray-900);
    letter-spacing: -0.4px;
    line-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cms-card-item__date {
    font-size: 16px;
    font-weight: 500;
    color: var(--cms-gray-600);
    letter-spacing: -0.32px;
    line-height: 26px;
}

/* ==============================================
   [Frame 3] 공지사항 서브 비주얼
   ============================================== */
.cms-sub-top {
    background: linear-gradient(180deg, var(--cms-gray-100) 0%, #f9f9f9 100%);
    border-radius: var(--cms-radius-card);
    height: 400px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 77px 60px;
    overflow: hidden;
    position: relative;
    margin-bottom: 80px;
}

.cms-sub-top__text { max-width: 704px; }

.cms-sub-top__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--cms-gray-900);
    letter-spacing: -0.64px;
    line-height: 44px;
    margin-bottom: 13px;
}

.cms-sub-top__desc {
    font-size: 18px;
    font-weight: 500;
    color: var(--cms-gray-500);
    letter-spacing: -0.36px;
    line-height: 28px;
}

.cms-sub-top__image {
    width: 280px;
    height: 280px;
    background: var(--cms-gray-200);
    border-radius: var(--cms-radius-card);
    position: absolute;
    right: 77px;
    top: 60px;
    overflow: hidden;
    flex-shrink: 0;
}

.cms-sub-top__image img { width: 100%; height: 100%; object-fit: cover; }

/* 공지사항 게시판 테이블 */
.cms-board-table-wrap { width: 100%; }

.cms-board-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid var(--cms-primary);
}

.cms-board-table thead tr {
    background: var(--cms-gray-50);
    border-bottom: 1px solid var(--cms-gray-200);
}

.cms-board-table thead th {
    font-size: 14px;
    font-weight: 600;
    color: var(--cms-gray-600);
    letter-spacing: -0.28px;
    line-height: 22px;
    padding: 12px 16px;
    text-align: center;
}

.cms-board-table thead th.col-title { text-align: left; }

.cms-board-table tbody tr {
    border-bottom: 1px solid var(--cms-gray-200);
    transition: background .15s;
}

.cms-board-table tbody tr:hover { background: var(--cms-gray-50); }

.cms-board-table tbody td {
    font-size: 14px;
    font-weight: 400;
    color: var(--cms-gray-600);
    letter-spacing: -0.28px;
    line-height: 22px;
    padding: 14px 16px;
    text-align: center;
    vertical-align: middle;
}

.cms-board-table tbody td.col-title {
    text-align: left;
    font-weight: 500;
    color: var(--cms-gray-900);
    cursor: pointer;
}

.cms-board-table tbody td.col-title a { color: inherit; }
.cms-board-table tbody td.col-title a:hover { color: var(--cms-primary); }

/* 공지 뱃지 */
.badge-notice {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--cms-accent);
    border: 1px solid var(--cms-accent);
    border-radius: 4px;
    padding: 1px 6px;
    margin-right: 6px;
    line-height: 18px;
    vertical-align: middle;
}

/* ==============================================
   [Frame 7] 갤러리 (이미지+텍스트 가로형)
   ============================================== */
.cms-gallery-list {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.cms-gallery-item {
    display: flex;
    align-items: center;
    gap: 32px;
    cursor: pointer;
    transition: opacity .2s;
}

.cms-gallery-item:hover { opacity: .85; }

.cms-gallery-item + .cms-gallery-item {
    padding-top: 60px;
    border-top: 1px solid var(--cms-gray-200);
}

.cms-gallery-item__thumb {
    width: 368px;
    height: 200px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--cms-gray-100) 0%, #ccc 100%);
    border-radius: var(--cms-radius-card);
    overflow: hidden;
}

.cms-gallery-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.cms-gallery-item__info { flex: 1; }

.cms-gallery-item__date {
    font-size: 16px;
    font-weight: 500;
    color: var(--cms-gray-600);
    letter-spacing: -0.32px;
    line-height: 26px;
    margin-bottom: 12px;
}

.cms-gallery-item__title {
    font-size: 24px;
    font-weight: 600;
    color: var(--cms-gray-900);
    letter-spacing: -0.48px;
    line-height: 36px;
    margin-bottom: 12px;
}

.cms-gallery-item__desc {
    font-size: 16px;
    font-weight: 500;
    color: var(--cms-gray-600);
    letter-spacing: -0.32px;
    line-height: 26px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==============================================
   페이지네이션 공통
   ============================================== */
.cms-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 80px;
}

.cms-pagination__pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cms-pagination__btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 18px;
    background: #fff;
    font-size: 16px;
    font-weight: 400;
    color: var(--cms-gray-600);
    letter-spacing: -0.32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.cms-pagination__btn.active,
.cms-pagination__btn:hover {
    background: var(--cms-gray-200);
    color: var(--cms-gray-900);
    font-weight: 600;
}

.cms-pagination__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cms-gray-500);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: color .15s;
    padding: 0;
}

.cms-pagination__arrow:hover { color: var(--cms-primary); }

/* 글쓰기 버튼 */
.cms-btn-write {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--cms-primary);
    border: none;
    padding: 8px 20px;
    border-radius: var(--cms-radius-btn);
    cursor: pointer;
    transition: opacity .2s;
    text-decoration: none;
    display: inline-block;
}

.cms-btn-write:hover { opacity: .85; color: #fff; }

/* 빈 목록 안내 */
.cms-empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--cms-gray-500);
    font-size: 16px;
}
