/* =====================================================
   Photo Gallery Viewer — PA3CS
   CSS público do widget Elementor
   ===================================================== */

.pgv-galeria *,
.pgv-galeria *::before,
.pgv-galeria *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.pgv-galeria {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* ── FILTRO DE CATEGORIAS ── */
.pgv-filtro {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.pgv-filtro-btn {
    padding: 9px 20px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #444;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    outline: none;
    white-space: nowrap;
}

.pgv-filtro-btn:hover {
    border-color: #1d6b3e;
    color: #1d6b3e;
    background: #f0f7f0;
}

.pgv-filtro-btn.active {
    background: #1d6b3e;
    color: #fff;
    border-color: #1d6b3e;
    font-weight: 600;
}

/* ── GRADE GENÉRICA ── */
.pgv-albuns-grid,
.pgv-fotos-grid {
    display: grid;
    gap: 20px;
}

.pgv-grid-1 { grid-template-columns: 1fr; }
.pgv-grid-2 { grid-template-columns: repeat(2, 1fr); }
.pgv-grid-3 { grid-template-columns: repeat(3, 1fr); }
.pgv-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── CARD DE ÁLBUM ── */
.pgv-album-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.pgv-album-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Área da capa */
.pgv-album-capa {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e8f0ed;
    overflow: hidden;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.pgv-album-capa img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.pgv-album-card:hover .pgv-album-capa img {
    transform: scale(1.04);
}

.pgv-album-capa-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f0ed 0%, #d4e6dc 100%);
}

.pgv-album-capa-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* Rodapé do card */
.pgv-album-info {
    padding: 16px 18px 18px;
}

.pgv-album-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #1d6b3e;
    margin-bottom: 5px;
    line-height: 1.3;
}

.pgv-album-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
    margin-bottom: 10px;
}

.pgv-album-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pgv-album-qtd {
    font-size: 12px;
    color: #1d6b3e;
    font-weight: 600;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 12px;
}

.pgv-album-categoria {
    font-size: 11px;
    color: #888;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ── VISUALIZAÇÃO DE FOTOS ── */
.pgv-fotos-header {
    margin-bottom: 20px;
}

.pgv-voltar-btn {
    background: none;
    border: none;
    color: #1d6b3e;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.15s;
}

.pgv-voltar-btn:hover {
    opacity: 0.75;
}

.pgv-fotos-titulo {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.pgv-fotos-desc {
    font-size: 13.5px;
    color: #777;
}

/* ── ITEM DE FOTO ── */
.pgv-foto-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: #e8f0ed;
}

.pgv-foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
    display: block;
}

.pgv-foto-item:hover img {
    transform: scale(1.06);
}

.pgv-foto-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 10px;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

.pgv-foto-item:hover .pgv-foto-overlay {
    opacity: 1;
}

.pgv-foto-legenda-hover {
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.pgv-foto-destaque-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(212,160,23,0.9);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

/* ── LOADING ── */
.pgv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 14px;
    color: #aaa;
    font-size: 13px;
}

.pgv-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #1d6b3e;
    border-radius: 50%;
    animation: pgv-spin 0.7s linear infinite;
}

@keyframes pgv-spin { to { transform: rotate(360deg); } }

/* ── ESTADO VAZIO ── */
.pgv-vazio {
    text-align: center;
    padding: 56px 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.pgv-vazio-icone {
    font-size: 44px;
    margin-bottom: 14px;
    opacity: 0.3;
}

.pgv-vazio-titulo {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.pgv-vazio-sub {
    font-size: 13px;
    color: #aaa;
}

/* ── LIGHTBOX ── */
.pgv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgv-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.pgv-lightbox-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px 60px;
    gap: 16px;
}

.pgv-lb-imagem-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.pgv-lb-imagem {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transition: opacity 0.2s ease;
}

.pgv-lb-imagem.pgv-lb-loading {
    opacity: 0.3;
}

.pgv-lb-legenda {
    color: rgba(255,255,255,0.85);
    font-size: 13.5px;
    text-align: center;
    margin-top: 12px;
    max-width: 600px;
    line-height: 1.5;
}

.pgv-lb-contador {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-top: 6px;
}

.pgv-lb-fechar {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    z-index: 2;
}

.pgv-lb-fechar:hover { background: rgba(255,255,255,0.25); }

.pgv-lb-prev,
.pgv-lb-next {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    flex-shrink: 0;
    line-height: 1;
}

.pgv-lb-prev:hover,
.pgv-lb-next:hover { background: rgba(255,255,255,0.28); }

.pgv-lb-prev:disabled,
.pgv-lb-next:disabled { opacity: 0.2; cursor: default; }

/* ── RESPONSIVO ── */
@media (max-width: 900px) {
    .pgv-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .pgv-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .pgv-grid-2,
    .pgv-grid-3,
    .pgv-grid-4 { grid-template-columns: 1fr; }

    .pgv-lightbox-container { padding: 16px 10px; gap: 8px; }
    .pgv-lb-prev, .pgv-lb-next { width: 36px; height: 36px; font-size: 24px; }
}
