
// Gutenberg
[data-type="loos/tab"] {
    position: relative;
    padding: 0;
    // border: dashed 1px $color_guide;

    .block-list-appender:first-child .block-editor-default-block-appender {
        display: block !important;
    }

    &.is-selected,
    &.has-child-selected {
        padding: 32px 4px 4px;
    }

    &.has-background,
    &.has-border {
        padding: 40px;
    }

    .c-tabList {
        position: relative;
        padding: 0;
    }

    .swell-block-tab__addBtn {
        z-index: 1;
        display: flex;
        align-items: center;
        margin: 0;
        margin-left: 4px;
        padding: 4px;
        list-style: none !important;

        .swl-tabBtn--add {
            padding: 2px;
            border-radius: 50%;
        }

        svg {
            display: block;
            width: 20px;
            height: 20px;
        }
    }


    .c-tabList__item {
        position: relative;
        display: flex;
        align-items: center;
        list-style: none !important;
        cursor: pointer;

        p {
            cursor: text;
        }
    }

    // タブブロックが選択 or タブボディが選択してる時だけ表示。かつ、アクティブなタブのみ表示。
    &:not(.is-selected):not(.has-child-selected),
    .c-tabList__item:not(.is-active) {

        .swell-block-tab__tooltips {
            display: none;
        }
    }

    .c-tabList__button {
        display: flex;
        align-items: center;
        text-align: center;

        > .rich-text {
            width: 100%;
            margin: 0 !important;
            line-height: inherit; // buttonの1を受け継ぐ
        }
    }

    &.is-style-balloon .swell-block-tab__addBtn {
        margin-bottom: 16px;
    }

    &.is-style-bb .swell-block-tab__addBtn {
        margin-bottom: .75em;
    }

}

// スクロール可能な時
[data-scroll-pc] {

    @include pc {

        &.swell-block-tab {
            padding-top: 0 !important;
        }

        .c-tabList {
            padding-top: 40px !important;
        }
    }
}

[data-scroll-sp] {

    @include sp {

        &.swell-block-tab {
            padding-top: 0 !important;
        }

        .c-tabList {
            padding-top: 40px !important;
        }
    }
}

// タブコンテンツ
[data-type="loos/tab-body"] {

    display: none;
    margin-top: 0 !important;
    margin-bottom: 0 !important;

    &[data-open] {
        display: block;
    }

    + .block-list-appender {
        display: none;
        visibility: hidden;
    }
}

// 各種ボタン
.swell-block-tab__tooltips {
    position: absolute;
    top: -30px;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    width: auto;
    color: #000;
    cursor: auto;

    svg {
        display: block;
        margin: 0 auto;
    }
}

.swl-tabBtn--add,
.swl-tabBtn--remove,
.swl-tabBtn--moveUp,
.swl-tabBtn--moveDown {
    display: block;
    color: #fff;
    background: #000;
    border: solid 1px #000;
    cursor: pointer;
    // transition: border-color .25s, opacity .25s;

    &:not(:hover) {
        color: #000;
        background: #fff;
    }
}
// .swl-tabBtn--add,
// .swl-tabBtn--remove,
// .swl-tabBtn--moveUp,
// .swl-tabBtn--moveDown {
//     display: block;
//     color: #000;
//     background: #fff;
//     border: solid 1px #000;
//     cursor: pointer;
//     transition: border-color .25s, opacity .25s;

//     &:not(:hover) {
//         border-color: transparent;
//         opacity: .5;
//     }
// }


.swl-tabBtn--remove,
.swl-tabBtn--moveUp,
.swl-tabBtn--moveDown {
    width: 28px;
    margin-right: 2px;
    padding: 2px;
    border-radius: 4px;

    svg {
        width: 20px;
        height: 20px;
    }
}


.swl-tabBtn--moveUp,
.swl-tabBtn--moveDown {

    &[data-active="false"] {
        opacity: .1 !important;
        pointer-events: none;
    }

}

