.p-gallery-block {
    padding: 0 0 80px;
}

.p-gallery-block__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.p-gallery-block__header {
    text-align: center;
    margin-bottom: 40px;
}

.p-gallery-block__title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 16px;
}

.p-gallery-block__description {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
}

/* フィルター */
.p-gallery-block__filter {
    margin-bottom: 30px;
    display: flex; /* フィルターグループを横並びに */
    justify-content: space-between; /* ALLボタンとスタッフプルダウンを両端に配置 */
    align-items: center;
    flex-wrap: wrap; /* 要素が多い場合に折り返す */
}

/* PC用フィルター */
.p-gallery-block__filter-pc {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* グループ間の隙間 */
    align-items: center; /* グループ内の要素を垂直中央揃え */
    flex-grow: 1; /* スタイルタイプフィルターが左側のスペースを占めるように */
}

.p-gallery-block__filter-group {
    display: flex; /* ラベルとリスト（またはプルダウン）を横並びに */
    align-items: center;
    gap: 10px; /* ラベルと要素の隙間 */
}

.p-gallery-block__filter-label {
    font-weight: bold;
    white-space: nowrap; /* ラベルが改行しないように */
}

.p-gallery-block__filter-list {
    display: flex; /* アイテムを横並びに */
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px; /* アイテム間の隙間 */
}

.p-gallery-block__filter-item {
    /* ボタンのスタイルは既存のものを利用 */
}

.p-gallery-block__filter-button {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background-color: #eee;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

/* スタイルタイプのボタンに適用するスタイル */
.p-gallery-block__filter-group--style .p-gallery-block__filter-item .p-gallery-block__filter-button {
  position: relative;
  display: block; /* ボタンをブロック要素にする */
  overflow: hidden;
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid #ccc; /* 既存のスタイルを維持または調整 */
  background-color: #fff; /* 既存のスタイルを維持または調整 */
  color: #333; /* 既存のスタイルを維持または調整 */
  transition: none; /* アニメーションで背景色を制御するため無効化 */
}

.p-gallery-block__filter-group--style .p-gallery-block__filter-item .p-gallery-block__filter-button::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  border-radius: 50px;
  background: #f5f5f5; /* 非アクティブ時の背景色 */
  pointer-events: none;
  content: "";
  transform: translateX(-100%);
  -webkit-animation: nav-link-leave 0.5s cubic-bezier(0.19, 1, 0.22, 1);
          animation: nav-link-leave 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  -webkit-animation-fill-mode: forwards;
          animation-fill-mode: forwards;
}

.p-gallery-block__filter-group--style .p-gallery-block__filter-item .p-gallery-block__filter-button:hover::before,
.p-gallery-block__filter-group--style .p-gallery-block__filter-item.is-active .p-gallery-block__filter-button::before {
  background: #35417a; /* ホバー・アクティブ時の背景色をウェブサイトの青色に合わせる */
  -webkit-animation-name: nav-link-enter;
          animation-name: nav-link-enter;
}

/* ALLボタンのアクティブ時のテキスト色 */
.p-gallery-block__filter-group--style .p-gallery-block__filter-item.is-active .p-gallery-block__filter-button {
    color: #886d15; /* アクティブ時のテキスト色 */
}

/* ALLボタン以外のホバー・アクティブ時のテキスト色 */
.p-gallery-block__filter-group--style .p-gallery-block__filter-item:not([data-filter="all"]).is-active .p-gallery-block__filter-button {
    color: #886d15;
}

/* モバイル用フィルター */
.p-gallery-block__filter-sp {
    display: flex;
    gap: 10px;
    width: 100%; /* モバイルでは幅いっぱいに */
    flex-direction: column; /* 縦並び */
}

.p-gallery-block__filter-sp .p-gallery-block__filter-group {
    width: 100%; /* グループを幅いっぱいに */
}

.p-gallery-block__filter-sp .p-gallery-block__filter-group--style .p-gallery-block__filter-list {
    width: 100%; /* スタイルタイプリストを幅いっぱいに */
}

.p-gallery-block__filter-sp .p-gallery-block__filter-select {
    width: 100%; /* プルダウンを幅いっぱいに */
}

.p-gallery-block__filter-select select {
    width: 100%; /* ドロップダウンを親要素の幅に合わせる */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    /* 必要に応じてその他のスタイルを追加 */
}

/* 768px以下のスクリーンサイズでPC用フィルターを非表示、モバイル用フィルターを表示 */
@media (max-width: 768px) {
    .p-gallery-block__filter-pc {
        display: none;
    }
    .p-gallery-block__filter-sp {
        display: flex;
    }
    
}

/* 769px以上のスクリーンサイズでモバイル用フィルターを非表示、PC用フィルターを表示 */
@media (min-width: 769px) {
    .p-gallery-block__filter-pc {
        display: flex;
    }
    .p-gallery-block__filter-sp {
        display: none;
    }

    .p-gallery-block__filter-group--style {
         /* スタイルタイプは左側に寄せる */
         margin-right: auto; /* これによりスタッフ選択が右に寄る */
    }
    
    .p-gallery-block__filter-group--staff {
        /* スタッフ選択は右側に寄せる */
    }
}

/* ギャラリーリスト */
.p-gallery-block__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.p-gallery-block__item {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.p-gallery-block__item[data-index="0"] { animation-delay: 0.1s; }
.p-gallery-block__item[data-index="1"] { animation-delay: 0.2s; }
.p-gallery-block__item[data-index="2"] { animation-delay: 0.3s; }
.p-gallery-block__item[data-index="3"] { animation-delay: 0.4s; }
.p-gallery-block__item[data-index="4"] { animation-delay: 0.5s; }
.p-gallery-block__item[data-index="5"] { animation-delay: 0.6s; }
.p-gallery-block__item[data-index="6"] { animation-delay: 0.7s; }
.p-gallery-block__item[data-index="7"] { animation-delay: 0.8s; }
.p-gallery-block__item[data-index="8"] { animation-delay: 0.9s; }

.p-gallery-block__item-image {
    position: relative;
    padding-top: 100%;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 8px;
}

.p-gallery-block__item-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.p-gallery-block__item:hover .p-gallery-block__item-img {
    transform: scale(1.05);
}

.p-gallery-block__item-content {
    padding: 0 8px;
}

.p-gallery-block__item-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.p-gallery-block__item-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.p-gallery-block__item-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .p-gallery-block {
        padding: 40px 0;
    }

    .p-gallery-block__title {
        font-size: 24px;
    }

    .p-gallery-block__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    .p-gallery-block__list {
        grid-template-columns: 1fr;
    }
}

/* ページネーション */
.p-gallery-block__pagination {
    margin-top: 40px;
    text-align: center;
}

.p-gallery-block__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 4px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.p-gallery-block__pagination .page-numbers:hover {
    background: #f5f5f5;
}

.p-gallery-block__pagination .page-numbers.current {
    background: #333;
    color: #fff;
    border-color: #333;
}

.p-gallery-block__pagination .prev,
.p-gallery-block__pagination .next {
    padding: 0 16px;
}

@media screen and (max-width: 768px) {
    .p-gallery-block__pagination {
        margin-top: 30px;
    }

    .p-gallery-block__pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        margin: 0 2px;
        padding: 0 8px;
        font-size: 14px;
    }
} 
