/* ===========================
   ReFLiA Gallery Page Styles
   =========================== */

/* ページ共通 */
.subpage body {
    background: transparent;
}

/* ページヒーロー（news/membersと統一） */
.page-hero {
    padding: 120px 0 60px;
    text-align: center;
    position: relative;
}

.page-hero__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #2a5a7a;
    margin: 0 0 12px;
}

.page-hero__sub {
    font-size: 0.85rem;
    color: #8ab0c8;
    letter-spacing: 0.15em;
}

.page-hero__line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #64c8f0, #a0dcff);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* ===========================
   フィルター
   =========================== */
.gallery-filter {
    padding: 0 0 40px;
    text-align: center;
}

.gallery-filter__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gallery-filter__btn {
    padding: 8px 22px;
    border: 1.5px solid rgba(100, 200, 240, 0.4);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.7);
    color: #5a8aaa;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.gallery-filter__btn:hover,
.gallery-filter__btn.is-active {
    background: linear-gradient(135deg, #64c8f0, #a0dcff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(100, 200, 240, 0.4);
}

/* ===========================
   グリッド
   =========================== */
.gallery-section {
    padding: 0 0 80px;
}

.gallery-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 48px;
}

@media (max-width: 950px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ===========================
   ギャラリーアイテム
   =========================== */
.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    aspect-ratio: 4 / 3;
    background: rgba(200, 230, 245, 0.3);
}

.gallery-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item__inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
    opacity: 0.3;
}

.gallery-item__img.loaded {
    opacity: 1;
}

.gallery-item:hover .gallery-item__img {
    transform: scale(1.06);
}

.gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: rgba(42, 90, 122, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gallery-item:hover .gallery-item__overlay {
    background: rgba(42, 90, 122, 0.35);
}

.gallery-item__zoom {
    color: #fff;
    font-size: 1.4rem;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .gallery-item__zoom {
    opacity: 1;
    transform: scale(1);
}

.gallery-item__cat {
    position: absolute;
    top: 8px;
    left: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
    background: rgba(100, 200, 240, 0.75);
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ===========================
   MOREボタン
   =========================== */
.gallery-more {
    text-align: center;
    margin-top: 16px;
}

.gallery-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    border: 1.5px solid rgba(100, 200, 240, 0.5);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.7);
    color: #5a8aaa;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.gallery-more__btn:hover {
    background: linear-gradient(135deg, #64c8f0, #a0dcff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 24px rgba(100, 200, 240, 0.45);
    transform: translateY(-2px);
}

/* ===========================
   モーダル
   =========================== */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 30, 50, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-modal__content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
    max-height: 90vh;
}

.gallery-modal__img-wrap {
    position: relative;
    max-width: 80vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal__img {
    max-width: 80vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

.gallery-modal__loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-modal__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(100, 200, 240, 0.3);
    border-top-color: #64c8f0;
    border-radius: 50%;
    animation: modal-spin 0.8s linear infinite;
}

@keyframes modal-spin {
    to { transform: rotate(360deg); }
}

.gallery-modal__close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
    z-index: 2;
}

.gallery-modal__close:hover {
    background: rgba(255,255,255,0.25);
}

.gallery-modal__close span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #fff;
    border-radius: 2px;
}

.gallery-modal__close span:first-child {
    transform: translateY(3.75px) rotate(45deg);
}

.gallery-modal__close span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
}

.gallery-modal__prev,
.gallery-modal__next {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.gallery-modal__prev:hover,
.gallery-modal__next:hover {
    background: rgba(100, 200, 240, 0.4);
    transform: scale(1.1);
}

.gallery-modal__info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.gallery-modal__counter {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.1em;
}

.gallery-modal__alt {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

/* SP対応 */
@media (max-width: 640px) {
    .gallery-modal__prev,
    .gallery-modal__next {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
    }
    .gallery-modal__prev { left: 8px; }
    .gallery-modal__next { right: 8px; }
    .gallery-modal__content {
        gap: 0;
    }
    .gallery-modal__img {
        max-width: 100vw;
        max-height: 80vh;
        border-radius: 0;
    }
}

/* ===========================
   空状態
   =========================== */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #8ab0c8;
}

.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.4;
}

.gallery-empty p {
    font-size: 0.9rem;
    line-height: 1.8;
}

.gallery-empty code {
    background: rgba(100, 200, 240, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    color: #5a8aaa;
}
