/*
 * SGHR Forum — front-end styles.
 *
 * All values derive from the theme's theme.json presets via
 * `var(--wp--preset--*)` / `var(--wp--custom--*)`, so the forum
 * automatically tracks a brand refresh. No hex literals.
 *
 * Sections:
 *   1. Shared primitives (layout, buttons, fields, byline, notices)
 *   2. Forum index (hero, toolbar, topic filter, list, pagination)
 *   3. Single question (question, answers, vote, composer)
 *   4. Ask page
 *   5. Home widget ("Aus dem Forum")
 */

/* ============================================================ *
 * 1. Shared primitives                                          *
 * ============================================================ */

.sghr-forum {
	display: block;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--sans);
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	box-sizing: border-box;
}

.sghr-forum *,
.sghr-forum *::before,
.sghr-forum *::after {
	box-sizing: border-box;
}

/* Sit flush against the theme chrome (matches the directory shell). */
body:has(.sghr-forum) .wp-site-blocks > * {
	margin-block-start: 0 !important;
}

body:has(.sghr-forum) .sghr-footer {
	margin-top: 0 !important;
}

/* Two-band shell: warm hero + white body, mirroring the directory. */
.sghr-forum__hero {
	background: var(--wp--preset--color--surface-warm);
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: clamp(2.25rem, 2.5rem + 1.5vw, 4.5rem) clamp(1.75rem, 2rem + 1vw, 3rem);
	padding-inline: clamp(1.25rem, 1.5rem + 4vw, 7.5rem);
}

.sghr-forum__hero-inner {
	max-width: 80rem;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.sghr-forum__body {
	background: var(--wp--preset--color--surface);
	padding-block: clamp(1.5rem, 2rem + 1.5vw, 3.5rem) clamp(2.5rem, 3rem + 1.5vw, 5rem);
	padding-inline: clamp(1.25rem, 1.5rem + 4vw, 7.5rem);
}

.sghr-forum__body-inner {
	max-width: 80rem;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.sghr-forum__hero-inner--narrow,
.sghr-forum__body-inner--narrow {
	max-width: 48rem;
}

.sghr-forum__hero-inner--read,
.sghr-forum__body-inner--read {
	max-width: 56rem;
}

@media (max-width: 47.99rem) {
	.sghr-forum__hero,
	.sghr-forum__body {
		padding-inline: var(--sghr-chrome-pad-x, 1.5rem);
	}
}

/* Buttons -------------------------------------------------------- */

.sghr-forum__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.6rem 1.1rem;
	border-radius: var(--wp--custom--radius--md, 5px);
	border: 1px solid transparent;
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color var(--wp--custom--motion--base, 150ms) ease,
		color var(--wp--custom--motion--base, 150ms) ease,
		border-color var(--wp--custom--motion--base, 150ms) ease;
}

.sghr-forum__btn--primary {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary-contrast);
}

.sghr-forum__btn--primary:hover,
.sghr-forum__btn--primary:focus-visible {
	background: var(--wp--preset--color--primary-hover);
	color: var(--wp--preset--color--primary-contrast);
}

.sghr-forum__btn--ghost {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--border);
}

.sghr-forum__btn--ghost:hover,
.sghr-forum__btn--ghost:focus-visible {
	border-color: var(--wp--preset--color--border-strong);
	background: var(--wp--preset--color--surface-subtle);
}

.sghr-forum__btn--pill {
	height: 3.5rem;
	padding-inline: 1.6rem;
	border-radius: 999px;
	font-weight: 600;
}

.sghr-forum__btn svg {
	width: 1.1em;
	height: 1.1em;
}

:where(.sghr-forum) a {
	color: var(--wp--preset--color--primary);
}

.sghr-forum :focus-visible {
	outline: none;
	box-shadow: var(--wp--custom--focus-ring--default, 0 0 0 3px rgba(42, 96, 143, 0.25));
}

/* Fields --------------------------------------------------------- */

.sghr-forum__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.sghr-forum__label {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.sghr-forum__field-hint,
.sghr-forum__hint {
	margin: 0;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum__input,
.sghr-forum__textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 8px);
}

.sghr-forum__textarea {
	resize: vertical;
	min-height: 7rem;
	line-height: 1.55;
}

.sghr-forum__input:focus-visible,
.sghr-forum__textarea:focus-visible {
	border-color: var(--wp--preset--color--primary);
}

/* Select wrapper -------------------------------------------------- *
 * Shared visual language with the directory dropdowns: a relative
 * host that styles BOTH the native <select> (no-JS fallback) and the
 * enhanced .sghr-menu-btn (theme's select-menu.js combobox) the same,
 * with one overlaid chevron. The popup itself is styled by the theme's
 * select-menu.css. */
.sghr-forum__select {
	position: relative;
	display: block;
	width: 100%;
}

.sghr-forum__select :is(select, .sghr-menu-btn) {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: 100%;
	padding: 0.7rem 2.4rem 0.7rem 0.9rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 8px);
	cursor: pointer;
}

.sghr-forum__select :is(select, .sghr-menu-btn):focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--primary);
}

.sghr-forum__select-chevron {
	position: absolute;
	right: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	pointer-events: none;
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum__select-chevron svg {
	width: 16px;
	height: 16px;
}

/* Byline / avatar ------------------------------------------------ */

.sghr-forum__byline {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.sghr-forum__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
}

.sghr-forum__avatar.is-sm {
	width: 1.4rem;
	height: 1.4rem;
}

.sghr-forum__author {
	font-weight: 500;
	color: var(--wp--preset--color--ink);
}

.sghr-forum__time,
.sghr-forum__dot {
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--sm);
}

/* Topic chips ---------------------------------------------------- */

.sghr-forum__topic-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.15rem 0.6rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	text-decoration: none;
}

.sghr-forum__topic-chip svg {
	width: 0.85em;
	height: 0.85em;
}

.sghr-forum__topic-chip.is-static {
	background: var(--wp--preset--color--surface-sunken);
	color: var(--wp--preset--color--ink-muted);
}

/* Notices -------------------------------------------------------- */

.sghr-forum__notice {
	padding: 0.75rem 1rem;
	border-radius: var(--wp--custom--radius--md, 5px);
	font-size: var(--wp--preset--font-size--base);
	border: 1px solid transparent;
}

.sghr-forum__notice.is-success {
	background: var(--wp--preset--color--success-bg);
	color: var(--wp--preset--color--success);
}

.sghr-forum__notice.is-info {
	background: var(--wp--preset--color--info-bg);
	color: var(--wp--preset--color--primary-active);
}

.sghr-forum__notice.is-error {
	background: var(--wp--preset--color--danger-bg);
	color: var(--wp--preset--color--danger);
}

.sghr-forum__error {
	margin: 0 0 0.5rem;
	padding: 0.6rem 0.8rem;
	border-radius: var(--wp--custom--radius--md, 5px);
	background: var(--wp--preset--color--danger-bg);
	color: var(--wp--preset--color--danger);
	font-size: var(--wp--preset--font-size--sm);
}

.sghr-forum__empty,
.sghr-forum__signin,
.sghr-forum__closed-notice {
	margin: 0;
	padding: 1.25rem;
	background: var(--wp--preset--color--surface);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 8px);
	color: var(--wp--preset--color--ink-muted);
	text-align: center;
}

.sghr-forum__back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--wp--preset--color--primary);
	font-weight: 500;
	text-decoration: none;
	width: fit-content;
}

.sghr-forum__back svg {
	width: 1.1em;
	height: 1.1em;
}

.sghr-forum__composer-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 0.75rem;
}

/* ============================================================ *
 * 2. Forum index                                               *
 * ============================================================ */

.sghr-forum__hero-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	flex-wrap: wrap;
}

.sghr-forum__hero-text {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sghr-forum__eyebrow {
	margin: 0;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-subtle);
}

.sghr-forum__hero-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--display-lg);
	font-weight: 600;
	line-height: 1.15;
	color: var(--wp--preset--color--ink);
}

.sghr-forum__hero-intro {
	margin: 0;
	max-width: 44rem;
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--lg);
}

.sghr-forum__ask-cta {
	flex-shrink: 0;
}

/* Hero search row */

.sghr-forum__searchrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 0.25rem;
}

.sghr-forum__search-btn {
	flex: 0 0 auto;
}

.sghr-forum__ask-panel {
	padding: 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 8px);
	box-shadow: var(--wp--custom--shadow--sm);
}

.sghr-forum__ask-panel-title {
	margin: 0 0 1rem;
	font-size: var(--wp--preset--font-size--xl);
}

/* The panel is already the card; drop the inner form's own card chrome
   here so we don't double up borders (it keeps its border on the
   standalone "Frage stellen" page, where it is not wrapped in a panel). */
.sghr-forum__ask-panel .sghr-forum__ask {
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
}

.sghr-forum__toolbar {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	justify-content: space-between;
}

/* The pill (border + radius + background) lives on the wrapper, and the
   <input> is transparent/borderless — same pattern as the directory and
   site search. This is what keeps the radius stable on focus: a native
   search control governs its OWN corners when you style the input
   directly, snapping the pill to near-square on focus. */
.sghr-forum__search {
	flex: 1 1 18rem;
	display: flex;
	align-items: center;
	height: 3.5rem;
	padding-inline: 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
}

.sghr-forum__search:focus-within {
	border-color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--custom--focus-ring--default, 0 0 0 3px rgba(42, 96, 143, 0.25));
}

.sghr-forum__search input {
	appearance: none;
	-webkit-appearance: none;
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--ink);
	background: transparent;
	border: 0;
	-webkit-tap-highlight-color: transparent;
}

/* The wrapper owns the focus ring (:focus-within above). Suppress the
   global `.sghr-forum :focus-visible` ring on the input itself, which
   would otherwise paint a rectangular highlight inside the pill. */
.sghr-forum__search input:focus,
.sghr-forum__search input:focus-visible {
	outline: none;
	box-shadow: none;
}

/* Keep the transparent field transparent when the browser autofills
   (Chrome paints an opaque inner box otherwise). */
.sghr-forum__search input:-webkit-autofill,
.sghr-forum__search input:-webkit-autofill:hover,
.sghr-forum__search input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 100px var(--wp--preset--color--surface) inset;
	-webkit-text-fill-color: var(--wp--preset--color--ink);
	transition: background-color 5000s ease-in-out 0s;
}

.sghr-forum__search input::-webkit-search-cancel-button,
.sghr-forum__search input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.sghr-forum__sorts {
	display: inline-flex;
	gap: 0.25rem;
	padding: 0.25rem;
	background: var(--wp--preset--color--surface-sunken);
	border-radius: var(--wp--custom--radius--pill, 999px);
}

.sghr-forum__sort-tab {
	padding: 0.4rem 0.85rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	color: var(--wp--preset--color--ink-muted);
	text-decoration: none;
}

.sghr-forum__sort-tab.is-active {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--custom--shadow--sm);
}

.sghr-forum__topic-filter {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sghr-forum__topic-pill {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--sm);
	text-decoration: none;
}

.sghr-forum__topic-pill.is-active {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary-contrast);
}

/* List ----------------------------------------------------------- */

.sghr-forum__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.sghr-forum__row {
	position: relative;
	display: flex;
	gap: 1.25rem;
	padding: 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	box-shadow: var(--wp--custom--shadow--sm, 0 1px 2px rgba(26, 31, 38, 0.06));
	transition: transform var(--wp--custom--motion--base, 150ms) ease,
		box-shadow var(--wp--custom--motion--base, 150ms) ease,
		border-color var(--wp--custom--motion--base, 150ms) ease;
}

.sghr-forum__row:hover {
	transform: translateY(-2px);
	box-shadow: var(--wp--custom--shadow--lg, 0 14px 32px rgba(26, 31, 38, 0.12));
	border-color: var(--wp--preset--color--border-strong);
}

.sghr-forum__row-stat {
	flex-shrink: 0;
	width: 4rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.1rem;
	text-align: center;
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum__row-count {
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 600;
	line-height: 1.1;
	color: var(--wp--preset--color--ink);
}

.sghr-forum__row-count.has-answers {
	color: var(--wp--preset--color--primary);
}

.sghr-forum__row-count-label {
	font-size: var(--wp--preset--font-size--xs);
}

.sghr-forum__row-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.sghr-forum__row-topic {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.sghr-forum__row-topic:hover,
.sghr-forum__row-topic:focus-visible {
	text-decoration: underline;
}

.sghr-forum__row-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 600;
	line-height: 1.3;
}

.sghr-forum__row-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.sghr-forum__row-title a:hover,
.sghr-forum__row-title a:focus-visible {
	color: var(--wp--preset--color--primary);
}

/* Stretched link: the title's anchor covers the whole card so a click
   anywhere navigates to the question, while keeping a single, accessible
   link. Interactive children (topic links) are lifted above the overlay
   below so they stay independently clickable. */
.sghr-forum__row-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.sghr-forum__row-topic {
	position: relative;
	z-index: 1;
}
.sghr-forum__row-meta {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: var(--wp--preset--font-size--sm);
}

/* Right aside: posted time + go arrow (mirrors the jobs cards). */
.sghr-forum__row-aside {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 1rem;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum__row-go {
	display: inline-flex;
	color: var(--wp--preset--color--primary);
	transition: transform var(--wp--custom--motion--base, 150ms) ease;
}

.sghr-forum__row-go svg {
	width: 1.25rem;
	height: 1.25rem;
}

.sghr-forum__row:hover .sghr-forum__row-go,
.sghr-forum__row:focus-within .sghr-forum__row-go {
	transform: translateX(3px);
}

/* Empty state ---------------------------------------------------- */

.sghr-forum__empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding: 3rem 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 8px);
	text-align: center;
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum__empty-state svg {
	width: 2.5rem;
	height: 2.5rem;
	color: var(--wp--preset--color--ink-subtle);
}

/* Pagination ----------------------------------------------------- */

.sghr-forum__pagination {
	display: flex;
	justify-content: center;
	margin-top: 0.5rem;
}

.sghr-forum__pagination-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.sghr-forum__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding-inline: 0.5rem;
	border-radius: var(--wp--custom--radius--lg, 8px);
	background: transparent;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--base);
}

.sghr-forum__page:hover {
	background: var(--wp--preset--color--surface-subtle);
}

.sghr-forum__page svg {
	width: 1.1em;
	height: 1.1em;
}

.sghr-forum__page--nav {
	border: 1px solid var(--wp--preset--color--border);
}

.sghr-forum__page.is-current {
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary);
	font-weight: 600;
}

.sghr-forum__page-dots {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2.5rem;
	color: var(--wp--preset--color--ink-muted);
}

/* ============================================================ *
 * 3. Single question                                           *
 * ============================================================ */

.sghr-forum__question {
	padding: 1.75rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	box-shadow: var(--wp--custom--shadow--sm);
}

.sghr-forum__topics {
	margin: 0 0 0.75rem;
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.sghr-forum__q-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--display-sm);
	font-weight: 600;
	line-height: 1.2;
}

.sghr-forum__q-meta {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin-top: 0.75rem;
	font-size: var(--wp--preset--font-size--sm);
}

.sghr-forum__closed-tag {
	padding: 0.1rem 0.5rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--warning-bg);
	color: var(--wp--preset--color--warning);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--xs);
}

.sghr-forum__q-body,
.sghr-forum__answer-body {
	line-height: 1.6;
	color: var(--wp--preset--color--ink);
	overflow-wrap: anywhere;
}

.sghr-forum__q-body :where(p, ul, ol, blockquote, pre):first-child,
.sghr-forum__answer-body :where(p, ul, ol, blockquote, pre):first-child {
	margin-top: 0;
}

.sghr-forum__q-body pre,
.sghr-forum__answer-body pre,
.sghr-forum__q-body code,
.sghr-forum__answer-body code {
	background: var(--wp--preset--color--surface-sunken);
	border-radius: var(--wp--custom--radius--sm, 3px);
	padding: 0.1em 0.35em;
	font-size: 0.92em;
}

.sghr-forum__q-body pre,
.sghr-forum__answer-body pre {
	padding: 0.9rem;
	overflow-x: auto;
}

.sghr-forum__q-body blockquote,
.sghr-forum__answer-body blockquote {
	margin: 1rem 0;
	padding-left: 1rem;
	border-left: 3px solid var(--wp--preset--color--border-strong);
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum__q-foot,
.sghr-forum__answer-foot {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 1.25rem;
	font-size: var(--wp--preset--font-size--sm);
}

.sghr-forum__answer-foot {
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--border);
}

.sghr-forum__q-foot {
	margin-top: 0.5rem;
}

.sghr-forum__edit {
	color: var(--wp--preset--color--ink-muted);
	text-decoration: none;
}

/* Owner controls (Bearbeiten / Löschen) ------------------------- */

.sghr-forum__q-foot {
	justify-content: flex-end;
}

.sghr-forum__answer-foot .sghr-forum__owner-actions {
	margin-left: auto;
}

.sghr-forum__owner-actions {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.sghr-forum__delete-form {
	margin: 0;
}

.sghr-forum__action {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.7rem;
	border: 1px solid transparent;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: transparent;
	color: var(--wp--preset--color--ink-muted);
	font: inherit;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.sghr-forum__action:hover,
.sghr-forum__action:focus-visible {
	background: var(--wp--preset--color--surface-subtle);
	color: var(--wp--preset--color--ink);
}

.sghr-forum__action svg {
	width: 1rem;
	height: 1rem;
}

.sghr-forum__action--danger {
	color: var(--wp--preset--color--error, #b3261e);
}

.sghr-forum__action--danger:hover,
.sghr-forum__action--danger:focus-visible {
	background: var(--wp--preset--color--error-bg, rgba(179, 38, 30, 0.08));
	color: var(--wp--preset--color--error, #b3261e);
}

/* Inline edit forms (hidden until is-editing) -------------------- */

.sghr-forum__edit-form {
	display: none;
	flex-direction: column;
	gap: 1rem;
}

.sghr-forum__question.is-editing .sghr-forum__q-body,
.sghr-forum__answer.is-editing .sghr-forum__answer-body {
	display: none;
}

.sghr-forum__question.is-editing .sghr-forum__q-foot,
.sghr-forum__answer.is-editing .sghr-forum__owner-actions {
	display: none;
}

.sghr-forum__question.is-editing .sghr-forum__edit-form,
.sghr-forum__answer.is-editing .sghr-forum__edit-form {
	display: flex;
}

/* Answers -------------------------------------------------------- */

.sghr-forum__answers {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.sghr-forum__answers-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xl);
}

.sghr-forum__answer-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.sghr-forum__answer {
	display: flex;
	gap: 1rem;
	padding: 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
}

.sghr-forum__vote {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
}

.sghr-forum__vote-form {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
}

.sghr-forum__vote-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--wp--custom--radius--pill, 999px);
	border: 1px solid var(--wp--preset--color--border-strong);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink-muted);
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.sghr-forum__vote-btn:hover:not(:disabled) {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.sghr-forum__vote-btn.is-active {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary-contrast);
}

.sghr-forum__vote-btn.is-static {
	cursor: default;
}

.sghr-forum__vote-btn svg {
	width: 1.2rem;
	height: 1.2rem;
}

.sghr-forum__vote-score {
	font-weight: 600;
	font-size: var(--wp--preset--font-size--base);
	color: var(--wp--preset--color--ink);
}

.sghr-forum__answer-main {
	flex: 1 1 auto;
	min-width: 0;
}

/* Composer ------------------------------------------------------- */

.sghr-forum__composer,
.sghr-forum__ask {
	padding: 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.sghr-forum__composer-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--lg);
}

/* ============================================================ *
 * 4. Ask page                                                  *
 * ============================================================ */

/* The ask page reuses the shared hero/body bands and boxed controls from
   section 1; the form picks up the primary pill submit. No page-specific
   rules remain. */

/* ============================================================ *
 * 5. Home widget ("Aus dem Forum")                             *
 * ============================================================ */

.sghr-forum-home {
	background: var(--wp--preset--color--primary-soft);
	padding-block: var(--sghr-section-pad-y, clamp(3rem, 4rem + 3vw, 5.5rem));
	padding-inline: var(--sghr-section-pad-x, clamp(1.25rem, 1.5rem + 4vw, 7.5rem));
}

.sghr-forum-home__inner {
	max-width: 80rem;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.sghr-forum-home__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.sghr-forum-home__heading {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sghr-forum-home__eyebrow {
	margin: 0;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--wp--preset--color--primary);
}

.sghr-forum-home__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--display-md);
	font-weight: 600;
	line-height: 1.15;
	color: var(--wp--preset--color--ink);
}

.sghr-forum-home__see-all {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	text-decoration: none;
}

.sghr-forum-home__see-all:hover,
.sghr-forum-home__see-all:focus-visible {
	color: var(--wp--preset--color--primary-hover);
}

.sghr-forum-home__see-all svg {
	width: 1.125rem;
	height: 1.125rem;
	transition: transform var(--sghr-chrome-dur, 200ms) var(--sghr-chrome-ease, ease);
}

.sghr-forum-home__see-all:hover svg {
	transform: translateX(3px);
}

.sghr-forum-home__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 36rem) {
	.sghr-forum-home__list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 60rem) {
	.sghr-forum-home__list {
		grid-template-columns: repeat(3, 1fr);
		gap: 1.25rem;
	}
}

.sghr-forum-home__empty {
	grid-column: 1 / -1;
	padding: 2rem;
	background: var(--wp--preset--color--surface);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg, 16px);
	color: var(--wp--preset--color--ink-muted);
	text-align: center;
}

.sghr-forum-home__link {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	height: 100%;
	padding: 1.5rem;
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--lg, 16px);
	color: inherit;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(26, 31, 38, 0.04);
	transition: transform var(--sghr-chrome-dur, 200ms) var(--sghr-chrome-ease, ease),
	            box-shadow var(--sghr-chrome-dur, 200ms) var(--sghr-chrome-ease, ease);
}

.sghr-forum-home__link:hover,
.sghr-forum-home__link:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--wp--custom--shadow--md, 0 8px 20px rgba(26, 31, 38, 0.1));
	outline: none;
}

.sghr-forum-home__topic {
	align-self: flex-start;
	max-width: 100%;
	padding: 0.25rem 0.75rem;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--primary-soft);
	border-radius: var(--wp--custom--radius--pill, 999px);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sghr-forum-home__q-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 600;
	line-height: 1.4;
	color: var(--wp--preset--color--ink);
}

.sghr-forum-home__foot {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: auto;
	padding-top: 0.125rem;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--ink-muted);
}

.sghr-forum-home__answers {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.sghr-forum-home__answers svg {
	width: 1rem;
	height: 1rem;
	color: var(--wp--preset--color--primary);
}

.sghr-forum-home__time {
	position: relative;
	padding-left: 0.75rem;
}

.sghr-forum-home__time::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 3px;
	height: 3px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: currentColor;
	opacity: 0.5;
}

/* ============================================================ *
 * Responsive                                                    *
 * ============================================================ */

@media (max-width: 600px) {
	.sghr-forum__toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.sghr-forum__sorts {
		justify-content: space-between;
	}

	.sghr-forum__row {
		flex-direction: row;
	}

	.sghr-forum__row-stat {
		width: 3rem;
	}

	.sghr-forum__row-time {
		display: none;
	}

	.sghr-forum__answer {
		flex-direction: column;
	}

	.sghr-forum__vote {
		flex-direction: row;
	}
}
