/**
 * Forumax Blogs — comments UI.
 *
 * @package Forumax_Extension
 */

.fmxext-comments {
	--fmxext-cc-accent: #0e9384;
	max-width: 820px;
	margin: 2rem 0;
	color: #101828;
}

/* ---- Header ---- */
.fmxext-comments-header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 1.5rem;
}

.fmxext-comments-header-icon {
	display: inline-flex;
	color: var(--fmxext-cc-accent);
}

.fmxext-comments-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: #101828;
}

.fmxext-comments-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 0.5rem;
	border-radius: 999px;
	background: #eef1f4;
	color: #475467;
	font-size: 0.8rem;
	font-weight: 600;
}

/* ---- Form ---- */
.fmxext-cform-wrap {
	margin-bottom: 2rem;
}

.fmxext-cform-row {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
}

.fmxext-cform-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
}

.fmxext-cform-main {
	flex: 1 1 auto;
	min-width: 0;
}

.fmxext-cform-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.75rem 0.9rem;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	font: inherit;
	line-height: 1.6;
	color: #101828;
	background: #fff;
	resize: vertical;
}

.fmxext-cform-input:focus {
	outline: none;
	border-color: var(--fmxext-cc-accent);
	box-shadow: 0 0 0 3px rgba( 14, 147, 132, 0.15 );
}

.fmxext-cform-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.6rem;
}

.fmxext-cform-cancel {
	font-size: 0.85rem;
	color: #667085;
	text-decoration: none;
}

.fmxext-cform-cancel:hover {
	color: #b42318;
}

.fmxext-cform-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.55rem 1.1rem;
	border: 0;
	border-radius: 8px;
	background: var(--fmxext-cc-accent);
	color: #fff;
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1;
	cursor: pointer;
}

.fmxext-cform-submit:hover {
	filter: brightness( 0.96 );
}

/* ---- List + threading ---- */
.fmxext-comments-list,
.fmxext-comment-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fmxext-comments-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.fmxext-comment-children {
	margin-top: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding-left: 1.25rem;
	border-left: 2px solid #eef1f4;
}

.fmxext-comment-row {
	display: flex;
	gap: 0.85rem;
}

.fmxext-comment-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
}

.fmxext-comment-main {
	flex: 1 1 auto;
	min-width: 0;
}

.fmxext-comment-head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.3rem;
}

.fmxext-comment-author {
	font-weight: 700;
	color: #101828;
}

.fmxext-comment-you {
	display: inline-flex;
	align-items: center;
	padding: 0.05rem 0.4rem;
	border-radius: 5px;
	background: #e9f7f3;
	color: var(--fmxext-cc-accent);
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fmxext-comment-role {
	font-size: 0.85rem;
	color: #98a2b3;
}

.fmxext-comment-time {
	margin-left: auto;
	font-size: 0.82rem;
	color: #98a2b3;
	white-space: nowrap;
}

.fmxext-comment-content {
	color: #344054;
	font-size: 0.95rem;
	line-height: 1.65;
}

.fmxext-comment-content p {
	margin: 0 0 0.75rem;
}

.fmxext-comment-content p:last-child {
	margin-bottom: 0;
}

/* ---- Actions ---- */
.fmxext-comment-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 0.6rem;
}

.fmxext-comment-action {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0;
	border: 0;
	background: none;
	color: #667085;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.fmxext-comment-action:hover {
	color: var(--fmxext-cc-accent);
}

.fmxext-comment-delete:hover {
	color: #b42318;
}

/* ---- Inline edit ---- */
.fmxext-comment-edit-form {
	display: none;
	margin-top: 0.6rem;
}

.fmxext-comment.is-editing .fmxext-comment-content,
.fmxext-comment.is-editing .fmxext-comment-actions {
	display: none;
}

.fmxext-comment.is-editing .fmxext-comment-edit-form {
	display: block;
}

.fmxext-comment-edit-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font: inherit;
	line-height: 1.6;
	color: #101828;
	resize: vertical;
}

.fmxext-comment-edit-input:focus {
	outline: none;
	border-color: var(--fmxext-cc-accent);
	box-shadow: 0 0 0 3px rgba( 14, 147, 132, 0.15 );
}

.fmxext-comment-edit-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.fmxext-comment-btn {
	padding: 0.45rem 0.9rem;
	border-radius: 8px;
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 0.85rem;
	line-height: 1;
	cursor: pointer;
}

.fmxext-comment-btn--ghost {
	background: #fff;
	border-color: #d0d5dd;
	color: #344054;
}

.fmxext-comment-btn--ghost:hover {
	background: #f9fafb;
}

.fmxext-comment-btn--primary {
	background: var(--fmxext-cc-accent);
	color: #fff;
}

.fmxext-comment-btn--primary:hover {
	filter: brightness( 0.96 );
}

/* ---- Load more ---- */
.fmxext-comments-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	margin-top: 1.5rem;
	padding: 0.85rem 1rem;
	border: 1px solid #e4e9ee;
	border-radius: 12px;
	background: #fff;
	color: #475467;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

.fmxext-comments-more:hover {
	border-color: #d0d5dd;
	background: #f9fafb;
}

.fmxext-comments-more.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.fmxext-comments-login {
	padding: 1rem 1.25rem;
	border: 1px solid #eaecf0;
	border-radius: 12px;
	background: #f9fafb;
	color: #475467;
	font-size: 0.95rem;
	margin-bottom: 2rem;
}

@media (max-width: 576px) {
	.fmxext-comment-time {
		margin-left: 0;
		flex-basis: 100%;
		order: 3;
	}
	.fmxext-comment-children {
		padding-left: 0.85rem;
	}
}
