/* Self-hosted wedding gallery (album tabs + lazy grid + lightbox).
   Scoped under #gallery / .pg- so it never collides with theme styles or main.js. */

#gallery .pg-tabs {
    text-align: center;
    margin: 0 0 34px;
    line-height: 2.4;
}
#gallery .pg-tab {
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    margin: 2px;
    color: #8a8a8a;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .25s ease, border-color .25s ease;
}
#gallery .pg-tab:hover { color: #333; }
#gallery .pg-tab.is-active { color: #111; border-bottom-color: #111; }
#gallery .pg-count { font-size: 11px; color: #b5b5b5; vertical-align: super; }

#gallery .pg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 600px) { #gallery .pg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { #gallery .pg-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }

#gallery .pg-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #efece7;
    cursor: pointer;
}
#gallery .pg-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: transform .55s ease, opacity .4s ease;
}
#gallery .pg-cell img.loaded { opacity: 1; }
#gallery .pg-cell:hover img { transform: scale(1.07); }

#gallery .pg-more { text-align: center; margin: 34px 0 0; }
#gallery .pg-more[hidden] { display: none; }

/* Lightbox */
.pg-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, .93);
    z-index: 3000;
}
.pg-lightbox.open { display: flex; }
.pg-lightbox .pg-full {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 6px 50px rgba(0, 0, 0, .55);
}
.pg-lightbox button {
    background: rgba(0, 0, 0, .35);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .2s ease;
}
.pg-lightbox button:hover { background: rgba(0, 0, 0, .65); }
.pg-lb-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
}
.pg-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 64px;
    font-size: 26px;
    border-radius: 6px;
}
.pg-lb-prev { left: 12px; }
.pg-lb-next { right: 12px; }
.pg-lb-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
    color: #fff;
}
.pg-counter { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.pg-lb-download {
    display: inline-block;
    padding: 9px 20px;
    border: 1px solid #fff;
    border-radius: 3px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}
.pg-lb-download:hover { background: #fff; color: #111; text-decoration: none; }

@media (max-width: 600px) {
    .pg-lb-nav { width: 40px; height: 54px; font-size: 20px; }
    .pg-lb-bar { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
}
