/* Onbu News Header Styles */

/* 공통 스타일 */
.onbu-news-header {
    width: 100%;
    background: #fff;
    position: relative;
	padding-top: 15px;
}

/* 컨테이너 */
.onbu-news-header .container {
    max-width: var(--gp-container-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* 헤더 상단 */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
	position: relative;
}

.date-display {
    font-size: 14px;
    color: #666;
    position: absolute;
    left: 0;
}

.logo-container {
    width: 100%;
    text-align: center;
}

.custom-logo-link {
    display: inline-block;
}

.custom-logo {
    width: var(--gp-logo-width, 200px);
    height: auto;
    max-height: none;
}

.header-controls {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.menu-toggle {
    padding: 0 !important;
    margin-left: 0 !important; /* 혹시 모를 마진도 제거 */
    color: #323232;
    width: auto; /* 너비가 자동 조정되도록 설정 */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
	font-size: 20px !important;
	display: block !important;  /* 강제로 보이게 설정 */
}



.search-toggle {
    padding: 0 !important;
    margin-left: 0 !important; /* 혹시 모를 마진도 제거 */
    background: none !important;
    color: #323232 !important;
    width: auto; /* 너비가 자동 조정되도록 설정 */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
	font-size: 18px !important;
}

.menu-toggle {
    left: 0;
}

.search-toggle {
    right: 0;
}

/* 네비게이션 */
.main-navigation {
    border-top: 1px solid #eee;
    border-bottom: 2px solid var(--news) !important;
    position: relative;
    display: flex;
    align-items: center;

}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.nav-menu li {
    padding: 15px 50px;
    white-space: nowrap;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}


/* 사이드 패널 */

/* 관리자 바가 있을 때 사이드 패널 위치 조정 */
.admin-bar .side-panel {
    top: 32px !important; /* 워드프레스 기본 관리자 바 높이만큼 아래로 이동 */
}

.side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.side-panel.active {
    right: 0;
}

.side-panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* X 버튼과 로고 사이 여백 확보 */
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

/* X 버튼 스타일 */
.close-panel {
    background: none !important;
    border: none;
    color: #323232 !important;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    left: 15px; /* X 버튼을 왼쪽 정렬 */
}

/* 로고 컨테이너 */
.side-panel-logo {
    flex-grow: 1; /* 가용 공간을 최대로 사용 */
    text-align: center; /* 로고를 중앙 정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 로고 이미지 */
.side-panel-logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

/* 검색 폼 */
/* 검색창 컨테이너 (네비게이션 메뉴와 너비 동일하게 조정) */
.search-form-container {
    width: 100%; /* 부모 컨테이너 너비를 100%로 설정 */
    max-width: 90%; /* 카테고리 메뉴와 동일한 너비로 조정 */
    margin: 0 auto; /* 중앙 정렬 */
    padding: 0;
    border-bottom: 2px solid #000; /* 하단 검은색 선 추가 */
}

/* 검색 폼을 가로 정렬 (입력창 + 버튼) */
.search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

/* 검색 입력 필드 */
/* 기본 검색 입력 필드 스타일 제거 */
.search-field {
    border: none !important; /* 기본 테두리 제거 */
    background: none !important; /* 배경 제거 */
    box-shadow: none !important; /* 그림자 제거 */
    outline: none !important; /* 클릭 시 테두리 제거 */
    font-size: 15px;
    width: 100%;
    padding: 10px 0;
}


/* 돋보기 아이콘 버튼 */
.search-submit {
    background: none !important;
    border: none;
    color: #323232 !important;
    font-size: 20px;
    cursor: pointer;
	margin-left: 15px !important; /* 오른쪽으로 15px 이동 */
}



/* 퀵 링크 */
.quick-links {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.quick-links-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.quick-links-menu li {
    text-align: center;
}

.quick-links-menu a {
    display: block;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

/* 아코디언 메뉴 */
.accordion-menu {
    flex-grow: 1;
    overflow-y: auto;
}

.accordion-menu-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.accordion-menu-items li {
    border-bottom: 1px solid #eee;
}

.accordion-menu-items > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
	font-size: 15px;
	padding-left: 20px; /* 텍스트가 더 오른쪽으로 이동 */
}

/* 모든 메뉴 항목 끝에 기본적으로 + 아이콘 추가 */
.accordion-menu-items > li > a::after {
    content: "\f067"; /* FontAwesome '+' 아이콘 */
    font-family: "Font Awesome 5 Free"; /* FontAwesome 적용 */
    font-weight: 900; /* FontAwesome 아이콘 굵게 */
    font-size: 14px;
    color: #888; /* 기본 색상 */
    margin-left: auto; /* 아이콘을 오른쪽 끝으로 정렬 */
    transition: transform 0.3s ease, color 0.3s ease;
	margin-right: 5px; /* 아이콘이 약간 왼쪽으로 이동 */
}

.accordion-menu-items > li > a:hover {
    background-color: #fafafa; /* 원하는 호버 색상 */
    color: #000; /* 호버 시 글자색 변경 (선택) */
    transition: background-color 0.3s ease;
}

.accordion-menu-items .sub-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f8f8;
}

.accordion-menu-items .menu-item-has-children.active > .sub-menu {
    display: block;
}

.accordion-menu-items .sub-menu a {
    display: block;
    padding: 12px 15px 12px 30px;
    color: #666;
    text-decoration: none;
}

/* 사이드바 위젯 */
.sidebar-widgets {
    padding: 15px;
    background: #f8f8f8;
}

.widget {
	margin-bottom: 20px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 16px;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .date-display {
        display: none;
    }
    
    .side-panel {
        width: 100%;
    }

    /* 모바일 네비게이션 */
    .main-navigation {
        position: relative;
        width: 100%;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-top: 1px solid #eee;
        border-bottom: 2px solid var(--news) !important;
    }

    /* 모바일 메뉴 버튼 */
    .menu-toggle,
    .search-toggle {
        position: absolute;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 48px;
        background: none;
        border: none;
        padding: 0;
        margin: 0;
        color: #323232;
        font-size: 18px;
        z-index: 2;
    }

    .menu-toggle {
        left: 0;
    }

    .search-toggle {
        right: 0;
    }

    /* 네비게이션 메뉴 컨테이너 */
    .nav-menu {
        position: absolute;
        left: 40px;
        right: 40px;
        display: flex !important;
        justify-content: flex-start;
        align-items: center;
        width: calc(100% - 90px);
        height: 100%; /* 48px에서 100%로 변경 */
        margin: 0;
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu li {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        padding: 0 15px;
        text-align: center;
    }

    .nav-menu li:first-child {
        padding-left: 5px; /* 첫 번째 아이템이 잘리지 않도록 여백 조정 */
    }

    .nav-menu li:last-child {
        padding-right: 5px;
    }

    .nav-menu a {
        white-space: nowrap;
        font-size: 15px;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        height: 100%;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .side-panel {
        display: block !important;
    }
    .accordion-menu {
        display: block !important;
    }
	
	 .accordion-menu-items > li > a {
        font-size: 17px !important;
    }
}
	
   .side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* X 버튼과 로고 사이 여백 확보 */
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

/* X 버튼 스타일 */
.close-panel {
    background: none;
    border: none;
    color: #000 !important;
    font-size: 25px !important;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    left: 20px; /* X 버튼을 왼쪽 정렬 */
	margin-top: 12px;
}

/* 로고 컨테이너 */
.side-panel-logo {
    flex-grow: 1; /* 가용 공간을 최대로 사용 */
    text-align: center; /* 로고를 중앙 정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
	margin-top: 15px;
	margin-bottom: 10px;
}

/* 로고 이미지 */
.side-panel-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}


/* 애니메이션 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

.side-panel.active {
    animation: slideIn 0.3s ease forwards;
}

.side-panel:not(.active) {
    animation: slideOut 0.3s ease forwards;
}

