/*
 * SHPro Forum — minimal layout-only CSS.
 * Most styling is delegated to Bootstrap 5.3 utilities and the project's theme system.
 */

.shpro-forum {
    /* container scope marker */
}

.shpro-forum .breadcrumb {
    align-items: center;
    row-gap: 0.35rem;
}

.shpro-forum .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.shpro-forum .breadcrumb-item.active {
    padding: 0;
    border-radius: 0;
    background-color: transparent;
    font-weight: inherit;
}

.shpro-forum .breadcrumb-item + .breadcrumb-item::before {
    float: none;
    display: inline-flex;
    align-items: center;
    align-self: center;
    line-height: 1;
    padding-right: 0.25rem;
    padding-left: 0;
}

.shpro-forum .breadcrumb a,
.shpro-forum__breadcrumb-current {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.shpro-forum__breadcrumb-current {
    padding: 0.25rem 0.625rem;
    border-radius: var(--bs-border-radius-pill, 50rem);
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.06);
    color: var(--bs-breadcrumb-item-active-color);
    font-weight: 600;
}

.shpro-forum__category-card .card-title a {
    color: inherit;
}

.shpro-forum__category-card .card-title a:hover,
.shpro-forum__category-card .card-title a:focus-visible {
    color: var(--bs-primary);
}

.shpro-forum__category-card {
    border-color: rgba(var(--bs-emphasis-color-rgb), 0.08);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.shpro-forum__category-card:hover,
.shpro-forum__category-card:focus-within {
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    box-shadow: 0 0.5rem 1.25rem rgba(var(--bs-emphasis-color-rgb), 0.08);
}

.shpro-forum__category-meta {
    min-width: 12rem;
}

.shpro-forum__thread-meta {
    min-width: 8rem;
}

.shpro-forum__thread-row .min-w-0 {
    min-width: 0;
}

.shpro-forum__trust-note {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.08);
    border-radius: var(--bs-border-radius);
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.04);
}

.shpro-forum__trust-note-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.shpro-forum__trust-note-item span {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.shpro-forum__post {
    scroll-margin-top: 5rem;
}

.shpro-forum__post-body {
    line-height: 1.65;
}

.shpro-forum__post-body > :last-child {
    margin-bottom: 0;
}

.shpro-forum__member-overview-card {
    border-color: rgba(var(--bs-emphasis-color-rgb), 0.08);
}

.shpro-forum__member-thread {
    min-height: 3.5rem;
}

.shpro-forum .dropdown-item {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

/* Ensure 44x44 touch targets on mobile for the New-Thread / pagination buttons. */
.shpro-forum .pagination .page-link {
    min-height: 2.75rem;
    min-width: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/*
 * Trix editor — minimal toolbar.
 * Hides toolbar buttons we don't want for a Selbsthilfe forum:
 * strikethrough, heading1, code, indent/outdent, file attachments.
 * Keeps: bold, italic, link, bullet/number list, blockquote, undo/redo.
 */
.shpro-forum trix-toolbar [data-trix-attribute="strike"],
.shpro-forum trix-toolbar [data-trix-attribute="heading1"],
.shpro-forum trix-toolbar [data-trix-attribute="code"],
.shpro-forum trix-toolbar [data-trix-action="decreaseNestingLevel"],
.shpro-forum trix-toolbar [data-trix-action="increaseNestingLevel"],
.shpro-forum trix-toolbar [data-trix-action="attachFiles"] {
    display: none;
}

/* Trix editor styling: match Bootstrap form-control look and respect dark mode. */
.shpro-forum trix-editor {
    min-height: 8rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.5rem 0.75rem;
}

.shpro-forum trix-editor:focus {
    border-color: var(--bs-primary);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), .25);
}

.shpro-forum trix-toolbar {
    --shpro-forum-trix-icon-filter: none;

    margin-bottom: 0.5rem;
}

.shpro-forum trix-toolbar .trix-button-group {
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.04);
    border-color: rgba(var(--bs-emphasis-color-rgb), 0.08);
}

.shpro-forum trix-toolbar .trix-button {
    color: var(--bs-emphasis-color);
    border-bottom-color: rgba(var(--bs-emphasis-color-rgb), 0.18);
}

.shpro-forum trix-toolbar .trix-button:not(:first-child) {
    border-left-color: rgba(var(--bs-emphasis-color-rgb), 0.18);
}

.shpro-forum trix-toolbar .trix-button:not(:disabled):hover,
.shpro-forum trix-toolbar .trix-button:not(:disabled):focus-visible {
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.08);
    color: var(--bs-emphasis-color);
}

.shpro-forum trix-toolbar .trix-button:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.shpro-forum trix-toolbar .trix-button.trix-active {
    background-color: rgba(var(--bs-primary-rgb), 0.16);
    color: var(--bs-emphasis-color);
}

.shpro-forum trix-toolbar .trix-button:disabled {
    color: var(--bs-secondary-color);
    opacity: 0.55;
}

.shpro-forum trix-toolbar .trix-button--icon::before {
    filter: var(--shpro-forum-trix-icon-filter);
    opacity: 0.82;
}

.shpro-forum trix-toolbar .trix-button--icon.trix-active::before {
    opacity: 1;
}

.shpro-forum trix-toolbar .trix-button--icon:disabled::before {
    opacity: 0.4;
}

[data-bs-theme="dark"] .shpro-forum trix-toolbar {
    --shpro-forum-trix-icon-filter: invert(1) grayscale(1);
}

[data-bs-theme="dark"] .shpro-forum trix-toolbar .trix-button.trix-active {
    background-color: rgba(var(--bs-primary-rgb), 0.32);
}

/* Quotes inside posts must read as quoted source text, not as a normal paragraph. */
.shpro-forum__post-body blockquote,
.shpro-forum trix-editor blockquote {
    margin: 1rem 0;
    padding: 0.875rem 1rem 0.875rem 1.25rem;
    border-left: 0.25rem solid var(--bs-primary);
    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.04);
    color: var(--bs-body-color);
}

.shpro-forum__post-body blockquote > :last-child,
.shpro-forum trix-editor blockquote > :last-child {
    margin-bottom: 0;
}

.shpro-forum__post-body blockquote blockquote,
.shpro-forum trix-editor blockquote blockquote {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.03);
}

/* Emoji buttons live inside Trix' toolbar — match the existing button-group look. */
.shpro-forum trix-toolbar .shpro-forum__emoji-btn {
    font-size: 1.1rem;
    line-height: 1;
    min-width: 2rem;
    padding: 0.25rem 0.4rem;
}

/* Report link: bewusst zurückhaltend (Reddit/Discourse-Konvention) — aber
 * mit 44×44 Touch-Target wie in CLAUDE.md vorgeschrieben. inline-flex hält
 * den Link visuell schlank, padding garantiert die Hit-Area. */
.shpro-forum__report-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.25rem 0.75rem;
    align-self: center;
}

.shpro-forum .dropdown-menu .shpro-forum__report-link {
    display: flex;
    width: 100%;
    align-self: auto;
    padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
}

.shpro-forum__report-link:hover,
.shpro-forum__report-link:focus-visible {
    text-decoration: underline !important;
    color: var(--bs-warning-text-emphasis, var(--bs-warning));
}

@media (max-width: 575.98px) {
    .shpro-forum__trust-note {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shpro-forum__category-card {
        transition: none;
    }
}
