/* CamWox photo viewer - full-screen gallery for one model's photos (see js/photo-viewer.js) */
html.pv-lock, html.pv-lock body { overflow: hidden; }

.pv {
    position: fixed; inset: 0; z-index: 900; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    color: #fff; background: #0b0611; font-family: inherit; overflow: hidden;
    opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility 0s linear .18s;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.pv.is-open { opacity: 1; visibility: visible; transition: opacity .18s ease; }
.pv[hidden] { display: none; }

/* blurred copy of the photo as an ambient backdrop */
.pv__bg {
    position: absolute; inset: -40px; z-index: 0; background-size: cover; background-position: center;
    filter: blur(46px) brightness(.38) saturate(1.3); transform: scale(1.1); transition: background-image .25s ease;
}
.pv__bar, .pv__stage, .pv__foot { position: relative; z-index: 1; min-width: 0; }

/* ---- top bar ---- */
.pv__bar {
    display: flex; align-items: center; gap: 14px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: linear-gradient(to bottom, rgba(8,3,12,.72), rgba(8,3,12,0));
}
.pv__who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.pv__name {
    color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv__name:hover { text-decoration: underline; }
.pv__site {
    flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff;
}
.pv__site:empty { display: none; }
.pv__profile {
    flex-shrink: 0; font-size: 13px; font-weight: 700; color: #fff; text-decoration: none; padding: 7px 14px; border-radius: 999px;
    background: var(--primary, #7B2D8E); border: 1px solid rgba(255,255,255,.18); white-space: nowrap;
}
.pv__profile:hover { filter: brightness(1.12); }
.pv__profile[hidden] { display: none; }
.pv__count { flex-shrink: 0; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; }
.pv__tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.pv__btn, .pv__nav {
    display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; color: #fff;
    background: rgba(255,255,255,.12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transition: background .15s ease, transform .15s ease, opacity .15s ease;
}
.pv__btn { width: 42px; height: 42px; border-radius: 50%; }
.pv__btn svg, .pv__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv__btn:hover, .pv__nav:hover { background: rgba(255,255,255,.26); }
.pv__btn[hidden] { display: none; }
.pv button:focus-visible, .pv a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---- stage ---- */
.pv__stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 14px; min-height: 0; }
.pv__nav { width: 54px; height: 54px; border-radius: 50%; }
.pv__nav svg { width: 26px; height: 26px; }
.pv__nav:hover { transform: scale(1.06); }
.pv__nav:disabled { opacity: .25; cursor: default; transform: none; }
.pv__frame {
    position: relative; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center;
    overflow: hidden; touch-action: pan-y pinch-zoom; user-select: none;
}
.pv__frame.is-zoomed { overflow: auto; display: block; touch-action: auto; cursor: grab; scrollbar-width: thin; }
.pv__img {
    max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0,0,0,.55); background: #120a1a; cursor: zoom-in;
    opacity: 0; transform: scale(.985); transition: opacity .22s ease, transform .22s ease;
}
.pv__img.is-ready { opacity: 1; transform: none; }
.pv__frame.is-zoomed .pv__img { max-width: none; max-height: none; border-radius: 0; cursor: zoom-out; display: block; margin: 0 auto; }
.pv__spinner {
    position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
    border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: pv-spin .8s linear infinite; opacity: 0; pointer-events: none;
}
.pv.is-loading .pv__spinner { opacity: 1; }
@keyframes pv-spin { to { transform: rotate(360deg); } }
.pv__error { position: absolute; margin: 0; padding: 12px 18px; border-radius: 10px; background: rgba(0,0,0,.55); font-size: 14px; font-weight: 600; }
.pv__error[hidden] { display: none; }

/* ---- thumbnails ---- */
.pv__foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(8,3,12,.78), rgba(8,3,12,0)); }
.pv__thumbs {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scroll-behavior: smooth; scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.3) transparent; justify-content: safe center;
}
.pv__thumbs::-webkit-scrollbar { height: 6px; }
.pv__thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 999px; }
.pv__thumb {
    flex: 0 0 auto; width: 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
    cursor: pointer; background: #1b1124; opacity: .6; transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
}
.pv__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv__thumb:hover { opacity: .95; }
.pv__thumb[aria-current="true"] { opacity: 1; border-color: #fff; transform: translateY(-2px); }
.pv__thumbs[hidden] { display: none; }

/* ---- small screens ---- */
@media (max-width: 720px) {
    .pv__bar { gap: 8px; padding-left: 12px; padding-right: 12px; }
    .pv__name { font-size: 15px; }
    .pv__profile { padding: 6px 11px; font-size: 12px; }
    .pv__site { display: none; }
    .pv__btn { width: 38px; height: 38px; }
    .pv__stage { grid-template-columns: minmax(0, 1fr); padding: 0 6px; }
    .pv__nav { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; z-index: 2; background: rgba(0,0,0,.42); }
    .pv__nav--prev { left: 8px; }
    .pv__nav--next { right: 8px; }
    .pv__thumb { width: 52px; height: 52px; border-radius: 8px; }
    .pv__foot { padding-left: 8px; padding-right: 8px; }
    .pv__frame { touch-action: pan-y; }
}
@media (prefers-reduced-motion: reduce) {
    .pv, .pv__img, .pv__bg, .pv__thumb, .pv__btn, .pv__nav { transition: none; }
    .pv__spinner { animation-duration: 2s; }
}
