/* ============================================
 * PDF VIEWER — modal interno pra artigos (R2)
 * Visual alinhado ao viewer de jornais (image_viewer):
 * fundo escuro, header em gradiente, close circular
 * com giro no hover, toolbar inferior estilo "FAB".
 * ============================================ */

.pdfv-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.pdfv-overlay.show { opacity: 1; animation: pdfv-fadein 0.2s ease; }
body.pdfv-open { overflow: hidden; }

@keyframes pdfv-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pdfv-zoomin { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pdfv-spin { to { transform: rotate(360deg); } }

.pdfv-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1100px, 96vw);
    height: 94vh;
    background: #1b1b1b;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.99);
    transition: transform 0.2s ease;
}
.pdfv-overlay.show .pdfv-modal { animation: pdfv-zoomin 0.25s ease; transform: scale(1); }

.pdfv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    color: #fff;
    background: linear-gradient(135deg, #4a3600, #6a4f00, #8a4400);
}
.pdfv-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
}
.pdfv-title i { color: #f4d03f; }
.pdfv-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 78vw;
}
.pdfv-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}
.pdfv-close:hover { background: rgba(255, 255, 255, 0.28); transform: rotate(90deg); }

.pdfv-body {
    position: relative;
    flex: 1 1 auto;
    background: #fff;
}
.pdfv-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ece5d6;
}

/* spinner de carregamento sobre o iframe */
.pdfv-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ece5d6;
    color: #6a4f00;
    font-size: 0.92rem;
}
.pdfv-loading[hidden] { display: none; }
.pdfv-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #d9cdb0;
    border-top-color: #b25900;
    border-radius: 50%;
    animation: pdfv-spin 0.8s linear infinite;
}

/* toolbar inferior estilo FAB (espirito do image_viewer) */
.pdfv-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: rgba(20, 20, 20, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pdfv-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1px solid rgba(212, 165, 116, 0.5);
    border-radius: 22px;
    background: rgba(106, 79, 0, 0.55);
    color: #f4d03f;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.pdfv-btn:hover { background: rgba(106, 79, 0, 0.85); transform: scale(1.04); color: #fff; }
.pdfv-hint {
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .pdfv-overlay { padding: 0; }
    .pdfv-modal { width: 100vw; height: 100vh; border-radius: 0; }
    .pdfv-title-text { max-width: 56vw; }
    .pdfv-close { width: 40px; height: 40px; }
    .pdfv-hint { display: none; }
    .pdfv-btn { padding: 8px 14px; }
}
