/* 전체 폰트 설정 */
body, h1, h2, h3, h4, h5, h6, input, textarea, select, button, table {
    font-family: 'Pretendard', 'Noto Sans KR', 'Noto Sans', sans-serif !important;
}

/* 페이지 레이아웃 설정 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 최소 높이를 화면 전체 높이로 설정 */
}

/* 전체 헤더 스타일 */
#hd {
    /* 헤더 관련 속성은 header.css에서 관리합니다 */
}

/* 스크롤시 헤더 타입 개선 */
#hd.scrolled {
    width: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#hd.scrolled #hd_wrapper {
    max-width: 100%;
    border-radius: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2차 메뉴 트랜지션 */
#gnb_2depth_wrap {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 메뉴 호버 가이드라인 */
.gnb_1dli {
    position: relative;
}

.gnb_1dli:after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #4267b2;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.gnb_1dli:hover:after {
    width: 80%;
}

/* 활성화된 메뉴 표시 */
.gnb_1dli.active .gnb_1da {
    color: #4267b2;
}

.gnb_1dli.active:after {
    width: 80%;
}

/* 이미지 영역 호버 효과 */
.menu_image {
    overflow: hidden;
    border-radius: 10px;
}

.menu_image img {
    transition: transform 0.5s ease;
}

.menu_image:hover img {
    transform: scale(1.05);
}

#hd:after {
    display: none !important;
}

#hd_wrapper {
    position: relative;
    margin: 0 auto;
    padding: 15px 0;
    width: 100%;
    max-width: 1430px;
    height: 70px;
}

#hd_wrapper .inner {
    display: flex;
    align-items: center;
    width: calc(100% - 40px);
    margin: 0 auto;
    height: 100%;
}

/* 로고 스타일 */
#logo {
    margin-right: 30px;
}

#logo img {
    height: 30px;
    width: auto;
    display: block;
}

/* 메뉴 스타일 */
#gnb {
    flex: 1;
}

#hd_wrapper .inner #gnb .gnb_wrap {
    display: flex;
    align-items: center;
    width: auto; /* 너비 자동 조절 */
    justify-content: flex-end;
    margin-right: 30px !important;
}

#gnb_1dul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: flex-end;
}

.gnb_1dli {
    position: relative;
    margin-right: 40px;
}

.gnb_1dli:last-child {
    margin-right: 0;
}

.gnb_1da {
    display: block;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    padding: 0 5px;
    line-height: 40px;
}

.gnb_1da:hover {
    color: #4267b2;
}

/* 우측 항목 스타일 */
.hd_right {
    display: flex !important;
    align-items: center !important;
    margin-left: 30px !important;
}

.mail_btn {
    display: inline-block;
    padding: 8px 15px;
    margin-right: 10px;
    background: #000;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 110%;
}

.lang_select {
    position: relative;
    margin-left: 10px;
}

.current_lang {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border: none; /* 테두리 제거 */
    color: #333;
    text-decoration: none;
    font-size: 110%;
}

.current_lang img {
    width: 16px;
    height: auto;
    margin-right: 5px;
}

.current_lang i.fa-caret-down {
    margin-left: 8px;
}

.lang_options {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0;
    padding: 5px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px; /* 버튼과 동일한 모양으로 변경 */
    list-style: none;
    z-index: 100;
    width: 100%; /* 언어 선택 버튼과 동일한 넓이 유지 */
    min-width: max-content; /* 내용물이 더 넓을 경우를 대비 */
}

/* 마우스가 타격할 때 메뉴가 사라지지 않도록 간격 없애기 */
.lang_select::after {
    content: '';
    position: absolute;
    height: 10px;
    width: 100%;
    top: 100%;
    left: 0;
    z-index: 99;
}

/* hover와 active 모두 지원하여 전방위적 지원 */
.lang_select:hover .lang_options,
.lang_select.active .lang_options {
    display: block;
}

.lang_options li a {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.lang_options li a:hover {
    background: #f5f5f5;
}

.lang_options li a img {
    width: 16px;
    height: auto;
    margin-right: 5px;
}

/* 기존 헤더 요소 숨기기 */
#tnb, .hd_sch_wr, .hd_login, .gnb_menu_btn, #gnb_all, #gnb_all_bg, h2.sound_only {
    display: none !important;
}

/* 스킵 내비게이션 */
#skip_to_container {
    display: none;
}

#hd_h1 {
    position: absolute;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}

/* 메인 콘텐츠 영역 조정 */
#wrapper {
    flex: 1; /* 가능한 모든 공간을 차지하도록 설정 */
    margin-top: 100px ; /* 헤더 상단 간격(15px) + 헤더 높이(70px) + 여유공간(15px) */
    padding-top: 0;
    border-top: none !important;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: unset !important; /* 고정 높이 제거 */
    overflow: visible; /* 넘치는 컨텐츠 허용 */
}

#wrapper:before, #wrapper:after {
    display: none !important;
}

#container_wr {
    padding-top: 0;
    border-top: none !important;
    width: 100%;
    max-width: 1430px;
}

#container {
    border-top: none !important;
    width: 100% !important;
    max-width: 1430px;
    float: none !important;
    margin: 0 auto;
    flex: 1; /* 콘텐츠 영역이 가능한 모든 공간을 차지하도록 설정 */
    display: flex;
    flex-direction: column;
    overflow: visible; /* 넘치는 컨텐츠 허용 */
    min-height: unset !important; /* 고정 높이 제거 */
}

/* 라인 및 여백 제거 */
hr {
    display: none !important;
}

/* 서브 페이지 콘텐츠 영역 */
.page-content {
    /* min-height 제거하고 컨텐츠에 맞게 자동 조절되도록 수정 */
    padding: 30px 0;
    box-sizing: border-box;
}

/* 반응형 처리 */
@media (max-width: 1240px) {
    #hd_wrapper {
        padding-left: 20px;
        padding-right: 20px;
    }
}