/* 전체 사이트 반응형 스타일 */
@charset "utf-8";

/* ============================
   기본 리셋 (태블릿/모바일 전용 → 미디어쿼리 안에서만 적용)
============================ */

/* ============================
   헤더 & 글로벌 네비게이션
============================ */
.main-header {
    width: 100%;
    background: #fff;
    border-bottom: 3px solid #B38A5A;
    position: relative;
    z-index: 1000;
}

.header-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 80px;
}

.site-logo img {
    height: 60px;
    width: auto;
    display: block;
}

/* GNB */
.gnb {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.gnb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gnb-item {
    position: relative;
}

.gnb-item > a {
    display: block;
    padding: 28px 16px;
    font-size: 14px;
    font-weight: bold;
    color: #444;
    text-decoration: none;
    white-space: nowrap;
}

.gnb-item > a:hover,
.gnb-item.active > a {
    color: #B38A5A;
    text-decoration: none;
}

.gnb-item > a .arrow {
    font-size: 10px;
    opacity: 0.6;
}

/* 서브메뉴 드롭다운 */
.gnb-item .sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 130px;
    background: #fff;
    border: 1px solid #e0d0c0;
    border-top: 2px solid #B38A5A;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.gnb-item:hover .sub-nav {
    display: block;
}

.gnb-item .sub-nav li a {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f0e8e0;
    white-space: nowrap;
}

.gnb-item .sub-nav li:last-child a {
    border-bottom: none;
}

.gnb-item .sub-nav li a:hover {
    background: #fdf5ed;
    color: #B38A5A;
}

/* 햄버거 버튼 */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    margin-left: 12px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #444;
    transition: all 0.3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================
   메인 페이지 레이아웃 (PC 기본)
============================ */

/* main01: 배너(좌 63%) + 게시판(우 37%) */
#main01_container {
    width: 1024px;
    margin: 0 auto;
    overflow: hidden;
}

#main01_container .left {
    float: left;
    width: 649px;
}

#main01_container .right {
    float: left;
    width: 375px;
}

/* 슬라이더 */
#quick_menur {
    width: 100%;
    height: auto;
    overflow: hidden;
}

#subQuickBanner_container {
    width: 100%;
    height: 0;
    padding-bottom: 93.06%; /* 604/649 */
    position: relative;
    overflow: hidden;
}

#subQuickBanner_container #subQuickBanner_contents {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
}

#subQuickBanner_container #subQuickBanner_contents li {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#subQuickBanner_container #subQuickBanner_contents li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 게시판 우측 영역 */
.main01_notice,
.main01_recruit,
.main01_free {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.notice_tit,
.recruit_tit,
.free_tit {
    padding: 8px 12px 4px 12px;
}

#main01_container::after {
    content: "";
    display: table;
    clear: both;
}

/* main02 퀵링크 - PC 기본 레이아웃 */
#main02_container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}
/* left 4개 이미지 가로 1줄 배치 */
#main02_container .left ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ============================
   서브 페이지 레이아웃
============================ */
#subTop {
    height: auto !important;
    background-color: #f7f5f5;
}

#subTop > div {
    width: 100% !important;
    max-width: 1024px;
    margin: 0 auto;
}

#subTop > div img {
    width: 100%;
    display: block;
}

/* .sub-layout: htm_top.php의 .box에 추가된 클래스 */
/* #sub_wrap(사이드바)과 #sub_cont_wrap(콘텐츠)을 나란히 배치 */
.sub-layout {
    max-width: 1024px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex !important;
    align-items: flex-start;
    gap: 0;
}

#sub_wrap {
    width: 200px !important;
    min-width: 200px;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

#sub_menu_wrap {
    width: 100% !important;
    min-width: unset;
    margin: 0 !important;
    float: none !important;
    display: block !important;
}

#sub_left_banner {
    width: 100% !important;
    clear: none;
    float: none !important;
    display: block;
    margin-top: 10px;
}

#sub_left_banner ul li img {
    width: 100%;
    display: block;
}

#sub_cont_wrap {
    flex: 1;
    width: auto !important;
    float: none !important;
    padding: 0 0 30px 30px;
    min-width: 0;
    position: relative;
}

.sub_cont img {
    max-width: 100%;
    height: auto;
}

.sub_cont table {
    max-width: 100%;
}

/* 서브 타이틀 */
.title {
    height: auto !important;
    margin-bottom: 16px;
}

.title img {
    max-width: 100%;
}

/* 사이드바 HTML 메뉴 스타일 */
.sub-sidebar-title {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: #B38A5A;
    padding: 14px 16px;
    text-decoration: none;
    cursor: default;
}

.sub-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e0d0c0;
    border-top: none;
}

.sub-sidebar-nav li a {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f0e8e0;
}

.sub-sidebar-nav li:last-child a {
    border-bottom: none;
}

.sub-sidebar-nav li a:hover {
    background: #fdf5ed;
    color: #B38A5A;
    text-decoration: none;
}

.sub-sidebar-nav li.active a {
    background: #fdf5ed;
    color: #B38A5A;
    font-weight: bold;
}

/* ============================
   HTML 푸터
============================ */
.site-footer {
    background: #555;
    color: #ccc;
    padding: 20px;
}

.footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.footer-links a:hover {
    color: #fff;
}

.footer-links span.sep {
    color: #777;
}

.footer-info {
    font-size: 12px;
    line-height: 1.9;
    color: #bbb;
}

.footer-copy {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.footer-family select {
    height: 26px;
    border: 1px solid #777;
    background: #666;
    color: #ccc;
    font-size: 12px;
    padding: 2px 6px;
    cursor: pointer;
}

/* ============================
   게시판 반응형
============================ */

/* .searchbox 높이 자동 + <p> 마진 제거 */
.searchbox {
    height: auto !important;
    padding-bottom: 10px !important;
}
.search-form-row {
    margin: 0;
}

/* board.css의 고정 너비 .box_normal 오버라이드 */
.box_normal {
    width: 100% !important;
    max-width: 734px;
    box-sizing: border-box;
}

/* 포토갤러리 고정 너비 테이블 오버라이드 */
.box_board table,
#board_table table {
    width: 100% !important;
    max-width: 100%;
}

/* 갤러리 리스트 고정 너비 오버라이드 */
#board_table .board_gall ul {
    width: 100% !important;
    left: 0 !important;
    display: flex;
    flex-wrap: wrap;
}

#board_table .board_gall ul li {
    float: none !important;
}

.board_list table,
.board_view_top,
.board_view_con,
.board_table01,
.board_table01_view,
.board_table01_write {
    max-width: 100%;
    width: 100% !important;
}

/* ============================
   미디어쿼리 - 태블릿 (768px ~ 1023px)
============================ */
@media (max-width: 1023px) {
    *, *::before, *::after {
        box-sizing: border-box;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    #contents {
        width: 100% !important;
        min-width: unset !important;
        overflow-x: hidden !important;
    }

    #topMenu { height: auto !important; }
    #main01  { height: auto !important; }
    #main02  { height: auto !important; }
    #footer  { height: auto !important; background-image: none !important; }

    .header-inner {
        max-width: 100%;
        padding: 0 16px;
    }

    .gnb-item > a {
        padding: 28px 10px;
        font-size: 13px;
    }

    #main01_container {
        width: 100% !important;
        height: auto !important;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    #main01_container .left { width: 58% !important; float: none !important; }
    #main01_container .right { width: 42% !important; float: none !important; }

    #main01_container .main01_notice,
    #main01_container .main01_recruit,
    #main01_container .main01_free {
        width: 100% !important;
        height: auto !important;
        padding: 14px 0 !important;
    }

    #main01_container .main01_photo {
        width: 100% !important;
        height: auto !important;
    }

    #main01_container .right table {
        width: 100% !important;
    }

    #sub_wrap { width: 170px !important; min-width: 170px; }

    /* 슬라이더 - 클리핑은 #subQuickBanner_container overflow:hidden에서 처리 */
    #quick_menur {
        overflow: visible !important;
    }

    /* main02 퀵링크 - 태블릿: flex 유지, 이미지 반응형 */
    #main02_container img {
        max-width: 100%;
        height: auto;
        display: block;
    }
}

/* ============================
   미디어쿼리 - 모바일 (~767px)
============================ */
@media (max-width: 767px) {

    /* 헤더 */
    .header-inner {
        height: auto;
        padding: 10px 16px;
        flex-wrap: nowrap;
    }

    .site-logo img {
        height: 44px;
    }

    .hamburger {
        display: flex;
    }

    /* GNB 모바일 */
    .gnb {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        justify-content: flex-end;
        align-items: flex-start;
    }

    .gnb.open {
        display: flex;
    }

    .gnb-list {
        flex-direction: column;
        background: #fff;
        width: 260px;
        height: 100%;
        overflow-y: auto;
        padding: 20px 0;
        box-shadow: -4px 0 16px rgba(0,0,0,0.2);
    }

    .gnb-item {
        border-bottom: 1px solid #f0e8e0;
    }

    .gnb-item > a {
        padding: 14px 20px;
        font-size: 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .gnb-item .sub-nav {
        display: none;
        position: static;
        border: none;
        border-top: 1px solid #f0e8e0;
        box-shadow: none;
        background: #faf6f1;
    }

    .gnb-item.menu-open .sub-nav {
        display: block;
    }

    .gnb-item .sub-nav li a {
        padding: 10px 28px;
        font-size: 13px;
    }

    /* 메인 배너 + 게시판 */
    #main01_container {
        flex-direction: column;
    }

    #main01_container .left {
        width: 100% !important;
    }

    #main01_container .right {
        width: 100% !important;
        padding: 12px 16px !important;
    }

    #main01_container .main01_notice,
    #main01_container .main01_recruit,
    #main01_container .main01_free {
        width: 100% !important;
    }

    /* 상담 및 입소문의 배너 - 모바일 상단 여백 */
    #main01_container .right > div:last-child {
        margin-top: 16px;
        text-align: center;
    }

    #main01_container .right > div:last-child img {
        max-width: 375px;
        width: 100%;
        height: auto;
    }

    /* main02 퀵링크 모바일 */
    #main02_container,
    #main02_container .left,
    #main02_container .center,
    #main02_container .right {
        float: none !important;
        width: 100% !important;
        display: block !important;
    }

    /* 시설/서비스/프로그램/후원 - 한 줄에 2개 */
    #main02_container .left ul {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #main02_container .left ul li {
        float: none !important;
        display: block !important;
        width: 50% !important;
        box-sizing: border-box !important;
    }

    #main02_container .left ul li img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* 찾아오시는 길 지도 - 100% */
    #main02_container .center img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* 입소대상/절차/비용 - 가로 나열 */
    #main02_container .right ul {
        display: flex !important;
        justify-content: center !important;
    }

    #main02_container .right ul li {
        float: none !important;
        display: block !important;
    }

    /* 서브 페이지 */
    .sub-layout {
        flex-direction: column;
        padding: 16px !important;
    }

    #sub_wrap {
        width: 100% !important;
        min-width: unset;
        margin-bottom: 8px !important;
    }

    #sub_left_banner {
        display: none !important;
    }

    #sub_cont_wrap {
        width: 100% !important;
        padding: 12px 0 20px 0 !important;
    }

    /* 사이드바 메뉴 모바일 토글 */
    .sub-sidebar-title {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sub-sidebar-title::after {
        content: '\25BC';
        font-size: 11px;
        opacity: 0.7;
    }

    .sub-sidebar-title.open::after {
        content: '\25B2';
    }

    .sub-sidebar-nav {
        display: none;
    }

    .sub-sidebar-nav.open {
        display: block;
    }

    /* 검색 폼 */
    .searchbox {
        height: auto !important;
        min-height: 44px;
        padding: 8px !important;
    }
    .search-form-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        justify-content: center;
    }
    .search-form-row .search_input {
        flex: 1;
        min-width: 60px;
        width: auto !important;
        height: 28px;
        box-sizing: border-box;
    }
    .search-form-row .board_search_sel {
        height: 28px;
    }

    /* 게시판 - 수평 스크롤 (overflow fallback) */
    #board_table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 4컬럼 게시판(공지/법령): 번호(1)·조회수(4) 컬럼 숨김 */
    /* display:none 대신 overflow:hidden+width:0 → COLGROUP 재배치 방지 */
    .board_table01:not(:has(col:nth-child(5))) {
        table-layout: fixed;
    }
    .board_table01:not(:has(col:nth-child(5))) col:nth-child(1),
    .board_table01:not(:has(col:nth-child(5))) col:nth-child(4) {
        width: 0 !important;
    }
    .board_table01:not(:has(col:nth-child(5))) col:nth-child(2) { width: 70% !important; }
    .board_table01:not(:has(col:nth-child(5))) col:nth-child(3) { width: 30% !important; }
    .board_table01:not(:has(col:nth-child(5))) th:nth-child(1),
    .board_table01:not(:has(col:nth-child(5))) td:nth-child(1):not([colspan]),
    .board_table01:not(:has(col:nth-child(5))) th:nth-child(4),
    .board_table01:not(:has(col:nth-child(5))) td:nth-child(4):not([colspan]) {
        overflow: hidden !important;
        max-width: 0 !important;
        padding: 0 !important;
        white-space: nowrap;
    }

    /* 5컬럼 게시판(채용정보): 성별(4) 컬럼 숨김 */
    .board_table01:has(col:nth-child(5)) {
        table-layout: fixed;
    }
    .board_table01:has(col:nth-child(5)) col:nth-child(1) { width: 20% !important; }
    .board_table01:has(col:nth-child(5)) col:nth-child(2) { width: 20% !important; }
    .board_table01:has(col:nth-child(5)) col:nth-child(3) { width: 20% !important; }
    .board_table01:has(col:nth-child(5)) col:nth-child(4) { width: 0 !important; }
    .board_table01:has(col:nth-child(5)) col:nth-child(5) { width: 40% !important; }
    .board_table01:has(col:nth-child(5)) th:nth-child(4),
    .board_table01:has(col:nth-child(5)) td:nth-child(4):not([colspan]) {
        overflow: hidden !important;
        max-width: 0 !important;
        padding: 0 !important;
        white-space: nowrap;
    }

    /* 자유게시판(board_counsel_list): 번호(1)·조회수(4) 컬럼 숨김 */
    .board_counsel_list table {
        table-layout: fixed;
        width: 100% !important;
    }
    .board_counsel_list col:nth-child(1),
    .board_counsel_list col:nth-child(4) { width: 0 !important; }
    .board_counsel_list col:nth-child(2) { width: 60% !important; }
    .board_counsel_list col:nth-child(3) { width: 20% !important; }
    .board_counsel_list col:nth-child(5) { width: 20% !important; }
    .board_counsel_list th:nth-child(1),
    .board_counsel_list td:nth-child(1):not([colspan]),
    .board_counsel_list th:nth-child(4),
    .board_counsel_list td:nth-child(4):not([colspan]) {
        overflow: hidden !important;
        max-width: 0 !important;
        padding: 0 !important;
        white-space: nowrap;
    }

    /* 포토갤러리 - 수평 스크롤 */
    .box_board {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 게시판 쓰기 폼 입력란 전체 너비 */
    .board_counsel_inquiry input[type="text"],
    .board_counsel_inquiry input[type="password"],
    .board_counsel_inquiry input[type="file"],
    .board_counsel_inquiry textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* 푸터 */
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .footer-info {
        font-size: 11px;
    }
}
