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

.cap_box {
    position: relative;
    --capbox-color: var(--color_main);
    --capbox-color--bg: unset;
}

.cap_box_ttl {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0 !important; //marginCtrlの影響を受けてしまうので
    padding: .5em;
    color: #fff;
    line-height: 1.5;
    text-align: center;
    background-color: var(--capbox-color);

    i {

        &:not(.-right) {
            margin-right: .4em;
            margin-left: -.25em;
        }

        &.-right {
            margin-right: -.25em;
            margin-left: .4em;
        }
    }

    svg {
        width: 1.1em;
        height: 1.1em;

        &:not(.-right) {
            margin-right: .4em;
            margin-left: -.25em;
        }

        &.-right {
            margin-right: -.25em;
            margin-left: .4em;
        }


    }
}

.cap_box_content {
    position: relative;
    z-index: 0;
    clear: both;
    margin-top: -2px;
    padding: 1.25em;
    background-color: var(--capbox-color--bg);
    border: solid 1px var(--capbox-color);

    @include tab {
        padding: 1.5em;
    }
}

.is-style-small_ttl {

    .cap_box_ttl {
        position: relative;
        top: 1px;
        float: left;
        padding: .25em .75em;
        font-size: .85em;
    }
}

.is-style-onborder_ttl,
.is-style-onborder_ttl2 {

    >.cap_box_ttl {
        position: relative;
        top: 1em;
        left: 1em;
        z-index: 1;
        display: inline-block;
        margin-bottom: 0;
        padding: .5em .75em;
        font-size: .85em;
        line-height: 1;
        text-align: center;
        // border-radius: 0;
    }

    >.cap_box_content {
        padding-top: 1.5em;

        @include tab {
            padding-top: 2em;
        }
    }
}

.is-style-onborder_ttl {

    >.cap_box_ttl {
        color: var(--capbox-color);
        background-color: var(--color_content_bg) !important;
    }

    >.cap_box_content {
        background-color: var(--color_content_bg) !important;
    }
}


.is-style-shadow {

    &.cap_box {
        overflow: hidden;
        box-shadow: var(--swl-box_shadow);
    }

    >.cap_box_content {
        border: none;
    }

    &:not([data-colset]) {
        --capbox-color--bg: #fff;

        >.cap_box_content {
            color: #333;
        }
    }
}

.is-style-inner {

    >.cap_box_ttl {
        position: absolute;
        min-width: 2em;
        max-width: 100%;
        padding: .25em 1em;
        overflow: hidden;
        font-size: .85em;
        white-space: nowrap;
    }

    >.cap_box_content {

        &::before {
            display: block;
            width: 100%;
            height: 1em;
            visibility: hidden;
            content: "";
        }
    }
}

.is-style-intext {

    &[data-colset] {
        background-color: var(--capbox-color--bg);
    }

    &.cap_box {
        padding: 1.5em;
        border: solid 1px var(--capbox-color);
    }

    >.cap_box_ttl {
        justify-content: flex-start;
        padding: 0;
        color: var(--capbox-color);
        text-align: left;
        background: none !important;
    }

    >.cap_box_content {
        margin-top: 1em;
        padding: 0;
        background: none !important;
        border: none;
    }
}
