/* =========================================================
   DLE 21 COMMENTS
   Blogzine / Bootstrap 5.3.3
   Основной класс: .thread__item
   ========================================================= */


/* =========================================================
   01. COMMENT ITEM
   ========================================================= */

.thread__item {
    display: flex;
    width: 100%;

    margin-top: 1.5rem;
    margin-bottom: 1.5rem;

    padding: 1rem;

    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);

    background-color: var(--bs-body-bg);

    position: relative;
}

.thread__item:first-child {
    margin-top: 0;
}

.thread__item:last-child {
    margin-bottom: 2rem;
}

.thread__item + .thread__item {
    margin-top: 2rem;
}


/* =========================================================
   02. REPLY / CHILD COMMENT
   ========================================================= */

.thread__item--reply {
    margin-left: 3.5rem;
    width: calc(100% - 3.5rem);
}

.thread__item--reply + .thread__item--reply {
    margin-top: 1.75rem;
}

.thread__item--reply:last-child {
    margin-bottom: 2rem;
}


/* =========================================================
   03. AVATAR
   ========================================================= */

.thread__avatar {
    flex: 0 0 52px;
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.thread__avatar-img {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
}

.thread__avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    border: 1px solid var(--bs-border-color);
    border-radius: 50%;

    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);

    font-size: 1.25rem;
    line-height: 1;
}


/* =========================================================
   04. ONLINE
   ========================================================= */

.thread__online-wrap {
    text-align: center;
}

.thread__online {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;

    margin-top: .4rem;

    font-size: .7rem;
    line-height: 1;

    color: var(--bs-success);

    white-space: nowrap;
}

.thread__online-dot {
    display: inline-block;

    width: 6px;
    height: 6px;
    flex: 0 0 6px;

    border-radius: 50%;

    background-color: var(--bs-success);

    box-shadow: 0 0 0 3px rgba(var(--bs-success-rgb), .12);
}


/* =========================================================
   05. CONTENT
   ========================================================= */

.thread__content {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 1rem;
}


/* =========================================================
   06. HEADER
   ========================================================= */

.thread__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: .75rem;
    flex-wrap: wrap;

    min-width: 0;
}

.thread__author-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}


/* =========================================================
   07. AUTHOR
   ========================================================= */

.thread__author {
    display: inline-flex;
    align-items: center;

    min-width: 0;

    font-weight: 600;
    line-height: 1.4;
}

.thread__author a {
    color: var(--bs-body-color);
    text-decoration: none;
    transition: color .2s ease;
}

.thread__author a:hover {
    color: var(--bs-primary);
}


/* =========================================================
   08. AUTHOR BADGE
   ========================================================= */

.thread__author-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;

    padding: .25rem .55rem;

    border-radius: var(--bs-border-radius-pill);

    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);

    font-size: .7rem;
    font-weight: 600;
    line-height: 1;
}

.thread__author-badge i {
    color: var(--bs-primary);
    font-size: .75rem;
}


/* =========================================================
   09. DATE
   ========================================================= */

.thread__date {
    display: inline-block;

    color: var(--bs-secondary-color);

    font-size: .78rem;
    line-height: 1.4;

    white-space: nowrap;
}


/* =========================================================
   10. GROUP
   ========================================================= */

.thread__group {
    margin-top: .15rem;

    color: var(--bs-secondary-color);

    font-size: .75rem;
    line-height: 1.4;
}


/* =========================================================
   11. NEWS / PUBLICATION
   ========================================================= */

.thread__news {
    margin-top: .75rem;

    padding: .7rem .85rem;

    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);

    background-color: var(--bs-tertiary-bg);
}

.thread__news-label {
    display: flex;
    align-items: center;
    gap: .3rem;

    margin-bottom: .25rem;

    color: var(--bs-secondary-color);

    font-size: .7rem;
    font-weight: 600;
    line-height: 1.3;

    text-transform: uppercase;
    letter-spacing: .02em;
}

.thread__news-label i {
    color: var(--bs-primary);
    font-size: .85rem;
}

.thread__news-title {
    color: var(--bs-body-color);

    font-size: .85rem;
    font-weight: 600;
    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* =========================================================
   12. COMMENT TEXT
   ========================================================= */

.thread__text {
    margin-top: .7rem;
    margin-bottom: .9rem;

    color: var(--bs-body-color);

    font-size: 1rem;
    line-height: 1.7;

    overflow-wrap: anywhere;
}

.thread__text p {
    margin-top: 0;
    margin-bottom: .75rem;
}

.thread__text p:last-child {
    margin-bottom: 0;
}

.thread__text a {
    color: var(--bs-primary);
    text-decoration: underline;
    text-decoration-color: rgba(var(--bs-primary-rgb), .35);
    text-underline-offset: 2px;

    transition: color .2s ease, text-decoration-color .2s ease;
}

.thread__text a:hover {
    color: var(--bs-primary-text-emphasis);
    text-decoration-color: currentColor;
}

.thread__text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bs-border-radius);
}

.thread__text blockquote {
    margin: 1rem 0;
    padding: .75rem 1rem;

    border-left: 3px solid var(--bs-primary);

    background-color: var(--bs-tertiary-bg);

    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;

    color: var(--bs-secondary-color);
}


/* =========================================================
   13. COMMENT IMAGES
   ========================================================= */

.thread__images {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .5rem;

    margin-top: .75rem;
}

.thread__images img {
    display: block;

    max-width: 100%;
    height: auto;

    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);

    transition: transform .2s ease, box-shadow .2s ease;
}

.thread__images img:hover {
    transform: translateY(-1px);
    box-shadow: 0 .5rem 1rem rgba(var(--bs-dark-rgb), .08);
}


/* =========================================================
   14. SIGNATURE
   ========================================================= */

.thread__signature {
    margin-top: .8rem;
    padding-top: .75rem;

    border-top: 1px solid var(--bs-border-color);

    color: var(--bs-secondary-color);

    font-size: .85rem;
    line-height: 1.6;
}


/* =========================================================
   15. COMMENT FOOTER
   ========================================================= */

.thread__footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: .4rem;

    margin-top: 1rem;

    min-height: 32px;
}


/* =========================================================
   16. BASE FOOTER BUTTON
   ========================================================= */

.thread__btn {
    --thread-btn-color: var(--bs-secondary-color);
    --thread-btn-bg: var(--bs-secondary-bg);
    --thread-btn-hover-color: var(--bs-secondary-text-emphasis);
    --thread-btn-hover-bg: var(--bs-secondary-bg);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;

    min-height: 32px;
    padding: .3rem .65rem;

    border: 1px solid transparent;
    border-radius: var(--bs-border-radius-pill);

    background-color: var(--thread-btn-bg);
    color: var(--thread-btn-color);

    font-size: .78rem;
    font-weight: 500;
    line-height: 1;

    white-space: nowrap;
    cursor: pointer;
    user-select: none;

    transition:
        color .2s ease,
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.thread__btn i {
    display: inline-block;
    font-size: .9rem;
    line-height: 1;
    transition: color .2s ease, transform .2s ease;
}

.thread__btn-label {
    display: inline-block;
    line-height: 1;
}

.thread__btn:hover {
    color: var(--thread-btn-hover-color);
    background-color: var(--thread-btn-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 .25rem .75rem rgba(var(--bs-dark-rgb), .08);
}

.thread__btn:active {
    transform: translateY(0);
    box-shadow: none;
}


/* =========================================================
   17. QUOTE
   ========================================================= */

.thread__btn--quote {
    --thread-btn-color: var(--bs-primary);
    --thread-btn-bg: var(--bs-primary-bg-subtle);
    --thread-btn-hover-color: var(--bs-primary-text-emphasis);
    --thread-btn-hover-bg: var(--bs-primary-bg-subtle);

    border-color: rgba(var(--bs-primary-rgb), .15);
}

.thread__btn--quote i {
    color: var(--bs-primary);
}


/* =========================================================
   18. REPLY
   ========================================================= */

.thread__btn--reply {
    --thread-btn-color: var(--bs-success);
    --thread-btn-bg: var(--bs-success-bg-subtle);
    --thread-btn-hover-color: var(--bs-success-text-emphasis);
    --thread-btn-hover-bg: var(--bs-success-bg-subtle);

    border-color: rgba(var(--bs-success-rgb), .15);
}

.thread__btn--reply i {
    color: var(--bs-success);
}


/* =========================================================
   19. REPLY COUNT
   ========================================================= */

.thread__btn--count {
    --thread-btn-color: var(--bs-info);
    --thread-btn-bg: var(--bs-info-bg-subtle);
    --thread-btn-hover-color: var(--bs-info-text-emphasis);
    --thread-btn-hover-bg: var(--bs-info-bg-subtle);

    border-color: rgba(var(--bs-info-rgb), .15);
}

.thread__btn--count i {
    color: var(--bs-info);
}


/* =========================================================
   20. COMPLAINT
   ========================================================= */

.thread__btn--complaint {
    --thread-btn-color: var(--bs-warning-text-emphasis);
    --thread-btn-bg: var(--bs-warning-bg-subtle);
    --thread-btn-hover-color: var(--bs-warning-text-emphasis);
    --thread-btn-hover-bg: var(--bs-warning-bg-subtle);

    border-color: rgba(var(--bs-warning-rgb), .2);
}

.thread__btn--complaint i {
    color: var(--bs-warning);
}


/* =========================================================
   21. EDIT
   ========================================================= */

.thread__btn--edit {
    --thread-btn-color: var(--bs-info);
    --thread-btn-bg: var(--bs-info-bg-subtle);
    --thread-btn-hover-color: var(--bs-info-text-emphasis);
    --thread-btn-hover-bg: var(--bs-info-bg-subtle);

    border-color: rgba(var(--bs-info-rgb), .15);
}

.thread__btn--edit i {
    color: var(--bs-info);
}


/* =========================================================
   22. DELETE
   ========================================================= */

.thread__btn--delete {
    --thread-btn-color: var(--bs-danger);
    --thread-btn-bg: var(--bs-danger-bg-subtle);
    --thread-btn-hover-color: var(--bs-danger-text-emphasis);
    --thread-btn-hover-bg: var(--bs-danger-bg-subtle);

    border-color: rgba(var(--bs-danger-rgb), .15);
}

.thread__btn--delete i {
    color: var(--bs-danger);
}


/* =========================================================
   23. RATING CONTAINER
   ========================================================= */

.thread__rating {
    display: inline-flex;
    align-items: center;
    gap: .2rem;

    min-height: 32px;
    padding: .15rem;

    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-pill);

    background-color: var(--bs-tertiary-bg);
}


/* =========================================================
   24. RATING SCORE
   ========================================================= */

.thread__rating-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;

    min-height: 30px;
    padding: .3rem .6rem;

    border-radius: var(--bs-border-radius-pill);

    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);

    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
}

.thread__rating-score i {
    color: var(--bs-warning);
}


/* =========================================================
   25. RATING BUTTON
   ========================================================= */

.thread__rating-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;

    min-height: 30px;
    padding: .3rem .6rem;

    border-radius: var(--bs-border-radius-pill);

    font-size: .78rem;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    user-select: none;

    transition:
        color .2s ease,
        background-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}


/* =========================================================
   26. LIKE
   ========================================================= */

.thread__rating-btn--up {
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
}

.thread__rating-btn--up i {
    color: var(--bs-success);
}

.thread__rating-btn--up:hover {
    background-color: var(--bs-success);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 .25rem .6rem rgba(var(--bs-success-rgb), .2);
}

.thread__rating-btn--up:hover i {
    color: #fff;
}


/* =========================================================
   27. DISLIKE
   ========================================================= */

.thread__rating-btn--down {
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
}

.thread__rating-btn--down i {
    color: var(--bs-danger);
}

.thread__rating-btn--down:hover {
    background-color: var(--bs-danger);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 .25rem .6rem rgba(var(--bs-danger-rgb), .2);
}

.thread__rating-btn--down:hover i {
    color: #fff;
}


/* =========================================================
   28. POSITIVE / NEGATIVE COMMENT
   ========================================================= */

.thread__rating.is-positive {
    border-color: rgba(var(--bs-success-rgb), .25);
}

.thread__rating.is-negative {
    border-color: rgba(var(--bs-danger-rgb), .25);
}


/* =========================================================
   29. RATING PLUS / MINUS
   ========================================================= */

.ratingtypeplusminus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
}


/* =========================================================
   30. MASS ACTION
   ========================================================= */

.thread__mass {
    display: inline-flex;
    align-items: center;

    min-height: 32px;

    margin-left: auto;
}

.thread__mass a,
.thread__mass button,
.thread__mass label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;
    padding: .3rem .6rem;

    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-pill);

    background-color: var(--bs-body-bg);
    color: var(--bs-secondary-color);

    font-size: .75rem;
    line-height: 1;

    text-decoration: none;
    cursor: pointer;

    transition:
        color .2s ease,
        background-color .2s ease,
        border-color .2s ease;
}

.thread__mass a:hover,
.thread__mass button:hover,
.thread__mass label:hover {
    color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
    border-color: rgba(var(--bs-primary-rgb), .2);
}


/* =========================================================
   31. FOCUS
   ========================================================= */

.thread__btn:focus-visible,
.thread__rating-btn:focus-visible,
.thread__mass a:focus-visible,
.thread__mass button:focus-visible,
.thread__mass label:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .2);
}


/* =========================================================
   32. DARK MODE
   ========================================================= */

[data-bs-theme="dark"] .thread__btn {
    box-shadow: none;
}

[data-bs-theme="dark"] .thread__btn:hover {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .2);
}

[data-bs-theme="dark"] .thread__news,
[data-bs-theme="dark"] .thread__rating {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .thread__mass a,
[data-bs-theme="dark"] .thread__mass button,
[data-bs-theme="dark"] .thread__mass label {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}


/* =========================================================
   33. TABLET
   ========================================================= */

@media (max-width: 991.98px) {

    .thread__item--reply {
        margin-left: 2.5rem;
        width: calc(100% - 2.5rem);
    }

}


/* =========================================================
   34. MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    .thread__item {
        margin-top: 1.25rem;
        margin-bottom: 1.5rem;
        padding: .85rem;
    }

    .thread__item + .thread__item {
        margin-top: 1.75rem;
    }

    .thread__item:last-child {
        margin-bottom: 2rem;
    }

    .thread__content {
        margin-left: .75rem;
    }

    .thread__item--reply {
        margin-left: 1.5rem;
        width: calc(100% - 1.5rem);
    }

    .thread__item--reply + .thread__item--reply {
        margin-top: 1.5rem;
    }

    .thread__header {
        align-items: flex-start;
        flex-direction: column;
        gap: .2rem;
    }

    .thread__footer {
        gap: .3rem;
    }

    .thread__mass {
        margin-left: 0;
    }

}


/* =========================================================
   35. SMALL MOBILE
   ========================================================= */

@media (max-width: 575.98px) {

    .thread__avatar {
        flex-basis: 44px;
        width: 44px;
        min-width: 44px;
    }

    .thread__avatar-img,
    .thread__avatar-placeholder {
        width: 44px;
        height: 44px;
    }

    .thread__content {
        margin-left: .65rem;
    }

    .thread__item--reply {
        margin-left: .75rem;
        width: calc(100% - .75rem);
    }

    .thread__item {
        margin-top: 1rem;
        margin-bottom: 1.25rem;
        padding: .75rem;
    }

    .thread__item + .thread__item {
        margin-top: 1.5rem;
    }

    .thread__text {
        font-size: .95rem;
        line-height: 1.65;
    }

    .thread__footer {
        gap: .25rem;
    }

    /*
       На телефоне текст кнопок скрывается
       через Bootstrap .d-none .d-md-inline.
       Поэтому кнопка превращается в компактную иконку.
    */

    .thread__btn {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
    }

    .thread__btn i {
        font-size: .9rem;
    }

    .thread__rating {
        min-height: 34px;
    }

    .thread__rating-btn,
    .thread__rating-score {
        min-height: 31px;
        padding: .3rem .5rem;
    }

    .thread__mass {
        width: 100%;
        margin-top: .2rem;
    }

}


/* =========================================================
   36. VERY SMALL SCREEN
   ========================================================= */

@media (max-width: 399.98px) {

    .thread__avatar {
        flex-basis: 40px;
        width: 40px;
        min-width: 40px;
    }

    .thread__avatar-img,
    .thread__avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .thread__content {
        margin-left: .55rem;
    }

    .thread__item--reply {
        margin-left: .5rem;
        width: calc(100% - .5rem);
    }

    .thread__btn {
        width: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    .thread__rating {
        min-height: 32px;
    }

    .thread__rating-btn,
    .thread__rating-score {
        min-height: 29px;
    }

}


/* =========================================================
   37. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .thread__btn,
    .thread__btn i,
    .thread__rating-btn,
    .thread__images img {
        transition: none;
    }

}


/* =========================================================
   38. PRINT
   ========================================================= */

@media print {

    .thread__footer {
        display: none;
    }

    .thread__item {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .thread__item--reply {
        margin-left: 1rem;
        width: auto;
    }

    .thread__text {
        color: #000;
    }

}