/*
 * Vendix comment styles: the comment list and the comment form.
 *
 * Loads after base.css on single views whose comments are open or that have comments.
 */

/* Comments ------------------------------------------------------------ */

.comments-area {
	margin-block-start: 3rem;
}

.comments-area a {
	text-decoration: underline;
}

.comment-list,
.comment-list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	padding-inline-start: 2rem;
}

/*
 * On small screens a wide table in a comment scrolls inside itself, not the page.
 * Replies step in less, and from the fourth level on no further, so a deep thread
 * (Settings → Discussion allows ten levels) keeps its text readable.
 */
@media (max-width: 767px) {
	.comment-content table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
	}

	.comment-list .children {
		padding-inline-start: 1rem;
	}

	.comment-list .children .children .children {
		padding-inline-start: 0;
	}
}

.comment-body {
	position: relative;
	padding-block: 1.5rem;
	padding-inline-start: 60px;
	border-block-end: 1px solid var(--vt-border);
}

.comment-body .avatar {
	position: absolute;
	inset-inline-start: 0;
	border-radius: 50%;
}

/*
 * Without avatars (Settings → Discussion → Show Avatars off, or taken out by a
 * plugin) the comments start at the edge, not after an empty space. Pingbacks
 * and trackbacks print no avatar: beside comments with avatars they keep the
 * text column of the comments. A browser without :has() keeps the space.
 */
.comment-list:not(:has(.avatar)) .comment-body {
	padding-inline-start: 0;
}

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem;
	margin-block-end: 0.75rem;
}

/* A long commenter name without spaces breaks instead of running out of the comment. */
.comment-meta > * {
	min-width: 0;
}

.comment-author {
	overflow-wrap: anywhere;
}

.comment-metadata,
.comment-body .reply {
	font-size: 0.8125rem;
}
