/* Variable definitions
------------------------------------------------------------------------------------- */
:root {
    --bg-hover-transition: background-color 0.25s linear;
}

/* General
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-svg-wrapper {
        height: 0;
        width: 0;
    }
}

/* Search Box
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-body #aa-forum-form-search-results .input-group {
        margin-bottom: 1rem;
    }
}

/* Administration :: Sortable categories and boards
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-ui-placeholder {
        outline: 1px dashed rgb(0 0 0);
    }

    .aa-forum .categories-sortable,
    .aa-forum .boards-sortable {
        list-style-type: none;
    }

    .aa-forum .boards-sortable > li:first-child {
        margin-top: 1rem;
    }

    .aa-forum [data-bs-toggle="collapse"].collapsed .if-expanded {
        display: none;
    }

    .aa-forum [data-bs-toggle="collapse"]:not(.collapsed) .if-collapsed {
        display: none;
    }

    .aa-forum .category-sortable {
        cursor: move;
    }
}

/* Breadcrumb
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-breadcrumb ul {
        list-style-type: none;
        padding: 0;
    }

    .aa-forum .aa-forum-breadcrumb ul li {
        display: inline;
    }

    .aa-forum .aa-forum-breadcrumb ul li:first-child {
        padding-left: 0;
    }
}

/* Category view
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .card-aa-forum-category .aa-forum-board {
        flex-direction: row;
        transition: var(--bg-hover-transition);
    }

    .aa-forum .card-aa-forum-category .aa-forum-board:last-child {
        margin-bottom: 0;
    }

    .aa-forum .card-aa-forum-category .aa-forum-board:hover {
        background: rgb(0 0 0 / 5%);
    }

    .aa-forum .card-aa-forum-category .aa-forum-board-image svg {
        height: 65px;
        margin-top: -1rem;
        width: 65px;
    }

    .aa-forum .card-aa-forum-category .aa-forum-board-name {
        width: 100%;
    }

    .aa-forum .aa-forum-board-name p:last-child {
        margin: 0;
    }

    .aa-forum .aa-forum-board-group-restrictions {
        list-style-type: none;
        margin: 0;
        padding: 0;
    }

    .aa-forum .aa-forum-board-last-post .img-last-post-avatar {
        float: left;
        height: 55px;
        margin-right: 1rem;
        width: 55px;
    }

    .aa-forum .aa-forum-board-last-post .last-post-information {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-wrap: normal;
    }

    .aa-forum .aa-forum-legend > span {
        display: flex;
        margin-right: 5rem;
    }

    .aa-forum .aa-forum-legend .aa-forum-legend-image svg {
        height: 30px;
        width: 30px;
    }

    .aa-forum .aa-forum-legend .aa-forum-legend-text {
        display: inline-block;
    }

    .aa-forum .aa-forum-legend span:last-child {
        margin-right: 0;
    }
}

/* Board view
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-topic-row .aa-forum-topic {
        align-content: center;
        align-items: center;
        display: flex;
        flex-direction: row;
        transition: var(--bg-hover-transition);
    }

    .aa-forum .aa-forum-topic-row:last-child .aa-forum-topic {
        margin-bottom: 0;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic:hover {
        background: rgb(0 0 0 / 5%);
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-image {
        width: 40px;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-image svg {
        height: 35px;
        margin-top: -1rem;
        width: 35px;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-name {
        width: auto;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-name p:last-child {
        margin-bottom: 0;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-stats {
        text-align: center;
        width: 15%;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-last-post {
        width: 25%;
    }

    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-actions {
        width: 70px;
    }

    .aa-forum .aa-forum-topic-locked {
        background-color: rgb(185 199 219 / 25%);
    }

    .aa-forum .aa-forum-topic-sticky {
        background-color: rgb(255 220 104 / 25%);
    }

    .aa-forum .label-aa-forum-topic-new-message {
        font-size: 55%;
    }

    .aa-forum .label-aa-forum-child-board-new-message {
        font-size: 55%;
        margin-left: 0.25rem;
        padding: 0.3em 0.6em;
        vertical-align: middle;
    }
}

/* Message view
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-message-author .img-author-avatar {
        max-width: 100%;
    }

    .aa-forum .aa-forum-message-wrapper {
        width: auto;
    }

    .aa-forum .aa-forum-message-body {
        border-top: 1px solid rgb(236 240 241);
    }

    .aa-forum .aa-forum-message-body-author-signature {
        border-top: 1px solid rgb(236 240 241);
        margin-top: 3em;
    }

    .aa-forum .aa-forum-message-body-last-edited {
        margin-top: 5rem;
    }

    .aa-forum .aa-forum-message-body img {
        height: auto !important; /* to override inline style added by CKEditor */
        max-width: 100%;
    }
}

/* Search view
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-search-result-inner {
        align-items: flex-start;
        display: flex;
        flex-flow: row nowrap;
        place-content: flex-start flex-start;
    }

    .aa-forum .aa-forum-search-results-total-number {
        font-size: 2rem;
        font-weight: bolder;
        margin-bottom: 2rem;
    }

    .aa-forum .aa-forum-search-result-counter {
        font-size: 3rem;
        font-weight: bolder;
        margin-right: 1rem;
        min-width: 50px;
        padding: 1rem;
    }

    .aa-forum .aa-forum-search-result-details {
        width: 100%;
    }

    .aa-forum .aa-forum-search-term-highlight {
        color: rgb(255 114 0) !important;
        font-size: 1.1em;
        font-weight: bold;
    }
}

/* Personal messages view
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .card-aa-forum-personal-messages-item {
        padding: 1rem;
        transition: var(--bg-hover-transition);
    }

    .aa-forum .card-aa-forum-personal-messages-item:hover {
        background: rgb(0 0 0 / 5%);
    }

    .aa-forum .card-aa-forum-personal-messages-item-header {
        border-bottom: 1px solid rgb(236 240 241);
        font-weight: 700;
    }

    .aa-forum .card-aa-forum-personal-messages-item-unread {
        font-weight: 700;
    }

    .aa-forum .aa-forum-personal-messages-message .card {
        margin-top: 2rem;
    }

    .aa-forum li.aa-forum-messages-sidebar-menu-item:has(a.active) {
        background-color: var(--bs-secondary-bg-subtle);
    }

    .aa-forum li.aa-forum-messages-sidebar-menu-item > a.active {
        color: rgb(var(--bs-primary-rgb));
    }
}

/* Lightbox
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .aa-forum-lightbox-modal {
        align-items: center;
        display: flex !important;
        justify-content: center;
        z-index: -1;
    }

    .aa-forum .aa-forum-lightbox-modal .modal-dialog {
        display: inline-block;
        height: auto !important;
        max-height: 95%;
        max-width: 95%;
        width: auto !important;
    }

    .aa-forum .aa-forum-lightbox-modal.fade.in {
        z-index: 1050;
    }
}

/* Buttons
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .btn-aa-forum-topic-moderation {
        background: none;
    }

    .aa-forum .btn-aa-forum-topic-moderation.focus,
    .aa-forum .btn-aa-forum-topic-moderation:focus,
    .aa-forum .btn-aa-forum-topic-moderation:hover {
        color: inherit;
        outline: 5px auto -webkit-focus-ring-color;
        outline-offset: -2px;
    }

    .aa-forum .btn-aa-forum-delete {
        color: rgb(255 0 0);
    }
}

/* SumoSelect
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .SumoSelect p {
        border-radius: var(--bs-border-radius);
        height: auto;
    }

    .aa-forum .SumoSelect {
        color: rgb(54 54 54);
        display: block;
    }

    .aa-forum .SumoSelect > .CaptionCont > label > i {
        background-image: none;
    }

    .aa-forum .SumoSelect > .CaptionCont > span.placeholder {
        background-color: transparent;
        color: rgb(62 68 76);
        opacity: 1;
    }
}

/* Select2
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .select2-container--bootstrap-5 {
        max-width: 100% !important;
    }
}

/* CKEditor 5 (WYSIWYG editor)
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum .ck-rounded-corners {
        --ck-border-radius: var(--bs-border-radius);
    }

    .aa-forum .ck-editor__editable {
        color: initial;
    }

    .aa-forum .ck-word-count {
        color: var(--bs-secondary-color) !important;

        --bs-text-opacity: 1;
    }
}

/*
----------------------------------------------------------------------------------------
                Responsive (@media all and (min-width: 768px))
----------------------------------------------------------------------------------------
*/

/* Category view (@media all and (min-width: 768px))
------------------------------------------------------------------------------------- */
@media all and (min-width: 768px) {
    .aa-forum .card-aa-forum-category .aa-forum-board-name {
        width: 60%;
    }

    .aa-forum .card-aa-forum-category .aa-forum-board-stats {
        text-align: center;
        width: 15%;
    }

    .aa-forum .card-aa-forum-category .aa-forum-board-last-post {
        width: 25%;
    }

    .aa-forum .aa-forum-legend {
        display: flex;
    }
}

/* Board view (@media all and (min-width: 768px))
------------------------------------------------------------------------------------- */
@media all and (min-width: 768px) {
    .aa-forum .aa-forum-topic-row .aa-forum-topic .aa-forum-topic-name {
        width: 60%;
    }
}

/* Message view (@media all and (min-width: 768px))
------------------------------------------------------------------------------------- */
@media all and (min-width: 768px) {
    .aa-forum .aa-forum-message {
        align-items: flex-start;
        display: flex;
        flex-wrap: nowrap;
    }

    .aa-forum .aa-forum-message-author figure {
        width: auto;
    }

    .aa-forum .aa-forum-message-author {
        min-width: 150px;
        width: 150px;
    }

    .aa-forum .aa-forum-message-wrapper {
        width: 100%;
    }
}

/*
----------------------------------------------------------------------------------------
                Responsive (@media all and (min-width: 992px))
----------------------------------------------------------------------------------------
*/

/* Personal messages view (@media all and (min-width: 992px))
------------------------------------------------------------------------------------- */
@media all and (min-width: 992px) {
    .aa-forum .card-aa-forum-personal-messages-item-header,
    .aa-forum .card-aa-forum-personal-messages-item {
        align-items: center;
        display: flex;
        flex-flow: row nowrap;
        place-content: flex-start flex-start;
    }

    .aa-forum .aa-forum-personal-message-date {
        min-width: 200px;
    }

    .aa-forum .aa-forum-personal-message-sender,
    .aa-forum .aa-forum-personal-message-recipient {
        min-width: 200px;
    }

    .aa-forum .aa-forum-personal-message-subject {
        width: 100%;
    }
}

/* Fix for oEmbed videos
------------------------------------------------------------------------------------- */
@media all {
    .aa-forum figure.media .oembed-video {
        height: auto;
        max-width: 100%;
        overflow: hidden;
        padding-bottom: 56.25%;
        position: relative;
    }

    .aa-forum figure.media .oembed-video > iframe {
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
    }
}
