/**
 * Revista · wpDiscuz support
 *
 * Loaded only when wpDiscuz is active. wpDiscuz's "Default" style hardcodes
 * light-mode grays (#333 area text, #666 editor text, #f7f7f7 header band,
 * #fff vote and reply buttons). These rules swap them for the theme's color
 * tokens so the comment area reads well in both light and dark mode.
 * Selectors are prefixed with "body" so they outrank wpDiscuz's own rules.
 */

/* 1. Text: comment area, editor and notices printed into the form
   -------------------------------------------------------------------------- */

/* Text printed after the form by other plugins (e.g. User Verification's
   "This site uses User Verification plugin to reduce spam") inherits this. */
body #comments,
body #wpdcom {
	color: var(--rv-text);
}

body #wpdcom .ql-editor > *,
body #wpdcom textarea {
	color: var(--rv-text);
}

body #wpdcom .ql-editor::before,
body #wpdcom input::placeholder,
body #wpdcom textarea::placeholder {
	color: var(--rv-muted);
	opacity: 1;
}

body #wpdcom .wpd-auth .wpd-login {
	color: var(--rv-muted);
}

/* "Notify of" dropdown under Subscribe. wpDiscuz paints it near-white with
   !important, so the theme's light dark-mode text was unreadable on it. */
body #wpdcom .wpdiscuz-subscribe-bar select.wpdiscuz_select {
	background-color: var(--rv-surface) !important;
	color: var(--rv-text);
}

body #wpdcom .wpdiscuz-subscribe-bar select.wpdiscuz_select option {
	background-color: var(--rv-surface);
	color: var(--rv-text);
}

/* 2. The line under the comment count: lavender in light mode, deep purple in
   dark mode, instead of wpDiscuz's green primary color.
   -------------------------------------------------------------------------- */

body #wpdcom {
	--rv-wpd-line: #d6ccff;
}

:root[data-theme="dark"] body #wpdcom {
	--rv-wpd-line: #3d3578;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) body #wpdcom {
		--rv-wpd-line: #3d3578;
	}
}

body #wpdcom .wpd-thread-head .wpd-thread-info,
body #wpdcom .wpd-thread-head .wpdiscuz-user-settings {
	border-bottom-color: var(--rv-wpd-line);
}

/* 3. Layout 3: the band beside the avatar (name + RSS) and the reply-to bar
   -------------------------------------------------------------------------- */

body #wpdcom.wpd-layout-3 .wpd-comment .wpd-comment-header,
body #wpdcom.wpd-layout-3 .wpd-comment .wpd-reply-to {
	background-color: var(--rv-surface-2);
	border-radius: var(--rv-radius-sm);
}

body #wpdcom.wpd-layout-3 .wpd-comment.wpd-sticky-comment .wpd-comment-header {
	background-color: color-mix(in srgb, var(--rv-lime) 18%, var(--rv-surface));
}

/* Replies keep wpDiscuz's transparent header. */
body #wpdcom.wpd-layout-3 .wpd-comment.wpd-reply .wpd-comment-header {
	background-color: transparent;
}

/* 4. Layout 3: solid vote, count and reply buttons so the thread line under
   the comment never shows through them (wpDiscuz's intended look). Phones
   drop that line and the button circles, so this stays on wider screens.
   -------------------------------------------------------------------------- */

@media screen and (min-width: 601px) {
	body #wpdcom.wpd-layout-3 .wpd-comment:not(.wpd-reply) > .wpd-comment-wrap .wpd-comment-footer :is(.wpd-vote-up, .wpd-vote-down, .wpd-vote-result, .wpd-reply-button, .wpd-tool-wrap i, .wpd-toggle .wpd-view-replies) {
		background: var(--rv-surface) !important;
		opacity: 1;
	}
}
