/* Nghiền Học — menu điện thoại */
.nh-burger {
	display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
	width: 42px; height: 42px; padding: 0 10px; border-radius: 12px; cursor: pointer;
	background: rgba(15, 23, 42, .7); border: 1px solid rgba(255, 255, 255, .12);
}
.nh-burger span { display: block; height: 2px; border-radius: 2px; background: #e2e8f0; transition: transform .25s, opacity .2s; }
.nh-mm-open .nh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nh-mm-open .nh-burger span:nth-child(2) { opacity: 0; }
.nh-mm-open .nh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 1280px) { .nh-burger, .nh-mm { display: none !important; } }

.nh-mm {
	position: fixed; left: 0; right: 0; bottom: 0; top: 80px; z-index: 49;
	background: rgba(4, 6, 15, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
	overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.nh-mm-open .nh-mm { opacity: 1; visibility: visible; }
.nh-mm-open body { overflow: hidden; }
.nh-mm-inner {
	margin: 10px 16px 24px; padding: 16px; border-radius: 20px;
	background: rgba(19, 26, 56, .92); border: 1px solid rgba(255, 255, 255, .1);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
	transform: translateY(-12px); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.nh-mm-open .nh-mm-inner { transform: none; }

.nh-mm-search {
	display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 10px;
	border-radius: 999px; background: rgba(15, 23, 42, .85); border: 1px solid rgba(255, 255, 255, .1); color: #64748b;
}
.nh-mm-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; box-shadow: none; padding: 0; color: #e2e8f0; font-size: 15px; }
.nh-mm-search input::placeholder { color: #64748b; }

.nh-mm-list { list-style: none; margin: 0; padding: 0; }
.nh-mm-link {
	display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 12px; border-radius: 12px;
	color: #e2e8f0; font-size: 16px; font-weight: 600; text-align: left; background: transparent; border: 0; cursor: pointer;
}
.nh-mm-link:hover, .nh-mm-link:focus-visible { background: rgba(124, 58, 237, .18); color: #fff; }
.nh-mm-link i { width: 18px; text-align: center; }
.nh-mm-toggle { justify-content: space-between; }
.nh-mm-toggle i { transition: transform .25s; font-size: 12px; }
.nh-mm-group.is-open .nh-mm-toggle i { transform: rotate(180deg); }
.nh-mm-sub { list-style: none; margin: 0 0 6px 14px; padding: 0 0 0 10px; border-left: 1px solid rgba(255, 255, 255, .1); display: none; }
.nh-mm-group.is-open .nh-mm-sub { display: block; }
.nh-mm-sublink { display: block; padding: 10px 12px; border-radius: 10px; color: #cbd5e1; font-size: 15px; font-weight: 500; }
.nh-mm-sublink:hover { background: rgba(124, 58, 237, .15); color: #c4b5fd; }

.nh-mm-actions { display: flex; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nh-mm-login, .nh-mm-cta {
	flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 16px; border-radius: 999px; font-size: 15px; font-weight: 700; white-space: nowrap;
}
.nh-mm-login { color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .18); background: transparent; }
.nh-mm-cta { color: #fff; background: linear-gradient(90deg, #7c3aed, #4f46e5, #ec4899); box-shadow: 0 0 35px -5px rgba(112, 66, 248, .45); }

/* Header gọn hơn trên điện thoại nhỏ */
@media (max-width: 479px) {
	#brx-header .nh-brand p { display: none; }
	#brx-header .nh-cta-top { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 400px) {
	#brx-header .nh-cta-top { display: none; }
}

/* ===== Header thoáng hơn (27/09) ===== */
#brx-header .nh-hrow { gap: 20px; }
#brx-header .nh-hright { gap: 10px; }
#brx-header nav { gap: 2px !important; }
#brx-header nav > a,
#brx-header nav > div > div:first-child {
	padding: 8px 8px; border-radius: 10px; line-height: 1.2;
	transition: background-color .2s, color .2s;
}
#brx-header nav > a:hover,
#brx-header nav > div:hover > div:first-child { background: rgba(139, 92, 246, .14); color: #fff; }
#brx-header nav > div { padding-top: 0; padding-bottom: 0; }
#brx-header nav > a i, #brx-header nav > div i { margin-right: 2px; }
/* nút Đăng nhập: có khung nhẹ để tách khỏi nút Làm bài ngay */
#brx-header .nh-hright > button:not(.nh-burger):not(.nh-search-btn) {
	padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
}
#brx-header .nh-hright > button:not(.nh-burger):not(.nh-search-btn):hover { border-color: rgba(167, 139, 250, .5); }

/* 1200–1599px: ô tìm kiếm thu thành nút kính lúp; ≥1600px hiện đầy đủ */
.nh-search-btn {
	display: none; width: 40px; height: 40px; border-radius: 999px; align-items: center; justify-content: center;
	color: #94a3b8; background: rgba(15, 23, 42, .7); border: 1px solid rgba(255, 255, 255, .1); cursor: pointer;
}
.nh-search-btn:hover { color: #fff; border-color: rgba(167, 139, 250, .5); }
#brx-header .nh-hright { position: relative; }
@media (min-width: 1280px) {
	.nh-search-btn { display: inline-flex; }
	#brx-header .nh-search-pill { display: none !important; }
	#brx-header .nh-search-pill.is-open {
		display: flex !important; position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
		padding: 10px 14px; background: rgba(15, 23, 42, .97); box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
	}
	#brx-header .nh-search-pill.is-open input { width: 240px !important; }
}
/* Ô tìm kiếm luôn thu gọn thành nút kính lúp trên máy tính (ô đầy đủ không vừa khung header) */

/* Dưới 1280px: dùng menu 3 gạch thay cho menu ngang (tránh chen chúc ở màn 1024–1199) */
@media (max-width: 1279px) {
	#brx-header nav { display: none !important; }
	#brx-header .nh-search-pill { display: none !important; }
	#brx-header .nh-hrow { gap: 12px; }
}
/* Điện thoại: bỏ nút Làm bài ngay trên header (đã có trong menu), logo + nút menu cách đều */
@media (max-width: 639px) {
	#brx-header .nh-cta-top { display: none !important; }
	#brx-header .nh-hright > button:not(.nh-burger) { display: none !important; }
	#brx-header .nh-brand { gap: 10px; }
}

/* Menu điện thoại thoáng hơn */
.nh-mm-inner { padding: 18px; }
.nh-mm-search { margin-bottom: 14px; }
.nh-mm-list > li + li { border-top: 1px solid rgba(255, 255, 255, .06); }
.nh-mm-link { padding: 15px 14px; gap: 12px; }
.nh-mm-sub { margin: 2px 0 10px 16px; }
.nh-mm-sublink { padding: 11px 14px; }
.nh-mm-actions { margin-top: 16px; padding-top: 18px; gap: 12px; }

/* Thanh quản trị WP (chỉ khi đăng nhập) */
.admin-bar #brx-header { top: 32px; }
@media (max-width: 782px) { .admin-bar #brx-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar #brx-header { top: 0; } }
/* Nhảy tới mục (#lop-10...) không bị header che */
#brx-content [id] { scroll-margin-top: 110px; }
html { scroll-behavior: smooth; }
/* 1200–1319px: thu hẹp khoảng đệm menu để không chạm mép */
@media (min-width: 1280px) and (max-width: 1319px) {
	#brx-header nav > a, #brx-header nav > div > div:first-child { padding: 8px 7px; }
	#brx-header .nh-hrow { gap: 14px; }
	#brx-header .nh-brand p { display: none; }
}