.flarum-no-comments {
	gap: var(--wp--preset--spacing--small) !important;
	flex-direction: column !important;
	align-items: center !important;
}

.flarum-no-comments p {
	margin: 0;
}

.flarum-comment {
	--flarum-avatar-size: clamp(32px, 6vw, 40px);
	--flarum-avatar-gap: 0.75rem;
	display: flex;
	flex-direction: column;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.flarum-comment:first-child {
	padding-top: 0;
}

.flarum-comment:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.flarum-comment-top {
	display: flex;
	align-items: center;
	gap: var(--flarum-avatar-gap);
	margin-bottom: 0.5rem;
}

.flarum-avatar {
	width: var(--flarum-avatar-size);
	height: var(--flarum-avatar-size);
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.flarum-avatar-letter {
	background: linear-gradient(135deg, var(--wp--preset--color--primary, #555) 0%, #16171a 100%);
	color: var(--wp--preset--color--main-accent, #fff);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 1.125rem;
	text-transform: uppercase;
}

.flarum-comment-meta {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.flarum-username {
	font-weight: 600;
	font-size: 0.95rem;
}

/* The avatar link only wraps the picture; it adds no box of its own. */
.flarum-avatar-link {
	display: flex;
	flex-shrink: 0;
	text-decoration: none;
}

a.flarum-username {
	color: inherit;
	text-decoration: none;
}

a.flarum-username:hover,
a.flarum-username:focus-visible {
	text-decoration: underline;
}

.flarum-timestamp {
	color: var(--wp--preset--color--secondary);
	font-size: 0.875rem;
	text-decoration: none;
}

.flarum-timestamp:hover,
.flarum-timestamp:focus-visible {
	text-decoration: underline;
}

.flarum-comment-content {
	line-height: 1.6;
}

.flarum-post-content {
	font-size: var(--wp--preset--font-size--small);
	padding-left: calc(var(--flarum-avatar-size) + var(--flarum-avatar-gap));
	overflow-wrap: break-word;
}

.flarum-post-content p {
	margin: 0 0 1rem 0;
}

.flarum-post-content p:last-child {
	margin-bottom: 0;
}

.flarum-post-content a {
	text-decoration: none;
}

.flarum-post-content a:hover {
	text-decoration: underline;
}

/* Emoji stay inline at text size; every other image is a block. */
.flarum-post-content img:not(.emoji) {
	max-width: 100%;
	height: auto;
	margin: 1rem 0;
	display: block;
	border-radius: 5px;
}

/* A picture that opens or ends a comment keeps the same spacing as text. */
.flarum-post-content > p:first-child > img:first-child,
.flarum-post-content > p:first-child > a:first-child > img:not(.emoji) {
	margin-top: 0;
}

.flarum-post-content > p:last-child > img:last-child,
.flarum-post-content > p:last-child > a:last-child > img:not(.emoji) {
	margin-bottom: 0;
}

.flarum-post-content iframe {
	max-width: 100%;
	margin: 1rem 0;
	border-radius: 5px;
}

/*
 * Responsive players (YouTube and the like) arrive as an iframe absolutely
 * positioned inside a padded aspect-ratio box. A margin on the frame would
 * push it out of the bottom of that box, so the spacing and rounding move to
 * the box instead.
 */
.flarum-post-content span[data-s9e-mediaembed] {
	margin: 1rem 0;
}

.flarum-post-content span[data-s9e-mediaembed] > span {
	border-radius: 5px;
}

.flarum-post-content span[data-s9e-mediaembed] iframe {
	margin: 0;
	border-radius: 0;
}

.flarum-post-content blockquote {
	border-left: 4px solid var(--wp--preset--color--border-light);
	padding-left: 1rem;
	margin: 1rem 0;
	color: var(--wp--preset--color--secondary);
}

/* The theme styles inline code; this only sizes it to the comment text. */
.flarum-post-content code {
	font-size: 0.875em;
}

.flarum-post-content pre {
	background: #1f2937;
	color: #f9fafb;
	padding: 1rem;
	border-radius: 0.375rem;
	overflow-x: auto;
	margin: 1rem 0;
}

.flarum-post-content pre code {
	background: transparent;
	padding: 0;
	color: inherit;
}

.flarum-spoiler {
	background: var(--wp--preset--color--tertiary);
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 5px;
	padding: 0.75rem;
}

.flarum-spoiler summary {
	cursor: pointer;
	font-weight: 600;
	user-select: none;
}

.flarum-spoiler[open] summary {
	margin-bottom: 0.5rem;
}

.flarum-post-mention,
.flarum-post-content .UserMention {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	margin-right: 0.125rem;
	color: inherit;
	font-weight: 600;
}

.flarum-reply-icon {
	width: 12px;
	height: 12px;
	fill: currentColor;
	flex-shrink: 0;
}

.flarum-post-mention a.PostMention {
	color: inherit;
	text-decoration: none;
}

.flarum-post-mention a.PostMention:hover {
	text-decoration: underline;
}

/*
 * Likes line under a comment, as Flarum shows it: a thumbs-up and "A, B, and
 * C like this." The footer is always rendered so a refresh can fill it in.
 */
.flarum-comment-footer:empty {
	display: none;
}

.flarum-likes {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
	padding-left: calc(var(--flarum-avatar-size) + var(--flarum-avatar-gap));
	color: var(--wp--preset--color--secondary);
	font-size: 0.875rem;
	line-height: 1.4;
}

/*
 * Font Awesome 7's 640 grid pads the glyph, so the box is larger than 1em.
 * The icon stays on the first line when the names wrap; the margin centres
 * it on that line (half the gap between line height and icon height).
 */
.flarum-likes-icon {
	width: 1.25em;
	height: 1.25em;
	margin-top: calc((1.4em - 1.25em) / 2);
	flex-shrink: 0;
	fill: currentColor;
}

.flarum-likes a.flarum-likes-name {
	color: inherit;
	text-decoration: none;
}

.flarum-likes a.flarum-likes-name:hover,
.flarum-likes a.flarum-likes-name:focus-visible {
	text-decoration: underline;
}

/*
 * Link cards: a pasted link shown as a thumbnail beside its headline and
 * date. Cards for this site's own articles carry its name; cards for other
 * sites carry their domain on a quieter ground.
 */
.flarum-post-content .flarum-link-card {
	display: flex;
	align-items: stretch;
	max-width: 600px;
	margin: 1rem 0;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--main);
	line-height: 1.4;
	text-decoration: none;
}

.flarum-post-content .flarum-link-card:last-child {
	margin-bottom: 0;
}

.flarum-post-content .flarum-link-card:hover {
	text-decoration: none;
}

.flarum-post-content .flarum-link-card:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.flarum-post-content .flarum-link-card--external {
	background: var(--wp--preset--color--tertiary);
}

.flarum-link-card__media {
	position: relative;
	flex: 0 0 168px;
	min-height: 104px;
	background: var(--wp--preset--color--border-light);
}

.flarum-post-content .flarum-link-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

.flarum-link-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.25rem;
	min-width: 0;
	padding: 0.75rem 1rem;
}

.flarum-link-card__kicker {
	color: var(--flarum-link-card-accent, var(--wp--preset--color--primary));
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.flarum-link-card__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
}

.flarum-link-card:hover .flarum-link-card__title {
	text-decoration: underline;
}

.flarum-link-card__site,
.flarum-link-card__meta {
	color: var(--wp--preset--color--secondary);
	font-size: 0.8rem;
}

.flarum-link-card__meta {
	margin-top: 0.125rem;
}

.flarum-reply-button {
	margin-top: 1.5rem;
}

@media (max-width: 600px) {
	.flarum-post-content,
	.flarum-likes {
		padding-left: 0;
	}

	.flarum-link-card__media {
		flex-basis: 96px;
	}
}
