/**
 * Yêu Hạt Glossary - Frontend Styles
 * Chuẩn giao diện bảng thuật ngữ chia cột theo nhóm chữ cái (7, A, B, C, D, Đ...),
 * Tooltip rê chuột & Trang chi tiết thuật ngữ
 */

:root {
	--yhg-primary-blue: #2b5783;
	--yhg-primary-blue-hover: #1d3f60;
	--yhg-accent-coral: #ef5350;
	--yhg-tooltip-bg: #2b2b2b;
	--yhg-tooltip-text: #ffffff;
	--yhg-border-color: #d6d6d6;
	--yhg-active-bg: #dcdcdc;
	--yhg-disabled-text: #c8c8c8;
}

/* ==========================================================================
   1. AUTO-LINKED KEYWORDS & TOOLTIP TRIGGER IN CONTENT
   ========================================================================== */
a.yh-glossary-term,
span.yh-glossary-term {
	color: inherit;
	text-decoration: none !important;
	border-bottom: 1px dashed var(--yhg-underline-color, #333333);
	padding-bottom: 1px;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
	position: relative;
	display: inline;
}

a.yh-glossary-term:hover,
a.yh-glossary-term:focus,
a.yh-glossary-term.yhg-active-hover,
span.yh-glossary-term:hover,
span.yh-glossary-term.yhg-active-hover {
	color: var(--yhg-hover-color, #ef5350) !important;
	border-bottom: 1px solid var(--yhg-hover-color, #ef5350) !important;
	text-decoration: none !important;
}

/* ==========================================================================
   2. FLOATING HOVER TOOLTIP (Hiển thị nội dung ngắn khi rê chuột)
   ========================================================================== */
.yh-glossary-tooltip-popup {
	position: fixed;
	z-index: 999999;
	background: var(--yhg-tooltip-bg, #2b2b2b);
	color: var(--yhg-tooltip-text, #ffffff);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 13.5px;
	font-weight: 400;
	line-height: 1.58;
	padding: 13px 16px;
	border-radius: 6px;
	max-width: var(--yhg-tooltip-width, 340px);
	min-width: 210px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.16s ease, transform 0.16s ease;
	word-wrap: break-word;
	text-align: left;
}

.yh-glossary-tooltip-popup.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ==========================================================================
   3. TRANG CHÍNH DANH SÁCH THUẬT NGỮ (/thuat-ngu - Chuẩn mẫu chia cột A-Z, Đ)
   ========================================================================== */
.yh-glossary-wrapper {
	max-width: 1320px;
	margin: 0 auto;
	padding: 36px 24px 72px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #111111;
}

.yh-glossary-header {
	margin-bottom: 42px;
}

.yh-glossary-main-title {
	font-size: 38px;
	font-weight: 500;
	color: #000000;
	margin: 0 0 12px 0;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.yh-glossary-subtitle {
	font-size: 13.5px;
	line-height: 1.65;
	color: #222222;
	max-width: 780px;
	margin: 0;
	font-weight: 400;
}

/* Thanh tìm kiếm & lọc chữ cái (tùy chọn) */
.yh-glossary-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 32px;
}

.yh-glossary-az-bar-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.yh-glossary-az-bar {
	display: inline-flex;
	flex-wrap: wrap;
	border: 1px solid #d4d4d4;
	background: #ffffff;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.yh-glossary-az-bar li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	border-right: 1px solid #e0e0e0;
}

.yh-glossary-az-bar li:last-child {
	border-right: none;
}

.yh-glossary-az-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 34px;
	padding: 0 8px;
	font-size: 14px;
	font-weight: 400;
	color: #222222;
	background: transparent;
	border: none;
	cursor: pointer;
	text-decoration: none !important;
	transition: background-color 0.14s ease, color 0.14s ease;
	user-select: none;
	line-height: 1;
}

.yh-glossary-az-btn[data-letter="all"] {
	padding: 0 12px;
}

.yh-glossary-az-btn:hover:not(.is-disabled):not(.is-active) {
	background-color: #f0f3f6;
	color: var(--yhg-hover-color, #ef5350);
}

.yh-glossary-az-btn.is-active {
	background-color: #111111;
	color: #ffffff;
	font-weight: 500;
}

.yh-glossary-az-btn.is-disabled {
	color: #cccccc;
	cursor: default;
	pointer-events: none;
	background: #ffffff;
}

.yh-glossary-search-row {
	max-width: 320px;
	width: 100%;
}

.yh-glossary-search-input {
	width: 100%;
	padding: 8px 13px;
	font-size: 13.5px;
	border: 1px solid #d4d4d4;
	border-radius: 4px;
	outline: none;
	transition: border-color 0.15s;
}

.yh-glossary-search-input:focus {
	border-color: #111111;
}

/* LƯỚI 6 CỘT NHÓM CHỮ CÁI (7, A, B, C, D, Đ...) CHUẨN HÌNH ĐÍNH KÈM */
.yh-glossary-groups-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	column-gap: 32px;
	row-gap: 44px;
	align-items: start;
}

.yh-glossary-groups-grid.yhg-grid-cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.yh-glossary-groups-grid.yhg-grid-cols-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
	.yh-glossary-groups-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.yh-glossary-groups-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 580px) {
	.yh-glossary-groups-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 20px;
		row-gap: 32px;
	}
	.yh-glossary-main-title {
		font-size: 30px;
	}
}

.yh-glossary-letter-group {
	min-width: 0;
}

.yh-glossary-letter-group.is-hidden {
	display: none !important;
}

.yh-glossary-letter-heading {
	font-size: 18px;
	font-weight: 600;
	color: #111111;
	margin: 0 0 14px 0;
	padding: 0;
	line-height: 1.25;
}

.yh-glossary-group-list {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.yh-glossary-item-row {
	margin: 0 !important;
	padding: 3.5px 0 3.5px 14px !important;
	list-style: none !important;
	position: relative;
	line-height: 1.5;
}

.yh-glossary-item-row::before {
	content: "•";
	position: absolute;
	left: 0;
	top: 3.5px;
	color: #111111;
	font-size: 13px;
	line-height: 1.5;
}

.yh-glossary-item-row.is-hidden {
	display: none !important;
}

a.yh-glossary-index-link {
	color: #1a1a1a;
	font-size: 13.5px;
	font-weight: 400;
	text-decoration: none !important;
	border-bottom: 1px dashed transparent;
	transition: color 0.14s ease, border-color 0.14s ease;
	display: inline;
	word-break: break-word;
}

a.yh-glossary-index-link:hover,
a.yh-glossary-index-link:focus,
a.yh-glossary-index-link.yhg-active-hover {
	color: var(--yhg-hover-color, #ef5350) !important;
	border-bottom: 1px dashed var(--yhg-hover-color, #ef5350);
}

.yh-glossary-empty-msg {
	padding: 20px 0;
	color: #666;
	font-size: 15px;
	font-style: italic;
	display: none;
}

/* ==========================================================================
   4. TRANG CHI TIẾT THUẬT NGỮ (/thuat-ngu/{slug} - Chuẩn mẫu Stinker)
   ========================================================================== */
.yh-glossary-single-wrap {
	max-width: 860px;
	margin: 0 auto;
	padding: 40px 16px 64px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #333333;
}

.yh-glossary-single-title {
	font-size: 36px;
	font-weight: 700;
	color: var(--yhg-hover-color, #ef5350);
	margin: 0 0 18px 0;
	line-height: 1.25;
}

.yh-glossary-single-divider {
	width: 118px;
	height: 2px;
	background-color: #5b6977;
	margin: 0 0 38px 0;
	border: none;
}

.yh-glossary-back-link {
	display: inline-block;
	color: var(--yhg-primary-blue, #2b5783);
	font-size: 15px;
	text-decoration: none !important;
	margin-bottom: 16px;
	transition: color 0.15s ease;
}

.yh-glossary-back-link:hover {
	color: var(--yhg-hover-color, #ef5350);
	text-decoration: underline !important;
}

.yh-glossary-back-link.is-bottom {
	margin-top: 18px;
	margin-bottom: 0;
}

.yh-glossary-single-content {
	font-size: 15.5px;
	line-height: 1.78;
	color: #2c2c2c;
}

.yh-glossary-single-content p {
	margin: 0 0 18px 0;
}
