body.gallery {
    margin: 0;
}

body.gallery main {
    background: url(../images/index/bgc_br.svg) left top repeat;
    display: block;
    padding-top: 7rem;
}

body.gallery section.gallery {
    padding: 0 0 5rem;
}

body.gallery .gallery_tabs {
    color: #fff;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    width: fit-content;
    margin: 3rem auto 4rem;
}

body.gallery .gallery_tabs .tab {
    border: solid 1px #fff;
    padding: 0.5rem 2rem;
    cursor: pointer;
    background: transparent;
    color: #fff;
}

body.gallery .gallery_tabs .tab.active {
    border: solid 1px #623e40;
    padding: 0.5rem 2rem;
    background-color: #fff;
    color: #623e40;
}

/* Masonry対応のギャラリーコンテナ */
.alm-listing {
  position: relative;
  margin: 0 auto;
  max-width: 100%;
}

.gallery_items.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Masonry用のアイテム設定 */
.gallery_item {
  width: calc(25% - 12px);
  margin-bottom: 12px;
  box-sizing: border-box;
  break-inside: avoid;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease;
}

.gallery_item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery_item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.gallery_item img:hover {
  transform: scale(1.05);
}

/* ロードモアボタン */
.gallery_box .alm-load-more-btn {
  display: block;
  margin: 2rem auto;
  color: #fff;
  border: solid 1px #fff;
  padding: 0.5rem 0;
  text-align: center;
  min-width: 300px;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s ease;
}

.gallery_box .alm-load-more-btn:hover {
  color: #623e40;
  border: solid 1px #623e40;
  background-color: #fff;
}

.gallery_box .alm-load-more-btn.done {
  display: none !important;
}

.alm-btn-wrap {
  text-align: center;
  margin-top: 40px;
}

@media screen and (max-width: 1024px) and (min-width: 768px) {
  .gallery_item {
    width: calc(33.333% - 12px);
  }
}

@media(max-width: 767px){
    body.gallery .gallery_tabs {
        gap: 0;
    }

    body.gallery .gallery_tabs .tab {
        width: calc((100% - 20px) / 2);
        padding: 0.5rem 0;
        text-align: center;
        margin: 0 20px 20px 0;
    }
	
	body.gallery .gallery_tabs .tab.active {
		padding: 0.5rem 0;
	}

    body.gallery .gallery_tabs .tab:nth-of-type(even) {
        margin-right: 0;
    }

    .gallery_item {
      width: calc(50% - 12px);
    }
}