/* 共通スタイル */

body{
    font-family: Arial, Helvetica, sans-serif;
    background-color: #F8F8F5;
    color: #1B1935;
    font-size: 1rem;
    font-weight: normal;
}

li{list-style: none;}

.text-s{font-size: 0.9rem;}
.text-m{font-size: 1rem;}
.text-l{font-size: 1.25rem;}
.text-xl{font-size: 2rem;}
.img-card{border-radius: 5px;}

.text-title{
    background-color: #1B1935;
    padding: 0.1rem 0.25rem;
    color: white;
    font-weight: normal;
}
.text-title::before{
    content: "◆";
    color: #4F5274;
}
h4{
    margin: 0;
}

hr{
    width: 100%;
    height: 1px;
    background-color: #4F5274;
    border: none;
}

.keyword{
    display: inline-block;
    background-color: #8F8E8E;
    color: white;
    padding: 0.25rem 1rem;
}
.keyword-list{
    display: flex;
    gap: 1rem;
}

.container{
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 5%;
}

a.button{
    background-color: #1B1935;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    padding: 0.75rem 3rem;
    transition: 0.2s ease;
    z-index: 1;
}

a.button:hover{
    background-color: #4F5274;
}

.show {
    transition: opacity 0.3s ease;
    opacity: 1;
}
.hide{
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* ヘッダー */

header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F8F8F5;
}

header #logo{
    max-width: 250px;
    transition: 0.2s ease;
    margin: 0;
    margin-left: 3%;
}

header #logo img{
    width: 100%;
}

header #logo:hover{
    opacity: 0.5;
}

header #headerNav #headerMenu{
    display: flex;
    margin: 0;
}

header #headerNav #headerMenu li a{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #1B1935;
    padding: 1rem 1.5rem;
    border-left: #8F8E8E solid 1px;
    transition: 0.2s ease;
}

header #headerNav ul li a:hover{
    background-color: white;
    color: #4F5274;
}

header #headerNav ul li span{
    color: #4F5274;
}

/* メインビジュアル */

#main{
    background-color: #4F5274;
    height: 100vh;
    max-height: 600px;
    position: relative;
    overflow: hidden;
}

#main::before{
    content: "";
    image-rendering: pixelated;
    background-image: url(../img/logo_wh.png);
    background-color: #1B1935;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 90%;
    width: 100%;
    height: 100%;
    max-width: 502px;
    max-height: 49px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    z-index: 2;
    animation-duration: 1s;
    animation-timing-function: ease;
    animation-fill-mode: forwards;
    animation-name: mainlogo;
}
@media screen and (min-width:768px) {

@keyframes mainlogo{
    0%{
        left:0;
    }
    100%{
        left: 10%;
    }
}
    
}

#main main{
    position: relative;
}

@keyframes slideLeft {
    0% {
        transform: translateX(0%);
        opacity: 0;
    }
    100% {
        transform: translateX(-10%);
        opacity: 0.9;
    }
}

@keyframes slideRight {
    0% {
        transform: translateX(0%);
        opacity: 0;
    }
    100% {
        transform: translateX(10%);
        opacity: 0.9;
    }
}

#main main::before,
#main main::after{
    content: "";
    background-repeat: no-repeat;
    width: 100%;
    height:100%;
    position: absolute;
    top: 0;
    z-index: 1;
    animation-duration: 1s;
    animation-timing-function: ease;
    animation-fill-mode: forwards;
    opacity: 0;
}

#main main::before{
    background-image: url(../img/design_mainL.svg);
    background-position: left;
    left: 0%;
    animation-name: slideLeft;
}

#main main::after{
    background-image: url(../img/design_mainR.svg);
    background-position: right;
    right: 0%;
    animation-name: slideRight;
}

#main main{
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    position: relative;
}

#main #mainCard_back{
    margin-top: -5%;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 2rem;
    transform: rotate(-5deg) translateY(-50%);
    position: absolute;
    top: 60%;
}

#main #mainCard_back img{
    width: 100%;
    box-shadow: 0px 10px 10px -6px rgba(0, 0, 0, 0.3);
    opacity: 0.5;
    filter: blur(2px);
}

#main #mainCard_front {
    width: 130vw;
    max-width: 130%;
    margin-top: -5%;
    padding: 0;
    display: flex;
    gap: 1.5%;
    transform: rotate(-5deg) translateY(-50%);
    position: absolute;
    top: 60%;
    
}

#main #mainCard_front img{
    width: 100%;
    box-shadow: 0px 10px 10px -6px rgba(0, 0, 0, 0.3);
    animation: floatAnimation 3s ease-in-out infinite; /* アニメーションを追加 */
}

@keyframes floatAnimation {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* 他コンテンツ */
/* 見出し部分 */

.section-title{
    display: inline-block;
    text-align: center;
    position: relative;
}
.section-title::before,
.section-title::after{
    content: "";
    background-image: url(../img/icon.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: absolute;
    width: 100%;
    height: 50%;
    top: 50%;
    transform: translateY(-50%);
}
.section-title::before{left: -7.5rem;}
.section-title::after{right: -7.5rem;}

.section-title h2{
    position: relative;
    font-weight: normal;
    margin: 0;
    line-height: 2.5rem;
}
.section-title h2::after{
    content: "";
    width: 10rem;
    height: 1px;
    background-color: #4F5274;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}
.section-title h3{
    font-weight: normal;
    color: #4F5274;
    margin: 0;
    width: 7rem;
    text-align: center;
}

/* About */

#about{
    background: linear-gradient(90deg,#1B1935 0%,#1B1935 50%,#F8F8F5 50%,#F8F8F5 100%);
    border-bottom: #4F5274 solid 5rem;
}

#about .container{
    display: flex;
    justify-content: center;
}

#about #aboutImg{
    background-image: url(../img/thumbnail_1.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    width: 50%;
}

#about #aboutContent{
    width: 50%;
    padding: 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: #F8F8F5;
    text-align: justify;
}

/* Cards */

#cards{
    background: linear-gradient(90deg,#4F5274 0%,#4F5274 50%,#1B1935 50%,#1B1935 100%);
}

#cards .container{
    display: flex;
    justify-content: center;
}

#cards #cardsImg{
    background-image: url(../img/card_0.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    width: 50%;
}

#cards #cardsContent{
    width: 50%;
    padding: 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: #F8F8F5;
    text-align: justify;
    border-top: #4F5274 solid 5rem;
    border-bottom: #4F5274 solid 5rem;
    position: relative;
}
#cards #cardsContent::before{
    content: "";
    background-color: #F8F8F5;
    width: 100vw;
    height: 100%;
    position: absolute;
    right: 0;
}

/* Method */

#method{
    text-align: center;
    margin-bottom: 5rem;
    padding-top: 5rem;
    background-image: url(../img/bg_TR.svg);
    background-repeat: no-repeat;
    background-position: top right;
    background-size: 15vw;
}

#method .container{
    display: flex;
    flex-direction: column;
    gap: 3rem;
    background-image:url(../img/method_bg1.png),url(../img/method_bg2.png);
    background-repeat: no-repeat;
    background-position: top left,bottom right;
    background-size: 30vw;
}

#method .method-contents{
    text-align: start;
    display: flex;
    justify-content: space-between;
}

#method .method-img,
#method .method-text{
    width: 100%;
}

#method .method-img{
    display: flex;
    justify-content: center;
    align-items: center;
}

#method .method-img ul{
    display: flex;
    justify-content: space-around;
}

#method .method-text{
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5%;
}

#method .method-img ul{
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

#method .method-img ul li{
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    border: #1B1935 solid 5px;
    background: #4F5274;
    color: white;
    aspect-ratio: 40/63;
    margin-bottom: 2%;
}

.card-l li{width: 30%;}
.card-m li{width: 30%;}
.card-s li{width: 18%;}


 /* Reading */

 #reading{
    background-image: url(../img/reading_bgL.svg),url(../img/reading_bgR.svg);
    background-repeat: no-repeat;
    background-position: left,right;
    background-size: contain;
    margin-bottom: 5rem;
    padding: 1rem 0;
 }
 #reading .container{
    text-align: center;
 }

#reading .img-card{
    width: 160px;
    height: 252px;
}

#reading ul{
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

#reading #readingResult{
    display: flex;
    justify-content: center;
    gap: 1rem;
    text-align: justify;
}

#reading #readingResultImg{
    box-shadow: 0px 10px 10px -6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1;
    transition: 0.3s;
    height: 100%;
    max-width: 20vw;
    border-radius: 5px;
    aspect-ratio: 160 / 252;
}
#readingResultImg.animate {
    transform: scaleX(0);
  }

#reading #readingResultImg:hover{
    filter: brightness(125%);
}
#reading #readingResultImg.no-hover:hover{
    filter: none;
}

#readingResultText{
    display: none;
    opacity: 0;
    transition: 0.3s ease;
}

/* Detail */

#detail{
    background-image: url(../img/bg_BL.svg);
    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: 15vw;
    padding-bottom: 5rem;
}

#detail .container{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

#detail ul{
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

#detail li{
    width: 360px;
    height: 240px;
    display: flex;
    overflow: hidden;
    background-color: #1B1935;
    justify-self: center;
    align-items: center;
}

#detail li img{
    width: 100%;
}

#detail #detailTable{
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#detail #detailTable .detail-category{
    display: flex;
}

#detail #detailTable .detail-th,
#detail #detailTable .detail-tb{
    width: 100%;
}

#detail #detailTable .detail-th{
    display: flex;
    justify-content: center;
    align-items: center;
}

#detail #detailTable dl{
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

#detail #detailTable dt,
#detail #detailTable dd{
    margin: 0;
    width: 50%;
}

#detail #detailTable dt,
#detail #detailTable p{
    text-align: center;
}

/* フッター */

footer{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1B1935;
    color: #4F5274;
}

.hamburger{
    background: none;
    border: none;
}

/* レスポンシブ */

@media screen and (max-width:1024px) {
    header{
        position: fixed;
        top: 0;
        z-index: 10;
        width: 100%;
        height: 5rem;
        transition: 0.2s ease;
    }
    header #logo{
        z-index: 1;
    }
    header.open{
        background-color: #1B1935;
    }
    header #headerNav{
        position: absolute;
        width: 100%;
        top: -100vh;
        transition: 0.3s ease;
    }
    header #headerNav.open{
        top: 100%;
        height: calc(100vh - 100%);
        overflow: auto;
        background-color: rgba(27, 25, 53, 0.95);
    }
    header #headerNav #headerMenu{
        display: none;
    }
    header #headerNav.open #headerMenu{
        display: block;
        width: 100%;
        flex-direction: column;
    }
    header #headerNav #headerMenu li a{
        width: 100%;
        color: white;
        border-left: none;
        border-bottom: #8F8E8E solid 1px;
    }
    .hamburger {
        width: 50px;
        height: 80px;
        position: relative;
        appearance: none;
        border: 0;
        padding: 0;
        margin: 0;
        margin-right: 3%;
        cursor: pointer;
      }
      .hamburger span,
      .hamburger span::after,
      .hamburger span::before {
        position: absolute;
        display: block;
        content: "";
        width: 100%;
        height: 3px;
        border-radius: 3px;
        background-color: #1B1935;
        transition: all 0.3s ease;
        z-index: 1;
      }
      .hamburger span::before {
        top: -10px;
      }
      .hamburger span::after {
        bottom: -10px;
      }
      .hamburger.open span {
        transform: rotate(90deg);
        background-color: transparent;
      }
      .hamburger.open span::before {
        top: 0;
        transform: rotate(45deg);
        background-color: #F8F8F5;
      }
      .hamburger.open span::after {
        bottom: 0;
        transform: rotate(-45deg);
        background-color: #F8F8F5;
      }
}

@media screen and (max-width:768px){

    header #headerNav ul li a:hover{
        background-color: transparent;
    }

    #main{
        max-height: 100vh;
        padding-top: 5rem;
    }
    #main::before{
        left: 50%;
        transform: translateX(-50%);
    }
    #main main::before{
        background-image: url(../img/bg_TL.svg);
        background-size: 50%;
        background-position: top left;
    }
    #main main::after{
        background-image: url(../img/bg2_BR.svg);
        background-size: 50%;
        background-position: bottom right;
    }
    #main #mainCard_back{
        width: 300%;
    }
    #main #mainCard_front{
        width: 250vh;
        max-width: 500%;
        margin-top: -12vw;
    }
    
    .container{
        padding: 0;
    }
    #about {
        background: transparent;
        border: none;
    }
    #about .container{
        flex-direction: column;
    }
    #about #aboutImg{
        width: 100%;
        height: 50vh;
        background-color: #1B1935;
        border-top: #1B1935 solid 3rem;
        border-bottom: #1B1935 solid 3rem;
    }
    #about #aboutContent{
        width: 100%;
    }
    #cards{
        background: #F8F8F5;
    }
    #cards .container{
        flex-direction: column-reverse;
    }
    #cards #cardsImg{
        width: 100%;
        height: 50vh;
        background-color: #1B1935;
        border-top: #1B1935 solid 3rem;
        border-bottom: #1B1935 solid 3rem;
    }
    #cards #cardsContent{
        width: 100%;
        border: none;
    }
    #cards #cardsContent::before{
        display: none;
    }

    #method{
        background-image: none;
    }
    #method .container{
        padding: 0 3%;
        background-size:contain;
    }
    #method .method-contents{
        flex-direction: column;
    }
    #method .method-img.nine-card ul{
        gap: 1rem;
    }
    #method .method-img.nine-card ul li{
        width: 25%;
        justify-content: center;
    }
    #reading{
        background: none;
    }
    #reading #readingResult{
        gap: 0;
    }
    #readingResultImgWrap{
        padding: 5%;
        width: 100%;
        height: 50vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #reading #readingResultText{
       padding: 0 5% 2.5% 5%;
    }
    #reading #readingResultText p{
        background-color: #F8F8F5;
    }
    #reading #readingResult{
        width: 100%;
        margin: 0 auto;
        background-image: url(../img/bg_TL.svg), url(../img/bg_TR.svg), url(../img/bg2_BR.svg), url(../img/bg_BL.svg);
        background-repeat: no-repeat;
        background-position: top left -20%,top right -20%,bottom right -20%,bottom left -20%;
        background-size: contain;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #reading #readingResultImg{
        max-width: 100%;
    }

    #detail ul{
        flex-direction: column;
    }
    #detail li{
        width: 100%;
    }
    #detail #detailTable .detail-category{
        flex-direction: column;
    }
    #detail #detailTable dt{
        width: 30%;
    }
    #detail #detailTable dd{
        width: 70%;
    }
}


/* ここからギャラリーページ */

#galleryMain{
    background-color: rgba(27, 25, 53, 0.9);
    background-image: url(../img/card_0.jpg);
    background-blend-mode: overlay;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    height: 20vw;
    min-height: 10rem;
    max-height: 15rem;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#galleryMain > *{
    margin: 0;
    font-weight: normal;
}

#loading-message{
    text-align: center;
}

#sort-buttons{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-top: 0;
}

#sort-buttons button{
    border: none;
    background: none;
    cursor: pointer;
    color: #4F5274;
}
#sort-buttons button.active{
    font-weight: bold;
    color: #1B1935;
}

#gallery{
    background-image: url(../img/bg_TL.svg),url(../img/bg2_BR.svg);
    background-repeat: no-repeat;
    background-position: top left,bottom right;
    background-size: calc(100% / 8);
    text-align: center;
}

#gallery .container {
    display: flex;
    flex-direction: column;
    height: auto;
}

#gallery .container .section-text p{
    margin-bottom: 0;
}

#gallery #galleryList {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: auto;
    gap: 2vw;
    transition: all 0.3s ease-in-out; 
    grid-auto-flow: dense;
}

#gallery #galleryList img {
    width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease; 
    grid-column: auto;
    grid-row: auto;
    border: solid 0 #1B1935;
}
#gallery #galleryList img:hover{
    filter: brightness(110%);
    border: solid 5px #1B1935;
}

#gallery #button .button{
    display: inline-block;
    margin: 5% 0;
}

  

/* モーダルのスタイル */

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(27, 25, 53, 0.9);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.modal-content {
  position: absolute;
  width: 90vw;
  height: 80vh;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #F8F8F5;
  padding: 1%;
}

.modal-content::before,
.modal-content::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

/* 上部の二等辺三角形 */
.modal-content::before {
  bottom: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 45vw 5vh 45vw;
  border-color: transparent transparent #F8F8F5 transparent;
}

/* 下部の二等辺三角形 */
.modal-content::after {
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 5vh 45vw 0 45vw;
  border-color: #F8F8F5 transparent transparent transparent;
}
.modal-content-bg1,
.modal-content-bg2{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4vw;
    height: 6vh;
    background-image: url('../img/icon.svg'); 
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    z-index: 1;
}
.modal-content-bg1{
    bottom: 99%;
  }
  .modal-content-bg2{
    top: 99%; 
  }


.modal-content-wrap {
    display: flex;
    height: 100%;
    overflow: auto;
    justify-content: space-between;
    gap: 1rem;
    transition: opacity 0.2s ease;
    opacity: 1;
}
.modal-content-wrap.show {
    transition: opacity 0.3s ease;
    opacity: 1;
}
#modal-images{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#modal-image{
    text-align: center;
}
#modal-images img{
    height: calc(80vh - 4vw);
    border-radius: 10px;
}
#modal-character{
    margin: 0;
    color: white;
    text-indent: 1rem;
}

#modal-text{
    width: calc(100% - 50vh);
    overflow: auto;
    display: flex;
    flex-direction: column;
}

#modal-name + p{
    margin-bottom: 0;
}

#modal-keywords{
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#modal-negaposi{
    color: #8F8E8E;
}
#modal-negaposi::before{
    content: "◇";
}

#same-category{
    margin-top: auto;
}
#modal-same-category-images{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2%;
}
#modal-same-category-images img{
    width: 100%;
    cursor: pointer;
    border-radius: 5px;
    border: solid 0 #1B1935;
    transition: 0.2s ease;
}
#modal-same-category-images img:hover{
    border: solid 5px #1B1935;
    filter: brightness(110%);
}
.close{
    width: 3vw;
    height: 3vw;
    position: absolute;
    cursor: pointer;
    right: 1vw;
    top: 2vh;
    transition: 0.2s ease;
    z-index: 1;
}
.close::before,.close::after{
    content: "";
    text-decoration: none;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background-color: white;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.close::before{
    transform: rotate(45deg);
}
.close::after{
    transform: rotate(-45deg);
}
.close:hover{
    opacity: 0.5;
}

#prev-btn,#next-btn{
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(1,10);
    font-size: 2vw;
    transition: 0.2s ease;
}
#prev-btn{
    left: 1vw;
}
#next-btn{
    right: 1vw;
}

#prev-btn:hover,#next-btn:hover{
    opacity: 0.5;
}

.autumn{background-color:#EA8F42}
.winter{background-color:#7692A5}
.spring{background-color:#E786A8}
.summer{background-color:#4EC6A5}
.heavy{background-color:#27562D}
.six{background-color:#43424C}

@media screen and (max-width:1024px){
    #galleryMain{
        margin-top: 5rem;
    }
    .modal-content-wrap{
        display: block;
    }
    .modal-content{
        padding: 5%;
    }
    #modal-character{
        margin-top: 1rem;
    }
    #modal-images img{
        height: 60vh;
    }
    #modal-text{
        width: 100%;
    }

}

@media screen and (max-width:768px) {
    #gallery .container{
        padding: 0 5%;
    }
    #gallery #galleryList{
        grid-template-columns: repeat(3, 1fr);
    }
    .close{
        width: 8%;
        top: 3%;
        right: 3%;
    }
    #prev-btn, #next-btn{
        color: #1B1935;
        width: calc(20% - 15vw);
    }
    #prev-btn{
        left: 5vw;
    }
    #next-btn{
        right: 5vw;
    }
    .modal-content-bg1,
    .modal-content-bg2{
    width: calc(10% - 1vw);
}
}