/* モーダルウィンドウに関するcssファイル */

:root {
  --animationCurve: 500ms cubic-bezier(0.165, 0.840, 0.440, 1.000);
  --lineCol: rgb(181, 181, 181);
}

.modalOverlay {
  filter: brightness(100%);
  position: relative;
  transition: filter var(--animationCurve);
}

/* ポインター */
[data-modalbtn] {
  width: 5%;
  aspect-ratio: 1/1;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, .2);
  position: absolute;
  z-index: 5;
  transform: scale(1);
  transition: transform 300ms cubic-bezier(0.165, 0.840, 0.440, 1.000);
  cursor: pointer;
}
[data-modalbtn]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1.5px;
  height: 30%;
  background-color: #fff;
}
[data-modalbtn]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  height: 1.5px;
  background-color: #fff;
}
[data-modalbtn="btn1"]{
  top: 12%;
  right: 25.7%;
}
[data-modalbtn="btn2"]{
  top: 43.5%;
  right: 12.5%;
}
[data-modalbtn="btn3"]{
  top: 4%;
  left: 5%;
}
[data-modalbtn="btn4"]{
  top: 17%;
  left: 50.5%;
  background-color: rgba(0, 0, 0, .25);
}
[data-modalbtn="btn5"]{
  top: 70%;
  right: 15%;
}

/* モーダルウィンドウ */
.modalWindow {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--animationCurve);
}
.modalImg {
  width: 25vw;
  aspect-ratio: 1/1;
  /* border: 1px solid #000; */
  border-radius: 50%;
  overflow: hidden;
  transform: scale(0.7);
  opacity: 0.6;
  transition: transform var(--animationCurve),
              opacity var(--animationCurve);
}
.modalWindow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block; 
}
.modalCaptionOverlay {
  background-color: #fff;
  width: max-content;
  position: absolute;
  top: 85%;
  left: 50%;
  padding: 7%;
  padding-left: 10%;
  display: grid;
  grid-template-columns: 1px 0.8em auto;
  grid-template-rows: auto 1px auto;
  transform: translateY(20%);
  transition: transform var(--animationCurve);
}
.modalCaptionOverlay::before {
  content: '';
  grid-column: 1;
  grid-row: 1 / 4;
  background-color: var(--lineCol);
}
.modalCaptionOverlay::after {
  content: '';
  grid-column: 1 / 4;
  grid-row: 2;
  background-color: var(--lineCol);
  position: relative;
  left: -20px;
  width: calc(100% + 20px);
}
.modalCaptionOverlay h3 {
  grid-column: 3;
  grid-row: 1;
  font-size: 17px;
  font-weight: 600;
  padding: 10px;
  padding-left: 5px;
}
.modalCaptionOverlay p {
  font-size: 14px;
  white-space: nowrap;
  line-height: 2.2;
  grid-column: 3;
  grid-row: 3;
  padding: 10px;
  padding-left: 20px;
}
.p_small {
  font-size: 13px;
}
.modalBackdrop {
  display: none;
}
.closeBtn {
  width: 60px;
  aspect-ratio: 1 / 1;
  background-color: rgba(255, 255, 255, .3);
  position: absolute;
  top: 20px;
  right: 20px;
}
.closeBtn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: #fff;
  width: 1px;
  height: 40px;
  transform: translate(-50%, -50%) rotate(45deg);
  z-index: 10;
}
.closeBtn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background-color: #fff;
  width: 1px;
  height: 40px;
  transform: translate(-50%, -50%) rotate(-45deg);
  z-index: 10;
}


.modalOverlay.active {
  filter: brightness(60%);
}
.modalWindow.active {
  opacity: 1;
  transition: opacity var(--animationCurve);
}
.modalWindow.active .modalImg{
  transform: scale(1.0);
  opacity: 1;
  transition: transform var(--animationCurve),
              opacity var(--animationCurve);
}
.modalWindow.active .modalCaptionOverlay{
  transform: translateY(0%);
}

/* アニメーション */
[data-modalbtn]:hover {
  transform: scale(1.2);
}


/* モーダルのレスポンシブ */
@media screen and (max-width: 768px) {
  [data-modalbtn] {
    width: 12%;
    border: 1px solid #fff;
    z-index: 10;
  }
  [data-modalbtn]::before {
    width: 1px;
  }
  [data-modalbtn]::after {
    height: 1px;
  }

  [data-modalbtn="btn1"]{
    top: 9%;
    right: 30.5%;
  }
  [data-modalbtn="btn2"]{
    top: 40%;
    right: 9%;
  }
  [data-modalbtn="btn3"]{
    top: 4%;
    left: 3%;
  }
  [data-modalbtn="btn4"]{
    top: 12%;
    left: 47%;
  }
  [data-modalbtn="btn5"]{
    top: 48%;
    right: 7%;
  }

  .modalWindow {
    top: 20%;
    z-index: 15;
  }
  .modalBackdrop {
    display: block;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition: background-color 500ms cubic-bezier(0.165, 0.840, 0.440, 1.000);
    z-index: 10;
  }
  .modalBackdrop.active{
    visibility: visible;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, .6);
  }
  .modalImg {
    width: 75vw;
  }
  .modalCaptionOverlay {
    width: 80vw;
    top: 90%;
    left: 50%;
    transform: translateX(-50%) translateY(20%);
  }
  .modalWindow.active .modalCaptionOverlay {
    transform: translateX(-50%) translateY(0%);
  }
  .modalCaptionOverlay h3 {
    padding-left: 0px;
  }
  .modalCaptionOverlay p {
    padding-left: 5px;
  }
}