/* =====================================================================
 * Knowledge / Research hub pages (template-knowledge.php,
 * template-research.php). Uses the --sc-* tokens from site-chrome.css.
 * ===================================================================== */
#content.hb { padding: 0 !important; }
.hb { background: #faf7fd; color: var(--sc-text); overflow-x: clip; }
.hb-wrap { max-width: var(--sc-max); margin: 0 auto; padding: 0 24px; }
.hb a { text-decoration: none; }
.hb a:focus-visible { outline: 2px solid var(--sc-purple); outline-offset: 3px; border-radius: 10px; }

/* ---------- Hero ---------- */
.hb-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 40px 0 44px;
	background: linear-gradient(180deg, #fff 0%, #fbf8fe 100%);
	border-bottom: 1px solid var(--sc-line);
}
.hb-hero::before {
	content: "";
	position: absolute;
	inset: -40% -10%;
	z-index: -1;
	background:
		radial-gradient(34% 50% at 8% 20%, rgba(168, 85, 247, .14), transparent 70%),
		radial-gradient(30% 45% at 94% 80%, rgba(245, 196, 81, .09), transparent 70%);
}
.hb-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 22px; font-size: 13.5px !important; color: var(--sc-muted); }
.hb-crumbs a { color: var(--sc-muted) !important; font-weight: 600; }
.hb-crumbs a:hover { color: var(--sc-purple) !important; }
.hb-crumbs i { font-size: 9px !important; opacity: .6; }
.hb-crumbs span { color: var(--sc-ink); font-weight: 600; }
.hb .hb-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12.5px !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sc-purple); }
.hb .hb-title { margin: 0; font-size: clamp(30px, 4vw, 48px) !important; font-weight: 800; line-height: 1.2; color: var(--sc-ink); }
.hb .hb-desc { max-width: 700px; margin: 12px 0 0; font-size: 16.5px !important; line-height: 1.75; }
.hb-stats { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 24px 0 0; padding: 0; }
.hb-stats li { display: flex; flex-direction: column; min-width: 140px; padding: 12px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--sc-line); box-shadow: 0 8px 22px rgba(31, 18, 51, .05); }
.hb-stats strong { font-family: 'Playfair Display', 'Noto Sans Thai', serif !important; font-size: 30px !important; font-weight: 600; line-height: 1.1; color: var(--sc-purple); }
.hb-stats span { font-size: 12.5px !important; color: var(--sc-muted); }
.hb-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hb-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--sc-line); font-size: 13.5px !important; font-weight: 600; color: var(--sc-text) !important; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.hb-jump a i { color: var(--sc-purple); font-size: 12px !important; transition: color .2s ease; }
.hb-jump a:hover { background: var(--sc-purple); border-color: var(--sc-purple); color: #fff !important; }
.hb-jump a:hover i { color: #fff; }

.hb-body { padding-top: 40px; padding-bottom: 88px; }
.hb-intro { margin-bottom: 36px; padding: 24px 28px; border-radius: 20px; background: #fff; border: 1px solid var(--sc-line); }
.hb-intro > :last-child { margin-bottom: 0; }

/* ---------- Sections ---------- */
.hb-section { scroll-margin-top: 100px; }
.hb-section + .hb-section { margin-top: 64px; }
.hb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.hb .hb-kicker { margin: 0 0 6px; font-size: 12.5px !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sc-purple); }
.hb .hb-head h2,
.hb .hb-video h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px) !important; font-weight: 700; line-height: 1.35; color: var(--sc-ink); }
.hb-more { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 14.5px !important; font-weight: 700; color: var(--sc-purple) !important; }
.hb-more i { font-size: 11px !important; transition: transform .2s ease; }
.hb-more:hover i { transform: translateX(4px); }

/* Cards */
.hb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.hb-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hb-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid var(--sc-line); transition: transform .25s ease, box-shadow .25s ease; }
.hb-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(31, 18, 51, .1); }
.hb-card-media { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sc-lavender); color: #c9b2e8; font-size: 30px; }
.hb-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.hb-card:hover .hb-card-media img { transform: scale(1.05); }
.hb-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.hb-card-date { font-size: 12.5px !important; color: var(--sc-muted); }
.hb-card-date i { color: var(--sc-purple); }
.hb .hb-card h3 { margin: 0; font-size: 15.5px !important; font-weight: 700; line-height: 1.5; }
.hb-card h3 a { color: var(--sc-ink) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hb-card h3 a::after { content: ""; position: absolute; inset: 0; }
.hb-card:hover h3 a { color: var(--sc-purple) !important; }
.hb-card-text { font-size: 13.5px !important; line-height: 1.65; color: var(--sc-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Books */
.hb-books { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.hb-books a { display: flex; flex-direction: column; gap: 12px; }
.hb-book { display: block; aspect-ratio: 600 / 848; overflow: hidden; border-radius: 5px 12px 12px 5px; background: var(--sc-lavender); box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .35), 0 14px 28px rgba(31, 18, 51, .18); transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease; transform-origin: left center; }
.hb-book img { width: 100%; height: 100%; object-fit: cover; }
.hb-books a:hover .hb-book { transform: perspective(1200px) rotateY(-12deg) translateY(-4px); box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .35), 14px 22px 34px rgba(31, 18, 51, .26); }
.hb-book-year { font-family: 'Playfair Display', 'Noto Sans Thai', serif !important; font-size: 19px !important; font-weight: 600; color: var(--sc-purple); }

/* Video */
.hb-video { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 44px; align-items: center; padding: 32px; border-radius: 24px; background: #fff; border: 1px solid var(--sc-line); }
.hb-video h2 { margin-bottom: 20px !important; }
.hb-video-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background: var(--sc-ink); }
.hb-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hb-btn { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px 20px; border-radius: 999px; border: 1.5px solid #dccbf0; background: #fff; font-size: 14.5px !important; font-weight: 700; color: var(--sc-purple) !important; transition: background .2s ease, border-color .2s ease; }
.hb-btn:hover { background: var(--sc-lavender); border-color: var(--sc-purple); }
.hb-btn-light { margin-top: 0; border-color: transparent; }

/* Link list */
.hb-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.hb-links a { display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--sc-line); font-size: 14.5px !important; font-weight: 700; line-height: 1.5; color: var(--sc-ink) !important; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.hb-links a > span:nth-child(2) { flex: 1; min-width: 0; }
.hb-links a:hover { transform: translateY(-2px); border-color: #e2d3f4; box-shadow: 0 12px 28px rgba(31, 18, 51, .08); color: var(--sc-purple) !important; }
.hb-link-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: var(--sc-lavender); color: var(--sc-purple); transition: background .2s ease, color .2s ease; }
.hb-links a:hover .hb-link-icon { background: var(--sc-purple); color: #fff; }
.hb-link-arrow { flex-shrink: 0; font-size: 12px !important; color: var(--sc-muted); transition: transform .2s ease, color .2s ease; }
.hb-links a:hover .hb-link-arrow, .hb-tl-card:hover .hb-link-arrow { transform: translateX(3px); color: var(--sc-purple); }

/* ---------- Research: feature ---------- */
.hb-feature {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
	gap: 36px;
	align-items: center;
	margin-bottom: 64px;
	padding: 28px;
	border-radius: 26px;
	background: linear-gradient(125deg, #3a0766 0%, #4b0880 40%, var(--sc-purple) 100%);
	color: #fff;
	box-shadow: 0 24px 50px rgba(75, 8, 128, .28);
}
.hb-feature::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(40% 70% at 95% 0%, rgba(214, 140, 255, .45), transparent 70%); }
.hb-feature-media { display: block; overflow: hidden; border-radius: 18px; aspect-ratio: 4 / 3; background: rgba(255, 255, 255, .1); }
.hb-feature-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hb .hb-feature-label { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 12.5px !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #e4c9ff; }
.hb-pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #f5c451; }
.hb-pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(245, 196, 81, .6); animation: hb-pulse 1.8s ease-out infinite; }
@keyframes hb-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hb .hb-feature h2 { margin: 0 0 12px; font-size: clamp(20px, 2.3vw, 28px) !important; font-weight: 800; line-height: 1.4; }
.hb-feature h2 a { color: #fff !important; }
.hb .hb-feature-date { margin: 0 0 10px; font-size: 15px !important; font-weight: 600; color: #f5c451; }
.hb .hb-feature-text { margin: 0 0 22px; font-size: 15px !important; line-height: 1.75; color: rgba(255, 255, 255, .85); }
.hb-feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hb-countdown { font-size: 14px !important; color: rgba(255, 255, 255, .85); }
.hb-countdown strong { font-family: 'Playfair Display', 'Noto Sans Thai', serif !important; font-size: 28px !important; color: #fff; margin-right: 4px; }

/* ---------- Research: timeline ---------- */
.hb-timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 96px; }
.hb-timeline::before { content: ""; position: absolute; left: 78px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, #d8b4fe, var(--sc-line)); }
.hb-timeline li { position: relative; }
.hb-timeline li + li { margin-top: 12px; }
.hb-tl-year { position: absolute; left: -96px; top: 50%; width: 64px; transform: translateY(-50%); text-align: right; font-family: 'Playfair Display', 'Noto Sans Thai', serif !important; font-size: 18px !important; font-weight: 600; color: var(--sc-purple); }
.hb-timeline li::before { content: ""; position: absolute; left: -24px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--sc-purple); box-shadow: 0 0 0 4px #faf7fd; }
.hb-timeline li.is-upcoming::before { background: #f5c451; border-color: #f5c451; }
.hb-tl-card { display: flex; align-items: center; gap: 16px; padding: 12px 18px 12px 12px; border-radius: 18px; background: #fff; border: 1px solid var(--sc-line); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.hb-tl-card:hover { transform: translateX(4px); border-color: #e2d3f4; box-shadow: 0 12px 28px rgba(31, 18, 51, .08); }
.hb-tl-thumb { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 96px; height: 64px; overflow: hidden; border-radius: 12px; background: var(--sc-lavender); color: #c9b2e8; }
.hb-tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hb-tl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hb-tl-title { font-size: 15px !important; font-weight: 700; line-height: 1.5; color: var(--sc-ink); }
.hb-tl-card:hover .hb-tl-title { color: var(--sc-purple); }
.hb-tl-date { font-size: 13px !important; color: var(--sc-muted); }
.hb-tl-date i { color: var(--sc-purple); }

/* ---------- Research: tiles + members ---------- */
.hb-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hb-tile { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 20px; background: #fff; border: 1px solid var(--sc-line); transition: transform .25s ease, box-shadow .25s ease; }
.hb-tile:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(31, 18, 51, .1); }
.hb-tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 14px; background: linear-gradient(135deg, #8a2be2, var(--sc-purple)); color: #fff; box-shadow: 0 10px 22px rgba(106, 13, 173, .25); }
.hb-tile strong { font-size: 16.5px !important; line-height: 1.45; color: var(--sc-ink); }
.hb-tile:hover strong { color: var(--sc-purple); }
.hb-tile > span:last-child { font-size: 14px !important; line-height: 1.65; color: var(--sc-muted); }
.hb-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.hb-members a { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; padding: 16px 10px; border-radius: 16px; background: #fff; border: 1px solid var(--sc-line); text-align: center; transition: border-color .2s ease, box-shadow .2s ease; }
.hb-members a:hover { border-color: #e2d3f4; box-shadow: 0 10px 24px rgba(31, 18, 51, .08); }
.hb-members img { width: 56px; height: 56px; object-fit: contain; }
.hb-members span { font-size: 13px !important; font-weight: 600; line-height: 1.45; color: var(--sc-text); }
.hb-members a:hover span { color: var(--sc-purple); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.hb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.hb-books { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.hb-books li:nth-child(5) { display: none; }
}
@media (max-width: 900px) {
	.hb-grid, .hb-grid-3, .hb-links, .hb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hb-video, .hb-feature { grid-template-columns: 1fr; gap: 24px; }
	.hb-books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.hb-books li:nth-child(n+4) { display: none; }
}
@media (max-width: 640px) {
	.hb-wrap { padding: 0 16px; }
	.hb-hero { padding: 26px 0 30px; }
	.hb-stats li { flex: 1 1 40%; min-width: 0; }
	.hb-jump { flex-wrap: nowrap; overflow-x: auto; margin: 20px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
	.hb-jump a { flex-shrink: 0; }
	.hb-body { padding-top: 28px; padding-bottom: 56px; }
	.hb-head { flex-wrap: wrap; }
	.hb-grid, .hb-grid-3, .hb-links, .hb-tiles { grid-template-columns: 1fr; }
	.hb-books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.hb-books li:nth-child(3) { display: none; }
	.hb-video, .hb-feature { padding: 20px; border-radius: 20px; }
	.hb-timeline { padding-left: 22px; }
	.hb-timeline::before { left: 6px; }
	.hb-timeline li::before { left: -22px; }
	.hb-tl-year { position: static; display: block; width: auto; margin: 0 0 6px; transform: none; text-align: left; font-size: 16px !important; }
	.hb-timeline li::before { top: 12px; margin-top: 0; }
	.hb-tl-thumb { width: 72px; height: 52px; }
	.hb-members { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
	.hb *, .hb *::before, .hb *::after { transition: none !important; animation: none !important; }
}
