/* ---------- Album index (cover tiles) ---------- */
.pg-albums {
    display: grid;
    grid-template-columns: repeat(var(--pg-cols, 3), 1fr);
    gap: 22px;
}

.pg-album-tile {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.pg-album-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.pg-album-cover {
    position: relative;
    height: 240px;
    background: #f2f2f2;
}

.pg-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-album-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 14px;
}

.pg-album-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}

.pg-album-name {
    padding: 14px 16px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

/* ---------- Single album header ---------- */
.pg-single-head {
    margin-bottom: 22px;
}

.pg-back {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #0073aa;
}

.pg-back:hover { text-decoration: underline; }

.pg-single-title {
    margin: 0;
    font-size: 28px;
}

/* ---------- Photo grid ---------- */
.pg-gallery {
    display: grid;
    grid-template-columns: repeat(var(--pg-cols, 3), 1fr);
    gap: 18px;
}

.pg-item {
    margin: 0;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.pg-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.pg-link { display: block; cursor: zoom-in; }

.pg-link img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

.pg-caption {
    padding: 12px 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

@media (max-width: 900px) {
    .pg-albums,
    .pg-gallery { grid-template-columns: repeat(2, 1fr); }
    .pg-album-cover { height: 220px; }
    .pg-link img { height: 240px; }
}
@media (max-width: 560px) {
    .pg-albums,
    .pg-gallery { grid-template-columns: 1fr; }
    .pg-album-cover { height: 260px; }
    .pg-link img { height: 300px; }
}

/* ---------- Lightbox ---------- */
.pg-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
}

.pg-lightbox.is-open { display: flex; }

.pg-lb-figure {
    margin: 0;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.pg-lb-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.pg-lb-caption {
    margin-top: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.pg-lb-close,
.pg-lb-prev,
.pg-lb-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 26px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: background .2s ease;
}

.pg-lb-close:hover,
.pg-lb-prev:hover,
.pg-lb-next:hover { background: rgba(255, 255, 255, 0.28); }

.pg-lb-close { top: 22px; right: 26px; font-size: 30px; }
.pg-lb-prev  { left: 26px; top: 50%; transform: translateY(-50%); }
.pg-lb-next  { right: 26px; top: 50%; transform: translateY(-50%); }

@media (max-width: 560px) {
    .pg-lb-prev { left: 10px; }
    .pg-lb-next { right: 10px; }
    .pg-lb-close { top: 12px; right: 12px; }
}