/* Bình luận — bố cục kiểu wpDiscuz (bản tối), màu nhấn theo màu primary của web. */
.wpc {
	--wpc-primary: var(--site-primary-color, #F49E00);
	--wpc-text: #e6e6e6;
	--wpc-muted: #9a9a9a;
	--wpc-line: #343434;
	--wpc-field: #1f1f1f;
	--wpc-field-line: #3d3d3d;
	--wpc-avatar: 48px;
	color: var(--wpc-text);
	font-size: 14px;
	line-height: 1.55;
}

.wpc *,
.wpc *::before,
.wpc *::after {
	box-sizing: border-box;
}

/* Reset style button/input của theme cha & Bootstrap */
.wpc button {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-shadow: none;
	cursor: pointer;
}

.wpc button:hover,
.wpc button:focus,
.wpc button:active {
	border: 0;
	background: none;
	box-shadow: none;
}

.wpc button:focus-visible {
	outline: 2px solid var(--wpc-primary);
	outline-offset: 2px;
	border-radius: 3px;
}

.wpc svg {
	display: inline-block;
	vertical-align: -0.15em;
	flex-shrink: 0;
}

/* ---- Thanh trên cùng ---- */
.wpc-form-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 0 10px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--wpc-line);
	color: var(--wpc-muted);
	font-size: 13px;
}

.wpc-form-head-left strong {
	color: var(--wpc-text);
}

.wpc .wpc-login-link {
	color: var(--wpc-primary);
	font-weight: 600;
}

.wpc .wpc-login-link:hover {
	text-decoration: underline;
}

.wpc-notice {
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px dashed var(--wpc-field-line);
	border-radius: 6px;
	color: var(--wpc-muted);
}

/* ---- Form ---- */
.wpc-form {
	margin: 0 0 22px;
}

.wpc-form-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.wpc-avatar {
	flex: 0 0 var(--wpc-avatar);
	width: var(--wpc-avatar);
	height: var(--wpc-avatar);
}

.wpc-avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	background: #2a2a2a;
}

.wpc-form-main {
	flex: 1 1 auto;
	min-width: 0;
}

.wpc textarea,
.wpc input[type="text"],
.wpc input[type="email"] {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--wpc-field-line);
	border-radius: 6px;
	background: var(--wpc-field);
	box-shadow: none;
	color: var(--wpc-text);
	font: inherit;
	transition: border-color .15s ease;
}

.wpc textarea {
	min-height: 46px;
	resize: vertical;
	overflow: hidden;
}

.wpc textarea::placeholder,
.wpc input::placeholder {
	color: #7c7c7c;
}

.wpc textarea:focus,
.wpc input[type="text"]:focus,
.wpc input[type="email"]:focus {
	border-color: var(--wpc-primary);
	outline: none;
	background: var(--wpc-field);
	color: var(--wpc-text);
}

.wpc-form.is-open textarea {
	min-height: 90px;
	overflow: auto;
}

.wpc-form-extra {
	display: none;
	margin-top: 10px;
}

.wpc-form.is-open .wpc-form-extra {
	display: block;
}

.wpc-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 10px;
}

.wpc-consent {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 10px;
	color: var(--wpc-muted);
	font-size: 13px;
	cursor: pointer;
}

.wpc-consent input {
	margin: 0;
	accent-color: var(--wpc-primary);
}

.wpc-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.wpc-message {
	margin-right: auto;
	color: var(--wpc-muted);
	font-size: 13px;
}

.wpc-message.is-error {
	color: #ff6b6b;
}

.wpc-message.is-success {
	color: #4fd18b;
}

.wpc .wpc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 36px;
	padding: 7px 18px;
	border: 1px solid var(--wpc-primary);
	border-radius: 4px;
	background: var(--wpc-primary);
	color: #141414;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	transition: filter .15s ease, background-color .15s ease, color .15s ease;
}

.wpc .wpc-btn:hover {
	border: 1px solid var(--wpc-primary);
	background: var(--wpc-primary);
	filter: brightness(1.08);
}

.wpc .wpc-btn-second,
.wpc .wpc-btn-second:hover {
	border: 1px solid var(--wpc-field-line);
	background: transparent;
	color: var(--wpc-text);
}

.wpc .wpc-btn-second:hover {
	border-color: var(--wpc-primary);
	color: var(--wpc-primary);
	filter: none;
}

.wpc .wpc-btn[disabled] {
	opacity: .6;
	cursor: wait;
}

.wpc-replying {
	margin-bottom: 6px;
	color: var(--wpc-muted);
	font-size: 12px;
}

.wpc-replying strong {
	color: var(--wpc-primary);
}

/* ---- Thanh số lượng + sắp xếp ---- */
.wpc-thread-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 16px;
	border-bottom: 2px solid var(--wpc-line);
	margin-bottom: 4px;
}

.wpc-thread-info {
	position: relative;
	padding: 0 0 8px;
	font-size: 15px;
	font-weight: 600;
}

.wpc-thread-info::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--wpc-primary);
}

.wpc-count {
	color: var(--wpc-primary);
	font-size: 17px;
	font-weight: 700;
}

.wpc-filter {
	display: flex;
	gap: 16px;
	padding-bottom: 8px;
}

.wpc .wpc-sort {
	color: var(--wpc-muted);
	font-size: 13px;
}

.wpc .wpc-sort:hover,
.wpc .wpc-sort.is-active {
	color: var(--wpc-primary);
}

.wpc .wpc-sort.is-active {
	font-weight: 600;
}

/* ---- Danh sách ---- */
.wpc-list {
	transition: opacity .15s ease;
}

.wpc.is-loading .wpc-list {
	opacity: .5;
}

.wpc-list > .wpc-comment {
	border-bottom: 1px solid var(--wpc-line);
}

.wpc-comment-wrap {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 0 12px;
}

.wpc-comment-right {
	flex: 1 1 auto;
	min-width: 0;
}

.wpc-comment-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin-bottom: 4px;
}

.wpc-author {
	color: var(--wpc-text);
	font-size: 15px;
	font-weight: 700;
}

.wpc-badge {
	padding: 1px 7px;
	border: 1px solid var(--wpc-primary);
	border-radius: 3px;
	color: var(--wpc-primary);
	font-size: 11px;
	font-weight: 600;
	line-height: 16px;
}

.wpc-badge-admin {
	background: var(--wpc-primary);
	color: #141414;
}

.wpc-date {
	color: var(--wpc-muted);
	font-size: 12px;
}

.wpc .wpc-chapter {
	padding: 1px 8px;
	border-radius: 10px;
	background: #2a2a2a;
	color: var(--font-third-color, #72CEFE);
	font-size: 12px;
	text-decoration: none;
}

.wpc .wpc-chapter:hover {
	color: var(--wpc-primary);
}

.wpc-pending {
	color: #f0ad4e;
	font-size: 12px;
	font-style: italic;
}

.wpc-comment.is-pending > .wpc-comment-wrap {
	opacity: .75;
}

.wpc-text {
	color: #d6d6d6;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.wpc-text p {
	margin: 0 0 .5em;
}

.wpc-text p:last-child {
	margin-bottom: 0;
}

.wpc-text a {
	color: var(--wpc-primary);
}

.wpc-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 18px;
	margin-top: 8px;
	color: var(--wpc-muted);
	font-size: 13px;
}

.wpc-vote {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.wpc .wpc-vote-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	color: var(--wpc-muted);
	font-size: 20px;
	transition: color .15s ease, background-color .15s ease;
}

.wpc .wpc-vote-btn:hover {
	background: #2a2a2a;
	color: var(--wpc-primary);
}

.wpc .wpc-vote-btn.is-active {
	color: var(--wpc-primary);
}

.wpc-score {
	min-width: 14px;
	color: var(--wpc-text);
	font-weight: 700;
	text-align: center;
}

.wpc-score.is-down {
	color: #ff6b6b;
}

.wpc .wpc-reply-btn,
.wpc .wpc-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--wpc-muted);
	font-size: 13px;
}

.wpc .wpc-reply-btn:hover,
.wpc .wpc-toggle:hover {
	color: var(--wpc-primary);
}

.wpc-reply-slot .wpc-form {
	margin: 12px 0 4px;
}

.wpc-reply-slot {
	--wpc-avatar: 36px;
}

/* Trả lời lồng nhau: thụt lề + đường kẻ trái như wpDiscuz */
.wpc-replies {
	margin-left: calc(var(--wpc-avatar) / 2);
	padding-left: calc(var(--wpc-avatar) / 2 + 4px);
	border-left: 2px solid var(--wpc-line);
}

.wpc-replies:empty {
	display: none;
}

.wpc-replies .wpc-comment-wrap {
	padding: 12px 0 8px;
}

.wpc-replies .wpc-avatar {
	--wpc-avatar: 36px;
}

.wpc-comment.is-collapsed > .wpc-replies {
	display: none;
}

.wpc-comment.is-new > .wpc-comment-wrap {
	animation: wpc-flash 1.6s ease;
}

@keyframes wpc-flash {
	from { background: rgba(244, 158, 0, .14); }
	to   { background: transparent; }
}

.wpc-empty {
	margin: 18px 0 4px;
	color: var(--wpc-muted);
	text-align: center;
}

.wpc-more-wrap {
	margin-top: 16px;
	text-align: center;
}

.wpc-more-wrap[hidden],
.wpc-empty[hidden] {
	display: none;
}

@media (max-width: 575px) {
	.wpc {
		--wpc-avatar: 38px;
	}

	.wpc-fields {
		grid-template-columns: 1fr;
	}

	.wpc-replies {
		margin-left: 8px;
		padding-left: 10px;
	}

	.wpc-replies .wpc-avatar {
		--wpc-avatar: 30px;
	}

	.wpc-filter {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpc-comment.is-new > .wpc-comment-wrap {
		animation: none;
	}
}
