:root {
    --e4n-category-1: #ed9bff;
    --e4n-category-2: #97D8B2;
    --e4n-category-3: #ADD9F4;
    --e4n-category-4: #f9f185;
    --e4n-category-5: #ff9ecd;
    --e4n-category-6: #FEB95F;
    --e4n-category-7: #CEBEBE;
    --e4n-category-8: #EEE1B3;
}
main.sub {
    font-family: var(--e4n-font-jp);
}
.sub__top--wrap img {
    width: 100%;
    height: 19vw;
    object-fit: cover;
}
section:nth-child(2) {
    padding-top: 2%;
}
section.sub__mainArea--titleWrap h2 {
    font-size: 3vw;
    margin-left: 3vw;
    margin-bottom: 1vw;
    line-height: .8;
    font-weight: 300;
    font-family: var(--e4n-font-eng);
}
.sub__mainArea--contentsDetail {
    width: 85%;
    margin: auto;
}
.sub__mainArea--contentsWrap:nth-child(even) {
    background-color: var(--e4n-background-blue);
    clip-path: polygon(0 130px, 100% 0%, 100% calc(100% - 130px), 0 100%);
    padding-top: 10%;
    padding-bottom: 12%;
}
.sub__mainArea--contentsWrap:last-child {
    background-color: var(--e4n-background-blue);
    clip-path: polygon(0 130px, 100% 0, 100% 100%, 0% 100%);
}
.sub__mainArea--contentsWrap.no-last-child {
    background-color: unset !important; /* 背景色を解除 */
    clip-path: unset !important;        /* clip-pathを解除 */
}
.sub__mainArea--contentsWrap h3, .sub__mainArea--contentsWrap h4, .sub__mainArea--contentsWrap h5 {
    margin: 1rem 0;
}
.sub__txtBlock p {
    text-indent: 1rem;
}
.sub__txtImgBlock--x {
    padding: 1rem 0;
}
.sub__txtImgBlock--x p {
    width: 55%;
    margin-bottom: 0;
}
.sub__txtImgBlock--x img {
    width: 40%;
    height: auto;
}
.sub__txtImgBlock--y {
    padding: 1rem 0;
}
.sub__txtImgBlock--y img {
    width: 70%;
    height: auto;
    margin: 0 auto 1rem;
}
.sub__txtImgBlocks--y--contents {
    width: 45%;
    -webkit-box-shadow: 11px 13px 27px 6px rgba(0, 0, 0, 0.08);
    box-shadow: 11px 13px 27px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    background-color: #fff;
}
.sub__txtImgBlocks--y .sub__category {
    padding: 1rem .5rem 0;
}
.sub__txtImgBlocks--y .sub__category a::before {
    content: "#";
    padding-right: 2px;
}
.sub__txtImgBlocks--y .sub__category a {
    display: flex;
    align-items: center;
    padding: 0 1em;
    height: 24px;
	line-height: 1;
	text-decoration: none;
    font-size: 90%;
    border-radius: 6px;
    margin: 0.3rem;
    color: var(--e4n-font-black);
}
.sub__category--1 {
    background-color: var(--e4n-category-1);
}
.sub__category--2 {
    background-color: var(--e4n-category-2);
}
.sub__category--3 {
    background-color: var(--e4n-category-3);
}
.sub__category--4 {
    background-color: var(--e4n-category-4);
}
.sub__category--5 {
    background-color: var(--e4n-category-5);
}
.sub__category--6 {
    background-color: var(--e4n-category-6);
}
.sub__category--7 {
    background-color: var(--e4n-category-7);
}
.sub__category--8 {
    background-color: var(--e4n-category-8);
}
.sub__txtImgBlocks--y--contents p {
    padding: 1rem;
    margin-bottom: 0;
}
.sub__txtImgBlocks--y--contents img {
    width: 100%;
    height: auto;
}
div.sub__moreBtn {
    display: inline-block;
    width: 8vw;
    text-align: center;
    text-decoration: none;
    line-height: 2.5vw;
    outline: none;
    color: var(--e4n-font-white);
    background-color: var(--e4n-accent-red);
    position: relative;
    border: 1px solid var(--e4n-accent-red);
    transition: color 0.5s ease;
    margin: 0 auto 1rem;
    display: block;
}
div.sub__moreBtn::before {
    position: absolute;
    top: 0;
    left: 0;
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: var(--e4n-font-white);
    transform: scaleX(0);
    transform-origin: right;
    transition: all 0.5s ease;
    transition-property: transform;
}
div.sub__moreBtn:hover {
    color: var(--e4n-accent-red);
    cursor: pointer;
}
div.sub__moreBtn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}
div.sub__moreBtn p {
    position: relative;
    font-family: var(--e4n-font-eng);
    padding: 0;
}



/* モーダルのスタイル */
.sub__modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 背景の半透明 */
    animation: modal-fade 0.3s ease-out;
}

.sub__modal-content {
    position: absolute;
    left: 20%; /* 画面左から20%の位置 */
    top: 50%; /* 垂直方向中央 */
    transform: translate(-50%, -50%); /* 水平方向・垂直方向に中央配置 */
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 60%;
    animation: slide-down 0.5s forwards;
    max-height: 90%;
}
.sub__modal-content div {
    max-height: 70vh; /* コンテンツの最大高さを70%に設定 */
    overflow-y: auto; /* 縦方向のスクロールを有効化 */
    padding: 1rem; /* 内側余白 */
    box-sizing: border-box; /* パディングを含めたボックスサイズ */
    overflow-y: scroll;
}
/* スクロールバーのスタイル */
.sub__modal-content div::-webkit-scrollbar {
    width: 12px;
    height: 8px;
}
/* スクロールバーのトラック部分（背景） */
.sub__modal-content div::-webkit-scrollbar-track {
    background: #fff; 
    margin-top: 2vw;
    margin-bottom: 2vw;
}
/* スクロールバーのつまみ部分（実際にスクロールする部分） */
.sub__modal-content div::-webkit-scrollbar-thumb {
    background: var(--e4n-accent-red);
    border-right: 4px solid transparent; 
    border-left: 4px solid transparent; 
    background-clip: padding-box; /* 背景を切り取る */
}
/* スクロールバーのつまみ部分（つまみがホバーされたとき） */
.sub__modal-content div::-webkit-scrollbar-thumb:hover {
    background: #555;
    border-right: 4px solid transparent; 
    border-left: 4px solid transparent;
    background-clip: padding-box; /* 背景を切り取る */
}
/* スクロールバーのつまみ部分がアクティブな時 */
.sub__modal-content div::-webkit-scrollbar-thumb:active {
    background: #333; 
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    background-clip: padding-box; /* 背景を切り取る */
}

/* モーダルがフェードインするアニメーション */
@keyframes modal-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* モーダルがスライドダウンするアニメーション */
@keyframes slide-down {
    0% { transform: translateX(0%) translateY(-100%); } /* 初期位置：画面外 */
    100% { transform: translateX(0%) translateY(-50%); } /* 最終位置：上下中央 */
}

/* 閉じるボタン */
.sub__close-btn {
    color: #aaa;
    font-size: 2vw;
    font-weight: bold;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.sub__close-btn:hover,
.sub__close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}



/* スマホ縦表示 (最大 575px) */
@media (max-width: 575px) {
    .sub__top--wrap {
        margin-top: 15vw;
    }
    section:nth-child(2) {
        padding-top: 7%;
    }
    section.sub__mainArea--titleWrap h2 {
        font-size: 6vw;
    }
    .sub__mainArea--contentsWrap:nth-child(even) {
        clip-path: polygon(0 70px, 100% 0%, 100% calc(100% - 70px), 0 100%);
        padding: 20% 0;
    }
    .sub__mainArea--contentsWrap:last-child {
        clip-path: polygon(0 70px, 100% 0, 100% 100%, 0% 100%);
    }
    .sub__mainArea--contentsWrap {
        width: 90%;
    }
    .sub__txtImgBlock--x {
        flex-direction: column;
    }
    .sub__txtImgBlock--x p, .sub__txtImgBlock--x img, .sub__txtImgBlock--y img, .sub__txtImgBlocks--y--contents  {
        width: 100%;
    }
    div.sub__moreBtn {
        font-size: 5vw;
        width: 37vw;
        line-height: 7.5vw;
        margin: 0 auto 1rem;
    }
    .sub__modal-content {
        left: 2.5%;
        width: 95%;
        padding: 1rem .5rem;
    }
    .sub__modal-content div::-webkit-scrollbar-track {
        margin-top: 10vw;
        margin-bottom: 5vw;
    }
    .sub__close-btn {
        font-size: 6vw;
    }
}

/* スマホ横表示 (576px 以上かつ最大 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .sub__top--wrap {
        margin-top: 8vw;
    }
    section:nth-child(2) {
        padding-top: 5%;
    }
    section.sub__mainArea--titleWrap h2 {
        font-size: 4vw;
    }
    .sub__mainArea--contentsWrap:nth-child(even) {
        clip-path: polygon(0 100px, 100% 0%, 100% calc(100% - 100px), 0 100%);
        padding: 15% 0;
    }
    .sub__mainArea--contentsWrap:last-child {
        clip-path: polygon(0 100px, 100% 0, 100% 100%, 0% 100%);
    }
    .sub__txtImgBlocks--y--contents {
        width: 70%;
    }
    div.sub__moreBtn {
        font-size: 3vw;
        width: 20vw;
        line-height: 4.5vw;
    }
    .sub__modal-content {
        left: 2.5%;
        top: 55%;
        width: 95%;
        max-height: 70%;
        padding: 1rem 4rem;
    }
    .sub__modal-content div {
        max-height: 60vh;
    }
    .sub__modal-content div::-webkit-scrollbar-track {
        margin-top: 10vw;
        margin-bottom: 5vw;
    }
    .sub__close-btn {
        font-size: 6vw;
    }
}
/* タブレット縦表示 (768px 以上かつ最大 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    section:nth-child(2) {
        padding-top: 5%;
    }
    section.sub__mainArea--titleWrap h2 {
        font-size: 4vw;
    }
    .sub__mainArea--contentsWrap:nth-child(even) { 
        clip-path: polygon(0 120px, 100% 0%, 100% calc(100% - 120px), 0 100%);
        padding: 15% 0;
    }
    .sub__mainArea--contentsWrap:last-child {
        clip-path: polygon(0 120px, 100% 0, 100% 100%, 0% 100%);
    }
    .sub__txtImgBlocks--y--contents {
        width: 80%;
    }
    div.sub__moreBtn {
        width: 13vw;
        line-height: 3.5vw;
        margin: 0 auto 2vw;
    }
}

/* タブレット横表示 (992px 以上かつ最大 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {

}
/* PC表示 (1200px 以上) */
@media (min-width: 1200px) {

}