body:has(.tx_nsnewscomments),
html:has(.tx_nsnewscomments) {
    scroll-behavior: smooth;
}

.tx_nsnewscomments {
    display: inline-block;
    width: 100%;

    .comments-container h1 {
        color: #283035;
        font-weight: 400;

        a {
            font-weight: 700;
        }
    }

    .no-comment-placeholder.hidden,
    .toggle-blog.hidden,
    .comment-box .comment-btn.hidden,
    .messages.hidden {
        display: none;
    }

    ul p,
    ul .comment-content {
        color: #494949;
    }

    .blog-form-container {
        display: none;

        &.blog-form-show {
            display: block;
        }
    }

    .comments-list {
        scroll-margin-top: 200px;

        li {
            position: relative;
            display: block;
            padding-top: 10px;
            margin-bottom: 15px;
            margin-left: 0;
            scroll-margin-top: 200px;

            &::after {
                content: '';
                display: block;
                width: 0;
                height: 0;
                clear: both;
            }
        }

        .childcomments {
            display: none;

            &.active {
                display: block;
            }

            + .comment-btn {
                margin-top: 30px;
            }
        }

        .show-childcomment {
            display: flex;
            align-items: center;
            cursor: pointer;


            .t3js-icon {
                display: block;
                height: 20px;
                width: 20px;
                margin-right: 3px;
                margin-top: -3px;
                margin-left: -2px;
                transform: rotate(-90deg);
                transform-origin: center center;
                transition: transform 0.5s;

                * {
                    height: 100%;
                    width: 100%;
                }
            }

            &.active .t3js-icon {
                transform: rotate(0deg);
            }
        }

        .comment-box {
            position: relative;
            width: 100%;
            margin-bottom: 20px;
            background-color: #fff;
            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
            border: 1px solid #ddd;
            border-radius: 4px;

            .comment-head {
                position: relative;
                padding: 10px 15px;
                color: #333;
                background-color: #f5f5f5;
                border-color: #ddd;
                border-top-right-radius: 3px;
                border-top-left-radius: 3px;

                i:hover {
                    color: #03658c;
                }
            }

            .comment-btn {
                position: relative;
                padding-left: 20px;
                /* color: inherit; */
                display: block;
                text-decoration: none;

                &:hover {
                    text-decoration: none;
                    color: #01665B;
                }
            }

            .comment-content {
                padding: 15px;
                /* font-size: 14px; */
                word-wrap: break-word;
            }

            .comment-name.by-author {
                &::after {
                    content: 'autor';
                    padding: 3px 5px;
                    margin-left: 10px;
                    color: #fff;
                    font-weight: 700;
                    background: #03658c;
                    border-radius: 3px;
                }

                strong {
                    margin-right: 5px;
                }
            }

            .comment-name.by-author,
            .comment-name.by-author a {
                color: #03658c;
            }
        }
    }

    .reply-list {
        padding-left: 10px;
        margin-top: 15px;
        clear: both;
    }

    .comment-main-level {
        position: relative;

        &::after {
            content: '';
            display: block;
            width: 0;
            height: 0;
            clear: both;
        }
    }

    .active-comment-form {
        position: relative;
    }

    .ns-icon-reply {
        position: absolute;
        top: 1px;
        left: 0;
        width: 14px;
        height: 14px;
        background-image: url('EXT:ns_news_comments/Resources/Public/Icons/reply.svg');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: contain;
    }

    .text-muted {
        color: #878787;
    }

    .comment-link {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 20px;
        height: 20px;
        color: #bbb;
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 14px auto;

        img {
            height: 100%;
            width: 100%;
        }

        a {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        .link-icon {
            display: inline-block;
            min-width: 22px;
            padding: 3px 4px;
            margin: 1px;
            line-height: 16px;
            text-align: center;
            cursor: pointer;
        }
    }

    .comment-link-input {
        width: 100%;
        padding: 3px;
        color: #666;
        border: 1px solid #ccc;
        border-radius: 3px;
        outline: 0;
    }

    span {
        display: inline;
    }

    .comment-footer {
        padding: 15px;
    }

    .typo3-messages {
        width: 100%;
        margin-top: 10px;

        li {
            width: 55%;
            padding-left: 20px;
            list-style: none;
            list-style-type: none;
        }
    }

    .thanksmsg {
        width: 70%;
    }

    .error-msg {
        display: none;
    }

    .comment-form {
        .text-muted {
            margin-top: 10px;
        }

        .has-error {
            position: relative;
        }

        textarea {
            min-height: 100px;
            padding: 10px 18px;
        }

        .has-error > input,
        textarea:focus:invalid,
        input[type="text"]:focus:invalid,
        input[type="email"]:focus:invalid {
            border: 1px solid red;
        }

        .ns-form-group {
            display: inline-block;
            width: 100%;
            max-width: 497px;
            margin: 0 0 15px;

            label {
                padding-left: 0;
                background: transparent;
                border-color: transparent;
            }

            .ns-form-checkbox input {
                display: inline;
                width: auto;
                height: auto;
                box-shadow: none;
                border-bottom: 0;
            }
        }

        .comment-form-close-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            float: right;
            padding: 0;
            color: #000;
            font-size: 27px;
            font-weight: 700;
            line-height: 1;
            text-shadow: 0 1px 0 #fff;
            background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
            border: 0 none;
            transition: all 0.3s ease-in-out;
            cursor: pointer;
            opacity: 0.2;
            text-decoration: none;
            display: none;

            &:focus,
            &:hover {
                color: #000;
                text-decoration: none;
                cursor: pointer;
                opacity: 0.5;
            }
        }
    }

    ul,
    ol {
        padding: 0;
        margin: 0;
        list-style: none;
        max-width: 100%;
    }

    ul ul {
        padding-left: 114px;
    }

    .reply-form:not(:empty) {
        padding: 30px;
        margin-top: 30px;
        /* background-color: rgba(0, 0, 0, 0.04); */
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 5px;
    }

    .ns-form-group-main {
        display: inline-block;
        width: 100%;
    }

    .reply-form .comment-form-close-btn {
        z-index: 1;
        display: inline-block;
    }

    .ns-alert {
        padding: 15px;
        margin-bottom: 20px;
        border: 1px solid transparent;
        border-radius: 4px;

        &-success {
            color: #3c763d;
            background-color: #dff0d8;
            border-color: #d6e9c6;
        }

        &-error {
            color: #a94442;
            background-color: #f2dede;
            border-color: #ebccd1;
        }
    }
}

@media screen and (max-width: ($breakpoint - 1px)) {
    .tx_nsnewscomments .reply-form:not(:empty) {
        padding: 20px;
        padding-bottom: 0;
    }

    .tx_nsnewscomments .comment-box .comment-head,
    .tx_nsnewscomments .comment-box .comment-content,
    .tx_nsnewscomments .comment-footer {
        padding: 10px;
    }
}

@media(max-width: 600px) {
    .tx_nsnewscomments .comment-author {
        display: flex;
        flex-direction: column;
    }
}