/* FB Photo Feed — Frontend Gallery Styles */

/* ── Grid ─────────────────────────────────────────── */
.fbpf-wrap { font-family: inherit; }

.fbpf-gallery-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 16px;
}

.fbpf-grid {
    display: grid;
    gap: 8px;
}
.fbpf-cols-1 { grid-template-columns: 1fr; }
.fbpf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.fbpf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.fbpf-cols-4 { grid-template-columns: repeat(4, 1fr); }
.fbpf-cols-5 { grid-template-columns: repeat(5, 1fr); }
.fbpf-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 768px) {
    .fbpf-cols-3, .fbpf-cols-4, .fbpf-cols-5, .fbpf-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .fbpf-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── Photo item ───────────────────────────────────── */
.fbpf-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
    cursor: pointer;
}

.fbpf-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;   /* square crop */
    overflow: hidden;
}

.fbpf-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
    display: block;
}

.fbpf-item:hover .fbpf-thumb {
    transform: scale(1.06);
}

/* ── Overlay ─────────────────────────────────────── */
.fbpf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease;
}

.fbpf-item:hover .fbpf-overlay {
    background: rgba(0, 0, 0, 0.35);
}

.fbpf-zoom-icon {
    color: #fff;
    font-size: 28px;
    opacity: 0;
    transform: scale(.8);
    transition: opacity .2s ease, transform .2s ease;
}
.fbpf-item:hover .fbpf-zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ── Album count badge ───────────────────────────── */
.fbpf-album-count {
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s;
}
.fbpf-album-item:hover .fbpf-album-count {
    opacity: 1;
    transform: translateY(0);
}

/* ── No cover placeholder ────────────────────────── */
.fbpf-no-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: #e8eaed;
}

/* ── Caption ─────────────────────────────────────── */
.fbpf-caption {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fbpf-caption-text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.fbpf-caption-date {
    font-size: 11px;
    color: #888;
}

/* ── Empty / notice ──────────────────────────────── */
.fbpf-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    background: #f9f9f9;
    border-radius: 6px;
}
.fbpf-notice {
    padding: 12px 16px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
}
.fbpf-notice-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

/* ── Lightbox ────────────────────────────────────── */
.fbpf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
    animation: fbpf-fade-in .2s ease;
}
.fbpf-lightbox.fbpf-lb-open {
    display: flex;
}

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

.fbpf-lb-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fbpf-lb-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    animation: fbpf-img-in .18s ease;
}
@keyframes fbpf-img-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

.fbpf-lb-caption {
    color: rgba(255,255,255,.75);
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    max-width: 80vw;
}

/* Lightbox buttons */
.fbpf-lb-close,
.fbpf-lb-prev,
.fbpf-lb-next {
    position: fixed;
    background: rgba(255,255,255,.12);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fbpf-lb-close,
.fbpf-lb-prev,
.fbpf-lb-next {
    width: 44px;
    height: 44px;
    font-size: 20px;
}
.fbpf-lb-close { top: 16px; right: 16px; font-size: 26px; }
.fbpf-lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.fbpf-lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }

.fbpf-lb-close:hover,
.fbpf-lb-prev:hover,
.fbpf-lb-next:hover {
    background: rgba(255,255,255,.28);
}

/* ── Album viewer ────────────────────────────────── */
.fbpf-album-viewer {
    margin-top: 20px;
}
.fbpf-album-viewer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.fbpf-back-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}
.fbpf-back-btn:hover { background: #f0f0f0; }
.fbpf-album-viewer-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}
.fbpf-album-loader {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 14px;
}
