/**
 * 무역용어 사전 (/trade-glossary/) 전용 스타일.
 *
 * 히어로·브레드크럼·wrap 등 공통 뼈대는 export-guide.css를 그대로 쓰고
 * (셸이 항상 함께 로드한다), 여기서는 이 페이지에만 있는 요소만 정의한다.
 * 색은 theme.json 프리셋 변수만 사용한다.
 */

/* === 히어로 === */
.tg-hero {
	padding: 0 0 40px;
	background: linear-gradient(180deg, var(--wp--preset--color--brand-light) 0%, var(--wp--preset--color--base) 100%);
}
.tg-breadcrumb {
	padding: 22px 0 18px;
}
.tg-hero .eg-hero-title {
	margin-bottom: 16px;
}
.tg-hero .eg-hero-sub {
	max-width: 760px;
}
.tg-hero .eg-hero-sub strong {
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
}

/* === 컨트롤 영역 (검색 · 카테고리 · 개수) === */
.tg-controls {
	margin-top: 28px;
}

/* --- 검색 --- */
.tg-search {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px;
	border-radius: 16px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
}
.tg-search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 52px;
	padding: 0 18px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	font-size: 16px;
	color: var(--wp--preset--color--contrast);
	box-sizing: border-box;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.tg-search-input::placeholder {
	color: var(--wp--preset--color--text-muted);
}
.tg-search-input:focus {
	outline: none;
	border-color: var(--wp--preset--color--brand);
	box-shadow: 0 0 0 3px rgba(20, 40, 160, 0.12);
}
/* 사파리·크롬이 type="search"에 붙이는 기본 지우기 버튼(초기화 링크와 중복). */
.tg-search-input::-webkit-search-decoration,
.tg-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}
.tg-search-submit {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 52px;
	padding: 0 26px;
	border: 0;
	border-radius: 12px;
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
	font-size: 15.5px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.18s ease;
}
.tg-search-submit:hover {
	background: var(--wp--preset--color--brand-dark);
}
.tg-search-submit .eg-icon {
	width: 18px;
	height: 18px;
	color: currentColor;
}
.tg-search-reset {
	display: inline-flex;
	align-items: center;
	height: 52px;
	padding: 0 20px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--text-secondary);
	font-size: 15.5px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.18s ease, color 0.18s ease;
}
.tg-search-reset:hover {
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--brand);
}

/* --- 카테고리 버튼 --- */
.tg-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}
.tg-cat {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--text-secondary);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.tg-cat:hover {
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--brand);
}
.tg-cat.is-active {
	background: var(--wp--preset--color--brand);
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
}
/* 검색 중 결과가 0건인 카테고리. 눌러 볼 수는 있게 두되 헛걸음임을 미리 알린다. */
.tg-cat.is-empty {
	opacity: 0.45;
}
.tg-cat-count {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--wp--preset--color--text-muted);
	font-variant-numeric: tabular-nums;
}
.tg-cat.is-active .tg-cat-count {
	color: rgba(255, 255, 255, 0.72);
}

/* --- 결과 개수 · 노출 개수 --- */
.tg-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 30px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.tg-total {
	margin: 0;
	font-size: 15.5px;
	color: var(--wp--preset--color--text-secondary);
}
.tg-total strong {
	font-weight: 800;
	color: var(--wp--preset--color--contrast);
	font-variant-numeric: tabular-nums;
}
.tg-perpage {
	display: flex;
	align-items: center;
	gap: 8px;
}
.tg-perpage-select {
	height: 40px;
	padding: 0 34px 0 14px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background-color: var(--wp--preset--color--base);
	/* 브라우저 기본 화살표 대신 직접 그린다(운영체제마다 크기가 제각각이라). */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A7A90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px 16px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	font-size: 14.5px;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}
.tg-perpage-select:focus {
	outline: none;
	border-color: var(--wp--preset--color--brand);
}
.tg-perpage-label {
	font-size: 14.5px;
	color: var(--wp--preset--color--text-muted);
	white-space: nowrap;
}
.tg-perpage-submit {
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--text-secondary);
	cursor: pointer;
}

/* === 용어 목록 === */
.tg-list-wrap {
	margin-top: 24px;
}
.tg-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 14px;
}
.tg-item {
	padding: 22px 24px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--base);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.tg-item:hover {
	border-color: #C8CEE8;
	box-shadow: 0 6px 20px rgba(13, 18, 48, 0.06);
}
.tg-item-head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px 12px;
}
.tg-badge {
	align-self: center;
	flex-shrink: 0;
	padding: 6px 14px;
	border: 1px solid var(--wp--preset--color--brand);
	border-radius: 999px;
	color: var(--wp--preset--color--brand);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.18s ease, color 0.18s ease;
}
.tg-badge:hover {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
}
.tg-term-en {
	margin: 0;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.3px;
	line-height: 1.4;
	color: var(--wp--preset--color--contrast);
	word-break: break-word;
}
.tg-term-ko {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--wp--preset--color--text-secondary);
	word-break: keep-all;
}
.tg-term-desc {
	margin: 14px 0 0;
	padding: 16px 18px;
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
	font-size: 15px;
	line-height: 1.8;
	color: var(--wp--preset--color--text-secondary);
	word-break: keep-all;
}
.tg-mark {
	padding: 0 2px;
	border-radius: 3px;
	background: var(--wp--preset--color--accent-gold);
	color: var(--wp--preset--color--contrast);
}

/* === 결과 없음 === */
.tg-empty {
	padding: 60px 24px;
	text-align: center;
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--surface);
}
.tg-empty-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
}
.tg-empty-sub {
	margin: 0;
	font-size: 15px;
	line-height: 1.75;
	color: var(--wp--preset--color--text-muted);
	word-break: keep-all;
}
.tg-empty-sub a {
	color: var(--wp--preset--color--brand);
	font-weight: 600;
}

/* === 페이지네이션 === */
.tg-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 36px;
}
.tg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--text-secondary);
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.18s ease, color 0.18s ease;
	box-sizing: border-box;
}
.tg-pagination a.page-numbers:hover {
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--brand);
}
.tg-pagination .page-numbers.current {
	background: var(--wp--preset--color--brand);
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
}
.tg-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	min-width: 24px;
	padding: 0;
}

/* === 교차 링크 === */
.tg-crosslink .eg-related-all {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
}

/* === 모바일 === */
@media (max-width: 768px) {
	.tg-hero {
		padding-bottom: 28px;
	}
	.tg-search {
		flex-wrap: wrap;
		padding: 12px;
		gap: 8px;
	}
	.tg-search-input {
		flex: 1 0 100%;
		height: 48px;
		font-size: 16px; /* iOS가 16px 미만이면 포커스 시 화면을 확대한다. */
	}
	.tg-search-submit {
		flex: 1 1 0;
		height: 46px;
		justify-content: center;
		padding: 0 18px;
	}
	.tg-search-reset {
		height: 46px;
		padding: 0 18px;
	}
	.tg-cats {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		/* 스크롤이 화면 끝까지 이어지도록 wrap의 좌우 여백만큼 밖으로 뺀다. */
		margin-left: -18px;
		margin-right: -18px;
		padding: 0 18px;
	}
	.tg-cats::-webkit-scrollbar {
		display: none;
	}
	.tg-meta {
		margin-top: 22px;
	}
	.tg-item {
		padding: 18px 18px;
	}
	.tg-term-en {
		font-size: 17.5px;
	}
	.tg-term-desc {
		padding: 14px 15px;
		font-size: 14.5px;
	}
	.tg-pagination .page-numbers {
		min-width: 38px;
		height: 38px;
		padding: 0 9px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tg-item,
	.tg-cat,
	.tg-badge,
	.tg-search-input,
	.tg-search-submit,
	.tg-search-reset,
	.tg-pagination .page-numbers {
		transition: none;
	}
}
