/*-------------
リッチテキストエディタ共通
-------------*/
.rte{
    --rte-line-height: 1.8;
}
:where(.rte,.rte *){
    --rte-margin-vertical: calc(1em * var(--rte-line-height));
    line-height: var(--rte-line-height);
}
:where(.rte) p:not(:last-child),
:where(.rte) > div{
    margin-bottom: var(--rte-margin-vertical);
}
.rte > *:first-child,
.rte > *:first-child *:first-child{
    margin-top: 0;
}
.rte > *:last-child,
.rte > *:last-child *:last-child{
    margin-bottom: 0;
}
@media screen and (max-width:767px){
    :where(.rte) > [style*="margin-left:"]{
        margin-left: 3em!important;
    }
    :where(.rte) > [style*="margin-left: 40px;"]{
        margin-left: 1em!important;
    }
    :where(.rte) > [style*="margin-left: 80px;"]{
        margin-left: 2em!important;
    }
}
:where(.rte) blockquote{
    margin: var(--rte-margin-vertical) 0;
    color: #555;
    font-style: italic;
}
:where(.rte) blockquote > *{
    display: inline;
}
:where(.rte) blockquote::before,
:where(.rte) blockquote::after{
    display: inline-block;
    font-style: normal;
}
:where(.rte) blockquote::before{
    content: "“";
}
:where(.rte) blockquote::after{
    margin-left: .25em;
    content: "”";
}
:where(.rte) hr{
    margin: calc(var(--rte-margin-vertical) * 2) 0;
    border-color: #ccc;
}
@media screen and (max-width:767px){
    :where(.rte) hr{
        margin: calc(var(--rte-margin-vertical) * 1.5) 0;
    }
}
:where(.rte) :is(h1,h2,h3,h4,h5,h6){
    line-height: 1.5;
}
.rte :is(h1,h2,h3,h4,h5,h6) + :is(h1,h2,h3,h4,h5,h6,div,p,img,p img,div img,table,ul,ol){
    margin-top: 0;
}
:where(.rte) h1{
    margin-top: 60px;
}
@media screen and (max-width:767px){
    :where(.rte) h1{
        margin-top: 50px;
    }
}
:where(.rte) h2{
    margin-top: 50px;
}
@media screen and (max-width:767px){
    :where(.rte) h2{
        margin-top: 40px;
    }
}
:where(.rte) h3{
    margin-top: 35px;
}
@media screen and (max-width:767px){
    :where(.rte) h3{
        margin-top: 30px;
    }
}
:where(.rte) h3{
    margin-top: 35px;
}
@media screen and (max-width:767px){
    :where(.rte) h3{
        margin-top: 30px;
    }
}
:where(.rte) h4{
    margin: 25px 0 15px;
    font-size: 2rem;
    font-weight: bold;
}
@media screen and (max-width:767px){
    :where(.rte) h4{
        font-size: 1.7rem;
    }
}
:where(.rte) h5{
    margin: 20px 0 10px;
    font-size: 1.8rem;
    font-weight: bold;
}
@media screen and (max-width:767px){
    :where(.rte) h5{
        font-size: 1.6rem;
    }
}
:where(.rte) h6{
    margin: 15px 0 5px;
    font-size: 1.6rem;
    font-weight: bold;
}
@media screen and (max-width:767px){
    :where(.rte) h6{
        font-size: 1.5rem;
    }
}
:where(.rte) a{
    color: var(--main-color3);
}
:where(.rte) a:not(:hover){
    text-decoration: underline;
}
:where(.rte) ul,
:where(.rte) ol{
    margin: 30px 0 32px;
}
:where(.rte) li:not(:last-child){
    margin-bottom: 7px;
}
:where(.rte) ul li{
    position: relative;
    padding-left: 1.2em;
}
:where(.rte) ul li::before{
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(1.5);
    transform-origin: left center;
    color: var(--main-color3);
    content: "・";
}
:where(.rte) ol{
    counter-reset: listnum;
}
:where(.rte) ol li{
    position: relative;
    padding-left: 1.35em;
}
:where(.rte) ol li::before{
    position: absolute;
    top: 0;
    left: 0;
    color: var(--main-color3);
    font-weight: 500;
    content: counter(listnum)".";
    counter-increment: listnum;
}
@media screen and (max-width:767px){
    :where(.rte) ul,
    :where(.rte) ol{
        margin: 18px 0 23px;
    }
    :where(.rte) li:not(:last-child){
        margin-bottom: 8px;
    }
}
:where(.rte) img{
    display: block;
    max-width: 100%;
    height: auto;
    margin: var(--rte-margin-vertical) 0;
}
:where(.rte) > img,
:where(.rte) > *:has(img){
    margin: 40px 0;
}
:where(.rte) [style*="left"] img,
:where(.rte) img[style*="left"]{
    margin-left: 0;
    margin-right: auto;
}
:where(.rte) [style*="center"] img,
:where(.rte) img[style*="center"]{
    margin-left: auto;
    margin-right: auto;
}
:where(.rte) [style*="right"] img,
:where(.rte) img[style*="right"]{
    margin-left: auto;
    margin-right: 0;
}
:where(.rte) img + br,
:where(.rte) > *:has(img) + br{
    display: none;
}
@media screen and (max-width:767px){
    :where(.rte) > img,
    :where(.rte) > *:has(img){
        margin: 30px 0;
    }
}
:where(.rte) table{
    --rte-th-fill: #0085b6;
    width: revert-layer!important;
}
:where(.rte) .editor__table,
:where(.rte) > table{
    margin: 30px 0;
}
:where(.rte) .editor__table table{
    margin: 0;
}
:where(.rte) table[cellspacing]{
    border-spacing: revert-layer!important;
    border-collapse: unset!important;
}
:where(.rte) table[align]{
    margin: revert-layer!important;
}
:where(.rte) th,
:where(.rte) td{
    padding: 10px 15px!important;
    border: solid 1px #ccc;
    line-height: 1.5;
}
:where(.rte) th{
    font-weight: 500;
}
:where(.rte) table[cellpadding] :is(th, td){
    padding: revert-layer!important;
}
:where(.rte) :is(th, td)[bordercolor]{
    border-color: revert-layer;
}
:where(.rte) :is(th, td)[align]{
    text-align: revert-layer;
}
:where(.rte) table caption{
    margin-bottom: 10px;
}
@media screen and (max-width:767px){
    :where(.rte) table{
        --my-pc-max: 940px;
        --my-max-width: 100%;
        width: 100%!important;
        max-width: var(--my-max-width);
        min-width: 100%;
    }
    :where(.rte) .editor__table,
    :where(.rte) > table{
        margin: 25px 0;
    }
    :where(.rte) .editor__table table{
        max-width: var(--my-max-width);
    }
    :where(.rte) .editor__table table:has(tr *:nth-child(3):last-child){
        width: 130vw!important;
    }
    :where(.rte) .editor__table table:has(tr *:nth-child(4):last-child){
        width: 180vw!important;
    }
    :where(.rte) .editor__table table:has(tr *:nth-child(5)){
        width: 230vw!important;
    }
    :where(.rte) th,
    :where(.rte) td{
        padding: 8px 10px!important;
    }
}
/* 自動色付け ---
:where(.rte) th{
    background: var(--rte-th-fill);
    color: #fff;
}
:where(.rte) thead > tr > th{
    border-color: var(--rte-th-fill);
}
:where(.rte) thead > tr > th:not(:last-child){
    border-right-color: #fff;
}
:where(.rte) table:not(:has(thead)) > tbody > tr > th{
    border-color: var(--rte-th-fill);
}
:where(.rte) table:not(:has(thead)) > tbody > tr:not(:last-child) > th{
    border-bottom-color: #fff;
}
:where(.rte) table:has(thead) > tbody > tr > th{
    background: var(--bg-color1);
    color: revert-layer;
}
:where(.rte) td{
    background: #fff;
}
--- */
:where(.rte) iframe{
    display: block;
    max-width: 100%;
    margin: 40px 0;
    background: #f0f0f0;
}
:where(.rte) [style*="left"] iframe,
:where(.rte) iframe[style*="left"]{
    margin-left: 0;
    margin-right: auto;
}
:where(.rte) [style*="center"] iframe,
:where(.rte) iframe[style*="center"]{
    margin-left: auto;
    margin-right: auto;
}
:where(.rte) [style*="right"] iframe,
:where(.rte) iframe[style*="right"]{
    margin-left: auto;
    margin-right: 0;
}
:where(.rte) .editor__emded{
    margin: 40px 0;
}
:where(.rte) .editor__emded iframe{
    margin: 0;
}
@media screen and (max-width:767px){
    :where(.rte) iframe,
    :where(.rte) .editor__emded{
        margin: 30px 0;
    }
}