/* ギャラリーアーカイブページ */
.p-gallery {
    padding: 0;
    margin-bottom: 120px;
}

.p-gallery__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* フィルター */
.p-gallery__filter {
    margin-bottom: 40px;
}

.p-gallery__filter-pc {
    display: none;
}

@media (min-width: 768px) {
    .p-gallery__filter-pc {
        display: block;
    }

    .p-gallery__filter-sp {
        display: none;
    }
}

.p-gallery__filter-group {
    margin-bottom: 20px;
}

.p-gallery__filter-group:last-child {
    margin-bottom: 0;
}

.p-gallery__filter-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.p-gallery__filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.p-gallery__filter-item {
    margin: 0;
}

.p-gallery__filter-link {
    display: block;
    padding: 8px 16px;
    background-color: #f5f5f5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.p-gallery__filter-link:hover {
    background-color: #e0e0e0;
}

.p-gallery__filter-item.is-active .p-gallery__filter-link {
    background-color: #333;
    color: #fff;
}

/* モバイル用フィルター */
.p-gallery__filter-sp {
    display: block;
}

.p-gallery__filter-select {
    margin-bottom: 15px;
}

.p-gallery__filter-select:last-child {
    margin-bottom: 0;
}

.p-gallery__filter-select-style,
.p-gallery__filter-select-staff {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
}

/* ギャラリー一覧 */
.p-gallery__list {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 30px;
}

@media (min-width: 768px) {
    .p-gallery__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .p-gallery__list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.p-gallery__item {
    margin: 0;
}

.p-gallery__item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.p-gallery__item-link:hover {
    opacity: 0.8;
}

.p-gallery__item-image {
    position: relative;
    padding-top: 100%;
    margin-bottom: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.p-gallery__item-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.p-gallery__item-content {
    padding: 0 5px;
}

.p-gallery__item-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.4;
}

.p-gallery__item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}

.p-gallery__item-style,
.p-gallery__item-staff {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* ページネーション */
.p-gallery__pagination {
    margin-top: 40px;
    text-align: center;
}

.p-gallery__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 5px;
    padding: 0 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.p-gallery__pagination .page-numbers:hover {
    background-color: #e0e0e0;
}

.p-gallery__pagination .current {
    background-color: #333;
    color: #fff;
}

.p-gallery__pagination .prev,
.p-gallery__pagination .next {
    padding: 0 15px;
}

/* ギャラリーシングルページ */
.p-gallery-single {
    padding: 60px 0;
}

.p-gallery-single__inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.p-gallery-single__header {
    margin-bottom: 40px;
    text-align: center;
}

.p-gallery-single__title {
    margin: 0 0 15px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1.4;
}

.p-gallery-single__meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.p-gallery-single__style,
.p-gallery-single__staff {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
}

.p-gallery-single__content {
    margin-bottom: 40px;
}

.p-gallery-single__image {
    margin-bottom: 30px;
    border-radius: 4px;
    overflow: hidden;
}

.p-gallery-single__img {
    width: 100%;
    height: auto;
    display: block;
}

.p-gallery-single__description {
    font-size: 16px;
    line-height: 1.8;
}

.p-gallery-single__description p {
    margin: 0 0 1.5em;
}

.p-gallery-single__description p:last-child {
    margin-bottom: 0;
}

/* 前後の記事へのリンク */
.p-gallery-single__navigation {
    margin-bottom: 40px;
    padding-top: 30px;
    border-top: 1px solid #ddd;
}

.p-gallery-single__nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.p-gallery-single__nav-link {
    display: block;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s ease;
}

.p-gallery-single__nav-link:hover {
    background-color: #e0e0e0;
}

.p-gallery-single__nav-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.p-gallery-single__nav-title {
    display: block;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
}

/* 一覧ページへのリンク */
.p-gallery-single__back {
    text-align: center;
}

.p-gallery-single__back-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s ease;
}

.p-gallery-single__back-link:hover {
    background-color: #e0e0e0;
}

.p-gallery-single__back-icon {
    margin-right: 8px;
}

.p-gallery-single__back-text {
    font-size: 16px;
    font-weight: bold;
}

/* アニメーション */
.p-gallery__item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* アニメーションの遅延 */
.p-gallery__item:nth-child(1) { animation-delay: 0.1s; }
.p-gallery__item:nth-child(2) { animation-delay: 0.2s; }
.p-gallery__item:nth-child(3) { animation-delay: 0.3s; }
.p-gallery__item:nth-child(4) { animation-delay: 0.4s; }
.p-gallery__item:nth-child(5) { animation-delay: 0.5s; }
.p-gallery__item:nth-child(6) { animation-delay: 0.6s; }
.p-gallery__item:nth-child(7) { animation-delay: 0.7s; }
.p-gallery__item:nth-child(8) { animation-delay: 0.8s; }
.p-gallery__item:nth-child(9) { animation-delay: 0.9s; } 