@import "../../../scss/foundation/mixin/_media.scss";

/**
 * ふきだし
 */
.c-balloon {
    position: relative;
    display: flex;
    align-content: flex-start;
    justify-content: space-between;
    //padding-bottom: 16px;

    &.-bln-right {
        flex-direction: row-reverse;
    }

}

.c-balloon__icon {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    text-align: center;

    @include tab {
        width: 80px;
    }
}

.c-balloon__iconImg {
    display: block;
    margin: 0 auto;
    object-fit: cover;

    // 詳細度あげる(エディターでコアのCSSに負けるのを防ぐ)
    .c-balloon & {
        width: 60px;
        height: 60px;

        @include tab {
            width: 80px;
            height: 80px;
        }
    }

    .-circle > & {
        // overflow: hidden; // プラグインでpictureタグに置き換えられた場合の対処?
        border: solid 2px #ececec;
        border-radius: 50%;
    }
}

.c-balloon__iconName {
    display: block;
    padding-top: 4px;
    font-size: 10px;
    line-height: 1;
    opacity: .8;
}

.c-balloon__body {
    display: flex;
    flex-basis: 100%;
    align-items: flex-start;
    padding: 4px 24px;

    @include tab {
        padding: 8px 24px;
    }

    // タイプ
    &.-thinking {

        padding-top: 8px;

        @include tab {
            padding-top: 16px;
        }
    }

    .-bln-left & {
        justify-content: flex-start;

    }

    .-bln-right & {
        justify-content: flex-end;
    }
}

.c-balloon__text {
    position: relative;
    max-width: 560px;
    padding: 1em;
    color: #333;
    line-height: 1.6;
    border-radius: 8px;

    @include mobile {
        font-size: .95em;
    }

    // ボーダー
    .-border-on & {
        border-style: solid;
        border-width: 1px;
    }
}

.c-balloon .c-balloon__text > p {
    margin-top: 0;
    margin-bottom: 0;
}

.c-balloon__shapes {
    position: absolute;
    top: 16px;
    z-index: 1;
    width: 0;
    height: 0;
    background-color: inherit;
    border-color: inherit;

    // .-thinking & {
    //     top: 0;
    // }

    .-bln-left & {
        left: 0;
    }

    .-bln-right & {
        right: 0;
        transform: rotateY(180deg);
    }

}

.c-balloon__before,
.c-balloon__after {
    position: absolute;
    top: 0;
    display: block;
    width: 0;
    height: 0;
    border-color: transparent; //詳細度低く
    border-style: solid;

    .-speaking & {
        left: -10px;
        border-width: 8px 10px 8px 0;
    }
    // 考え中
    .-thinking & {
        background: inherit;
        border-radius: 50%;
    }

    .-thinking.-border-none & {
        border: none;
    }

    .-thinking.-border-on & {
        border-color: inherit;
        border-width: 1px;
    }
}

.c-balloon__before {
    z-index: 3;

    .-speaking.-border-on & {
        left: -8px;
    }

    .-thinking & {
        top: 0;
        left: -21px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
    }

}

.c-balloon__after {
    z-index: 2;
    border-right-color: inherit;

    .-speaking.-border-none & {
        display: none;
    }

    .-thinking & {
        top: 8px;
        left: -16px;
        width: 12px;
        height: 12px;
    }

}


@include mobile {

    .-sp-vrtcl {

        &.c-balloon {
            flex-wrap: wrap;
        }

        .c-balloon__body {
            width: 100%;
            padding: 8px 0 0;
        }
        // .c-balloon__text{width: 100%;}

        .-speaking { //.c-balloon__body.-speaking
            margin-top: 8px;
        }

        // 発言
        .-speaking .c-balloon__shapes {
            top: 0;
            margin: 0 22px 0 36px;
            transform: rotate(90deg);
        }

        .-thinking .c-balloon__shapes {
            top: -24px;
            margin: 0 88px;
        }

    }
}
