/* Theo dõi / Lưu bài (inc/social.php) + Bình luận (comments.php) + danh sách trong /tai-khoan/. */

/* ── Nút ─────────────────────────────────────────────────────────────── */

.tri-soc {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1.5px solid #dbe3f0;
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--navy);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tri-soc:hover {
	border-color: var(--wp--preset--color--navy);
}

.tri-soc:active {
	transform: scale(0.96);
}

.tri-soc.is-on {
	border-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--navy);
	color: #fff;
}

.tri-soc--bookmark.is-on {
	border-color: var(--wp--preset--color--orange);
	background: var(--wp--preset--color--orange);
	--fill: currentColor;
}

.tri-soc__tick,
.tri-soc.is-on .tri-soc__plus {
	display: none;
}

.tri-soc.is-on .tri-soc__tick {
	display: inline;
}

.tri-soc__n:empty {
	display: none;
}

.tri-soc__n {
	padding-left: 6px;
	border-left: 1px solid currentColor;
	opacity: 0.8;
}

.tri-soc--icon {
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
}

.tri-soc--icon .tri-soc__txt {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Vị trí */
.tri-article__social {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 4px;
}

.tri-knowledge-row {
	position: relative;
}

.tri-knowledge-row > .tri-soc--icon {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	box-shadow: 0 4px 12px rgba(9, 31, 91, 0.12);
	opacity: 0.85;
}

.tri-knowledge-row:hover > .tri-soc--icon,
.tri-knowledge-row > .tri-soc--icon.is-on {
	opacity: 1;
}

.tri-knowledge-overview__head .tri-soc,
.tri-practice-layout__main > .tri-soc,
.tri-archive__head .tri-soc {
	margin: 12px 0 4px;
}

.tri-archive__head {
	text-align: center;
}

.tri-tp-follow,
.tri-au-hero__follow {
	margin-top: 14px;
}

.tri-tp-hero .tri-soc:not(.is-on) {
	border-color: rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.tri-tp-hero .tri-soc.is-on {
	border-color: #fff;
	background: #fff;
	color: var(--wp--preset--color--navy);
}

.tri-soc-toast {
	position: fixed;
	bottom: 90px;
	left: 50%;
	z-index: 100001;
	padding: 10px 18px;
	border-radius: 10px;
	background: #091f5b;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 12px 30px rgba(9, 31, 91, 0.3);
	transform: translateX(-50%);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.tri-soc-toast.is-out {
	opacity: 0;
	transform: translate(-50%, 10px);
}

/* ── Bình luận / câu trả lời ─────────────────────────────────────────── */

.tri-cmts {
	--tri-cmt-line: color-mix(in srgb, var(--wp--preset--color--navy) 10%, transparent);
	--tri-cmt-ice: var(--wp--custom--color--ice-soft, #eef5fb);
	--tri-cmt-surface: #fff;
	margin-top: 48px;
	padding: 28px 24px 24px;
	border: 1px solid var(--tri-cmt-line);
	border-radius: var(--wp--custom--radius--card, 18px);
	background:
		radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--wp--preset--color--cyan, #00b2ff) 10%, transparent), transparent 55%),
		linear-gradient(180deg, color-mix(in srgb, var(--wp--preset--color--ice, #bad6eb) 22%, #fff) 0%, var(--tri-cmt-surface) 42%);
	color: var(--wp--preset--color--navy);
	box-shadow: 0 12px 32px color-mix(in srgb, var(--wp--preset--color--navy) 6%, transparent);
}

.tri-cmts__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--tri-cmt-line);
}

.tri-cmts__h {
	margin: 0;
	font-family: var(--wp--preset--font-family--beau-sans, inherit);
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
	font-weight: var(--wp--custom--font--weight-strong, 700);
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.tri-cmts__sub {
	margin: 6px 0 0;
	max-width: 46ch;
	color: color-mix(in srgb, var(--wp--preset--color--navy) 62%, white);
	font-size: 0.94rem;
	line-height: 1.45;
}

.tri-cmts__count {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	min-width: 48px;
	height: 48px;
	padding: 0 12px;
	border-radius: 14px;
	background: var(--wp--preset--color--navy);
	color: #fff;
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 8px 18px color-mix(in srgb, var(--wp--preset--color--navy) 22%, transparent);
}

/* Composer (đã đăng nhập) */
.tri-cmts__composer {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 14px;
	margin-bottom: 28px;
	padding: 16px;
	border: 1px solid var(--tri-cmt-line);
	border-radius: 16px;
	background: color-mix(in srgb, #fff 82%, var(--tri-cmt-ice));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tri-cmts__composer-av,
.tri-cmt__avatar {
	position: relative;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: 50%;
	background: linear-gradient(145deg, var(--wp--preset--color--royal, #3b63a8), var(--wp--preset--color--sky, #6f96d1));
	color: #fff;
	font-weight: 800;
	letter-spacing: 0.02em;
	box-shadow: 0 0 0 3px #fff, 0 0 0 4px color-mix(in srgb, var(--wp--preset--color--navy) 12%, transparent);
}

.tri-cmts__composer-av {
	width: 48px;
	height: 48px;
	font-size: 1rem;
}

.tri-cmts__composer-av img,
.tri-cmt__avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	-webkit-user-drag: none;
}

.tri-cmts__composer-hi {
	margin: 0 0 8px;
	color: color-mix(in srgb, var(--wp--preset--color--navy) 70%, white);
	font-size: 0.86rem;
	font-weight: 600;
}

.tri-cmts__composer-main .comment-respond {
	margin: 0;
}

.tri-cmts__form {
	display: grid;
	gap: 12px;
	margin: 0;
}

.tri-cmts__reply-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 0 0 4px;
	font-size: 0.95rem;
	font-weight: 700;
}

.tri-cmts__cancel a {
	color: var(--wp--preset--color--royal, #3b63a8);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
}

.tri-cmts__cancel a:hover,
.tri-cmts__cancel a:focus-visible {
	text-decoration: underline;
}

.tri-cmts__field {
	margin: 0;
}

.tri-cmts__field textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 118px;
	padding: 14px 16px;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--navy) 14%, #dbe3f0);
	border-radius: 14px;
	background: #fff;
	color: var(--wp--preset--color--navy);
	font: inherit;
	font-size: 0.98rem;
	line-height: 1.55;
	resize: vertical;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tri-cmts__field textarea::placeholder {
	color: color-mix(in srgb, var(--wp--preset--color--navy) 38%, white);
}

.tri-cmts__field textarea:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--royal, #3b63a8) 45%, #dbe3f0);
}

.tri-cmts__field textarea:focus {
	border-color: var(--wp--preset--color--royal, #3b63a8);
	outline: 0;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--wp--preset--color--royal, #3b63a8) 18%, transparent);
}

.tri-cmts__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin: 0;
}

.tri-cmts__hint {
	margin: 0;
	color: color-mix(in srgb, var(--wp--preset--color--navy) 48%, white);
	font-size: 0.78rem;
	line-height: 1.4;
}

.tri-cmts__form .form-submit {
	margin: 0;
}

.tri-cmts__submit {
	min-height: 44px;
	padding-inline: 22px;
}

/* Login gate */
.tri-cmts__login {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px 18px;
	margin-bottom: 28px;
	padding: 18px 20px;
	border: 1.5px dashed color-mix(in srgb, var(--wp--preset--color--royal, #3b63a8) 35%, #c9d6ec);
	border-radius: 16px;
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--wp--preset--color--ice, #bad6eb) 35%, #fff), #fff 70%);
}

.tri-cmts__login-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: var(--wp--preset--color--navy);
	color: #fff;
}

.tri-cmts__login-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.3;
}

.tri-cmts__login-desc {
	margin: 4px 0 0;
	color: color-mix(in srgb, var(--wp--preset--color--navy) 62%, white);
	font-size: 0.9rem;
	line-height: 1.45;
}

.tri-cmts__login-btn {
	white-space: nowrap;
}

/* Empty */
.tri-cmts__empty {
	padding: 28px 18px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--tri-cmt-ice) 70%, #fff);
	text-align: center;
}

.tri-cmts__empty-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 800;
}

.tri-cmts__empty-desc {
	margin: 6px auto 0;
	max-width: 40ch;
	color: color-mix(in srgb, var(--wp--preset--color--navy) 58%, white);
	font-size: 0.92rem;
	line-height: 1.45;
}

/* List */
.tri-cmts__list,
.tri-cmts__list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tri-cmts__list > .tri-cmt + .tri-cmt {
	margin-top: 10px;
}

.tri-cmts__list .children {
	margin: 10px 0 0 28px;
	padding-left: 16px;
	border-left: 2px solid color-mix(in srgb, var(--wp--preset--color--royal, #3b63a8) 22%, transparent);
}

.tri-cmt__box {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 12px 14px;
	padding: 14px 14px 12px;
	border: 1px solid transparent;
	border-radius: 14px;
	background: color-mix(in srgb, #fff 88%, var(--tri-cmt-ice));
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tri-cmt__box:hover {
	border-color: var(--tri-cmt-line);
	box-shadow: 0 6px 18px color-mix(in srgb, var(--wp--preset--color--navy) 5%, transparent);
}

.tri-cmt.is-best > .tri-cmt__box {
	border-color: color-mix(in srgb, #1a7f37 35%, transparent);
	background: linear-gradient(180deg, #f3fbf5, #fff);
	box-shadow: 0 8px 20px color-mix(in srgb, #1a7f37 8%, transparent);
}

.tri-cmt__avatar {
	width: 44px;
	height: 44px;
	font-size: 0.95rem;
}

.tri-cmt.has-badge .tri-cmt__avatar,
.tri-cmt--admin .tri-cmt__avatar {
	background: linear-gradient(145deg, var(--wp--preset--color--orange, #ec6207), #ff9a52);
}

.tri-cmt--teacher .tri-cmt__avatar {
	background: linear-gradient(145deg, var(--wp--preset--color--navy), var(--wp--preset--color--royal, #3b63a8));
}

.tri-cmt--author .tri-cmt__avatar {
	background: linear-gradient(145deg, var(--wp--preset--color--cyan, #00b2ff), var(--wp--preset--color--royal, #3b63a8));
}

.tri-cmt__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
}

.tri-cmt__who {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	min-width: 0;
}

.tri-cmt__name {
	font-size: 0.98rem;
	font-weight: 800;
	line-height: 1.25;
}

.tri-cmt__badge {
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--wp--preset--color--orange, #ec6207);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.tri-cmt__badge--teacher {
	background: var(--wp--preset--color--navy);
}

.tri-cmt__badge--author {
	background: var(--wp--preset--color--royal, #3b63a8);
}

.tri-cmt__best {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 9px;
	border-radius: 999px;
	background: #e5f6ea;
	color: #146c2e;
	font-size: 0.72rem;
	font-weight: 800;
}

.tri-cmt__best::before {
	content: "✓";
}

.tri-cmt__time {
	color: color-mix(in srgb, var(--wp--preset--color--navy) 42%, white);
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.tri-cmt__time:hover,
.tri-cmt__time:focus-visible {
	color: var(--wp--preset--color--royal, #3b63a8);
}

.tri-cmt__wait {
	margin: 8px 0 0;
	padding: 8px 12px;
	border-radius: 10px;
	background: #fff6e8;
	color: #8a5a00;
	font-size: 0.84rem;
	line-height: 1.4;
}

.tri-cmt__body {
	margin-top: 6px;
	font-size: 0.98rem;
	line-height: 1.65;
	overflow-wrap: anywhere;
}

.tri-cmt__body p {
	margin: 0.45em 0;
}

.tri-cmt__body p:first-child {
	margin-top: 0;
}

.tri-cmt__body p:last-child {
	margin-bottom: 0;
}

.tri-cmt__body a {
	color: var(--wp--preset--color--royal, #3b63a8);
	font-weight: 600;
}

.tri-cmt__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 10px;
	font-size: 0.84rem;
	font-weight: 700;
}

.tri-cmt__tools a,
.tri-cmt__tools button {
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--royal, #3b63a8);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.tri-cmt__tools a:hover,
.tri-cmt__tools a:focus-visible,
.tri-cmt__tools button:hover,
.tri-cmt__tools button:focus-visible {
	color: var(--wp--preset--color--navy);
	text-decoration: underline;
}

.tri-cmt__reply a::before {
	content: "↩ ";
	font-weight: 700;
}

/* Pagination */
.tri-cmts .tri-cmts__pager,
.tri-cmts .navigation.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
}

.tri-cmts .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tri-cmts .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--tri-cmt-line);
	border-radius: 10px;
	background: #fff;
	color: var(--wp--preset--color--navy);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

.tri-cmts .page-numbers.current,
.tri-cmts a.page-numbers:hover,
.tri-cmts a.page-numbers:focus-visible {
	border-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--navy);
	color: #fff;
}

@media (max-width: 767px) {
	.tri-cmts {
		margin-top: 36px;
		padding: 20px 14px 16px;
		border-radius: 14px;
	}

	.tri-cmts__composer {
		grid-template-columns: 40px minmax(0, 1fr);
		gap: 10px;
		padding: 12px;
	}

	.tri-cmts__composer-av {
		width: 40px;
		height: 40px;
	}

	.tri-cmts__login {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.tri-cmts__login-btn {
		grid-column: 1 / -1;
		justify-self: stretch;
		text-align: center;
	}

	.tri-cmts__list .children {
		margin-left: 8px;
		padding-left: 10px;
	}

	.tri-cmt__box {
		grid-template-columns: 36px minmax(0, 1fr);
		gap: 10px;
		padding: 12px 10px;
	}

	.tri-cmt__avatar {
		width: 36px;
		height: 36px;
		font-size: 0.85rem;
	}

	.tri-cmts__count {
		min-width: 40px;
		height: 40px;
		border-radius: 12px;
		font-size: 0.95rem;
	}
}


.tri-acc-h {
	margin: 22px 0 10px;
	font-size: 18px;
}

.tri-acc-h:first-child {
	margin-top: 0;
}

.tri-acc-empty {
	color: #5b6886;
}

.tri-acc-list {
	display: grid;
	gap: 14px;
}

.tri-acc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tri-acc-chips li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 14px;
	border: 1px solid #e3e9f5;
	border-radius: 999px;
	background: #fff;
	font-weight: 700;
}

.tri-acc-chips a {
	color: var(--wp--preset--color--navy);
	text-decoration: none;
}
