/*
 * CommentAura public thread styles (1.0.0 redesign, ADR-0032; spec: docs/plan/45).
 *
 * Hand-authored plain CSS, no build step. The goal is a thread that feels as familiar as the
 * comments on a social feed — soft bubbles, quiet actions, 3D reaction faces — while belonging to
 * whatever theme it is installed in.
 *
 * Rules that govern every line below:
 *
 *  1. NEVER write to :root (sponsor directive, Gate C). Every token is declared on the
 *     .commentaura-thread container, so deactivating CommentAura returns the theme's own comment
 *     styling untouched: zero lock-in applies to appearance too.
 *  2. Inherit first (P7, doc 26 §5). Fonts and colours come from the theme. Tints are
 *     `color-mix()` against currentColor, so the same rule reads correctly on a light theme and a
 *     dark one without a second palette. Surfaces that float over other content (the reaction bar,
 *     menus) use the theme's own base colour when it defines one, and the system `Canvas` otherwise.
 *  3. No `!important`, and no `opacity` on anything with text (it multiplies the theme's text colour
 *     and cannot be undone by a child; measured failing 1.4.3 on Astra in 2026-08). De-emphasis is
 *     size, weight and a bounded colour mix.
 *  4. Every selector is scoped under a `commentaura-` class. Element selectors appear only inside
 *     that scope, where core's `comment_form()` markup leaves no choice.
 *  5. Accessibility floors are in px (2.5.8 is specified in CSS pixels; `rem` moves with the
 *     theme's root size). Typography-linked sizes are relative.
 */

.commentaura-thread {
	/* ── Space ── */
	--commentaura-space-1: 0.5rem;
	--commentaura-space-2: 1rem;
	--commentaura-space-3: 1.5rem;

	/* ── Shape ── */
	--commentaura-radius-sm: 8px;
	--commentaura-radius-md: 12px;
	--commentaura-radius-bubble: 18px;
	--commentaura-radius-pill: 999px;

	/*
	 * The avatar column. It sizes the grid track AND the circle, so they cannot drift apart. rem,
	 * not em: a custom property holding `em` resolves at each *using* element, so one declaration
	 * would give the track and the circle two different widths.
	 */
	--commentaura-gutter: 2.5rem;
	--commentaura-reply-gutter: 2rem;

	/* ── Ink and tints (all relative to the theme's text colour) ── */
	--commentaura-rule: color-mix(in srgb, currentColor 12%, transparent);
	--commentaura-control-bg: color-mix(in srgb, currentColor 6%, transparent);
	--commentaura-control-bg-hover: color-mix(in srgb, currentColor 10%, transparent);
	--commentaura-control-line: color-mix(in srgb, currentColor 16%, transparent);

	/*
	 * Quiet text: the action row, times, counts. 72%, derived rather than picked: on Astra's slate
	 * body text (#334155) it composites to about #6c7685, 4.6:1 on white; on Twenty Twenty-Five's
	 * near-black it is above 7:1; on a dark theme's light text it stays far above 4.5:1. It is never
	 * used for the comment itself.
	 */
	--commentaura-muted: color-mix(in srgb, currentColor 72%, transparent);

	/*
	 * The boundary of anything a person types into (1.4.11, 3:1). 78% is the derived minimum for a
	 * theme whose body text sits exactly on 1.4.3's floor (#767676 → #949494 → 3.03:1).
	 */
	--commentaura-field-line: color-mix(in srgb, currentColor 78%, transparent);

	/* ── The bubble ── */
	--commentaura-bubble-bg: color-mix(in srgb, currentColor 5.5%, transparent);
	--commentaura-bubble-pad-block: 0.5rem 0.625rem;
	--commentaura-bubble-pad-inline: 0.875rem;

	/*
	 * Floating surfaces. A block theme names its page colour `base` and its text `contrast`; a
	 * classic theme names nothing, and the system colour pair is the only honest guess. They are
	 * always used as a PAIR, so the text on a surface is legible whichever pair applies.
	 */
	--commentaura-surface: var(--wp--preset--color--base, Canvas);
	--commentaura-surface-ink: var(--wp--preset--color--contrast, CanvasText);
	--commentaura-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 8px 24px rgb(0 0 0 / 14%);

	/* ── Motion ── */
	--commentaura-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--commentaura-fast: 120ms;
	--commentaura-slow: 220ms;

	/*
	 * The shared tap target, px on purpose (see rule 5). 30px on fine pointers, 44px on touch
	 * (below). The quiet text actions keep the 24px floor instead, plus the space between them.
	 */
	--commentaura-tap: 30px;

	margin-block: var(--commentaura-space-3);
	color: inherit;
	font-family: inherit;
}

/* A dark classic theme (detected by the islands; see index.js): dark floating surfaces. */
.commentaura-thread.commentaura--on-dark {
	--commentaura-surface: #1f2228;
	--commentaura-surface-ink: #eceef1;
	--commentaura-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 45%);
}

/*
 * Visually hidden, still announced. Not `display:none`, which removes it from the accessibility
 * tree along with the screen.
 */
.commentaura-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.commentaura-icon {
	display: block;
	flex: none;
	inline-size: 1em;
	block-size: 1em;
}

/* ══ Header: "Comments · 12" and the sort menu ══════════════════════════════════════════════ */

.commentaura-thread__header {
	display: flex;
	flex-wrap: wrap;
	gap: var(--commentaura-space-1) var(--commentaura-space-2);
	align-items: center;
	justify-content: space-between;
	margin-block-end: var(--commentaura-space-2);
}

.commentaura-thread__title {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	margin: 0;
	font-size: 1.125em;
	font-weight: 700;
	line-height: 1.3;
}

.commentaura-thread__count {
	color: var(--commentaura-muted);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

/* A drawn dot, not "·": generated text is read aloud; an empty box is not. */
.commentaura-thread__count::before {
	content: "";
	display: inline-block;
	inline-size: 4px;
	block-size: 4px;
	margin-inline-end: 0.5em;
	border-radius: 50%;
	background: currentColor;
	vertical-align: middle;
}

/* ══ Popovers: the sort menu and the "⋯" menu share one look ════════════════════════════════ */

.commentaura-sort,
.commentaura-menu {
	position: relative;
}

.commentaura-sort__toggle,
.commentaura-menu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25em;
	min-block-size: 24px;
	min-inline-size: 24px;
	padding: 0.125rem 0.5rem;
	border-radius: var(--commentaura-radius-pill);
	color: var(--commentaura-muted);
	font-size: 0.875em;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
	transition: background-color var(--commentaura-fast) ease, color var(--commentaura-fast) ease;
}

.commentaura-sort__toggle::-webkit-details-marker,
.commentaura-menu__toggle::-webkit-details-marker,
.commentaura-reactions__summary::-webkit-details-marker {
	display: none;
}

.commentaura-sort__toggle:hover,
.commentaura-menu__toggle:hover,
.commentaura-sort[open] > .commentaura-sort__toggle,
.commentaura-menu[open] > .commentaura-menu__toggle {
	background: var(--commentaura-control-bg-hover);
	color: inherit;
}

.commentaura-sort__list,
.commentaura-menu__list {
	position: absolute;
	z-index: 20;
	inset-block-start: calc(100% + 4px);
	inset-inline-end: 0;
	display: flex;
	flex-direction: column;
	min-inline-size: 10rem;
	margin: 0;
	padding: 0.25rem;
	border: 1px solid color-mix(in srgb, var(--commentaura-surface-ink) 14%, transparent);
	border-radius: var(--commentaura-radius-md);
	background: var(--commentaura-surface);
	box-shadow: var(--commentaura-shadow);
	color: var(--commentaura-surface-ink);
	font-size: 0.9375rem;
	list-style: none;
	animation: commentaura-pop var(--commentaura-fast) var(--commentaura-ease);
}

.commentaura-sort__list > li {
	margin: 0;
}

.commentaura-sort__item,
.commentaura-thread .commentaura-menu__item {
	display: flex;
	align-items: center;
	min-block-size: 36px;
	padding: 0.375rem 0.75rem;
	border-radius: var(--commentaura-radius-sm);
	color: inherit;
	font-size: 1em;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.commentaura-sort__item:hover,
.commentaura-sort__item:focus-visible,
.commentaura-thread .commentaura-menu__item:hover,
.commentaura-thread .commentaura-menu__item:focus-visible {
	background: color-mix(in srgb, var(--commentaura-surface-ink) 8%, transparent);
	text-decoration: none;
}

.commentaura-sort__item[aria-current="true"] {
	font-weight: 700;
}

/* A drawn tick beside the current order. */
.commentaura-sort__item[aria-current="true"]::after {
	content: "";
	inline-size: 0.35em;
	block-size: 0.65em;
	margin-inline-start: auto;
	border-inline-end: 2px solid currentColor;
	border-block-end: 2px solid currentColor;
	transform: rotate(45deg) translate(-2px, -1px);
}

.commentaura-thread .commentaura-comment__delete {
	color: color-mix(in srgb, #d63638 70%, var(--commentaura-surface-ink));
}

/* ══ The list ═══════════════════════════════════════════════════════════════════════════════ */

.commentaura-thread__list,
.commentaura-thread__replies {
	margin: 0;
	padding: 0;
	list-style: none;
}

.commentaura-thread__list > .commentaura-thread__item + .commentaura-thread__item {
	margin-block-start: var(--commentaura-space-3);
}

.commentaura-thread__empty,
.commentaura-thread__closed {
	margin-block: var(--commentaura-space-2);
	color: var(--commentaura-muted);
	font-size: 0.9375em;
}

/* ══ One comment ════════════════════════════════════════════════════════════════════════════ */

/*
 * A two-column grid: the avatar in its own gutter, everything else beside it. A gutter cannot be
 * displaced by anything the text does (a 245-character display name once pushed a flex-row
 * monogram onto its own line: 28px → 124px, measured 2026-08-19).
 */
.commentaura-comment {
	display: grid;
	grid-template-columns: var(--commentaura-gutter) minmax(0, 1fr);
	column-gap: 0.625rem;
	align-items: start;
}

/*
 * Initials on a soft colour derived from the name (comment-item.php sets the hue). Lightness and
 * saturation are fixed here so every hue keeps the dark initial legible (above 7:1 across the
 * wheel). No Gravatar: it would announce every reader to a third party (NFR-PRIV-1).
 */
.commentaura-comment__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: var(--commentaura-gutter);
	block-size: var(--commentaura-gutter);
	border-radius: 50%;
	background: hsl(var(--commentaura-avatar-hue, 220) 70% 87%);
	color: hsl(var(--commentaura-avatar-hue, 220) 55% 22%);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	overflow: hidden;
	user-select: none;
}

.commentaura-comment__main {
	min-inline-size: 0;
}

/*
 * The bubble: name, labels, text. It hugs short comments and grows to the column for long ones,
 * which is what makes a thread read as people talking rather than as a table of paragraphs.
 */
.commentaura-comment__bubble {
	position: relative;
	box-sizing: border-box;
	inline-size: fit-content;
	max-inline-size: 100%;
	min-inline-size: 0;
	padding: var(--commentaura-bubble-pad-block);
	padding-inline: var(--commentaura-bubble-pad-inline);
	border-radius: var(--commentaura-radius-bubble);
	background: var(--commentaura-bubble-bg);
}

/* The summary hangs off the bubble's corner; leave it room, and never let it cover the name. */
.commentaura-comment__bubble:has(> .commentaura-comment__summary) {
	min-inline-size: 8.5rem;
	margin-block-end: 0.75rem;
}

/* Editing: the field needs the whole column. */
.commentaura-comment__bubble:has(.commentaura-editor),
.commentaura-comment__bubble:has(.commentaura-comment__editor) {
	inline-size: 100%;
}

.commentaura-comment__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.125rem 0.5rem;
	font-size: 0.875em;
	line-height: 1.35;
}

/*
 * The one item that can be arbitrarily long. `anywhere`, because a display name may be a single
 * unbroken token.
 */
.commentaura-comment__author {
	min-inline-size: 0;
	font-weight: 700;
	overflow-wrap: anywhere;
}

/*
 * "Author", "Pinned": short words in a soft pill. No `text-transform: uppercase`: CSS case
 * transforms reach the accessible name, and short all-caps runs make screen readers spell.
 */
.commentaura-label {
	display: inline-flex;
	align-items: center;
	padding: 0.0625rem 0.5rem;
	border-radius: var(--commentaura-radius-pill);
	background: var(--commentaura-control-bg-hover);
	font-size: 0.8125em;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.commentaura-label--pinned::before {
	content: "";
	inline-size: 0.45em;
	block-size: 0.45em;
	margin-inline-end: 0.35em;
	border-radius: 50%;
	background: currentColor;
}

.commentaura-comment__edited {
	color: var(--commentaura-muted);
	font-size: 0.8125em;
}

.commentaura-comment__body {
	margin-block-start: 0.125rem;
	font-size: 0.9375em;
	line-height: 1.55;
	overflow-wrap: break-word;
	word-break: break-word;
}

.commentaura-comment__body > * {
	margin-block: 0;
}

.commentaura-comment__body > * + * {
	margin-block-start: 0.625em;
}

/*
 * Underlined inside comments only: a link distinguished by colour alone fails 1.4.1 on themes like
 * Astra (1.99:1 against body text), and strangers' links are where the distinction matters most.
 */
.commentaura-comment__body a {
	overflow-wrap: anywhere;
	text-decoration: underline;
}

.commentaura-comment__body img,
.commentaura-comment__body iframe {
	max-inline-size: 100%;
	block-size: auto;
}

.commentaura-comment__body pre {
	overflow-x: auto;
	max-inline-size: 100%;
	padding: 0.625rem 0.75rem;
	border-radius: var(--commentaura-radius-sm);
	background: var(--commentaura-control-bg);
	font-size: 0.875em;
}

.commentaura-comment__body pre code {
	padding: 0;
	background: none;
	font-size: inherit;
}

.commentaura-comment__body blockquote {
	margin-inline: 0;
	padding-inline-start: 0.75rem;
	border-inline-start: 3px solid var(--commentaura-control-line);
}

.commentaura-comment__pending {
	margin-block: 0 0.25rem;
	color: var(--commentaura-muted);
	font-size: 0.875em;
}

.commentaura-thread__item--moderated > .commentaura-comment .commentaura-comment__bubble {
	background: transparent;
	outline: 1px dashed var(--commentaura-control-line);
	outline-offset: -1px;
}

/* ── The reaction summary on the bubble's corner ── */

.commentaura-comment__summary {
	position: absolute;
	z-index: 1;
	inset-block-end: -0.875rem;
	inset-inline-end: -0.375rem;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.125rem 0.4375rem 0.125rem 0.1875rem;
	border-radius: var(--commentaura-radius-pill);
	background: var(--commentaura-surface);
	box-shadow: 0 1px 3px rgb(0 0 0 / 16%), 0 0 0 1px color-mix(in srgb, var(--commentaura-surface-ink) 8%, transparent);
	color: var(--commentaura-surface-ink);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.commentaura-summary__faces {
	display: inline-flex;
	align-items: center;
}

.commentaura-summary__face {
	display: block;
	inline-size: 18px;
	block-size: 18px;
	margin: 0;
	border-radius: 50%;
	background: var(--commentaura-surface);
	box-shadow: 0 0 0 2px var(--commentaura-surface);
}

.commentaura-summary__face + .commentaura-summary__face {
	margin-inline-start: -4px;
}

.commentaura-summary__count {
	font-variant-numeric: tabular-nums;
}

/* ══ The action row: Like · Reply · 2h ══════════════════════════════════════════════════════ */

.commentaura-comment__actions {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 0.875rem;
	margin-block-start: 0.125rem;
	padding-inline-start: var(--commentaura-bubble-pad-inline);
	font-size: 0.8125em;
	line-height: 1.2;
}

/*
 * Quiet words. No border, no box, no background until hover. The 24px floor is the target height;
 * the gap between words keeps neighbouring targets apart (2.5.8's spacing exception).
 */
.commentaura-action,
.commentaura-comment__permalink {
	display: inline-flex;
	align-items: center;
	gap: 0.3125rem;
	min-block-size: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--commentaura-muted);
	font: inherit;
	font-size: 1em;
	font-weight: 700;
	line-height: inherit;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: color var(--commentaura-fast) ease;
}

/*
 * Classic themes style every <button> state too: Astra paints `button:hover` and `:focus` with its
 * accent (0,1,1), which beat our single class and put blue text on a blue box. The quiet words and
 * the faces stay transparent in every state; the load-more button keeps its own tint.
 */
.commentaura-thread :is(.commentaura-action:not(.commentaura-loadmore__button), .commentaura-reaction):is(:hover, :focus, :active) {
	background: transparent;
	box-shadow: none;
}

/*
 * Classic themes style every <button> (Astra: a shadow and a radius; others: padding, capitals).
 * Our icon buttons are drawn by us, so the same neutral base applies to all of them.
 */
.commentaura-vote,
.commentaura-reaction,
.commentaura-toolbar__button,
.commentaura-replying__cancel {
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.commentaura-comment__permalink {
	font-weight: 500;
}

.commentaura-action:hover,
.commentaura-comment__permalink:hover {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.commentaura-action:focus-visible,
.commentaura-comment__permalink:focus-visible,
.commentaura-vote:focus-visible,
.commentaura-reaction:focus-visible,
.commentaura-reactions__summary:focus-visible,
.commentaura-sort__toggle:focus-visible,
.commentaura-menu__toggle:focus-visible,
.commentaura-sort__item:focus-visible,
.commentaura-thread .commentaura-menu__item:focus-visible,
.commentaura-toolbar__button:focus-visible,
.commentaura-replying__cancel:focus-visible,
.commentaura-composer :is(input, textarea, button):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ── Like, and the reaction bar ── */

.commentaura-comment__reactions {
	display: inline-flex;
	margin: 0;
}

.commentaura-reactions__group {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

/*
 * After reacting: your face and its name, in the reaction's colour. The colour is mixed 55% toward
 * the theme's own text colour, which darkens it on a light theme and lightens it on a dark one, so
 * even the yellow faces clear 4.5:1 on both (#f7b125 → ≈#8f681c on white, 5.1:1).
 */
.commentaura-react.is-active {
	color: color-mix(in srgb, var(--commentaura-react-color, currentColor) 55%, currentColor);
}

.commentaura-react__face {
	display: block;
	inline-size: 18px;
	block-size: 18px;
	margin-block: -2px;
}

/* The no-JS disclosure beside Like. The island replaces it with hover, long-press and Enter. */
.commentaura-reactions__summary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 24px;
	block-size: 24px;
	border-radius: 50%;
	color: var(--commentaura-muted);
	list-style: none;
	cursor: pointer;
	transition: background-color var(--commentaura-fast) ease;
}

.commentaura-reactions__summary:hover,
.commentaura-reactions__more[open] > .commentaura-reactions__summary {
	background: var(--commentaura-control-bg-hover);
	color: inherit;
}

/*
 * The bar floats above Like. It wraps rather than scrolls when an owner switches on many faces
 * (OD-13 sets no maximum), and it never grows wider than the space it has. A visible border keeps
 * it distinct on any theme, including one whose page colour equals the fallback surface.
 */
.commentaura-reactions__menu {
	position: absolute;
	z-index: 30;
	inset-block-end: calc(100% + 8px);
	inset-inline-start: calc(-1 * var(--commentaura-bubble-pad-inline));
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	inline-size: max-content;
	max-inline-size: min(23rem, calc(100vw - 2rem));
	padding: 5px;
	border: 1px solid color-mix(in srgb, var(--commentaura-surface-ink) 16%, transparent);
	border-radius: 28px;
	background: var(--commentaura-surface);
	box-shadow: var(--commentaura-shadow);
	color: var(--commentaura-surface-ink);
	transform-origin: 20% 100%;
	animation: commentaura-bar-in var(--commentaura-slow) var(--commentaura-ease);
}

.commentaura-reaction {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 42px;
	block-size: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.commentaura-reaction__face {
	display: block;
	inline-size: 36px;
	block-size: 36px;
	margin: 0;
	transition: transform var(--commentaura-slow) var(--commentaura-ease);
	transform-origin: 50% 80%;
	pointer-events: none;
}

.commentaura-reaction:hover .commentaura-reaction__face,
.commentaura-reaction:focus-visible .commentaura-reaction__face,
.commentaura-reaction.is-current .commentaura-reaction__face {
	transform: translateY(-6px) scale(1.3);
}

/* The reader's current reaction, marked with a dot under its face as well as by the button's state. */
.commentaura-reaction.is-active::after {
	content: "";
	position: absolute;
	inset-block-end: 1px;
	inset-inline-start: 50%;
	inline-size: 4px;
	block-size: 4px;
	border-radius: 50%;
	background: currentColor;
	transform: translateX(-50%);
}

/* The face's name: hidden until the face is pointed at or focused, then a small dark tag above it. */
.commentaura-reaction__label {
	position: absolute;
	inset-block-end: calc(100% + 8px);
	inset-inline-start: 50%;
	padding: 0.1875rem 0.5rem;
	border-radius: var(--commentaura-radius-pill);
	background: color-mix(in srgb, var(--commentaura-surface-ink) 88%, transparent);
	color: var(--commentaura-surface);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	clip-path: inset(50%);
}

[dir="rtl"] .commentaura-reaction__label {
	transform: translateX(50%);
}

.commentaura-reaction:hover .commentaura-reaction__label,
.commentaura-reaction:focus-visible .commentaura-reaction__label,
.commentaura-reaction.is-current .commentaura-reaction__label {
	clip-path: none;
}

/* No room above (the first comment at the top of the window): the bar opens below Like instead. */
.commentaura-reactions__menu.is-below {
	inset-block-start: calc(100% + 8px);
	inset-block-end: auto;
	transform-origin: 20% 0;
}

/* ── Votes, when a site turns them on: borderless ▲ n ▼ ── */

.commentaura-comment__votes {
	display: inline-flex;
	margin: 0;
}

.commentaura-votes__group {
	display: inline-flex;
	align-items: center;
	gap: 0.125rem;
	color: var(--commentaura-muted);
}

.commentaura-vote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 24px;
	block-size: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	transition: background-color var(--commentaura-fast) ease, color var(--commentaura-fast) ease;
}

.commentaura-vote .commentaura-icon {
	inline-size: 14px;
	block-size: 14px;
}

.commentaura-vote:hover,
.commentaura-vote.is-active {
	background: var(--commentaura-control-bg-hover);
}

.commentaura-vote.is-active {
	color: inherit;
}

.commentaura-vote__score {
	min-inline-size: 0.5em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

/* ── The "⋯" menu ── */

.commentaura-comment__actions > .commentaura-menu {
	margin-inline-start: auto;
}

.commentaura-menu__toggle {
	padding: 0.125rem 0.375rem;
}

.commentaura-menu__toggle .commentaura-icon {
	inline-size: 16px;
	block-size: 16px;
}

/*
 * On a device that can hover, the menu stays out of the way until the comment is pointed at or
 * anything in it has focus. `visibility` rather than `opacity` (rule 3). Keyboard users reach it:
 * Tab lands on Like, Reply or the time first, which is focus within the comment, which shows it.
 * On touch it is always visible.
 */
@media (hover: hover) {

	.commentaura-comment .commentaura-menu:not([open]) > .commentaura-menu__toggle {
		visibility: hidden;
	}

	.commentaura-comment:hover .commentaura-menu > .commentaura-menu__toggle,
	.commentaura-comment:focus-within .commentaura-menu > .commentaura-menu__toggle {
		visibility: visible;
	}
}

/* ══ Replies ════════════════════════════════════════════════════════════════════════════════ */

/*
 * Indented under a thin line that runs down from the parent's avatar. Only two visual levels: a
 * reply to a reply to a reply sits at the same indent as its parent, so deep threads never squeeze
 * the text into a sliver on a phone. Core's thread depth setting still decides the nesting.
 */
.commentaura-thread__replies {
	margin-block-start: 0.75rem;
	margin-inline-start: calc(var(--commentaura-gutter) / 2 - 1px);
	padding-inline-start: calc(var(--commentaura-gutter) / 2 + 0.625rem - 1px);
	border-inline-start: 2px solid var(--commentaura-rule);
}

.commentaura-thread__replies > .commentaura-thread__item + .commentaura-thread__item {
	margin-block-start: 0.875rem;
}

.commentaura-thread__replies .commentaura-comment {
	grid-template-columns: var(--commentaura-reply-gutter) minmax(0, 1fr);
	column-gap: 0.5rem;
}

.commentaura-thread__replies .commentaura-comment__avatar {
	inline-size: var(--commentaura-reply-gutter);
	block-size: var(--commentaura-reply-gutter);
	font-size: 0.875rem;
}

.commentaura-thread__replies .commentaura-thread__replies {
	margin-inline-start: calc(var(--commentaura-reply-gutter) / 2 - 1px);
	padding-inline-start: calc(var(--commentaura-reply-gutter) / 2 + 0.5rem - 1px);
}

.commentaura-thread__replies .commentaura-thread__replies .commentaura-thread__replies {
	margin-inline-start: 0;
	padding-inline-start: 0;
	border-inline-start: 0;
}

/* "View 3 more replies" */
.commentaura-replies__more {
	margin-block-start: 0.625rem;
	font-size: 0.8125em;
}

.commentaura-replies__more .commentaura-action::before {
	content: "";
	inline-size: 1.25rem;
	block-size: 2px;
	margin-inline-end: 0.25rem;
	border-radius: 2px;
	background: var(--commentaura-rule);
}

/* ══ Pagination, load more ══════════════════════════════════════════════════════════════════ */

.commentaura-thread__pagination {
	margin-block: var(--commentaura-space-3);
	font-size: 0.875em;
}

/*
 * Core's `paginate_comments_links()` emits bare anchors: a standalone row of controls, so 2.5.8's
 * inline exception does not cover them.
 */
.commentaura-thread__pagination a,
.commentaura-thread__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-inline-size: 24px;
	min-block-size: 24px;
	padding-inline: 0.25rem;
}

.commentaura-loadmore {
	display: flex;
	justify-content: center;
	margin-block: var(--commentaura-space-3) 0;
}

.commentaura-loadmore__button {
	gap: 0.5rem;
	min-block-size: 40px;
	padding: 0.5rem 1.25rem;
	border-radius: var(--commentaura-radius-pill);
	background: var(--commentaura-control-bg);
	color: inherit;
	font-size: 0.875em;
}

.commentaura-loadmore__button:hover {
	background: var(--commentaura-control-bg-hover);
	text-decoration: none;
}

.commentaura-spinner {
	box-sizing: border-box;
	inline-size: 1em;
	block-size: 1em;
	border: 2px solid var(--commentaura-control-line);
	border-block-start-color: currentColor;
	border-radius: 50%;
	animation: commentaura-spin 700ms linear infinite;
}

.commentaura-thread [aria-disabled="true"] {
	cursor: progress;
}

/* ══ The composer ═══════════════════════════════════════════════════════════════════════════ */

.commentaura-composer {
	margin-block-start: var(--commentaura-space-3);
}

/* Replying in place: the composer sits under the comment, indented with it. */
.commentaura-thread__item > .commentaura-composer {
	margin-block: 0.75rem 0;
	margin-inline-start: calc(var(--commentaura-gutter) + 0.625rem);
}

.commentaura-composer .comment-reply-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-block: 0 var(--commentaura-space-1);
	font-size: 0.875em;
	font-weight: 600;
}

.commentaura-composer .comment-reply-title small {
	font-size: 1em;
}

.commentaura-composer .comment-notes,
.commentaura-composer .logged-in-as {
	margin-block: 0 0.75rem;
	color: var(--commentaura-muted);
	font-size: 0.8125em;
}

.commentaura-composer .logged-in-as a {
	color: inherit;
}

/* Signed in: name and account links on one row, dot-separated, wrapping cleanly on phones. */
.commentaura-composer__form > .commentaura-composer__identity {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	gap: 0.25rem 0.5rem;
	line-height: 1.5;
}

.commentaura-composer__identity strong {
	font-weight: 600;
}

.commentaura-composer__identity a {
	text-decoration: none;
}

.commentaura-composer__identity a::before {
	content: "·";
	margin-inline-end: 0.5rem;
	color: var(--commentaura-muted);
}

.commentaura-composer__identity a:is(:hover, :focus-visible) {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.commentaura-composer__form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0.75rem;
	margin: 0;
}

.commentaura-composer__form > * {
	grid-column: 1 / -1;
	margin: 0;
}

/* Name, email and website side by side on wide screens; the website takes the full row below. */
.commentaura-composer__form > .comment-form-author {
	grid-column: 1;
}

.commentaura-composer__form > .comment-form-email {
	grid-column: 2;
}

.commentaura-composer__form > p {
	display: flex;
	flex-direction: column;
	gap: 0.3125rem;
}

.commentaura-composer__form label {
	font-size: 0.8125em;
	font-weight: 600;
}

/* The comment field's label stays for assistive technology; its placeholder says the same thing. */
.commentaura-composer .comment-form-comment > label,
.commentaura-composer .commentaura-field-row--compact > label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.commentaura-composer :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
	box-sizing: border-box;
	inline-size: 100%;
	max-inline-size: 100%;
	min-block-size: 44px;
	margin: 0;
	padding: 0.625rem 0.875rem;
	border: 1px solid var(--commentaura-field-line);
	border-radius: var(--commentaura-radius-md);
	background: transparent;
	color: inherit;
	font: inherit;
	transition: border-color var(--commentaura-fast) ease, box-shadow var(--commentaura-fast) ease;
}

.commentaura-composer textarea {
	display: block;
	min-block-size: 7.5rem;
	font-size: 0.9375em;
	line-height: 1.6;
	resize: vertical;
}

.commentaura-composer :is(input[type="text"], input[type="email"], input[type="url"], textarea):focus {
	border-color: currentColor;
	box-shadow: 0 0 0 1px currentColor;
	outline: none;
}

.commentaura-composer :is(input, textarea)::placeholder {
	color: var(--commentaura-muted);
}

/*
 * With JavaScript the field and its toolbar are one rounded box: the toolbar sits inside the top
 * edge, and the textarea loses its own border. The box carries the 1.4.11 boundary instead.
 */
.commentaura-field {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--commentaura-field-line);
	border-radius: var(--commentaura-radius-md);
	transition: box-shadow var(--commentaura-fast) ease, border-color var(--commentaura-fast) ease;
}

.commentaura-field:focus-within {
	border-color: currentColor;
	box-shadow: 0 0 0 1px currentColor;
}

.commentaura-composer .commentaura-field textarea {
	min-block-size: 6.5rem;
	padding-block-start: 0.25rem;
	border: 0;
	border-radius: 0 0 var(--commentaura-radius-md) var(--commentaura-radius-md);
	box-shadow: none;
	resize: none;
	overflow-y: hidden;
}

.commentaura-composer .commentaura-field textarea:is(:focus, :focus-visible) {
	box-shadow: none;
	outline: none;
}

/* Guest details, revealed on first input by the island. Present (and required) without it. */
.commentaura-composer--quiet :is(.comment-form-author, .comment-form-email, .comment-form-url, .comment-form-cookies-consent, .comment-notes) {
	display: none;
}

.commentaura-composer__form > :is(.comment-form-cookies-consent, .comment-subscription-form) {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.5rem;
}

.commentaura-composer__form > :is(.comment-form-cookies-consent, .comment-subscription-form) label {
	display: inline-flex;
	align-items: center;
	min-block-size: 24px;
	color: var(--commentaura-muted);
	font-weight: 400;
}

.commentaura-composer input[type="checkbox"] {
	flex: 0 0 auto;
	inline-size: 24px;
	block-size: 24px;
	margin: 0;
	accent-color: currentColor;
}

.commentaura-subscribe__hint {
	display: block;
	flex-basis: 100%;
	margin-block-start: 0.25rem;
	font-size: 0.8125em;
}

.commentaura-composer .form-submit {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
}

/*
 * Layout and behaviour only at class specificity. Appearance lives in :where() below, at ZERO
 * specificity, so a block theme's own `:root :where(.wp-element-button)` button always wins
 * (regression guard 2026-08-19, AccessibilityTest). Height floor in px.
 */
.commentaura-composer__submit {
	min-block-size: 40px;
	cursor: pointer;
}

.commentaura-composer__submit:is([disabled], [aria-disabled="true"]) {
	cursor: not-allowed;
}

:where(.commentaura-composer__submit:not(.wp-element-button):not(.wp-block-button__link)),
:where(.commentaura-editor__save:not(.wp-element-button):not(.wp-block-button__link)) {
	padding: 0.5rem 1.25rem;
	border: 1px solid var(--commentaura-surface-ink);
	border-radius: var(--commentaura-radius-pill);
	background: var(--commentaura-surface-ink);
	color: var(--commentaura-surface);
	font: inherit;
	font-weight: 600;
}

/* Disabled until there is text: whatever button the theme draws, the state still reads. */
:where(.commentaura-composer__submit:is([disabled], [aria-disabled="true"])) {
	filter: grayscale(1) contrast(0.55) brightness(1.15);
}

.commentaura-composer__status {
	margin: 0;
	margin-inline-end: auto;
	color: var(--commentaura-muted);
	font-size: 0.8125em;
}

.commentaura-composer__status--error {
	color: color-mix(in srgb, #d63638 70%, currentColor);
}

/* "Replying to Maya ×" */
.commentaura-composer__replying:empty {
	display: none;
}

.commentaura-replying {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	gap: 0.25rem;
	padding: 0.125rem 0.125rem 0.125rem 0.625rem;
	border-radius: var(--commentaura-radius-pill);
	background: var(--commentaura-control-bg-hover);
	font-size: 0.8125em;
	font-weight: 600;
}

.commentaura-replying__cancel {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 24px;
	block-size: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.commentaura-replying__cancel:hover {
	background: var(--commentaura-control-bg-hover);
}

/* ── The toolbar, inside the field's top edge ── */

.commentaura-composer__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--commentaura-space-1);
	padding: 0.25rem 0.375rem 0;
}

.commentaura-toolbar {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.125rem;
}

.commentaura-toolbar__button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: var(--commentaura-tap);
	block-size: var(--commentaura-tap);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--commentaura-radius-sm);
	background: transparent;
	color: var(--commentaura-muted);
	font: inherit;
	cursor: pointer;
	transition: background-color var(--commentaura-fast) ease, color var(--commentaura-fast) ease;
}

.commentaura-toolbar__button .commentaura-icon {
	inline-size: 16px;
	block-size: 16px;
}

.commentaura-toolbar__button:hover {
	background: var(--commentaura-control-bg-hover);
	color: inherit;
}

/* The shortcut tooltip ("Bold · Ctrl+B"), on hover and keyboard focus. Decorative: aria-label names the button. */
.commentaura-toolbar__button::after {
	content: attr(data-tip);
	position: absolute;
	z-index: 20;
	inset-block-end: calc(100% + 6px);
	inset-inline-start: 50%;
	padding: 0.1875rem 0.5rem;
	border-radius: 6px;
	background: color-mix(in srgb, var(--commentaura-surface-ink) 88%, transparent);
	color: var(--commentaura-surface);
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	clip-path: inset(50%);
}

.commentaura-toolbar__button:is(:hover, :focus-visible)::after {
	clip-path: none;
}

.commentaura-draft {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--commentaura-space-1);
	margin: 0;
	color: var(--commentaura-muted);
	font-size: 0.8125em;
}

/* ══ Editing in place ═══════════════════════════════════════════════════════════════════════ */

.commentaura-editor {
	display: flex;
	flex-direction: column;
	gap: var(--commentaura-space-1);
	margin-block-start: 0.25rem;
	min-inline-size: 0;
}

.commentaura-editor__label {
	font-size: 0.8125em;
	font-weight: 600;
}

.commentaura-editor__field {
	box-sizing: border-box;
	inline-size: 100%;
	max-inline-size: 100%;
	min-block-size: 6rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--commentaura-field-line);
	border-radius: var(--commentaura-radius-md);
	background: transparent;
	color: inherit;
	font: inherit;
	resize: vertical;
}

.commentaura-editor__field:focus {
	border-color: currentColor;
}

.commentaura-editor__field:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.commentaura-editor__note {
	margin: 0;
	color: var(--commentaura-muted);
	font-size: 0.8125em;
}

.commentaura-editor__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--commentaura-space-2);
}

.commentaura-editor__save {
	min-block-size: 40px;
	cursor: pointer;
}

.commentaura-comment__editor {
	min-inline-size: 0;
}

/* ══ Arrival: a new comment settles into place ══════════════════════════════════════════════ */

.commentaura-thread__item.is-new > .commentaura-comment .commentaura-comment__bubble {
	animation: commentaura-arrive 900ms var(--commentaura-ease);
}

.commentaura-comment[tabindex="-1"]:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: var(--commentaura-radius-md);
}

@keyframes commentaura-arrive {

	from {
		box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 35%, transparent);
		transform: translateY(8px);
	}

	to {
		box-shadow: 0 0 0 3px transparent;
		transform: none;
	}
}

@keyframes commentaura-bar-in {

	from {
		transform: translateY(6px) scale(0.92);
	}

	to {
		transform: none;
	}
}

@keyframes commentaura-pop {

	from {
		transform: translateY(-4px);
	}

	to {
		transform: none;
	}
}

@keyframes commentaura-spin {

	to {
		transform: rotate(360deg);
	}
}

/* ══ Small screens ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {

	.commentaura-thread {
		--commentaura-gutter: 2.25rem;
		--commentaura-reply-gutter: 1.75rem;
		--commentaura-bubble-pad-inline: 0.75rem;
	}

	.commentaura-comment {
		column-gap: 0.5rem;
	}

	.commentaura-composer__form > :is(.comment-form-author, .comment-form-email) {
		grid-column: 1 / -1;
	}

	.commentaura-thread__item > .commentaura-composer {
		margin-inline-start: 0;
	}

	.commentaura-reaction {
		inline-size: 38px;
		block-size: 38px;
	}

	.commentaura-reaction__face {
		inline-size: 32px;
		block-size: 32px;
	}
}

@media (pointer: coarse) {

	.commentaura-thread {
		--commentaura-tap: 44px;
	}

	.commentaura-action,
	.commentaura-comment__permalink {
		min-block-size: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.commentaura-thread *,
	.commentaura-thread *::before,
	.commentaura-thread *::after {
		transition: none;
		animation: none;
	}

	.commentaura-reaction:is(:hover, :focus-visible, .is-current) .commentaura-reaction__face {
		transform: none;
	}

	.commentaura-thread .commentaura-spinner {
		animation: commentaura-spin 1.6s linear infinite;
	}
}

/*
 * Forced colours flatten every tint, so controls that defer to the theme everywhere else get a real
 * border here: it is the only thing that still says "this is a control".
 */
@media (forced-colors: active) {

	.commentaura-action,
	.commentaura-vote,
	.commentaura-reaction,
	.commentaura-reactions__summary,
	.commentaura-menu__toggle,
	.commentaura-sort__toggle,
	.commentaura-composer__submit,
	.commentaura-toolbar__button,
	.commentaura-comment__bubble,
	.commentaura-comment__avatar,
	.commentaura-label,
	.commentaura-comment__summary {
		border: 1px solid currentColor;
	}
}
