/* Học Lịch Sử – Tìm kiếm AI (dùng biến màu của child theme, có giá trị dự phòng) */

.hls-ai-head__form { margin-top: 20px; max-width: 680px; }
.hls-ai-page { padding-top: 32px; padding-bottom: 72px; }

.hls-ai-box {
	position: relative;
	background: var(--hls-card, #fff);
	border: 1px solid var(--hls-line, #e8ddcc);
	border-radius: 18px;
	padding: 22px 22px 24px;
	box-shadow: 0 2px 4px rgba(61, 17, 11, .05), 0 12px 32px rgba(61, 17, 11, .08);
	margin-bottom: 40px;
	overflow: hidden;
}
.hls-ai-box::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg, var(--hls-red, #8e2a1e), var(--hls-gold, #c9972b));
}
@media (min-width: 768px) { .hls-ai-box { padding: 28px 32px 30px; } }

.hls-ai-box__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hls-ai-box__head strong { display: block; color: var(--hls-ink, #231d19); font-size: 16px; }
.hls-ai-box__sub { display: block; font-size: 13px; color: var(--hls-muted, #75685d); }
.hls-ai-box__avatar {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: linear-gradient(145deg, var(--hls-red, #8e2a1e), var(--hls-red-700, #6f1f15));
	color: #f6dc9f;
	flex: none;
}

.hls .hls-ai-box__title {
	font-size: clamp(20px, 2.4vw, 26px);
	line-height: 1.3;
	margin: 0 0 14px;
}

.hls-ai-answer {
	font-size: 16.5px;
	line-height: 1.8;
	color: var(--hls-ink-2, #4a3f37);
}
.hls-ai-answer > :first-child { margin-top: 0; }
.hls-ai-answer > :last-child { margin-bottom: 0; }
.hls-ai-answer p { margin: 0 0 1em; }
.hls-ai-answer h2, .hls-ai-answer h3 { font-size: 19px; margin: 1.4em 0 .5em; }
.hls-ai-answer ul, .hls-ai-answer ol { margin: 0 0 1em 1.3em; }
.hls-ai-answer li { margin-bottom: .35em; }
.hls-ai-answer strong { color: var(--hls-ink, #231d19); }

.hls-ai-sources {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 18px;
	font-size: 13.5px;
}
.hls-ai-sources span { color: var(--hls-muted, #75685d); font-weight: 600; }
.hls-ai-sources a {
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--hls-paper-2, #f4ede1);
	color: var(--hls-ink-2, #4a3f37);
	text-decoration: none;
}
.hls-ai-sources a:hover { background: var(--hls-gold-100, #f6ead0); color: var(--hls-red, #8e2a1e); }

.hls-ai-box__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--hls-line, #e8ddcc);
}
.hls-ai-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 20px;
	border-radius: 999px;
	border: 1px solid var(--hls-red, #8e2a1e);
	background: var(--hls-red, #8e2a1e);
	color: #fff !important;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	cursor: pointer;
	margin: 0;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.2;
}
.hls-ai-btn:hover { background: var(--hls-red-700, #6f1f15); }
.hls-ai-btn--ghost { background: transparent; color: var(--hls-red, #8e2a1e) !important; }
.hls-ai-btn--ghost:hover { background: var(--hls-paper-2, #f4ede1); }
.hls-ai-note { font-size: 13.5px; color: var(--hls-muted, #75685d); }

/* Đang tải */
.hls-ai-steps { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 18px; font-size: 13.5px; }
.hls-ai-steps span { display: inline-flex; align-items: center; gap: 8px; color: #b3a698; transition: color .3s; }
.hls-ai-steps span::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}
.hls-ai-steps .is-active { color: var(--hls-red, #8e2a1e); font-weight: 600; }
.hls-ai-steps .is-active::before { animation: hls-ai-pulse 1s ease-in-out infinite; }
.hls-ai-steps .is-done { color: var(--hls-gold-600, #a87a1c); }

.hls-ai-skeleton i {
	display: block;
	height: 14px;
	margin-bottom: 12px;
	border-radius: 7px;
	background: linear-gradient(90deg, var(--hls-paper-2, #f4ede1) 0%, #fff 50%, var(--hls-paper-2, #f4ede1) 100%);
	background-size: 200% 100%;
	animation: hls-ai-shimmer 1.4s linear infinite;
}
.hls-ai-skeleton i:nth-child(1) { width: 92%; }
.hls-ai-skeleton i:nth-child(2) { width: 100%; }
.hls-ai-skeleton i:nth-child(3) { width: 84%; }
.hls-ai-skeleton i:nth-child(4) { width: 60%; margin-bottom: 0; }

@keyframes hls-ai-shimmer { to { background-position: -200% 0; } }
@keyframes hls-ai-pulse { 50% { transform: scale(1.5); opacity: .5; } }

.hls-ai-box.is-not_found .hls-ai-answer,
.hls-ai-box.is-off_topic .hls-ai-answer,
.hls-ai-error p { color: var(--hls-muted, #75685d); }
.hls-ai-error p { margin: 0 0 14px; }

.hls-ai-results { margin-top: 8px; }
.hls-ai-noresult {
	padding: 28px;
	text-align: center;
	color: var(--hls-muted, #75685d);
	background: var(--hls-card, #fff);
	border: 1px dashed var(--hls-line-2, #d9cab3);
	border-radius: 14px;
}

/* ---------- Bài viết hỏi – đáp ---------- */

.hls-qa-question {
	padding: 16px 20px;
	border-left: 4px solid var(--hls-gold, #c9972b);
	background: var(--hls-gold-100, #f6ead0);
	border-radius: 0 12px 12px 0;
	font-size: 1.05em;
	color: var(--hls-ink, #231d19);
}
.hls-qa-sources {
	margin-top: 2em;
	padding: 18px 22px;
	background: var(--hls-paper-2, #f4ede1);
	border-radius: 12px;
	font-size: .94em;
}
.hls .hls-qa-sources h2 { font-size: 17px; margin: 0 0 8px; }
.hls-qa-sources ul { margin: 0 0 0 1.2em; }
.hls-qa-sources li { margin-bottom: .3em; }

.hls-qa-cta {
	margin-top: 2.4em;
	padding: 22px 24px;
	border: 1px solid var(--hls-line, #e8ddcc);
	border-radius: 14px;
	background: var(--hls-card, #fff);
}
.hls-qa-cta p { margin: 0 0 12px; }
.hls-qa-cta form { display: flex; gap: 8px; margin: 0 0 12px; }
.hls .hls-qa-cta input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--hls-line-2, #d9cab3);
	border-radius: 999px;
	box-shadow: none;
	font-size: 15px;
}
.hls .hls-qa-cta button {
	height: 44px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--hls-red, #8e2a1e);
	color: #fff;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	line-height: 44px;
}
.hls-qa-cta .hls-qa-note { margin: 0; font-size: 13px; color: var(--hls-muted, #75685d); }

@media (prefers-reduced-motion: reduce) {
	.hls-ai-skeleton i, .hls-ai-steps .is-active::before { animation: none; }
}
