/* ═══════════════════════════════════════════════════════════
   JD GLOSSARY — Frontend styles
═══════════════════════════════════════════════════════════ */

.jdg-glossary {
	width: 100%;
}

/* ── Category tabs row ──────────────────────────────────── */

.jdg-cat-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 32px;
}

.jdg-cat-label {
	font-family: var(--jd-font-body);
	font-size: 14px;
	color: #888;
	white-space: nowrap;
	flex-shrink: 0;
}

.jdg-cat-tabs-wrap {
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.jdg-cat-tabs-wrap::-webkit-scrollbar {
	display: none;
}

.jdg-cat-tabs {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	padding-bottom: 2px;
}

/* Override theme tab styles for glossary context */
.jdg-cat-tabs .child-cat-tab {
	cursor: pointer;
	flex-shrink: 0;
	border: 1px solid #eff1f1;
	color: #222;
	background: none;
}

.jdg-cat-tabs .child-cat-tab:hover,
.jdg-cat-tabs .child-cat-tab:focus {
	border-color: var(--jd-color-accent);
	color: #222;
	background: none;
}

.jdg-cat-tabs .child-cat-tab.is-active,
.jdg-cat-tabs .child-cat-tab[aria-selected="true"] {
	border-color: var(--jd-color-accent);
	background: var(--jd-color-accent);
	color: #ffffff;
}

/* ── Letter panel ───────────────────────────────────────── */

.jdg-letters {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 40px;
}

.jdg-letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 4px;
	border-radius: 4px;
	border: 1px solid #eff1f1;
	background: none;
	font-family: var(--jd-font-body);
	font-size: 14px;
	font-weight: 500;
	color: #222;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.jdg-letter:hover:not(:disabled) {
	border-color: var(--jd-color-accent);
	color: var(--jd-color-accent);
}

.jdg-letter--empty,
.jdg-letter:disabled {
	color: #ccc;
	border-color: #f0f0f0;
	cursor: default;
}

/* ── Letter group heading ───────────────────────────────── */

.jdg-letter-anchor {
	display: flex;
	align-items: center;
	margin: 40px 0 16px;
}

.jdg-letter-anchor:first-child {
	margin-top: 0;
}

.jdg-letter-heading {
	font-family: var(--jd-font-heading);
	font-size: 28px;
	font-weight: 700;
	color: var(--jd-color-accent);
	line-height: 1;
}

/* ── Term card ──────────────────────────────────────────── */

.jdg-term-card {
	padding: 20px 0;
	border-bottom: 1px solid #eff1f1;
}

.jdg-term-card:last-child {
	border-bottom: none;
}

/* Clickable */
.jdg-term-card {
	cursor: pointer;
}

.jdg-term-card:hover {
	border-top-color: var(--jd-color-accent);
	border-bottom-color: var(--jd-color-accent);
}

/* Hidden by category filter */
.jdg-term-card[hidden] {
	display: none;
}

/* Title row */
.jdg-term-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.jdg-term-title {
	font-family: var(--jd-font-heading);
	font-size: 20px;
	font-weight: 700;
	color: #222;
	line-height: 1.3;
}

/* Copy link button */
.jdg-copy-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: none;
	color: #aaa;
	cursor: pointer;
	flex-shrink: 0;
	transition: color 0.15s, background 0.15s;
}

.jdg-copy-link:hover {
	color: var(--jd-color-accent);
	background: #f8f0f4;
}

.jdg-copy-link.is-copied {
	color: #2e7d32;
}

/* English title */
.jdg-term-en {
	font-family: var(--jd-font-body);
	font-size: 14px;
	color: #666;
	margin-bottom: 6px;
}

.jdg-term-en-label {
	font-style: italic;
	margin-right: 4px;
}

.jdg-term-en-value {
	font-weight: 500;
}

/* Category label */
.jdg-term-cat {
	font-family: var(--jd-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--jd-color-accent);
	margin-bottom: 10px;
	letter-spacing: 0.03em;
}

/* Description */
.jdg-term-desc {
	font-family: var(--jd-font-body);
	font-size: 16px;
	color: #333;
	line-height: 1.7;
}

.jdg-term-desc p {
	margin: 0 0 0.75em;
}

.jdg-term-desc p:last-child {
	margin-bottom: 0;
}

/* Empty state */
.jdg-empty {
	color: #999;
	font-style: italic;
	margin-top: 40px;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
	.jdg-letters {
		gap: 3px;
	}

	.jdg-letter {
		min-width: 32px;
		height: 32px;
		font-size: 13px;
	}

	.jdg-term-title {
		font-size: 18px;
	}
}
