// main: backend.scss
@import "colors";

.widget.snippet-preview {

    > div {

        font-family: arial,sans-serif;
        font-size: 20px;
        padding: 15px;
        border: 1px solid $col-gray;

        > div {
            width: calc(100% - 15px);
            max-width: 560px;
            overflow: hidden;
        }

        @media screen and (max-width: 560px) {

            font-size: 16px;

            > .url,
            > .title { white-space: normal; }
        }
    }

    .url {

        position: relative;

        font-size: 14/20*1em;
        line-height: 1.3;
        font-weight: 400;
        color: #3C4043;

        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .title {

        font-size: 1em;
        line-height: 1.3;
        padding-top: 4px;
        margin-bottom: 3px;
        font-weight: 400;
        color: #1a0dab;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        span {
            font-size: inherit;
            line-height: inherit;
            font-weight: inherit;
            color: $col-orange;
        }
    }

    .description {
        font-size: 14/20*1em;
        line-height: 1.58;
        font-weight: 400;
        color: #3C4043;
    }

    p.explanation {

        margin-top: 1em;
        margin-bottom: 0;
        padding: 15px;

        background: $col-yellow-light;

        line-height: 1.4;
        color: darken($col-yellow-light,40%);

        a {
            color: inherit;
            text-decoration: underline;
        }

        em {
            font-style: normal;
            font-family: "Courier New", Courier, "Lucida Console", Monaco, monospace;
        }
    }
}

.widget.snippet {

    > input, > textarea {
        display: none;
    }

    > div[contenteditable] {

        width: 100%;
        line-height: normal;
        font-size: .875rem;
        min-height: 30px;

        mark {
            background: $col-red;
            color: $col-white;
        }

        &[class*="length_"] {

            outline: none;

            &.length_short { box-shadow: 0px 3px 0px 0px $col-yellow-light; }
            &.length_long { box-shadow: 0px 3px 0px 0px $col-red; }
            &.length_optimal { box-shadow: 0px 3px 0px 0px $col-green; }
        }

    }

    > input + div[contenteditable] {
        @media screen and (min-width: 1500px) {
            white-space: nowrap;
        }
        overflow: hidden;
    }

    > textarea + div[contenteditable] {
        height: auto !important;
        min-height: 30px;
    }

    h3 label {

        display: flex;
        justify-content: space-between;

        .snippet-count {
            font-weight: 400;
            font-size: 0.8em;
        }

        + img { display: none; }
    }
}