/*
 * Tomegah — article comments (patterns/comments.php).
 *
 * Core comment blocks and core's comment form, styled to match the rest of
 * the article foot: the heading row of Related reading, hairline rows like
 * the post grid, and the contact form's fields and consent checkbox.
 * Reading width (680px), no avatars. Loaded only on single articles —
 * see tomegah_enqueue_comments_assets() in functions.php.
 *
 * Contrast (on white): charcoal 15.6:1, muted 6.9:1, forest 12.2:1,
 * field border 3.7:1 (WCAG 1.4.11); the moderation note is charcoal on
 * sand.
 */

.tomegah-comments {
	padding-bottom: clamp(2.5rem, 1.904rem + 2.427vw, 4.5rem);
	font-size: 1rem;
	line-height: 1.6;
}

.tomegah-comments > * {
	margin-block: 0;
}

.tomegah-comments .tomegah-section__head {
	margin-bottom: 28px;
}

/* Empty and closed states. */
.tomegah-comments__empty,
.tomegah-comments__closed {
	color: var(--wp--preset--color--muted);
}

.tomegah-comments__closed {
	margin-top: 28px !important;
	padding-top: 20px;
	border-top: 1px solid var(--wp--preset--color--line);
}

/* The list: hairline rows, replies indented on a hairline rule. */
.tomegah-comments__list,
.tomegah-comments__list ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tomegah-comments__list > li + li,
.tomegah-comments__list ol > li + li {
	border-top: 1px solid var(--wp--preset--color--line);
}

.tomegah-comments__list ol {
	margin-left: 24px;
	padding-left: 20px;
	border-left: 1px solid var(--wp--preset--color--line);
}

.tomegah-comment {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 0;
}

.tomegah-comments__list > li:first-child > .tomegah-comment {
	padding-top: 0;
}

.tomegah-comment > * {
	margin-block: 0;
}

.tomegah-comment__meta {
	gap: 2px 12px;
	align-items: baseline;
}

.tomegah-comment__meta > * {
	margin: 0;
}

.tomegah-comment__author {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.tomegah-comment__date {
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
}

.tomegah-comment__content {
	overflow-wrap: anywhere;
}

.tomegah-comment__content > *,
.tomegah-comment__content p {
	margin: 0;
}

.tomegah-comment__content > * + * {
	margin-top: 0.8em;
}

/* Shown only to the person who wrote a comment that awaits moderation. */
.tomegah-comment .comment-awaiting-moderation {
	display: block;
	margin-bottom: 12px;
	padding: 10px 14px;
	border-left: 3px solid var(--wp--preset--color--terracotta);
	background-color: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--charcoal);
	font-size: 0.875rem;
	font-style: normal;
	line-height: 1.55;
}

.tomegah-comment__reply a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--forest);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 6px;
}

.tomegah-comment__reply a:hover {
	color: var(--wp--preset--color--terracotta);
}

.tomegah-comments__pagination {
	gap: 16px;
	margin-top: 24px !important;
}

/* The form. */
.tomegah-comments .comment-respond {
	margin-top: 36px;
	padding-top: 24px;
	border-top: 1px solid var(--wp--preset--color--charcoal);
}

/* Moved under a comment by the Reply link. */
.tomegah-comment .comment-respond,
.tomegah-comments__list .comment-respond {
	margin: 4px 0 22px;
	max-width: 100%;
}

.tomegah-comments .comment-reply-title {
	margin: 0 0 16px;
	font-size: clamp(1.25rem, 1.168rem + 0.337vw, 1.4375rem);
	line-height: 1.25;
}

.tomegah-comments .comment-reply-title small {
	display: block;
	margin-top: 6px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 400;
}

.tomegah-comments #cancel-comment-reply-link {
	color: var(--wp--preset--color--forest);
}

.tomegah-comments .comment-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.tomegah-comments .comment-form > * {
	grid-column: 1 / -1;
	margin: 0;
}

.tomegah-comments .comment-form > .comment-form-author,
.tomegah-comments .comment-form > .comment-form-email {
	grid-column: auto;
}

.tomegah-comments .comment-notes,
.tomegah-comments .logged-in-as {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	line-height: 1.55;
}

.tomegah-comments .comment-notes a,
.tomegah-comments .logged-in-as a {
	color: var(--wp--preset--color--forest);
}

.tomegah-comments .required {
	color: var(--wp--preset--color--terracotta);
}

.tomegah-comments .comment-form-comment,
.tomegah-comments .comment-form-author,
.tomegah-comments .comment-form-email {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tomegah-comments .comment-form label {
	font-size: 0.875rem;
	font-weight: 600;
}

.tomegah-comments .comment-form input[type="text"],
.tomegah-comments .comment-form input[type="email"],
.tomegah-comments .comment-form textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--wp--custom--color--field-border);
	border-radius: 2px;
	background-color: var(--wp--preset--color--field);
	color: var(--wp--preset--color--charcoal);
	font-family: inherit;
	font-size: 1rem;
}

.tomegah-comments .comment-form textarea {
	min-height: 160px;
	padding: 12px 14px;
	line-height: 1.6;
	resize: vertical;
}

.tomegah-comments .comment-form input:focus,
.tomegah-comments .comment-form textarea:focus {
	border-color: var(--wp--preset--color--forest);
}

/* Cookie checkbox: the contact form's consent layout. */
.tomegah-comments .comment-form-cookies-consent {
	position: relative;
	padding-left: 32px;
}

.tomegah-comments .comment-form-cookies-consent input[type="checkbox"] {
	position: absolute;
	top: 1px;
	left: 0;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--wp--preset--color--forest);
}

.tomegah-comments .comment-form-cookies-consent label {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
	line-height: 1.55;
}

.tomegah-comments .form-submit .wp-element-button {
	min-height: 48px;
	padding: 0 28px;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
}

@media (max-width: 599px) {

	.tomegah-comments .comment-form {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	.tomegah-comments__list ol {
		margin-left: 8px;
		padding-left: 14px;
	}

	.tomegah-comments .form-submit .wp-element-button {
		width: 100%;
		min-height: 50px;
	}
}
