/* 實景相簿（gallery）— 聖路生命禮顧 */
.g-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.g-filter {
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--primary-color, #2c5282);
    background: #fff;
    color: var(--primary-color, #2c5282);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.g-filter:hover {
    background: var(--bg-light, #f0f4f8);
}

.g-filter.active {
    background: var(--primary-color, #2c5282);
    color: #fff;
}

.g-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.g-card {
    margin: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.g-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.g-card:hover img {
    transform: scale(1.05);
}

.g-card figcaption {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    color: #4a5568;
    text-align: center;
}

/* 首頁精選 */
[data-gallery-preview] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

[data-gallery-preview] img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    cursor: zoom-in;
    display: block;
    transition: transform 0.3s;
}

[data-gallery-preview] img:hover {
    transform: scale(1.04);
}

/* 燈箱 */
.g-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.g-lightbox.open {
    display: flex;
}

.g-lightbox figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
}

.g-lightbox img {
    max-width: 92vw;
    max-height: 84vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.g-caption {
    color: #e6edf5;
    font-size: 0.95rem;
    margin-top: 0.8rem;
    text-align: center;
}

.g-lightbox button {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 1.8rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
}

.g-lightbox button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.g-close {
    top: 1.5rem;
    right: 1.5rem;
}

.g-prev {
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.g-next {
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.g-count {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .g-card img {
        height: 130px;
    }

    .g-lightbox button {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.4rem;
    }

    .g-prev {
        left: 0.5rem;
    }

    .g-next {
        right: 0.5rem;
    }
}
