/* pp-lightbox + the gallery layouts used by the Image view control. */

/* ── overlay ── */
.pp-lb-overlay{
  position:fixed;inset:0;z-index:20000;display:none;
  background:rgba(8,11,18,.92);backdrop-filter:blur(3px);
  align-items:center;justify-content:center;
}
.pp-lb-overlay.pp-lb-on{display:flex}
.pp-lb-stage{margin:0;max-width:92vw;max-height:88vh;display:flex;flex-direction:column;align-items:center;gap:10px}
.pp-lb-img{max-width:92vw;max-height:82vh;border-radius:6px;box-shadow:0 12px 48px rgba(0,0,0,.5);opacity:0;transform:scale(.98);transition:opacity .18s,transform .18s}
.pp-lb-img.pp-lb-loaded{opacity:1;transform:none}
.pp-lb-cap{color:#e8eef7;font-size:13.5px;text-align:center;max-width:80vw}
.pp-lb-close,.pp-lb-nav{
  position:absolute;background:rgba(255,255,255,.10);color:#fff;border:none;cursor:pointer;
  border-radius:50%;width:44px;height:44px;font-size:26px;line-height:1;display:flex;align-items:center;justify-content:center;
  transition:background .15s;
}
.pp-lb-close:hover,.pp-lb-nav:hover{background:rgba(255,255,255,.22)}
.pp-lb-close{top:16px;right:18px;font-size:30px}
.pp-lb-prev{left:16px;top:50%;transform:translateY(-50%)}
.pp-lb-next{right:16px;top:50%;transform:translateY(-50%)}
.pp-lb-counter{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);color:#cbd5e1;font-size:12.5px;letter-spacing:.05em}
@media(max-width:640px){.pp-lb-nav{width:38px;height:38px;font-size:22px}.pp-lb-close{top:10px;right:10px}}

/* ── gallery layouts (view-Image renders these) ── */
.pp-gallery{--gap:8px}
.pp-gallery a{display:block;position:relative;overflow:hidden;border-radius:8px;line-height:0;text-decoration:none}
.pp-gallery img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .25s}
.pp-gallery.pp-g-border a{border:1px solid var(--pp-border,#e2e8f0)}
.pp-gallery a:hover img{transform:scale(1.04)}
.pp-gallery .pp-g-cap{position:absolute;left:0;right:0;bottom:0;padding:6px 8px;font-size:11.5px;color:#fff;
  background:linear-gradient(transparent,rgba(0,0,0,.65));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}

/* fixed-size thumbnail grid (both width+height set) */
.pp-gallery.pp-g-thumbs{display:flex;gap:var(--gap);flex-wrap:wrap;align-items:flex-start}
.pp-gallery.pp-g-thumbs a{flex:0 0 auto}
/* single */
.pp-gallery.pp-g-single{display:inline-block}
/* horizontal strip */
.pp-gallery.pp-g-horizontal{display:flex;gap:var(--gap);flex-wrap:wrap}
.pp-gallery.pp-g-horizontal a{flex:0 0 auto}
/* vertical stack */
.pp-gallery.pp-g-vertical{display:flex;flex-direction:column;gap:var(--gap)}
/* masonry (CSS columns) */
.pp-gallery.pp-g-masonry{column-gap:var(--gap);column-width:180px}
.pp-gallery.pp-g-masonry a{margin:0 0 var(--gap);break-inside:avoid;width:100%}
.pp-gallery.pp-g-masonry img{height:auto}
/* grid */
.pp-gallery.pp-g-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:var(--gap)}

@media(max-width:640px){
  .pp-gallery.pp-g-mobfull img{width:100%!important;height:auto!important}
  .pp-gallery.pp-g-mobfull.pp-g-horizontal a{flex-basis:100%}
}

/* ── File view control ── */
.pp-fileview{display:flex;flex-direction:column;gap:6px}
.pp-fileview .pp-fv-item{display:flex;align-items:center;gap:8px;font-size:13px}
.pp-fileview .pp-fv-ic{flex:0 0 auto;width:22px;height:22px;background:no-repeat center/contain;opacity:.9}
.pp-fv-file{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E")}
.pp-fv-img{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E")}
.pp-fv-pdf{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E")}
.pp-fv-doc{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h6'/%3E%3C/svg%3E")}
.pp-fv-xls{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M9 13l6 5M15 13l-6 5'/%3E%3C/svg%3E")}
.pp-fv-zip{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M11 7v2M11 11v2M11 15v2'/%3E%3C/svg%3E")}
.pp-fv-audio{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='1.6'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E")}
.pp-fv-video{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ec4899' stroke-width='1.6'%3E%3Crect x='2' y='4' width='14' height='16' rx='2'/%3E%3Cpath d='M22 8l-6 4 6 4z'/%3E%3C/svg%3E")}
.pp-fileview a{color:var(--pp-primary,#3b82f6);text-decoration:none}
.pp-fileview a:hover{text-decoration:underline}
.pp-fileview .pp-fv-size{color:var(--pp-text-muted,#94a3b8);font-size:11.5px}
.pp-fileview .pp-fv-embed{margin-top:6px;border:1px solid var(--pp-border,#e2e8f0);border-radius:8px;overflow:hidden;max-width:100%}
.pp-fileview .pp-fv-embed iframe,.pp-fileview .pp-fv-embed video,.pp-fileview .pp-fv-embed audio{display:block;width:100%;border:0}
