/* モーダルとSwiperのスタイルをここに書く予定 */
/* レイアウト */
.p-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 89.3%;
    gap: 1.25rem;
    margin: 0 auto;
  }
  @media screen and (min-width: 781px) {
    .p-grid {
      display: grid;
      width: 86.32%;
      grid-template-columns: 1fr 1fr;
      row-gap: 3.25rem;
      -moz-column-gap: 1.25rem;
           column-gap: 1.25rem;
    }
  }
  @media screen and (min-width: 1200px) {
    .p-grid {
      width: 85%;
      grid-template-columns: 1fr 1fr 1fr;
    }
  }
  .p-grid__cell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    place-items: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0;
    position: relative;
    z-index: 1000;
  }
  .p-grid__image {
    grid-row: 1/2;
    width: 80%;
  }
  .p-grid__text {
    grid-row: 2/3;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.7rem;
  }
  .p-grid__icon {
    display: flex;
    justify-content: center;
  }

/* swiper */
.p-swiper {
    width: auto;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
  }
  .p-swiper__wrapper {
    /* wrapperのサイズを調整 */
    width: 100%;
    height: 100%;
  }
  .p-swiper__slide {
    /* スライドのサイズを調整、中身のテキスト配置調整、背景色 */
    color: #ffffff;
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 300px;
  }
  .p-swiper__slide:nth-child(3n+1) {
    /*1、4、7、3n+1枚目の背景色 */
    background-color: #3E3E3E;
  }
  .p-swiper__slide:nth-child(3n+2) {
    /*2、5、8、3n+2枚目の背景色 */
    background-color: #707070;
  }
  .p-swiper__slide:nth-child(3n+3) {
    /*3、6、9、3n+3枚目の背景色 */
    background-color: rgba(188, 186, 186, 0.8);
  }
  .p-swiper__slide img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
  
  .swiper-slide {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .swiper-slide img {
    width: 80% !important;
    position: absolute;
    aspect-ratio: 1/1;
  }
  @media screen and (min-width: 1200px) {
    .swiper-slide img {
      width: 45.25% !important;
    }
  }
  
  .swiper-button-next {
    right: 0rem !important;
  }
  @media screen and (min-width: 1200px) {
    .swiper-button-next {
      right: 10px;
    }
  }
  .swiper-button-next::after {
    color: #FFFFFF !important;
    font-size: 1.875rem !important;
  }
  @media screen and (min-width: 1200px) {
    .swiper-button-next::after {
      font-size: 2.75rem !important;
    }
  }
  
  .swiper-button-prev {
    left: 0rem !important;
  }
  @media screen and (min-width: 1200px) {
    .swiper-button-prev {
      left: 10px;
    }
  }
  .swiper-button-prev::after {
    color: #FFFFFF !important;
    font-size: 1.875rem !important;
  }
  @media screen and (min-width: 1200px) {
    .swiper-button-prev::after {
      font-size: 2.75rem !important;
    }
  }
  
  .swiper-pagination-bullets {
    bottom: 1.7% !important;
    position: absolute;
  }
  @media screen and (min-width: 1200px) {
    .swiper-pagination-bullets {
      bottom: 22.7% !important;
    }
  }
  .swiper-pagination-bullet {
    --swiper-theme-color: white;
  }
  
  .swiper-scrollbar {
    display: none;
  }
  
  .swiper,
  .p-swiper {
    touch-action: pan-x pan-y;
  }

  /* モーダルCSS */
  .p-modal__portfolio {
    position: fixed;
    width: 100%;
    height: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    touch-action: none;
  }
  @media screen and (min-width: 1200px) {
    .p-modal__portfolio {
      height: 100%;
      aspect-ratio: unset;
    }
  }
  .p-modal__portfolio.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    overflow: hidden;
  }
  .p-modal__portfolio.is-close {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease; /* 閉じる時: 200ms */
  }
  .p-modal__content {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.4s ease;
    touch-action: pan-x pan-y;
  }
  .p-modal__portfolio.is-open .p-modal__content {
    transform: scale(1);
  }
  .p-modal__close {
    position: absolute;
    top: 0;
    right: 0;
    font-size: clamp(4rem, 4.7vw, 20rem);
    width: 6.5rem;
    height: 10.5rem;
    z-index: 100000000;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
  }
  @media screen and (min-width: 1200px) {
    .p-modal__close {
      top: 0;
      right: 8.5rem;
    }
  }
  
  .js-open-modal {
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: 0.3s;
  }
  .js-open-modal:hover {
    transform: scale(1.08);
  }
  
  body.modal-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    touch-action: none;
  }
  
  #js-content {
    visibility: visible !important;
    opacity: 1 !important;
  }