@charset "utf-8";

html {
    scrollbar-gutter: stable;
}

/* 항상 스크롤바 공간 확보 */
body {
    overflow-y: scroll !important;
}

/* Bootstrap 모달 열릴 때 생기는 padding 제거 */
body.modal-open {
    padding-right: 0 !important;
}

:root {
    /* Colors */
    --side-title-bg: #3498db;

    /* Motion */
    --transition-base: all 0.3s ease;

    /* Typography */
    --font-base: system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --font-size-base: 15px;       /* 기본 폰트 크기 */
    --line-height-base: 1.65;     /* 한글 가독성 최적 */
    --letter-spacing-base: -0.01em;
}

/* ==============================
   Base Layout
============================== */
html {
    font-size: 16px;              /* rem 기준 */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    letter-spacing: var(--letter-spacing-base);
    color: #212529;               /* Bootstrap text-body */
    background-color: #fff;
    transition: var(--transition-base);
}

/* ==============================
   Bootstrap Compatibility
============================== */
p {
    margin-bottom: 0.75rem;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* ==============================
   Gnuboard Specific
============================== */
#container,
#container_wr,
#wrapper {
    font-size: 1rem;
}

.bo_table,
.bo_list,
.bo_view {
    font-size: 0.95rem;
}

.bo_content {
    line-height: 1.7;
}

/* ==============================
   Headings (Bootstrap scale)
============================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-base);
    font-weight: 700;
    line-height: 1.3;
}

/* ==============================
   Utilities
============================== */
.text-small {
    font-size: 0.875rem;
}

.text-large {
    font-size: 1.125rem;
}

.fw-medium {
    font-weight: 500;
}

/* ==============================
   Optional: Dark Mode
============================== */
[data-theme="dark"] body {
    background-color: #121212;
    color: #e5e5e5;
}
 
header { 
	height: 70px; 
	border-bottom: 1px solid var(--bs-border-color);
	background-color: var(--bs-body-bg);
}

/* ==============================
   Swiper 슬라이더
============================== */
.header-Swiper {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.header-Swiper::-webkit-scrollbar {
    display: none;
}

.header-Swiper .btn {
    font-size: 0.8rem !important;
}

/* 버튼의 부모 요소에 overflow hidden 추가 */
.position-sticky > .position-relative {
    overflow: hidden;
}

/* 버튼 클릭 시 배경색 변화 제거 */
.header-Swiper .btn-outline-secondary:active,
.header-Swiper .btn-outline-secondary:focus {
    color: var(--bs-secondary) !important;
    background-color: transparent !important;
    border-color: var(--bs-secondary) !important;
    box-shadow: none !important;
}

.header-Swiper .btn-primary:active,
.header-Swiper .btn-primary:focus {
    color: #ffffff !important;
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: none !important;
}

/* 다크모드에서 outline-secondary 버튼 클릭 시 */
[data-bs-theme="dark"] .header-Swiper .btn-outline-secondary:active,
[data-bs-theme="dark"] .header-Swiper .btn-outline-secondary:focus {
    color: #ffffff !important;
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* 다크모드에서 버튼 텍스트 색상 */
[data-bs-theme="dark"] .header-Swiper .btn-outline-secondary {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25);
}

[data-bs-theme="dark"] .header-Swiper .btn-outline-secondary:hover {
    background-color: #ffffff;
    border-color: #ffffff;
}

[data-bs-theme="dark"] .header-Swiper .btn-primary {
    color: #ffffff !important;
}

/* 화살표 버튼 */
.header-Swiper-arrow {
    position: absolute;
    top: -20px;
    transform: translateY(-50%);
    z-index: 10;
    display: none;
    width: 0;
    height: 0;
    padding: 0;
    font-size: 0;
    line-height: 1;
}

.header-Swiper-arrow-left {
    left: 0;
}

.header-Swiper-arrow-right {
    right: 0;
}

.header-Swiper-arrow.show {
    display: block;
}
/* ==============================
   Swiper 슬라이더
============================== */

/* 버튼 및 브랜드 전용 */
.header-btn {
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	font-size: 14px;
}
    
.header-btn-icon {
	width: 40px;
	padding: 0;
	font-size: 1.1rem;
}

.navbar-brand {
	font-size: 1.25rem !important;
	margin-right: 10px;
}

.board-title { 
	font-size: 1.5rem; 
	border-left: 5px solid var(--side-title-bg); 
	padding-left: 12px; 
	margin-bottom: 1.5rem;
}

/* --- 사이드바 통합 스타일 (PC/모바일 공통) --- */
.side-box {
	border: 1px solid var(--bs-border-color);
	border-radius: 8px;
	background-color: var(--bs-tertiary-bg);
	overflow: hidden;
	width: 100%;
	box-sizing: border-box;
}

.side-title { 
	background: var(--side-title-bg); 
	color: #fff; 
	padding: 15px; 
	font-weight: bold;
	border: none !important;
	margin-bottom: -1px; /* 미세한 틈새 방지 */
}

/* --- 모바일/태블릿 환경 (991px 이하) --- */
@media (max-width: 991.98px) {
	.offcanvas-lg { width: 300px; }
        
	/* 모바일 스크롤 및 잘림 방지 핵심 */
	.offcanvas-body {
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		display: block !important; /* flex 대신 block으로 스크롤 확보 */
	}

	.offcanvas-body > div {
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		box-sizing: border-box !important;
	}

	/* 게시판 테이블 모바일 최적화 */
	.tbl_head01 thead { display: none; }
	.tbl_head01 tr { 
		display: block; 
		margin-bottom: 1rem; 
		border: 1px solid var(--bs-border-color); 
		border-radius: 8px; 
		padding: 12px;
		background: var(--bs-tertiary-bg);
	}

	.tbl_head01 td {
		display: block;
		border: none;
		padding: 3px 0;
		text-align: left !important;
	}

	.td_num,
	.td_hit {
		display: none !important;
	}

	.td_subject {
		font-weight: bold;
		font-size: 1.1rem;
		border-bottom: 1px solid var(--bs-border-color) !important;
		margin-bottom: 8px;
		padding-bottom: 5px !important;
	}

	.td_name, .td_date {
		display: inline-block !important;
		margin-right: 12px;
		font-size: 0.85rem;
		opacity: 0.7;
	}
}

/* --- PC 환경 (992px 이상) --- */
@media (min-width: 992px) {
	.offcanvas-lg {
		position: static !important;
		visibility: visible !important;
		transform: none !important;
		background: none !important;
		border: none !important;
		width: auto !important;
		height: auto !important;
	}
	.offcanvas-body {
		overflow: visible !important;
		display: flex;
		flex-direction: column;
	}
}

/* 1. 모든 리스트 아이템 (1차, 2차 공통) */
.side-box .list-group .list-group-item {
    border-left: 4px solid transparent !important; /* 공간 확보용 투명 선 */
    padding-left: 12px !important; 
    transition: none !important;
    display: block !important;
    box-sizing: border-box !important;
	font-size: 0.9rem;
}

/* 2. 2차 메뉴 전용 (들여쓰기 유지) */
/* 1차 메뉴와 시작 라인을 맞추고 싶다면 padding-left를 동일하게, 
   안쪽으로 넣고 싶다면 아래처럼 더 크게 주시면 됩니다. */
.side-box .list-group .list-group-item.small {
    padding-left: 24px !important; /* 1차(12px)보다 더 안쪽으로 고정 */
	font-size: 0.9rem;
}

/* 3. 활성화(Active) 상태 (1차, 2차 공통) */
.side-box .list-group .list-group-item.active {
    background-color: #f0f7ff !important;
    color: #007bff !important;
    font-weight: bold !important;
    
    /* 핵심: active 상태에서도 border-left 두께를 유지해야 글자가 안 밀립니다. */
    border-left: 4px solid transparent !important; 
    
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.1) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 다크모드 대응 */
[data-bs-theme='dark'] { --side-title-bg: #2980b9; }



/* =========================
   사이드뷰 (Bootstrap 라이트/다크 대응)
   ========================= */
.sv_wrap,
.sv_wrap * {
    text-align: left !important;
}

/* 래퍼 */
.sv_wrap {
    position: relative;
    font-weight: normal;
    overflow: visible !important;
}

/* 사이드뷰를 포함한 카드는 overflow visible 처리 */
.board-list .card:has(.sv_wrap),
.board-list .card .card-body:has(.sv_wrap) {
    overflow: visible !important;
}

/* 카드 호버시 transform 때문에 잘릴 수 있으므로 제거 */
.board-list .card:has(.sv_wrap):hover {
    transform: none !important;
}

/* 멤버 이름 */
.sv_member {
    color: var(--bs-body-color);
    text-decoration: none;
}
.sv_member:hover {
    color: var(--bs-primary);
}

/* 사이드뷰 박스 */
.sv_wrap .sv {
    z-index: 10000;
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    font-size: 1em;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: auto;
    min-width: 150px;
    white-space: nowrap;
}

/* 말풍선 화살표 */
.sv_wrap .sv::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 16px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent var(--bs-body-bg) transparent;
}

/* 사이드뷰 링크 */
.sv_wrap .sv a {
    display: block;
    padding: 0 12px;
    line-height: 32px;
    width: 100%;
    color: var(--bs-body-color);
    text-decoration: none;
    white-space: nowrap;
}

/* hover */
.sv_wrap .sv a:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

/* 활성화 */
.sv_on {
    display: block !important;
}

/* JS 비활성 대응 */
.sv_nojs .sv {
    display: block;
}

/* 사이드뷰 프로필 이미지 스타일 */
.lt-user-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: white;
    font-size: 0.7rem;
	text-align:center !important;
    overflow: hidden;
}

.lt-user-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 사이드뷰 기본 스타일 */
.sv_wrap .lt-user-img {
    margin-right: 0;
    vertical-align: middle;
}


/* 시간 표시 */
.sv_time {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}


/* 1. 스크린 리더용 텍스트 숨기기 (이미지에 보이는 '열린', '페이지' 제거) */
.pg .sound_only {
    display: none !important;
}

/* 2. 페이징 전체 컨테이너 정렬 */
.pg_wrap {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    width: 100%;
}

.pg {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* 버튼 사이 간격 */
}

/* 3. 기본 버튼 스타일 (숫자 및 화살표) */
.pg_page, .pg_start, .pg_prev, .pg_next, .pg_end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    
    /* 부트스트랩 다크모드 호환 */
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
}

/* 4. 현재 선택된 페이지 (파란색 버튼) */
.pg_current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    background-color: var(--bs-primary) !important;
    border: 1px solid var(--bs-primary) !important;
    color: #fff !important;
}

/* 5. 호버 효과 */
.pg_page:hover {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-primary-border-subtle);
    color: var(--bs-primary);
}

/* 6. 화살표 버튼 내 텍스트 숨김 처리 (필요한 경우) */
.pg_start, .pg_prev, .pg_next, .pg_end {
    color: var(--bs-body-secondary);
}



/* =========================
   CAPTCHA (가운데 정렬)
   ========================= */

#captcha {
    width: 100%;
    padding: .75rem;
	margin-top: .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);

    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* 🔥 전체를 가운데 */
    align-items: center;
    gap: .5rem;
}

/* legend 숨김 */
#captcha legend {
    display: none;
}

/* 캡차 이미지 */
#captcha_img {
    height: 38px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-secondary-bg);
}

/* 입력창 */
#captcha_key {
    width: 90px;
    height: 38px;
    padding: .375rem .5rem;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-align: center;
}

#captcha_key:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .15rem rgba(var(--bs-primary-rgb), .25);
    outline: none;
}

/* 버튼 */
#captcha button {
    height: 38px;
    padding: 0 .75rem;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    font-size: .85rem;
    white-space: nowrap;
}

#captcha button:hover {
    background-color: var(--bs-tertiary-bg);
}

/* 안내 문구 (항상 아래 + 가운데) */
#captcha_info {
    flex: 0 0 100%;
    margin-top: .25rem;
    font-size: .8rem;
    color: var(--bs-secondary-color);
    text-align: center;
}
