/* ─────────────────────────────────────
   ギャラリーグリッド
───────────────────────────────────── */

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

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

/* 各アイテム */
.gallery-item {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #F5F7FA;
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 44px;
}

/* 画像本体 */
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

/* Lazy Load 完了後にフェードイン */
.gallery-img.is-loaded {
    opacity: 1;
}

/* 1枚目（eager load）は最初から表示 */
.gallery-img[loading="eager"] {
    opacity: 1;
}

.gallery-item a:hover .gallery-img,
.gallery-item a:focus .gallery-img {
    transform: scale(1.04);
}

/* ─────────────────────────────────────
   アルバムセクション
───────────────────────────────────── */

.album-section {
    margin-bottom: 64px;
}

.album-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
}

.album-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1B3A6B;
    margin: 0;
}

.album-date {
    font-size: 0.875rem;
    color: #6E6E73;
}

/* ─────────────────────────────────────
   ページヘッダー
───────────────────────────────────── */

.page-gallery {
    padding: 60px 0 80px;
}

.page-header {
    margin-bottom: 48px;
}

.page-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1B3A6B;
    margin: 0 0 8px;
}

.page-lead {
    color: #6E6E73;
    font-size: 1rem;
    margin: 0;
}

.no-albums {
    color: #6E6E73;
    text-align: center;
    padding: 48px 0;
}

/* ─────────────────────────────────────
   Lightbox
───────────────────────────────────── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: lb-fade-in 0.2s ease;
}

@keyframes lb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-inner {
    position: relative;
    max-width: min(1200px, 95vw);
    max-height: 95vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media {
    text-align: center;
}

.lightbox-picture {
    display: block;
}

.lightbox-img {
    max-width: min(1200px, 90vw);
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin-inline: auto;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 10px;
    letter-spacing: 0.05em;
}

/* ボタン共通 */
.lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.lightbox-btn:hover,
.lightbox-btn:focus {
    background: rgba(255, 255, 255, 0.30);
    outline: 2px solid rgba(255, 255, 255, 0.6);
}

.lightbox-close {
    top: -52px;
    right: 0;
    font-size: 20px;
}

.lightbox-prev {
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 767px) {
    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }
    .lightbox-close { top: -48px; right: 4px; }
    .lightbox-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}