@charset "UTF-8";
/* CSS Document */

/*=================
ギャラリー
===================*/
#gallery {
    margin-top: 30px;
}
#gallery .-w-wrapper {
    border-radius: 6px;
    overflow: hidden;
}
#gallery h2 {
    text-align: center;
}

/* ギャラリー全体 */
@media (min-width: 769px) {
    #gallery .-w-wrapper {
        padding: 0 20px;
    }
}
.gallery-grid {
    display: grid;
    grid-template-columns: 1.7fr 1.1fr 0.7fr 1.1fr;
    grid-template-rows: repeat(2, 0.7fr);
    gap: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.gallery-grid:nth-of-type(n + 2) {
    margin-top: 15px;
}

.gallery-grid .tall { grid-area: 1 / 1 / 3 / 2; }
.gallery-grid .item:nth-child(2) { grid-area: 1 / 2 / 2 / 3; }
.gallery-grid .item:nth-child(3) { grid-area: 1 / 3 / 2 / 5; }
.gallery-grid .item:nth-child(4) { grid-area: 2 / 2 / 3 / 4; }
.gallery-grid .item:nth-child(5) { grid-area: 2 / 4 / 3 / 5; }

.gallery-grid .item {
  overflow: hidden;
}
.gallery-grid .item img,.gallery-grid .item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.gallery-grid .item img:hover,.gallery-grid .item video:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.gallery-grid .tall img {
    aspect-ratio: 1 / 1;
}

/*リバース*/
.gallery-grid.reverse {
    grid-template-columns: 1.1fr 0.7fr 1.1fr 1.7fr;
}
.gallery-grid.reverse .tall { grid-area: 1 / 4 / 3 / 5; }
.gallery-grid.reverse .item:nth-child(2) { grid-area: 1 / 1 / 2 / 2; }
.gallery-grid.reverse .item:nth-child(3) { grid-area: 1 / 2 / 2 / 4; }
.gallery-grid.reverse .item:nth-child(4) { grid-area: 2 / 1 / 3 / 3; }
.gallery-grid.reverse .item:nth-child(5) { grid-area: 2 / 3 / 3 / 4; }

/* ボタン */
#gallery .btn {
    margin: 40px auto 0;
    text-align: center;
    width: fit-content;
}
#gallery .btn a {
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 1.6rem;
    font-weight: 500;
    padding-right: 24px;
    transition: 0.3s;
}
#gallery .btn a span {
    position: relative;
    display: inline-block;
    margin-left: 20px;
    width: 7px;
    height: 10px;
}
#gallery .btn a span::after {
    content: '';
    background: url("../img/top/arrow_right_bl.svg") no-repeat;
    background-size: contain;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-45%);
    transition: 0.3s;
}

#gallery .btn a:hover {
    opacity: 0.8;
}
#gallery .btn a:hover span::after {
    left: 3px;
}


/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}
.modal img {
  max-width: 700px;
  max-height: 90vh;
  display: block;
  margin: auto;
  object-fit: contain;

  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.modal .youtube {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 1000px;
  min-width: 700px;
}
.modal .youtube iframe {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  overflow: hidden;
}
.modal video {
    max-width: 1000px;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 3px;
}

.modal .close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
}

.modal img {
  animation: zoomIn 0.4s ease;
}
@keyframes zoomIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .gallery-grid,.gallery-grid.reverse {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 8px;
        border-radius: 0;
    }
    .gallery-grid:nth-of-type(n + 2) {
        margin-top: 8px;
    }
    .gallery-grid .tall,
    .gallery-grid .item:nth-child(2),
    .gallery-grid .item:nth-child(3),
    .gallery-grid .item:nth-child(4),
    .gallery-grid .item:nth-child(5) {
        grid-area: auto;
    }
    .gallery-grid.reverse .tall,
    .gallery-grid.reverse .item:nth-child(2),
    .gallery-grid.reverse .item:nth-child(3),
    .gallery-grid.reverse .item:nth-child(4),
    .gallery-grid.reverse .item:nth-child(5) {
        grid-area: auto;
    }

    .gallery-grid .item {
        aspect-ratio: 1 / 1;
    }
    #gallery .btn {
        margin: 24px auto 0;
    }
    .modal img {
        max-width: 84vw;
        max-height: 70vh;
    }
    .modal .youtube {
        min-width: 300px;
        max-width: 92vw;
        max-height: 70vh;
    }
    .modal video {
        min-width: 300px;
        max-width: 92vw;
        max-height: 70vh;
    }
}