/* ==========================================================================
   WP 개념사전 - 프론트엔드 스타일
   ========================================================================== */

/* 가나다/ABC 인덱스
   ========================================================================== */
.wpcd-index {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 30px;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 8px;
}

.wpcd-index-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.wpcd-index-item.active {
	background: #0073aa;
	color: #fff;
}

.wpcd-index-item.active:hover {
	background: #005a87;
	color: #fff;
}

.wpcd-index-item.inactive {
	background: #e9ecef;
	color: #adb5bd;
	pointer-events: none;
}

/* 개념 그룹
   ========================================================================== */
.wpcd-group {
	margin-bottom: 30px;
}

.wpcd-group-title {
	font-size: 24px;
	font-weight: 700;
	color: #0073aa;
	padding-bottom: 8px;
	border-bottom: 2px solid #0073aa;
	margin-bottom: 15px;
}

.wpcd-terms {
	margin: 0;
}

.wpcd-terms dt {
	font-weight: 600;
	font-size: 16px;
	margin-bottom: 4px;
}

.wpcd-terms dt a {
	color: #1e1e1e;
	text-decoration: none;
}

.wpcd-terms dt a:hover {
	color: #0073aa;
}

.wpcd-terms dd {
	margin: 0 0 20px 0;
	padding-left: 0;
	color: #555;
	font-size: 14px;
	line-height: 1.6;
}

/* 자동 링크 + 툴팁
   ========================================================================== */
a.wpcd-term {
	position: relative;
	border-bottom: 1px dotted #0073aa;
	text-decoration: none;
	color: inherit;
}

a.wpcd-term:hover {
	color: #0073aa;
}

/* 툴팁 - 다크 */
a.wpcd-term[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	padding: 10px 14px;
	background: #1e1e1e;
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	border-radius: 6px;
	white-space: normal;
	width: max-content;
	max-width: 300px;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

a.wpcd-term[data-tooltip]::before {
	content: '';
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1e1e1e;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

a.wpcd-term[data-tooltip]:hover::after,
a.wpcd-term[data-tooltip]:hover::before {
	opacity: 1;
	visibility: visible;
}

/* 툴팁 - 라이트 */
.wpcd-tooltip-light a.wpcd-term[data-tooltip]::after {
	background: #fff;
	color: #333;
	border: 1px solid #ddd;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wpcd-tooltip-light a.wpcd-term[data-tooltip]::before {
	border-top-color: #fff;
}

/* AJAX 검색
   ========================================================================== */
.wpcd-search-wrap {
	position: relative;
	max-width: 500px;
	margin-bottom: 30px;
}

.wpcd-search-input {
	width: 100%;
	padding: 12px 16px;
	font-size: 16px;
	border: 2px solid #ddd;
	border-radius: 8px;
	outline: none;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
}

.wpcd-search-input:focus {
	border-color: #0073aa;
}

.wpcd-search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	display: none;
	z-index: 1000;
	max-height: 400px;
	overflow-y: auto;
}

.wpcd-search-results.active {
	display: block;
}

.wpcd-search-result-item {
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s ease;
}

.wpcd-search-result-item:last-child {
	border-bottom: none;
}

.wpcd-search-result-item:hover {
	background: #f8f9fa;
}

.wpcd-search-result-item a {
	text-decoration: none;
	color: inherit;
	display: block;
}

.wpcd-search-result-item .term-title {
	font-weight: 600;
	font-size: 15px;
	color: #1e1e1e;
	margin-bottom: 4px;
}

.wpcd-search-result-item .term-excerpt {
	font-size: 13px;
	color: #666;
	line-height: 1.4;
}

.wpcd-search-no-results {
	padding: 16px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* 아카이브 / 싱글 템플릿
   ========================================================================== */
.wpcd-archive-wrap {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px 0;
}

.wpcd-single-wrap {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px 0;
}

.wpcd-single-meta {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.wpcd-single-meta .category-badge {
	display: inline-block;
	padding: 4px 12px;
	background: #e8f4fd;
	color: #0073aa;
	border-radius: 20px;
	font-size: 13px;
	text-decoration: none;
}

.wpcd-single-meta .category-badge:hover {
	background: #0073aa;
	color: #fff;
}

/* 반응형
   ========================================================================== */
@media (max-width: 768px) {
	.wpcd-index {
		gap: 3px;
		padding: 10px;
	}

	.wpcd-index-item {
		width: 30px;
		height: 30px;
		font-size: 12px;
	}

	.wpcd-search-wrap {
		max-width: 100%;
	}

	a.wpcd-term[data-tooltip]::after {
		max-width: 220px;
		font-size: 12px;
	}
}
