/* ALPL forum-specific behavior kept with the Artur Forum plugin. */
.cma-form.REPLY-DISABLED {
    display: none !important;
}

.REPLY-DISABLED-DIV {
    box-sizing: border-box;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #0868b8;
    background: #eef6fc;
    color: #243746;
}

.REPLY-DISABLED-DIV p {
    margin: 0;
}

.artur_button_submitForumQuestion {
    cursor: pointer;
}

.cma-form-container input[type="submit"].artur_button_submitForumQuestion {
    border-color: #0868b8 !important;
    background: #0868b8 !important;
    background-image: none !important;
    color: #fff !important;
    text-shadow: none !important;
}

.cma-form-container input[type="submit"].artur_button_submitForumQuestion:hover,
.cma-form-container input[type="submit"].artur_button_submitForumQuestion:focus {
    border-color: #064f8c !important;
    background: #064f8c !important;
    background-image: none !important;
    color: #fff !important;
}

.cma-form-container .artur-forum-rules-notice,
.cma-form-container .artur-forum-rules-notice a,
.cma-form-container .artur-forum-rules-notice a:visited {
    color: #858b90 !important;
}

.cma-form-container .artur-forum-rules-notice {
    margin: 16px 0 8px;
}

.cma-form-container .artur-forum-rules-notice a {
    text-decoration: underline;
}

.cma-form-container .artur-forum-rules-notice a:hover,
.cma-form-container .artur-forum-rules-notice a:focus {
    color: #686e73 !important;
}

/* Clear, responsive topic rows for the CLX, LGL and OTH forum lists. */
.cma-thread-list .cma-thread-snippet {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    column-gap: 14px;
    row-gap: 4px;
    align-items: start;
    padding: 16px 12px;
    border-top: 1px solid #d7e0e7;
}

.cma-thread-list .cma-thread-snippet.cma_sticky_background {
    margin-bottom: 8px;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 12px !important;
    background: #fff8e8 !important;
    box-shadow: 0 2px 8px rgba(56, 72, 84, 0.08);
    overflow: hidden;
}

.cma-thread-list .cma-thread-snippet > .cma-thread-meta {
    grid-column: 1;
    grid-row: 1 / span 5;
    float: none;
    margin: 0;
}

.cma-thread-list .cma-thread-meta-div .cma-thread-numbers {
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 62px !important;
    min-width: 62px !important;
    height: 62px;
    aspect-ratio: 1 / 1;
    margin: 0 0 5px;
    padding: 5px !important;
    border: 0;
    border-radius: 10px !important;
    background: #0868b8;
    color: #fff;
}

.cma-thread-list .cma-thread-snippet .cma-thread-meta-div .cma-thread-numbers.cma-thread-no-answers {
    border: 0 !important;
    background: #d8d8d8 !important;
    background-image: none !important;
    color: #7b8084 !important;
}

.cma-thread-list .cma-thread-meta-div .cma-thread-numbers-count {
    font-size: 20px;
    line-height: 1.1;
}

.cma-thread-list .cma-thread-meta-div .cma-thread-numbers-caption {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.15;
}

.cma-thread-list .cma-thread-snippet > .cma-thread-title {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 0;
    font: inherit;
}

.cma-thread-list .cma-thread-title > h4 {
    margin: 0;
}

.cma-thread-list .cma-thread-title > h4 > a,
.cma-thread-list .cma-thread-title > h4 > a:visited {
    color: #0868b8;
}

.cma-thread-list .cma-thread-title > h4 > a:hover,
.cma-thread-list .cma-thread-title > h4 > a:focus {
    color: #064f8c;
}

.cma-thread-list .cma-thread-author-line {
    grid-column: 2;
    grid-row: 2;
    color: #667784;
    font-size: 0.84rem;
    line-height: 1.35;
}

.cma-thread-list .cma-thread-author-label,
.cma-thread-list .cma-thread-last-answer-label {
    font-weight: 600;
}

.cma-thread-list .cma-thread-author-name a,
.cma-thread-list .cma-thread-last-answer-name a {
    color: #344956;
    text-decoration: none;
}

.cma-thread-list .cma-thread-author-name a:hover,
.cma-thread-list .cma-thread-last-answer-name a:hover {
    color: #0868b8;
    text-decoration: underline;
}

.cma-thread-list .cma-thread-author-separator {
    margin-right: 0.3em;
    color: #9aa8b2;
}

.cma-thread-list .cma-thread-last-answer-divider {
    padding: 0 0.45em;
    color: #9aa8b2;
}

.cma-thread-list .cma-thread-snippet > .cma-thread-summary-right {
    grid-column: 2;
    grid-row: 3;
    float: none;
    padding: 0;
    color: #526572;
    font-size: 0.8rem;
    line-height: 1.35;
    text-align: left;
}

.cma-thread-list .cma-thread-snippet > .cma-thread-tags {
    grid-column: 2;
    grid-row: 4;
}

.cma-thread-list .cma-thread-snippet > .cma-thread-content {
    grid-column: 2;
    grid-row: 5;
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    transform: none !important;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cma-thread-list .artur-forum-thread-content-link {
    display: block;
    border-radius: 5px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.cma-thread-list .artur-forum-thread-content-link:hover {
    background: rgba(8, 104, 184, 0.04);
    color: #0868b8;
    text-decoration: none;
}

.cma-thread-list .artur-forum-thread-content-link:focus-visible {
    outline: 2px solid #0868b8;
    outline-offset: 3px;
}

@media (max-width: 800px) {
    .cma-thread-list .cma-thread-snippet {
        grid-template-columns: 58px minmax(0, 1fr);
        column-gap: 16px;
    }

    .cma-thread-list .cma-thread-meta-div .cma-thread-numbers {
        width: 58px !important;
        min-width: 58px !important;
        height: 58px;
    }
}

@media (max-width: 480px) {
    .cma-thread-list .cma-thread-snippet {
        grid-template-columns: 54px minmax(0, 1fr);
        column-gap: 14px;
        padding: 14px 4px;
    }

    .cma-thread-list .cma-thread-meta-div .cma-thread-numbers {
        width: 54px !important;
        min-width: 54px !important;
        height: 54px;
        padding: 4px !important;
    }

    .cma-thread-list .cma-thread-meta-div .cma-thread-numbers-count {
        font-size: 1.2rem;
    }

    .cma-thread-list .cma-thread-meta-div .cma-thread-numbers-caption {
        font-size: 0.68rem;
    }
}

/* Keep the selected forum page consistent with the ALPL brand colour. */
.cma-pagination .page-numbers.current,
.cma-pagination > span.current {
    color: #fff !important;
    background-color: #0868b8 !important;
    border-color: #0868b8 !important;
}

.artur-forum-new-topic-divider {
    height: 0;
    margin: 30px 0 20px;
    border: 0;
    border-top: 1px solid #d7e0e7;
}

.artur-forum-new-topic-divider + .cma-question-form-container h3 {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Give the topic and every answer the same simple inner alignment. */
.cma-thread-wrapper td.cma-question-content,
.cma-thread-wrapper td.cma-answer-content {
    box-sizing: border-box;
    padding: 15px !important;
}

.cma-thread-wrapper td.cma-answer-content > .cma-answer-content {
    padding: 0 !important;
}

.cma-thread-wrapper .cma-question-meta,
.cma-thread-wrapper .cma-answer-meta {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    float: none !important;
    clear: both;
    width: 100%;
    max-width: none !important;
    margin: 0 0 16px !important;
    padding: 0 0 10px !important;
    border: 0 !important;
    border-bottom: 1px solid #c8dce9 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #526572 !important;
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
    text-align: left !important;
}

.cma-thread-wrapper .cma-question-author,
.cma-thread-wrapper .cma-answer-author {
    display: flex;
    flex: 0 0 100%;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.28em;
    margin: 0 !important;
}

.cma-thread-wrapper .artur-forum-post-author,
.cma-thread-wrapper .artur-forum-post-author a,
.cma-thread-wrapper .artur-forum-post-author a:visited {
    color: #0868b8 !important;
    font-size: 1.05em;
    font-weight: 700;
    text-decoration: none;
}

.cma-thread-wrapper .artur-forum-post-author a:hover {
    text-decoration: underline;
}

.cma-thread-wrapper .artur-forum-post-action,
.cma-thread-wrapper .cma-question-date,
.cma-thread-wrapper .cma-answer-date {
    color: #526572;
}

.cma-thread-wrapper .artur-forum-post-stats {
    margin-left: 0.35em;
    color: #758794;
    font-size: 0.84em;
}

.cma-thread-wrapper .cma-question-category,
.cma-thread-wrapper .cma-question-views,
.cma-thread-wrapper .cma-question-custom-field {
    margin: 5px 12px 0 0;
    color: #758794;
    font-size: 0.84em;
}

/* Keep short messages from sitting against the bottom edge of their card. */
.cma-thread-wrapper .cma-question-body,
.cma-thread-wrapper .cma-answer-body {
    box-sizing: border-box;
    padding-bottom: 12px;
}

/* Fold long posts after five lines while keeping short posts unchanged. */
.cma-thread-wrapper .artur-forum-post-collapsible {
    position: relative;
    max-height: var(--artur-forum-collapsed-height);
    overflow: hidden;
    cursor: pointer;
}

.cma-thread-wrapper .artur-forum-post-collapsible::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3.5em;
    background: linear-gradient(
        to bottom,
        var(--artur-forum-fade-transparent),
        var(--artur-forum-fade-color) 82%
    );
    pointer-events: none;
}

.cma-thread-wrapper .artur-forum-post-collapsible.artur-forum-post-expanded {
    max-height: none;
    overflow: visible;
    cursor: auto;
}

.cma-thread-wrapper .artur-forum-post-collapsible.artur-forum-post-expanded::after {
    display: none;
}

.cma-thread-wrapper button.artur-forum-post-toggle {
    appearance: none;
    display: block;
    width: auto;
    height: auto;
    margin: 4px 0 14px auto;
    padding: 3px 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #6f7b84 !important;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: right;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
}

.cma-thread-wrapper button.artur-forum-post-toggle:hover,
.cma-thread-wrapper button.artur-forum-post-toggle:focus-visible {
    color: #4f5b64 !important;
    text-decoration: underline;
}
