/*!
Theme Name: Chính Tả
Description: Theme cho website phân biệt chính tả tiếng Việt: hộp trả lời nhanh, bảng so sánh, mẹo nhớ, bài tập có đáp án, trang nhóm lỗi, tra cứu gợi ý tức thì và liên kết nội bộ tự động. Dựa trên Underscores.
Version: 1.4.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: chinhta
Tags: blog, education, one-column, custom-logo, custom-menu, featured-images, block-patterns, block-styles

Chính Tả is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.

Biến màu, font và giao diện các khối trong bài viết nằm ở assets/css/content.css.
*/

/*--------------------------------------------------------------
>>> MỤC LỤC:
----------------------------------------------------------------
# Nền tảng
# Bố cục
# Header & menu
# Ô tìm kiếm
# Trang chủ
# Thẻ (card, nhóm lỗi, chip, nhãn)
# Breadcrumb & tiêu đề trang
# Bài viết
# Bài liên quan, tác giả
# Footer
# WordPress core & tiện ích
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Nền tảng
--------------------------------------------------------------*/
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {

	body {
		font-size: 1.125rem;
	}
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: var(--c-text);
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.2;
	text-wrap: balance;
}

p {
	margin: 0 0 1.1em;
}

a {
	color: var(--c-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--c-primary-dark);
}

:focus-visible {
	outline: 3px solid var(--c-accent-line);
	outline-offset: 2px;
}

img,
video {
	max-width: 100%;
	height: auto;
}

svg {
	flex: none;
}

button,
input,
select,
textarea {
	color: inherit;
	font: inherit;
}

button {
	cursor: pointer;
}

hr {
	height: 1px;
	margin: 2rem 0;
	border: 0;
	background: var(--c-line);
}

/*--------------------------------------------------------------
# Bố cục
--------------------------------------------------------------*/
.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1;
}

.container {
	width: 100%;
	max-width: calc(1120px + 2 * var(--gutter, 16px));
	margin-inline: auto;
	padding-inline: var(--gutter, 16px);
}

.container--narrow {
	max-width: calc(720px + 2 * var(--gutter, 16px));
}

.container .container--narrow {
	margin-inline: 0;
	padding-inline: 0;
	max-width: 720px;
}

:root {
	--gutter: 16px;
}

@media (min-width: 600px) {

	:root {
		--gutter: 24px;
	}
}

@media (min-width: 1024px) {

	:root {
		--gutter: 32px;
	}
}

.section {
	padding: clamp(2rem, 5vw, 3.5rem) 0;
}

.section--alt {
	background: var(--c-surface);
	border-block: 1px solid var(--c-line);
}

.section--chips {
	padding-top: clamp(2rem, 4vw, 2.75rem);
}

.section__head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.section__title {
	margin: 0;
	font-size: clamp(1.55rem, 3.5vw, 2rem);
}

.section__title--sm {
	margin-bottom: 0.85rem;
	font-size: 1.25rem;
}

a.section__more {
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
	font-size: 0.95rem;
	font-weight: 700;
	text-decoration: none;
}

a.section__more:hover {
	text-decoration: underline;
}

/*--------------------------------------------------------------
# Header & menu
--------------------------------------------------------------*/
.site-header {
	position: relative;
	z-index: 20;
	background: var(--c-surface);
	border-bottom: 1px solid var(--c-line);
}

.site-header__inner {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	min-height: 64px;
}

.site-branding {
	display: flex;
	gap: 0.85rem;
	align-items: center;
	min-width: 0;
	margin-right: auto;
}

.site-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.65rem;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}

.site-title a {
	padding: 0 0.12em;
	background: linear-gradient(transparent 60%, var(--c-accent) 60%, var(--c-accent) 92%, transparent 92%);
	color: var(--c-primary);
	text-decoration: none;
}

.site-description {
	display: none;
	margin: 0;
	color: var(--c-muted);
	font-size: 0.85rem;
	line-height: 1.3;
}

.custom-logo-link {
	display: block;
	min-width: 0;
	max-width: 100%;
}

/* Logo ngang (≈ 6:1): thu nhỏ theo màn hình, co lại thay vì tràn khi header chật. */
.custom-logo-link img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 34px;
}

@media (max-width: 400px) {

	.custom-logo-link img {
		max-height: 28px;
	}

	/* Màn hình rất hẹp: nút menu chỉ còn biểu tượng (chữ "Menu" vẫn đọc được bằng trình đọc màn hình). */
	.menu-toggle span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	.menu-toggle {
		padding: 0;
	}
}

.menu-toggle,
.search-toggle {
	display: inline-flex;
	gap: 0.4rem;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 0.85rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: 999px;
	color: var(--c-text);
	font-size: 0.95rem;
	font-weight: 700;
}

.search-toggle {
	padding: 0;
}

.menu-toggle:hover,
.search-toggle:hover,
.menu-toggle[aria-expanded="true"],
.search-toggle[aria-expanded="true"] {
	background: var(--c-primary-soft);
	border-color: #d9cffc;
	color: var(--c-primary-dark);
}

.main-navigation ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-navigation a {
	display: block;
	color: var(--c-text);
	font-weight: 700;
	text-decoration: none;
}

.header-search {
	order: 1;
}

.main-navigation {
	order: 2;
}

@media (max-width: 959px) {

	.main-navigation .menu {
		display: none;
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		max-height: calc(100vh - 64px);
		overflow-y: auto;
		padding: 0.5rem var(--gutter) 1rem;
		background: var(--c-surface);
		border-bottom: 1px solid var(--c-line);
		box-shadow: var(--shadow);
	}

	.main-navigation.toggled .menu {
		display: block;
	}

	.main-navigation .menu a {
		padding: 0.7rem 0.25rem;
		border-bottom: 1px solid var(--c-line);
	}

	.main-navigation .sub-menu {
		padding-left: 1rem;
	}

	.main-navigation .sub-menu a {
		font-weight: 400;
	}

	.header-search__panel {
		display: none;
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		padding: 0.75rem var(--gutter);
		background: var(--c-surface);
		border-bottom: 1px solid var(--c-line);
		box-shadow: var(--shadow);
	}

	.header-search__panel.is-open {
		display: block;
	}
}

@media (min-width: 960px) {

	.site-header__inner {
		gap: 1rem;
		min-height: 72px;
	}

	.site-description {
		display: block;
		max-width: 16rem;
	}

	.custom-logo-link img {
		max-height: 44px;
	}

	/* Có logo (đã chứa tên site) thì chỉ hiện khẩu hiệu khi header đủ rộng. */
	.custom-logo-link ~ .site-description {
		display: none;
	}

	.menu-toggle,
	.search-toggle {
		display: none;
	}

	.header-search,
	.main-navigation {
		order: 0;
	}

	.header-search__panel {
		width: 300px;
	}

	.main-navigation .menu {
		display: flex;
		gap: 0.25rem;
		align-items: center;
	}

	.main-navigation li {
		position: relative;
	}

	.main-navigation .menu > li > a {
		padding: 0.5rem 0.85rem;
		border-radius: 999px;
		font-size: 0.98rem;
	}

	.main-navigation .menu > li > a:hover,
	.main-navigation .menu > .current-menu-item > a,
	.main-navigation .menu > .current-menu-ancestor > a {
		background: var(--c-primary-soft);
		color: var(--c-primary-dark);
	}

	.main-navigation .menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 0.4em;
		height: 0.4em;
		margin-left: 0.45em;
		border-right: 2px solid currentcolor;
		border-bottom: 2px solid currentcolor;
		transform: translateY(-0.2em) rotate(45deg);
	}

	.main-navigation .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 30;
		min-width: 250px;
		padding: 0.5rem;
		background: var(--c-surface);
		border: 1px solid var(--c-line);
		border-radius: var(--radius);
		box-shadow: var(--shadow);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
	}

	/* Mục cuối nằm sát mép phải: menu con mở về bên trái để không tràn màn hình. */
	.main-navigation .menu > li:last-child > .sub-menu {
		right: 0;
		left: auto;
	}

	.main-navigation .sub-menu .sub-menu {
		top: 0;
		left: 100%;
	}

	.main-navigation li:hover > .sub-menu,
	.main-navigation li.focus > .sub-menu,
	.main-navigation li:focus-within > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.main-navigation .sub-menu a {
		padding: 0.5rem 0.75rem;
		border-radius: var(--radius-sm);
		font-size: 0.95rem;
		font-weight: 400;
	}

	.main-navigation .sub-menu a:hover,
	.main-navigation .sub-menu .current-menu-item > a {
		background: var(--c-primary-soft);
		color: var(--c-primary-dark);
	}

	.main-navigation .sub-menu .menu-item-has-children > a::after {
		transform: translateY(-0.1em) rotate(-45deg);
	}
}

/*--------------------------------------------------------------
# Ô tìm kiếm
--------------------------------------------------------------*/
.search-form {
	position: relative;
}

.search-form__field {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	padding: 0.25rem 0.25rem 0.25rem 0.9rem;
	background: var(--c-surface);
	border: 2px solid var(--c-line);
	border-radius: 999px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.search-form__field:focus-within {
	border-color: var(--c-primary);
	box-shadow: 0 0 0 4px var(--c-primary-soft);
}

.search-form__field .icon {
	color: var(--c-muted);
}

.search-field {
	flex: 1;
	min-width: 0;
	padding: 0.45rem 0;
	background: transparent;
	border: 0;
	outline: 0;
	font-size: 1rem;
}

.search-field::placeholder {
	color: #8f8aa6;
}

.search-submit {
	flex: none;
	padding: 0.5rem 1rem;
	background: var(--grad-brand);
	border: 0;
	border-radius: 999px;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
}

.search-submit:hover {
	background: var(--grad-brand-hover);
}

.search-form--lg .search-form__field {
	padding: 0.4rem 0.4rem 0.4rem 1.15rem;
	border-width: 3px;
	box-shadow: 0 8px 0 var(--c-primary-soft);
}

.search-form--lg .search-form__field:focus-within {
	box-shadow: 0 8px 0 var(--c-primary-soft), 0 0 0 4px var(--c-primary-soft);
}

.search-form--lg .search-field {
	padding: 0.65rem 0;
	font-size: 1.1rem;
}

.search-form--lg .search-submit {
	padding: 0.75rem 1.35rem;
	font-size: 1.05rem;
}

.search-suggest {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	z-index: 40;
	overflow: hidden;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	text-align: left;
}

.search-suggest[hidden] {
	display: none;
}

.search-suggest__list {
	margin: 0;
	padding: 0.35rem;
	list-style: none;
}

.search-suggest__list a {
	display: block;
	padding: 0.55rem 0.8rem;
	border-radius: var(--radius-sm);
	color: var(--c-text);
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
}

.search-suggest__list a:hover,
.search-suggest__list [aria-selected="true"] a {
	background: var(--c-primary-soft);
	color: var(--c-primary-dark);
}

.search-suggest__list .search-suggest__all {
	margin-top: 0.25rem;
	padding-top: 0.25rem;
	border-top: 1px solid var(--c-line);
}

.search-suggest__list .search-suggest__all a {
	color: var(--c-primary);
	font-size: 0.95rem;
	font-weight: 400;
}

/*--------------------------------------------------------------
# Trang chủ
--------------------------------------------------------------*/
.hero {
	padding: clamp(2.75rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.25rem);
	background-color: var(--c-bg);
	background-image: radial-gradient(#e4dac8 1.2px, transparent 1.3px);
	background-size: 22px 22px;
	border-bottom: 1px solid var(--c-line);
	text-align: center;
}

.hero__inner {
	max-width: calc(760px + 2 * var(--gutter));
}

.hero__title {
	margin-bottom: 0.4em;
	color: var(--c-text);
	font-size: clamp(2.2rem, 6.5vw, 3.75rem);
	line-height: 1.08;
}

/* Giống chữ "Chính Tả" trong logo: chữ tím trên vạch bút dạ vàng. */
.brand-mark {
	padding: 0 0.06em;
	background: linear-gradient(transparent 60%, var(--c-accent) 60%, var(--c-accent) 90%, transparent 90%);
	color: var(--c-primary);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.hero__text {
	max-width: 620px;
	margin: 0 auto 1.75rem;
	text-wrap: pretty;
	color: var(--c-muted);
	font-size: clamp(1rem, 2.2vw, 1.2rem);
}

.hero .search-form {
	max-width: 640px;
	margin: 0 auto;
	text-align: left;
}

/* Ô check chính tả */
.checker {
	max-width: 720px;
	margin: 0 auto;
	text-align: left;
}

.checker__box {
	background: var(--c-surface);
	border: 3px solid var(--c-line);
	border-radius: var(--radius);
	box-shadow: 0 8px 0 var(--c-primary-soft);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.checker__box:focus-within {
	border-color: var(--c-primary);
	box-shadow: 0 8px 0 var(--c-primary-soft), 0 0 0 4px var(--c-primary-soft);
}

.checker__input {
	display: block;
	width: 100%;
	min-height: 8.5rem;
	padding: 1rem 1.1rem 0.5rem;
	background: transparent;
	border: 0;
	border-radius: var(--radius) var(--radius) 0 0;
	outline: 0;
	font-size: 1.05rem;
	line-height: 1.6;
	resize: vertical;
}

.checker__input::placeholder {
	color: #8f8aa6;
}

.checker__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	padding: 0.5rem 0.5rem 0.5rem 1.1rem;
	border-top: 1px dashed var(--c-line);
}

.checker__count {
	margin-right: auto;
	color: var(--c-muted);
	font-size: 0.85rem;
}

.checker__sample {
	padding: 0.55rem 0.95rem;
	background: transparent;
	border: 1px solid var(--c-line);
	border-radius: 999px;
	color: var(--c-text);
	font-size: 0.92rem;
	font-weight: 700;
}

.checker__sample:hover {
	border-color: var(--c-primary);
	color: var(--c-primary);
}

.checker__submit {
	display: inline-flex;
	gap: 0.45rem;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.35rem;
	background: var(--grad-brand);
	border: 0;
	border-radius: 999px;
	color: #fff;
	font-size: 1.02rem;
	font-weight: 700;
}

.checker__submit:hover {
	background: var(--grad-brand-hover);
}

.checker__submit .icon {
	stroke-width: 3;
}

.checker__submit:disabled {
	cursor: progress;
	opacity: 0.75;
}

@media (max-width: 480px) {

	.checker__submit {
		flex: 1 1 100%;
	}
}

.checker__note {
	margin: 1.1rem 0 0;
	color: var(--c-muted);
	font-size: 0.88rem;
	text-align: center;
}

.checker__result {
	margin-top: 1.25rem;
	padding: 1.1rem 1.2rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	scroll-margin: 1rem;
}

.checker__head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.8rem;
}

.checker__title {
	margin: 0;
	color: var(--c-err);
	font-family: var(--font-display);
	font-size: 1.2rem;
	font-weight: 800;
	line-height: 1.3;
}

.checker__title.is-ok {
	color: var(--c-ok);
}

.checker__title:focus {
	outline: 0;
}

.checker__fix-all {
	padding: 0.45rem 1rem;
	background: var(--c-ok);
	border: 0;
	border-radius: 999px;
	color: #fff;
	font-size: 0.92rem;
	font-weight: 700;
}

.checker__fix-all:hover {
	filter: brightness(0.92);
}

.checker__preview {
	margin: 0 0 1rem;
	padding: 0.85rem 1rem;
	background: var(--c-bg);
	border-radius: var(--radius-sm);
	line-height: 1.85;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* Mạnh hơn "mark:not([style])" (tô vàng trong bài viết) ở content.css. */
.checker__preview .checker__err {
	padding: 0 0.15em;
	background: var(--c-err-soft);
	border-radius: 4px;
	color: var(--c-err);
	font-weight: 700;
	text-decoration: underline wavy var(--c-err);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
}

.checker__list {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.checker__item {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.55rem 0.6rem 0.55rem 0.9rem;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
}

.checker__pair {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.45rem;
	align-items: baseline;
	margin: 0;
	font-size: 1.02rem;
}

.checker__wrong {
	color: var(--c-err);
}

.checker__arrow,
.checker__times {
	color: var(--c-muted);
}

.checker__times {
	font-size: 0.85rem;
}

.checker__right {
	color: var(--c-ok);
}

.checker__actions {
	display: flex;
	gap: 0.6rem;
	align-items: center;
}

.checker__fix {
	padding: 0.35rem 0.95rem;
	background: var(--c-ok-soft);
	border: 0;
	border-radius: 999px;
	color: var(--c-ok);
	font-size: 0.9rem;
	font-weight: 700;
}

.checker__fix:hover {
	background: var(--c-ok);
	color: #fff;
}

a.checker__more {
	font-size: 0.9rem;
	font-weight: 700;
}

.checker__hint {
	margin: 0.9rem 0 0;
	color: var(--c-muted);
	font-size: 0.88rem;
}

.checker__result > .checker__hint:first-child {
	margin-top: 0;
}

/*--------------------------------------------------------------
# Thẻ (card, nhóm lỗi, chip, nhãn)
--------------------------------------------------------------*/
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: 1rem;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
	border-color: #ddd2fb;
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.card:focus-within {
	outline: 3px solid var(--c-accent-line);
	outline-offset: 2px;
}

.card__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem 1.1rem 1.1rem;
}

.card__title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.25;
}

.card__title a {
	color: var(--c-text);
	text-decoration: none;
}

.card__title a:focus-visible {
	outline: 0;
}

/* Cả thẻ bấm được. */
.card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card:hover .card__title a {
	color: var(--c-primary);
}

.card__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--c-muted);
	font-size: 0.95rem;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

.card__body .badge {
	align-self: flex-start;
	margin-top: auto;
}

.card[hidden] {
	display: none;
}

/* Thẻ ngang: ảnh nhỏ bên trái (trang nhóm lỗi). */
.card-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.85rem;
}

@media (min-width: 700px) {

	.card-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}
}

.card--row {
	flex-direction: row;
	align-items: center;
}

.card--row .card__media {
	flex: none;
	width: clamp(112px, 30%, 200px);
	padding: 0.7rem 0 0.7rem 0.7rem;
}

.card--row .card__media img {
	border-radius: calc(var(--radius) - 5px);
}

.card--row .card__body {
	gap: 0.35rem;
	align-self: stretch;
	justify-content: center;
	padding: 0.85rem 1rem;
}

.card--row .card__title {
	font-size: 1.15rem;
}

.card--row .card__excerpt {
	font-size: 0.92rem;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.card--row .badge {
	margin-top: 0.15rem;
}

@media (max-width: 480px) {

	.card--row .card__title {
		font-size: 1.05rem;
	}

	.card--row .card__body {
		padding: 0.7rem 0.8rem;
	}

	.card--row .card__excerpt {
		font-size: 0.84rem;
		line-height: 1.45;
	}
}

.group-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
	gap: 1rem;
}

.group-card {
	--group-color: var(--c-primary);
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1.1rem 1.2rem 1.15rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-top: 5px solid var(--group-color);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	transition: transform 0.15s, box-shadow 0.15s;
}

.group-card:nth-child(6n + 2) {
	--group-color: #c2185b;
}

.group-card:nth-child(6n + 3) {
	--group-color: #1f7a45;
}

.group-card:nth-child(6n + 4) {
	--group-color: #a14d0a;
}

.group-card:nth-child(6n + 5) {
	--group-color: #1d64a8;
}

.group-card:nth-child(6n) {
	--group-color: #8a3ab9;
}

.group-card:hover {
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.group-card:focus-within {
	outline: 3px solid var(--c-accent-line);
	outline-offset: 2px;
}

.group-card__title {
	margin: 0;
	font-size: 1.35rem;
}

.group-card__title a {
	color: var(--c-text);
	text-decoration: none;
}

.group-card__title a:focus-visible {
	outline: 0;
}

.group-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.group-card__count {
	margin: 0;
	color: var(--group-color);
	font-size: 0.9rem;
	font-weight: 700;
}

.group-card__sample {
	margin: 0;
	color: var(--c-muted);
	font-size: 0.92rem;
	line-height: 1.5;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.chips--center {
	justify-content: center;
	margin-top: 1.4rem;
}

.chips__label {
	align-self: center;
	color: var(--c-muted);
	font-size: 0.92rem;
}

a.chip {
	display: inline-flex;
	gap: 0.4rem;
	align-items: center;
	padding: 0.3rem 0.85rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: 999px;
	color: var(--c-text);
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.45;
	text-decoration: none;
}

a.chip:hover {
	border-color: var(--c-primary);
	color: var(--c-primary);
}

a.chip--group {
	background: var(--c-primary-soft);
	border-color: transparent;
	color: var(--c-primary-dark);
}

.chip__count {
	color: var(--c-muted);
	font-size: 0.85em;
	font-weight: 400;
}

.badge {
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
	padding: 0.2rem 0.65rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.45;
	white-space: nowrap;
}

.badge::before {
	content: "";
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background: currentcolor;
}

.badge--a {
	background: var(--c-info-soft);
	color: var(--c-info);
}

.badge--b {
	background: var(--c-err-soft);
	color: var(--c-err);
}

.badge--c {
	background: var(--c-ok-soft);
	color: var(--c-ok);
}

/*--------------------------------------------------------------
# Breadcrumb & tiêu đề trang
--------------------------------------------------------------*/
.breadcrumb {
	padding-top: 1.25rem;
	color: var(--c-muted);
	font-size: 0.9rem;
	line-height: 1.5;
}

.breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumb li + li::before {
	content: "›";
	margin-right: 0.4rem;
	color: #b3aec6;
}

.breadcrumb a {
	color: var(--c-muted);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--c-primary);
	text-decoration: underline;
}

.breadcrumb [aria-current] {
	color: var(--c-text);
}

.page-header {
	padding: 1.25rem 0 1.75rem;
}

/* Tiêu đề trang tìm kiếm / lưu trữ thẳng lề trái với lưới thẻ bên dưới. */
.page-header .container--narrow {
	max-width: calc(1120px + 2 * var(--gutter));
}

.page-header .container--narrow > * {
	max-width: 720px;
}

.page-header .search-form {
	margin-top: 1rem;
}

.eyebrow {
	margin: 0 0 0.35rem;
	color: var(--c-primary);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.page-title {
	margin: 0 0 0.35rem;
	font-size: clamp(2rem, 5vw, 2.75rem);
	line-height: 1.12;
}

.page-count {
	margin: 0 0 1rem;
	color: var(--c-muted);
	font-weight: 700;
}

.archive-description {
	margin-top: 1rem;
}

/*--------------------------------------------------------------
# Trang nhóm lỗi
--------------------------------------------------------------*/
.hub {
	--group-color: var(--c-primary);
}

.hub--c1 {
	--group-color: #c2185b;
}

.hub--c2 {
	--group-color: #1f7a45;
}

.hub--c3 {
	--group-color: #a14d0a;
}

.hub--c4 {
	--group-color: #1d64a8;
}

.hub--c5 {
	--group-color: #8a3ab9;
}

.hub-hero {
	display: grid;
	gap: 1.5rem;
	align-items: center;
	margin: 0.9rem 0 1.5rem;
	padding: clamp(1.4rem, 4vw, 2.5rem);
	background-color: var(--c-surface);
	background-image: radial-gradient(#ebe3d4 1.1px, transparent 1.2px);
	background-size: 20px 20px;
	border: 1px solid var(--c-line);
	border-top: 6px solid var(--group-color);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

@media (min-width: 900px) {

	.hub-hero {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 2.5rem;
	}
}

.hub-hero .eyebrow {
	color: var(--group-color);
}

.hub-hero__title {
	margin: 0 0 0.6rem;
	font-size: clamp(2rem, 5vw, 3rem);
	line-height: 1.08;
}

.hub-hero__desc {
	max-width: 640px;
	color: var(--c-muted);
}

.hub-hero__desc > :last-child {
	margin-bottom: 0;
}

.hub-hero__count {
	display: inline-flex;
	gap: 0.35rem;
	align-items: baseline;
	margin: 1rem 0 0;
	padding: 0.3rem 0.9rem;
	background: color-mix(in srgb, var(--group-color) 10%, #fff);
	border-radius: 999px;
	color: var(--group-color);
	font-size: 0.92rem;
	font-weight: 700;
}

.hub-hero__count strong {
	font-family: var(--font-display);
	font-size: 1.15rem;
}

/* Thẻ từ mẫu bên phải banner, cùng phong cách thumbnail. */
.hub-hero__sample {
	display: none;
}

@media (min-width: 900px) {

	.hub-hero__sample {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		min-width: 260px;
		max-width: 340px;
		margin-right: 0.5rem;
		padding: 1.6rem 1.75rem 1.4rem;
		background: #fffdf8;
		border-radius: var(--radius);
		box-shadow: 0 10px 28px rgba(31, 29, 51, 0.12);
		text-align: center;
		transform: rotate(-2.5deg);
	}

	.hub-hero__sample::before {
		content: "";
		position: absolute;
		top: -12px;
		left: 50%;
		width: 96px;
		height: 26px;
		background: rgba(255, 213, 79, 0.75);
		transform: translateX(-50%) rotate(3deg);
	}
}

.hub-hero__word {
	color: var(--group-color);
	font-family: var(--font-display);
	font-size: clamp(2rem, 3.4vw, 2.6rem);
	font-weight: 800;
	line-height: 1.1;
	text-shadow: 0 3px 0 rgba(31, 29, 51, 0.15);
}

.hub-hero__word--b {
	color: #e8731c;
}

.hub--c3 .hub-hero__word--b {
	color: #1d64a8;
}

.hub-hero__vs {
	margin: 0.3rem 0;
	padding: 0.1rem 0.7rem;
	background: var(--c-accent);
	border-radius: 999px;
	color: #5a2d0c;
	font-family: var(--font-display);
	font-size: 0.95rem;
	font-weight: 800;
}

/* Lọc theo loại */
.hub-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin: 0 0 1rem;
}

.hub-filter__label {
	color: var(--c-muted);
	font-size: 0.92rem;
}

.hub-filter__btn {
	display: inline-flex;
	gap: 0.45rem;
	align-items: center;
	min-height: 40px;
	padding: 0.25rem 0.85rem 0.25rem 0.5rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: 999px;
	color: var(--c-text);
	font-size: 0.92rem;
	font-weight: 700;
	text-decoration: none;
}

.hub-filter__btn:first-of-type {
	padding-left: 0.95rem;
}

.hub-filter__btn:hover {
	border-color: var(--group-color);
	color: var(--c-text);
}

.hub-filter__btn[aria-current="page"] {
	border-color: var(--group-color);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--group-color) 30%, transparent);
}

.hub-filter__count {
	color: var(--c-muted);
	font-weight: 400;
}

.hub-more {
	max-width: 720px;
	margin-top: clamp(2rem, 5vw, 3rem);
}

.error-404 {
	padding: 3rem 0 1rem;
	text-align: center;
}

.error-404__code {
	margin: 0;
	color: var(--c-primary);
	font-family: var(--font-display);
	font-size: clamp(5rem, 18vw, 8.5rem);
	font-weight: 800;
	line-height: 1;
	text-shadow: 0 6px 0 var(--c-primary-soft);
}

.error-404 .search-form {
	max-width: 560px;
	margin: 1.5rem auto 0;
	text-align: left;
}

/*--------------------------------------------------------------
# Bài viết
--------------------------------------------------------------*/
.entry-header {
	padding: 1rem 0 1.25rem;
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.9rem;
}

.entry-title {
	margin: 0 0 0.6rem;
	font-size: clamp(2rem, 5.5vw, 2.9rem);
	line-height: 1.12;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.6rem;
	color: var(--c-muted);
	font-size: 0.92rem;
}

.entry-meta a {
	color: inherit;
}

.post-thumbnail {
	margin: 0 0 1.75rem;
}

.post-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.entry-content {
	overflow-wrap: break-word;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content h2 {
	margin: 2.4em 0 0.7em;
	font-size: clamp(1.55rem, 4vw, 1.95rem);
	scroll-margin-top: 1.5rem;
}

/* Vạch vàng nhỏ trên mỗi H2, giống băng dính trên thumbnail. */
.entry-content h2::before {
	content: "";
	display: block;
	width: 2.25rem;
	height: 0.4rem;
	margin-bottom: 0.55rem;
	background: var(--c-accent);
	border-radius: 999px;
}

.entry-content h3 {
	margin: 1.8em 0 0.5em;
	font-size: clamp(1.2rem, 3vw, 1.4rem);
	font-weight: 700;
	scroll-margin-top: 1.5rem;
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 1.1em;
	padding-left: 1.35em;
}

.entry-content li {
	margin-bottom: 0.35em;
}

.entry-content li::marker {
	color: var(--c-primary);
}

.entry-content strong {
	color: #15132a;
}

.entry-content .wp-block-group.is-style-tra-loi-nhanh strong {
	color: var(--c-primary-dark);
}

/* Mục lục tự động */
.toc {
	margin: 0 0 1.75rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
}

.toc summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.8rem 1.1rem;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}

.toc summary::-webkit-details-marker {
	display: none;
}

.toc summary::after {
	content: "";
	width: 0.5em;
	height: 0.5em;
	border-right: 2px solid currentcolor;
	border-bottom: 2px solid currentcolor;
	transform: rotate(45deg);
	transition: transform 0.2s;
}

.toc details[open] summary::after {
	transform: rotate(-135deg);
}

.entry-content .toc ol {
	margin: 0;
	padding: 0 1.1rem 1rem 2.5rem;
	font-size: 0.97rem;
}

.toc li {
	margin: 0.3rem 0;
}

.toc a {
	color: var(--c-text);
	text-decoration: none;
}

.toc a:hover {
	color: var(--c-primary);
	text-decoration: underline;
}

.entry-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-top: 1.5rem;
	color: var(--c-muted);
	font-size: 0.92rem;
}

.widget-area--after {
	margin-top: 2rem;
}

.widget {
	margin: 0 0 1.5rem;
}

.widget-title {
	font-size: 1.25rem;
}

/*--------------------------------------------------------------
# Bài liên quan, tác giả
--------------------------------------------------------------*/
.author-box {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	margin-top: 2rem;
	padding: 1.25rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
}

.author-box__avatar {
	flex: none;
	border-radius: 50%;
}

.author-box__label {
	margin: 0;
	color: var(--c-muted);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.author-box__name {
	margin: 0 0 0.25rem;
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.3;
}

.author-box__name a {
	color: var(--c-text);
	text-decoration: none;
}

.author-box__bio {
	margin: 0;
	color: var(--c-muted);
	font-size: 0.95rem;
}

.related {
	margin-top: 2rem;
	background: var(--c-surface);
	border-top: 1px solid var(--c-line);
}

.related .card {
	background: var(--c-bg);
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.site-footer {
	padding: 2.75rem 0 1.5rem;
	background: #221c45;
	color: #d9d5f2;
	font-size: 0.95rem;
}

.site-footer a {
	color: #fff;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--c-accent);
	text-decoration: underline;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 768px) {

	.site-footer__grid {
		grid-template-columns: 1.2fr 2fr 1fr;
	}
}

.site-footer__brand {
	margin: 0 0 0.9rem;
}

.site-footer__brand .custom-logo-link {
	display: inline-block;
}

.site-footer__brand img {
	display: block;
	width: auto;
	max-width: 100%;
	height: 40px;
}

.site-footer__heading {
	margin: 0 0 0.75rem;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.site-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer li {
	margin-bottom: 0.45rem;
	break-inside: avoid;
}

.site-footer__groups ul {
	column-gap: 1.5rem;
	columns: 2;
}

.site-info {
	margin-top: 2rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: #aaa4d0;
	font-size: 0.85rem;
}

/*--------------------------------------------------------------
# WordPress core & tiện ích
--------------------------------------------------------------*/
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	top: 5px;
	left: 5px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 15px 23px 14px;
	clip: auto !important;
	clip-path: none;
	background-color: var(--c-surface);
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	color: var(--c-primary-dark);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: normal;
	text-decoration: none;
}

#primary[tabindex="-1"]:focus {
	outline: 0;
}

.alignleft {
	float: left;
	margin-right: 1.5em;
	margin-bottom: 1.5em;
}

.alignright {
	float: right;
	margin-bottom: 1.5em;
	margin-left: 1.5em;
}

.aligncenter {
	clear: both;
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.wp-caption,
.wp-block-image figcaption,
.wp-caption-text {
	color: var(--c-muted);
	font-size: 0.88rem;
	text-align: center;
}

.wp-caption {
	max-width: 100%;
	margin-bottom: 1.5em;
}

.gallery {
	display: grid;
	grid-gap: 1.5em;
	margin-bottom: 1.5em;
}

.gallery-columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.gallery-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.sticky,
.bypostauthor {
	display: block;
}

.page-links {
	clear: both;
	margin: 1.5em 0;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	margin: 2rem 0 0.5rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0.4rem 0.85rem;
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: 999px;
	color: var(--c-text);
	font-weight: 700;
	text-decoration: none;
}

.pagination .page-numbers.dots {
	min-width: auto;
	padding: 0.4rem 0.2rem;
	background: transparent;
	border-color: transparent;
}

.pagination .page-numbers.current {
	background: var(--grad-brand);
	border-color: transparent;
	color: #fff;
}

.pagination a.page-numbers:hover {
	background: var(--c-primary);
	border-color: var(--c-primary);
	color: #fff;
}

.hub-hero__page {
	margin-left: 0.25rem;
	color: var(--c-muted);
	font-weight: 400;
}

.no-results {
	padding: 1rem 0 2rem;
}

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

@media (min-width: 1200px) {

	.custom-logo-link ~ .site-description {
		display: block;
	}
}
