/* Community board page, aligned with the community feed and topic detail. */
body.qm-community-board-page {
    background: #f4f4f4;
    color: var(--qm-color-text);
    letter-spacing: 0;
}

.qm-community-board {
    --board-page: #f4f4f4;
    --board-card: #fefefd;
    --board-ink: #343433;
    --board-muted: #666666;
    --board-faint: #b4aeb4;
    --board-line: rgba(52, 52, 51, 0.08);
    --board-violet: #ae81ef;
    --board-lime: #cefb48;
    --board-cyan: #8cf6fb;
    --board-pink: #f262f0;
    min-height: 72vh;
    padding: 22px 0 52px;
    overflow-x: clip;
    background: var(--board-page);
    color: var(--board-ink);
    letter-spacing: 0;
}

.qm-community-board,
.qm-community-board * {
    box-sizing: border-box;
}

.qm-community-board a {
    text-decoration: none;
}

.qm-community-board__shell {
    width: 100%;
    max-width: 960px;
}

.qm-community-board__mobile-toolbar {
    display: none;
}

.qm-community-board__back {
    margin: 0 0 14px;
}

.qm-community-board__back a {
    display: inline-flex;
    min-height: 34px;
    padding: 4px 6px;
    align-items: center;
    gap: 7px;
    border-radius: var(--qm-radius-size-1);
    color: var(--board-muted);
    font-size: 13px;
}

.qm-community-board__back a:hover {
    background: rgba(52, 52, 51, 0.05);
    color: var(--board-ink);
}

.qm-board-hero,
.qm-board-feed {
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: var(--qm-radius-size-1) !important;
    background: var(--board-card);
    box-shadow: none;
}

.qm-board-hero__cover {
    position: relative;
    width: 100%;
    height: clamp(220px, 27vw, 310px);
    margin: 0;
    overflow: hidden;
    background: #e9e8ea;
}

.qm-board-hero__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.qm-board-hero__cover--fallback {
    display: grid;
    place-items: center;
    background: var(--board-violet);
}

.qm-board-hero__cover--fallback span {
    color: #fff;
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
}

.qm-board-hero__content {
    padding: 20px 24px 0;
}

.qm-board-hero__heading {
    display: flex;
    min-width: 0;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.qm-board-hero__copy {
    min-width: 0;
}

.qm-board-hero__label {
    display: inline-flex;
    margin-bottom: 6px;
    color: var(--board-violet);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.qm-board-hero h1 {
    margin: 0;
    color: var(--board-ink);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.25;
}

.qm-board-hero__copy p {
    max-width: 650px;
    margin: 8px 0 0;
    color: var(--board-muted);
    font-size: 13px;
    line-height: 1.65;
}

.qm-board-hero__action {
    flex: 0 0 auto;
}

.qm-board-compose {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 14px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: var(--qm-radius-size-1) !important;
    background: var(--board-lime);
    color: var(--qm-color-text) !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.qm-board-compose:hover {
    background: #bfea3d;
    color: var(--qm-color-text) !important;
}

.qm-board-compose.is-disabled {
    background: rgba(52, 52, 51, 0.06);
    color: var(--board-muted) !important;
}

.qm-board-stats {
    display: grid;
    margin: 20px 0 0;
    padding: 16px 0 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--board-line);
}

.qm-board-stat {
    display: flex;
    min-width: 0;
    padding: 0 16px;
    align-items: center;
    gap: 10px;
    border-right: 1px solid var(--board-line);
}

.qm-board-stat:first-child {
    padding-left: 0;
}

.qm-board-stat:last-child {
    padding-right: 0;
    border-right: 0;
}

.qm-board-stat__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-circle);
    color: var(--board-ink);
    font-size: 14px;
}

.qm-board-stat--topics .qm-board-stat__icon {
    background: var(--board-lime);
}

.qm-board-stat--views .qm-board-stat__icon {
    background: var(--board-cyan);
}

.qm-board-stat--interactions .qm-board-stat__icon {
    background: #d9c4ff;
}

.qm-board-stat--heat .qm-board-stat__icon {
    background: #ffb7d8;
}

.qm-board-stat__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.qm-board-stat dt,
.qm-board-stat dd {
    margin: 0;
}

.qm-board-stat dt {
    color: var(--board-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.qm-board-stat dd {
    overflow: hidden;
    color: var(--board-ink);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.qm-board-feed {
    margin-top: 14px;
    padding: 20px 24px 24px;
}

.qm-board-feed__header {
    display: flex;
    min-height: 34px;
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qm-board-feed__header > div {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
}

.qm-board-feed__header h2 {
    margin: 0;
    color: var(--board-ink);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}

.qm-board-feed__header > div > span,
.qm-board-feed__sort {
    color: var(--board-muted);
    font-size: 11px;
    font-weight: 600;
}

.qm-board-feed__sort {
    display: inline-flex;
    min-height: 30px;
    padding: 5px 9px;
    align-items: center;
    gap: 6px;
    border-radius: var(--qm-radius-size-1);
    background: rgba(52, 52, 51, 0.045);
}

.qm-board-topic-list {
    margin: 0;
    gap: 12px;
}

.qm-community-board .qm-board-topic-card {
    overflow: visible;
    border: 1px solid var(--board-line);
    border-radius: var(--qm-radius-size-1) !important;
    background: var(--board-card);
    box-shadow: none;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__body {
    padding: 14px 16px 13px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__header {
    min-height: 40px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--qm-radius-circle) !important;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__name {
    color: var(--board-ink);
    font-size: 13px;
    font-weight: 700;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__time {
    color: var(--board-faint);
    font-size: 10px;
    font-weight: 500;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__menu > summary {
    color: var(--board-muted);
}

.qm-community-board .qm-board-topic-card .qm-community-topic__menu-panel {
    border-color: var(--board-line);
    border-radius: var(--qm-radius-size-1) !important;
    background: var(--board-card);
}

.qm-community-board .qm-board-topic-card .qm-community-topic__menu-panel .qm-topic-action {
    border-radius: var(--qm-radius-size-1) !important;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__status {
    min-height: 20px;
    padding: 3px 7px;
    border-radius: 5px !important;
    font-size: 10px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__title-link {
    margin-top: 12px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__title {
    color: var(--board-ink);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.55;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__board {
    margin-right: 7px;
    border-radius: var(--qm-radius-pill) !important;
    background: var(--board-ink);
    color: var(--board-card);
}

.qm-community-board .qm-board-topic-card .qm-community-topic__excerpt {
    margin-top: 5px;
    color: var(--board-muted);
    font-size: 13px;
    line-height: 1.65;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media-carousel {
    margin-top: 9px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media {
    padding: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media-item,
.qm-community-board .qm-board-topic-card .qm-community-topic__media[data-count="1"] .qm-community-topic__media-item {
    aspect-ratio: 4 / 3;
    max-height: 190px;
    border-radius: 7px !important;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media[data-count="1"] .qm-community-topic__media-item {
    aspect-ratio: 16 / 6;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media-controls {
    margin-top: 7px;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__media-nav {
    width: 28px;
    height: 28px;
    border-color: var(--board-line);
    background: var(--board-card);
}

.qm-community-board .qm-board-topic-card .qm-community-topic__footer {
    min-height: 32px;
    margin-top: 10px;
    justify-content: space-between;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__footer-left {
    margin-left: 0;
}

.qm-community-board .qm-board-topic-card .qm-community-topic__footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qm-community-board .qm-board-topic-card .qm-topic-stat {
    min-width: 32px;
    padding: 4px 5px;
    color: var(--board-muted);
    font-size: 11px;
}

.qm-community-board .qm-board-topic-card .qm-topic-stat__icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.qm-board-empty {
    display: flex;
    min-height: 190px;
    padding: 32px 16px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: var(--board-muted);
    text-align: center;
}

.qm-board-empty i {
    color: var(--board-faint);
    font-size: 30px;
}

.qm-board-empty p {
    margin: 0;
    font-size: 13px;
}

.qm-board-pagination {
    display: flex;
    margin-top: 18px;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.qm-board-pagination .page-numbers {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--qm-radius-size-1);
    background: rgba(52, 52, 51, 0.045);
    color: var(--board-muted);
    font-size: 12px;
    font-weight: 700;
}

.qm-board-pagination .page-numbers.current {
    background: var(--board-ink);
    color: var(--board-card);
}

.qm-community-board :is(a, button, summary):focus-visible {
    outline: 2px solid var(--board-violet);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    html,
    body.qm-community-board-page {
        background: #f4f4f4 !important;
    }

    html:has(body.qm-community-board-page) {
        padding-bottom: 0 !important;
        scroll-padding-bottom: 0 !important;
    }

    body.qm-community-board-page {
        padding-bottom: 0 !important;
        color: var(--qm-color-text);
    }

    body.qm-community-board-page #qm-header,
    body.qm-community-board-page .site-footer,
    body.qm-community-board-page #qm-bottom-nav {
        display: none !important;
    }

    .qm-community-board {
        min-height: 100vh;
        padding: 0 0 28px;
    }

    .qm-community-board__shell {
        width: 100%;
        max-width: none;
        padding-top: 62px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .qm-community-board__mobile-toolbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 70;
        display: grid;
        width: 100%;
        height: 52px;
        padding: 0 12px;
        align-items: center;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        background: rgba(244, 244, 244, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .qm-community-board__mobile-toolbar > a,
    .qm-community-board__mobile-toolbar > span {
        display: inline-flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: var(--qm-radius-circle);
        color: var(--board-ink);
    }

    .qm-community-board__mobile-toolbar > strong {
        overflow: hidden;
        color: var(--board-ink);
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .qm-community-board__back {
        display: none;
    }

    .qm-board-hero,
    .qm-board-feed,
    .qm-community-board .qm-board-topic-card {
        border-radius: var(--qm-radius-size-3) !important;
    }

    .qm-board-hero__cover {
        height: 180px;
    }

    .qm-board-hero__content {
        padding: 14px 12px 0;
    }

    .qm-board-hero__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .qm-board-hero h1 {
        font-size: 21px;
    }

    .qm-board-hero__copy p {
        margin-top: 6px;
        font-size: 12px;
    }

    .qm-board-hero__action,
    .qm-board-compose {
        width: 100%;
    }

    .qm-board-stats {
        margin-top: 14px;
        padding: 13px 0 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 14px;
    }

    .qm-board-stat {
        padding: 0 10px;
    }

    .qm-board-stat:first-child,
    .qm-board-stat:nth-child(3) {
        padding-left: 0;
    }

    .qm-board-stat:nth-child(2) {
        padding-right: 0;
        border-right: 0;
    }

    .qm-board-stat:nth-child(3),
    .qm-board-stat:nth-child(4) {
        padding-top: 13px;
        border-top: 1px solid var(--board-line);
    }

    .qm-board-stat:last-child {
        padding-right: 0;
    }

    .qm-board-stat__icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .qm-board-stat dd {
        font-size: 16px;
    }

    .qm-board-feed {
        margin-top: 12px;
        padding: 14px 12px 16px;
    }

    .qm-board-feed__header {
        margin-bottom: 10px;
    }

    .qm-board-feed__header h2 {
        font-size: 15px;
    }

    .qm-board-feed__sort {
        min-height: 28px;
        padding: 4px 7px;
        font-size: 10px;
    }

    .qm-board-topic-list {
        gap: 10px;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__body {
        padding: 12px;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__badges {
        flex: 0 0 auto;
        overflow: visible;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__badges > :not(.qm-level-badge):not(.qm-level-badge-sm) {
        display: none;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__title-link {
        margin-top: 10px;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__title {
        font-size: 15px;
        line-height: 1.5;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__excerpt {
        font-size: 12px;
        line-height: 1.6;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__media {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__media-item,
    .qm-community-board .qm-board-topic-card .qm-community-topic__media[data-count="1"] .qm-community-topic__media-item {
        aspect-ratio: 1 / 1;
        max-height: 220px;
    }

    .qm-community-board .qm-board-topic-card .qm-community-topic__media[data-count="1"] .qm-community-topic__media-item {
        aspect-ratio: 16 / 8;
    }
}

html.dark body.qm-community-board-page,
body.dark.qm-community-board-page,
html.dark .qm-community-board,
body.dark .qm-community-board {
    --board-page: #18171a;
    --board-card: #232225;
    --board-ink: #f1f1f0;
    --board-muted: #aaa4ad;
    --board-faint: #807a83;
    --board-line: rgba(255, 255, 255, 0.09);
    background: var(--board-page) !important;
    color: var(--board-ink);
}

html.dark .qm-board-hero,
html.dark .qm-board-feed,
html.dark .qm-community-board .qm-board-topic-card,
body.dark .qm-board-hero,
body.dark .qm-board-feed,
body.dark .qm-community-board .qm-board-topic-card {
    border-color: var(--board-line);
    background: var(--board-card);
}

html.dark .qm-community-board .qm-board-topic-card .qm-community-topic__board,
body.dark .qm-community-board .qm-board-topic-card .qm-community-topic__board {
    background: var(--board-ink);
    color: var(--board-card);
}

html.dark .qm-community-board .qm-board-topic-card .qm-community-topic__menu-panel,
body.dark .qm-community-board .qm-board-topic-card .qm-community-topic__menu-panel {
    border-color: var(--board-line);
    background: var(--board-card);
}

html.dark .qm-community-board .qm-board-topic-card .qm-topic-stat--view .qm-topic-stat__icon,
body.dark .qm-community-board .qm-board-topic-card .qm-topic-stat--view .qm-topic-stat__icon {
    padding: 1px;
    border-radius: var(--qm-radius-circle);
    background: rgba(255, 255, 255, 0.82);
}

html.dark .qm-board-feed__sort,
body.dark .qm-board-feed__sort {
    background: rgba(255, 255, 255, 0.06);
}

html.dark .qm-community-board .qm-board-compose:not(.is-disabled),
body.dark .qm-community-board .qm-board-compose:not(.is-disabled) {
    color: var(--qm-color-text) !important;
    -webkit-text-fill-color: #343433 !important;
}

@media (max-width: 767.98px) {
    html.dark .qm-community-board__mobile-toolbar,
    body.dark .qm-community-board__mobile-toolbar {
        background: rgba(24, 23, 26, 0.94);
    }
}
