:root {
	--color-primary: #2563eb;
	--color-primary-dark: #1d4ed8;
	--color-text: #1f2937;
	--color-muted: #6b7280;
	--color-border: #e5e7eb;
	--color-bg: #f5f6f8;
	--color-surface: #ffffff;
	--color-danger: #dc2626;
	--color-success: #059669;
	--radius: 6px;
}

* { box-sizing: border-box; }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body {
	margin: 0;
	font-family: -apple-system, "Segoe UI", "Malgun Gothic", Roboto, Helvetica, Arial, sans-serif;
	background: var(--color-bg);
	color: var(--color-text);
	line-height: 1.6;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* 입력창/textarea/select 는 정상적으로 선택·편집 가능해야 하므로 예외 처리 */
input, textarea, select {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); }

.wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 16px;
}

/* Header */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }

.site-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
}

.logo { font-size: 22px; font-weight: 800; color: var(--color-primary); letter-spacing: -0.5px; }

.member-box { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--color-muted); }
.member-box a { color: var(--color-text); }
.member-box .welcome { color: var(--color-text); }

.site-nav { background: var(--color-primary); }
.site-nav-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.site-nav ul { list-style: none; display: flex; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav li a {
	display: block;
	padding: 12px 18px;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
}
.site-nav li a:hover { background: var(--color-primary-dark); color: #fff; }

/* 카테고리 그룹 드롭다운 메뉴 */
.has-dropdown { position: relative; }
.nav-dropdown-toggle {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 18px;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	background: none;
	border: 0;
	cursor: pointer;
	font-family: inherit;
}
.nav-dropdown-toggle:hover { background: var(--color-primary-dark); }
.nav-dropdown-toggle .caret { font-size: 10px; }
.site-nav .nav-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 180px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--color-surface);
	border-radius: var(--radius);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
	z-index: 50;
}
.has-dropdown.open .nav-dropdown { display: block; }
.nav-dropdown li a {
	display: block;
	padding: 9px 16px;
	color: var(--color-text);
	font-weight: 500;
	font-size: 14px;
}
.nav-dropdown li a:hover { background: var(--color-bg); color: var(--color-primary); }

.site-search { display: flex; gap: 4px; padding: 8px 0; flex-shrink: 0; }
.site-search input {
	padding: 6px 10px;
	border: 0;
	border-radius: 4px;
	font-size: 13px;
	width: 140px;
	min-width: 0;
}
.site-search button { padding: 6px 10px; flex-shrink: 0; }

/* Main */
.site-main { padding: 24px 16px 60px; min-height: 60vh; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #ecfdf5; color: var(--color-success); border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }

/* Panels / cards */
.panel {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 20px;
}

.panel-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--color-text);
}

/* 홈 화면 상단 배너 슬라이더 */
.home-slider { position: relative; overflow: hidden; border-radius: var(--radius); margin-bottom: 20px; background: #000; }
.home-slider-track { display: flex; transition: transform 0.4s ease; }
.home-slide { position: relative; flex: 0 0 100%; aspect-ratio: 16 / 9; }
.home-slide-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-slide-video, .home-slide-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.home-slide-caption {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	padding: 10px 16px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	pointer-events: none;
}
.home-slider-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	border: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
}
.home-slider-arrow:hover { background: rgba(0, 0, 0, 0.6); }
.home-slider-arrow.prev { left: 10px; }
.home-slider-arrow.next { right: 10px; }
.home-slider-dots {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
}
.home-slider-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); border: 0; cursor: pointer; padding: 0; }
.home-slider-dot.active { background: #fff; }

@media (max-width: 640px) {
	.home-slider-arrow { width: 30px; height: 30px; font-size: 16px; }
}

/* Board list table */
.board-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board-table th, .board-table td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--color-border);
	text-align: center;
}
.board-table th { color: var(--color-muted); font-weight: 600; background: #fafafa; }
.board-table td.subject { text-align: left; word-break: break-word; }
.board-table td.subject a { font-weight: 500; }
.board-table tr.notice { background: #f8fafc; }
.badge-notice {
	display: inline-block;
	font-size: 11px;
	color: #fff;
	background: var(--color-primary);
	border-radius: 3px;
	padding: 1px 6px;
	margin-right: 6px;
}
.comment-count { color: var(--color-primary); font-weight: 700; font-size: 12px; margin-left: 4px; }

.copyable-key {
	cursor: pointer;
	background: #f3f4f6;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	padding: 2px 6px;
}
.copyable-key:hover { border-color: var(--color-primary); color: var(--color-primary); }
.copyable-key.copied { background: #e8f6ee; border-color: #2f8a52; color: #2f8a52; }

.board-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.board-search { justify-content: flex-end; }
.board-search input {
	padding: 7px 10px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	font-size: 13px;
	min-width: 0;
}

/* Buttons */
.btn {
	display: inline-block;
	padding: 9px 16px;
	border-radius: var(--radius);
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-text);
	font-size: 14px;
	cursor: pointer;
	font-weight: 600;
}
.btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-danger { color: var(--color-danger); border-color: var(--color-danger); background: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-row input[type=text],
.form-row input[type=password],
.form-row input[type=email],
.form-row select,
.form-row textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	font-size: 14px;
	font-family: inherit;
}
.form-row textarea { min-height: 260px; resize: vertical; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.field-error { color: var(--color-danger); font-size: 13px; margin-top: 4px; }
.form-narrow { max-width: 420px; margin: 0 auto; }

/* Post view */
.post-header { border-bottom: 2px solid var(--color-text); padding-bottom: 14px; margin-bottom: 18px; }
.post-title { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.post-meta { color: var(--color-muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.post-content { font-size: 15px; min-height: 120px; white-space: pre-wrap; word-break: break-word; margin-bottom: 24px; }
.post-content.is-html { white-space: normal; line-height: 1.8; }

/* 관리자가 작성한 페이지 / 에디터(TinyMCE)로 작성된 게시글 본문 (신뢰 가능한 HTML) */
.page-content { font-size: 15px; line-height: 1.8; word-break: break-word; }
/*
 * TinyMCE 로 이미지/영상 크기를 조절하면 width/height 를 인라인 style 이나
 * 속성으로 고정값으로 박아넣는데, 화면 폭이 좁을 때도 그 고정값을 그대로 쓰면
 * 넘치거나 너무 작게 보일 수 있어 !important 로 항상 컨테이너 폭에 맞춘다.
 */
.page-content img,
.post-content.is-html img {
	max-width: 100% !important;
	width: auto !important;
	height: auto !important;
	border-radius: var(--radius);
}
.page-content iframe,
.page-content video,
.page-content embed,
.page-content object,
.post-content.is-html iframe,
.post-content.is-html video,
.post-content.is-html embed,
.post-content.is-html object {
	max-width: 100% !important;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
	overflow: hidden;
	border: 0;
}
.page-content .lightbox-img,
.post-content.is-html .lightbox-img { cursor: zoom-in; }
.page-content p,
.post-content.is-html p { margin: 0 0 1em; }
.page-content h1, .page-content h2, .page-content h3,
.post-content.is-html h1, .post-content.is-html h2, .post-content.is-html h3 { margin: 1.4em 0 0.6em; line-height: 1.4; }
.page-content table,
.post-content.is-html table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.page-content table td, .page-content table th,
.post-content.is-html table td, .post-content.is-html table th { border: 1px solid var(--color-border); padding: 8px; }

.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 14px 0; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* URL을 단독으로 입력하면 나오는 노션(Notion) 스타일 웹 북마크 카드 */
.link-bookmark {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	margin: 14px 0;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.link-bookmark:hover { border-color: var(--color-primary); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); color: inherit; }
.link-bookmark-thumb {
	flex-shrink: 0;
	width: 140px;
	background-color: #f3f4f6;
	background-size: cover;
	background-position: center;
}
.link-bookmark-info {
	flex: 1;
	min-width: 0;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}
.link-bookmark-title {
	font-weight: 600;
	font-size: 15px;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.link-bookmark-desc {
	font-size: 13px;
	color: var(--color-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.link-bookmark-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9ca3af; margin-top: 2px; }
.link-bookmark-favicon { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.link-bookmark-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
	.link-bookmark.has-thumb { flex-direction: column; }
	.link-bookmark-thumb { width: 100%; height: 140px; }
}

.attachment-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attachment-list li { font-size: 13px; padding: 8px 12px; background: #fafafa; border: 1px solid var(--color-border); border-radius: var(--radius); }
.attachment-list a { font-weight: 600; }
.attachment-images { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 0 0 20px; }
.attachment-images img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--color-border); cursor: zoom-in; }

/* 이미지 클릭 시 뜨는 팝업(라이트박스) */
.lightbox-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 1000;
	align-items: center;
	justify-content: center;
	padding: 24px;
	cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img {
	max-width: 100%;
	max-height: 100%;
	border-radius: var(--radius);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Comments */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.comment-item.reply { margin-left: 32px; }
.comment-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--color-muted); margin-bottom: 4px; }
.comment-head strong { color: var(--color-text); }
.comment-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.comment-actions a { font-size: 12px; color: var(--color-muted); margin-left: 8px; }
.comment-form { display: flex; gap: 8px; margin-top: 16px; }
.comment-form textarea { flex: 1; min-height: 60px; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius); font-family: inherit; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span {
	display: inline-block;
	min-width: 32px;
	padding: 6px 8px;
	text-align: center;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	font-size: 13px;
}
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Admin */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #111827; color: #e5e7eb; flex-shrink: 0; }
.admin-sidebar .logo { display: block; padding: 18px 20px; color: #fff; font-weight: 800; font-size: 18px; border-bottom: 1px solid #1f2937; }
.admin-sidebar ul { list-style: none; margin: 0; padding: 10px 0; }
.admin-sidebar li a { display: block; padding: 10px 20px; color: #cbd5e1; font-size: 14px; }
.admin-sidebar li a:hover, .admin-sidebar li a.active { background: #1f2937; color: #fff; }
.admin-sidebar .sidebar-divider { height: 1px; background: #1f2937; margin: 10px 20px; }
.admin-content { flex: 1; padding: 24px 30px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; }
.admin-table th { background: #fafafa; color: var(--color-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--color-primary); }
.stat-card .label { color: var(--color-muted); font-size: 13px; margin-top: 4px; }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); padding: 20px 0; margin-top: 40px; color: var(--color-muted); font-size: 13px; text-align: center; }
.site-footer .footer-biz-info { margin: 0 0 8px; line-height: 1.6; }

@media (max-width: 640px) {
	.wrap { padding: 0 12px; }

	/* 헤더: 로고와 회원정보(환영합니다/로그아웃 등)를 한 줄로 유지 */
	.site-header-top { flex-wrap: nowrap; gap: 8px; padding: 12px; }
	.logo { font-size: 17px; flex-shrink: 0; }
	.member-box { flex-wrap: nowrap; gap: 6px; font-size: 12px; min-width: 0; }
	.member-box .welcome {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		min-width: 0;
	}
	.member-box a { flex-shrink: 0; white-space: nowrap; }

	.site-nav-inner { flex-direction: column; align-items: stretch; }
	.site-nav ul { padding: 4px 0; }
	.site-nav li a { padding: 10px 12px; }
	.site-search { width: 100%; padding: 6px 0 10px; }
	.site-search input { flex: 1; width: auto; }

	/* 드롭다운: 데스크탑처럼 떠있는 패널이 아니라, 메뉴 안에서 바로 펼쳐지는 아코디언 형태로 */
	.nav-dropdown-toggle { width: 100%; padding: 10px 12px; justify-content: space-between; }
	.site-nav .nav-dropdown {
		position: static;
		display: none;
		width: 100%;
		margin: 0;
		padding: 0;
		background: rgba(0, 0, 0, 0.12);
		border-radius: 0;
		box-shadow: none;
	}
	.has-dropdown.open .nav-dropdown { display: block; }
	.nav-dropdown li a { padding: 10px 12px 10px 28px; color: #fff; }
	.nav-dropdown li a:hover { background: var(--color-primary-dark); color: #fff; }

	.site-main { padding: 16px 12px 40px; }
	.panel { padding: 14px; }
	.panel-title { font-size: 16px; }

	/* 게시판 툴바/검색 */
	.board-search { width: 100%; }
	.board-search input { flex: 1; }

	/* 게시판 목록: 번호/조회 컬럼은 숨기고 제목 위주로 */
	.board-table { font-size: 13px; table-layout: fixed; }
	.board-table th, .board-table td {
		padding: 8px 6px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.col-hide-sm { display: none; }

	/* 제목이 길면 줄바꿈 대신 한 줄로 자르고 ...으로 표시 */
	.board-table td.subject {
		display: flex;
		align-items: center;
		gap: 4px;
		white-space: nowrap;
		overflow: hidden;
		word-break: normal;
	}
	.board-table td.subject a {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.board-table td.subject .badge-notice,
	.board-table td.subject .comment-count {
		flex-shrink: 0;
	}

	/* 폼 */
	.form-row textarea { min-height: 180px; }
	.form-actions { flex-wrap: wrap; }
	.form-narrow { max-width: 100%; }

	/* 게시글 보기 */
	.post-title { font-size: 18px; }
	.attachment-images img { max-width: 100%; height: auto; }

	/* 댓글 */
	.comment-item.reply { margin-left: 14px; }
	.comment-form { flex-direction: column; }
	.comment-form button { align-self: flex-end; }

	/* 관리자 */
	.admin-body { flex-direction: column; }
	.admin-sidebar { width: 100%; }
	.admin-sidebar ul { display: flex; overflow-x: auto; padding: 0; }
	.admin-sidebar li a { padding: 12px 14px; white-space: nowrap; }
	.admin-content { padding: 16px; }
	.admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
