.works-modal {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  transition-duration: 0.4s;
}

.works-modal.active {
  opacity: 1;
  transition-duration: 0.4s;
  pointer-events: initial;
}

.modal-close {
  position: absolute;
  right: 32px;
  top: 32px;
  width: 40px;
  height: 40px;
  font-size: 2.4rem;
  background-color: #fff;
  border: none;
  color: #000;
}
.modal-close i {
  position: relative;
  display: block;
}
.modal-close i::before {
  content: "";
  position: absolute;
  left: 15%;
  top: 50%;
  width: 70%;
  height: 2px;
  transform: rotate(45deg);
  background-color: #000;
}
.modal-close i::after {
  content: "";
  position: absolute;
  left: 15%;
  top: 50%;
  width: 70%;
  height: 2px;
  transform: rotate(-45deg);
  background-color: #000;
}

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    margin-top: 5vh;
    margin-bottom: 5%;
    padding: 2rem;
    width: 100%;
    padding: 80px;
    overflow-y: auto;
    height: 90vh;
}

.modal-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.modal-left,
.modal-right {
  width: 48.75%;
}

.main-image-outer {
  width: 100%;
  aspect-ratio: 1/0.75;
}
.main-image-outer img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

.modal-sub-images {
    display: flex;
	flex-wrap:wrap;
	justify-content:space-between;
    gap: 0;
    margin-top: 1rem;
}
.modal-sub-images::after {
	content:"";
	width:32%;
}

.modal-sub-images li {
  position: relative;
  aspect-ratio: 1/0.75;
  width:32%;
}

.sub-image-thumb {
  width: 100%;
  height:auto;
  aspect-ratio: 1/0.75;
  cursor: pointer;
  -o-object-fit: cover;
     object-fit: cover;
  margin-bottom: 10px;
	display:block;
}

.image-alt{
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #fff;
  background-color: #111A39;
  padding: 2px;
  border-radius: 0px;
}
.sub-image-thumb:hover {
  border-color: #111A39;
}

.modal-right h2 {
  font-size: 2.4rem;
  color: #000;
}
.modal-right .modal-categories {
  margin-top: 8px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  justify-content: last baseline;
}
.modal-right .modal-categories li {
  border: solid #111A39 1px;
  color: #111A39;
  font-size: 1.4rem;
  text-align: center;
  padding: 2.4px 8px;
}

@media screen and (min-width: 750px) and (max-width: 1024px) {
	.workspage-archive .works-list {
		justify-content: space-between;
		gap: 16px 0;
		/* 代わりにgapで間隔調整 */
	  }
	  .workspage-archive .works-list .works-item {
		width: 48.75%;
	  }
	  .workspage-archive .works-list .works-item .terms {
		margin-top: 8px;
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
	  }
	  .workspage-archive .works-list .works-item .terms li {
		width: 90%;
		padding: 2.4px 8px;
	  }
	.modal-content{
		padding:32px;
	}
	.modal-close{
		top:16px;
		right:16px;
	}
}

@media screen and (max-width: 750px) {
  .workspage-search {
    margin-top: 40px;
  }
  .workspage-search__container {
    padding: 24px 16px;
  }
  .workspage-search__container .lr {
    display: block;
  }
  .workspage-search__container .lr .left .heading {
    font-size: 1.6rem;
  }
  .workspage-search__container .lr .right {
    margin-top: 8px;
    padding-left: 0px;
  }
  .workspage-search__container .lr .right select {
    width: 100%;
    padding: 8px;
    font-size: 1.4rem;
  }
  .workspage-archive {
    padding-top: 40px;
  }
  .workspage-archive .works-list {
    justify-content: space-between;
    gap: 16px 0;
    /* 代わりにgapで間隔調整 */
  }
  .workspage-archive .works-list .works-item {
    width: 48.75%;
  }
  .workspage-archive .works-list .works-item h3 {
    font-size: 1.5rem;
  }
  .workspage-archive .works-list .works-item .terms {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .workspage-archive .works-list .works-item .terms li {
    width: 90%;
    font-size: 1.2rem;
    padding: 2.4px 8px;
  }
  .modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
  }
  .modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
  }
  .modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    margin-top: 0;
    margin-bottom: 0;
    padding: 2rem;
    width: 100%;
    margin-top: 20px;
    max-height: calc(100vh - 40px);
    padding: 64px 16px;
	overflow-y:auto;
  }
  .modal-flex {
    display: block;
  }
  .modal-left,
  .modal-right {
    width: 100%;
  }
	.sub-image-thumb {
		aspect-ratio: 1 / 0.75;
    height: auto;
    margin-bottom: 0;
	}
  .image-alt{
    position: initial;
    margin-top: 0px;
    font-size: 1rem;
    margin-bottom: 0px;
  }
  .modal-sub-images {
    display: flex;
	flex-wrap:wrap;
    justify-content:space-between;
    margin-top: 1rem;
      gap:8px 0;
      overflow-x:auto;
      overflow-y:hidden;
  }
  .modal-sub-images li {
    width: 48.75%;
  }
  .modal-right {
    border-top: solid 1px #eee;
    padding-top: 16px;
    margin-top: 16px;
  }
  .modal-right h2 {
    font-size: 1.7rem;
  }
  .modal-right .modal-categories {
    flex-wrap: wrap;
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
  }
  .modal-right .modal-categories li {
    font-size: 1.25rem;
    padding: 2.4px 8px;
  }
}