/* WPAS PDF Viewer */
.wpas-pv-wrap, .wpas-pv-wrap * { box-sizing: border-box; }

.wpas-pv-no-pdf { font-size:14px; color:#9ca3af; font-style:italic; padding:8px 0; }

/* Wrap: fills column, no overflow */
.wpas-pv-wrap {
    display: flex;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
}

/* Card */
.wpas-pv-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wpas-pv-card--lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

/* Thumbnail */
.wpas-pv-thumb {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f5;
    flex-shrink: 0;
}
.wpas-pv-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.3s ease;
}
.wpas-pv-card:hover .wpas-pv-thumb img { transform: scale(1.04); }

.wpas-pv-icon { display:flex; align-items:center; justify-content:center; color:#c4c9d4; }
.wpas-pv-icon svg { width:72px; height:72px; display:block; }

/* Overlay */
.wpas-pv-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.52);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease; z-index: 2;
}
.wpas-pv-card:hover .wpas-pv-overlay { opacity: 1; }
.wpas-pv-overlay-inner { display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.wpas-pv-overlay-icon svg { width:28px; height:28px; stroke:#fff; fill:none; display:block; }
.wpas-pv-overlay-label { font-size:14px; font-weight:600; color:#fff; text-align:center; font-family:system-ui,sans-serif; }

/* Footer */
.wpas-pv-footer { display:flex; flex-direction:column; gap:8px; padding:10px 12px; min-width:0; }
.wpas-pv-footer-row { display:flex; align-items:center; gap:6px; min-width:0; overflow:hidden; }
.wpas-pv-badge {
    display:inline-flex; align-items:center; flex-shrink:0;
    background:#e24b4a; color:#fff; font-size:10px; font-weight:700;
    letter-spacing:0.05em; padding:2px 6px; border-radius:4px; white-space:nowrap;
}
.wpas-pv-filename {
    font-size:12px; font-weight:500; color:#1f2937;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    min-width:0; flex:1; line-height:1.4;
}
.wpas-pv-btn {
    display:flex; align-items:center; justify-content:center;
    width:100%; padding:8px 18px; font-size:13px; font-weight:500;
    color:#fff; background:#1d4ed8; border:none; border-radius:6px;
    cursor:pointer; transition:background 0.15s;
}
.wpas-pv-card:hover .wpas-pv-btn { background:#1e40af; }

/* ═══════════════════════════════════════════════
   DIALOG LIGHTBOX
   Native <dialog> element — browser handles the
   backdrop and stacking context automatically.
   Works in every context including Loop Grid.
═══════════════════════════════════════════════ */
dialog.wpas-pv-lb {
    /* Force override ALL browser UA stylesheet dialog defaults */
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    margin: auto !important;
    /* !important required — browsers set their own max-width/max-height on dialog */
    width: 90vw !important;
    height: 90vh !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
dialog.wpas-pv-lb[open] {
    opacity: 1;
    transform: scale(1);
}
/* Backdrop */
dialog.wpas-pv-lb::backdrop {
    background: rgba(0,0,0,0.82);
}

/* Panel inside dialog */
.wpas-pv-lb-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #111827;
}

/* Header */
.wpas-pv-lb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    height: 52px;
    min-height: 52px;
    flex-shrink: 0;
    background: #1f2937;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.wpas-pv-lb-title {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    font-family: system-ui, sans-serif;
}

/* Close button — always white X on dark bg */
.wpas-pv-lb-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    background: rgba(255,255,255,0.15) !important;
    border: 1.5px solid rgba(255,255,255,0.4) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 0 !important;
    text-indent: 0 !important;
    color: transparent !important;
    transition: background 0.15s;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 10 !important;
}
.wpas-pv-lb-close:hover {
    background: rgba(255,255,255,0.28) !important;
    border-color: rgba(255,255,255,0.6) !important;
}
.wpas-pv-lb-close svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    stroke: #ffffff !important;
    stroke-width: 2.5px !important;
    fill: none !important;
    pointer-events: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
}
.wpas-pv-lb-close svg line {
    stroke: #ffffff !important;
    stroke-width: 2.5 !important;
    opacity: 1 !important;
}

/* Body + iframe */
.wpas-pv-lb-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
    background: #fff;
}
.wpas-pv-lb-body iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Spinner */
.wpas-pv-spinner-wrap {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: #0d1117; z-index: 5; pointer-events: none;
}
.wpas-pv-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: wpas-spin 0.7s linear infinite;
}
@keyframes wpas-spin { to { transform: rotate(360deg); } }

/* Mobile — bottom sheet */
@media (max-width: 768px) {
    dialog.wpas-pv-lb {
        width: 100vw !important;
        height: 93vh !important;
        max-width: 100vw !important;
        max-height: 93vh !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        margin: auto 0 0 0 !important;
    }
}
