/* Project media viewer — fig 6915:9569.
   Standalone lightbox for the project page only; nothing here touches the
   site's Fancybox instances. Geometry is the 1920 mock: 56px glass discs inset
   50, a glass toolbar pill top-right, Montserrat Bold 20 counter top-left, a
   1235x875 stage and a 120x85 filmstrip whose active frame is brand orange. */

.pmv {
    position: fixed;
    inset: 0;
    z-index: 1000010; /* over the sticky header (999999) */
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pmv.is-open {
    opacity: 1;
    visibility: visible;
}

.pmv[hidden] {
    display: none;
}

.pmv__scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12.5px);
    -webkit-backdrop-filter: blur(12.5px);
}

/* ─── counter ─── */
.pmv__counter {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
}

/* ─── toolbar: one pill, three 56px controls ─── */
.pmv__toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
    display: flex;
    align-items: center;
    background: rgba(23, 27, 28, 0.6);
    border-radius: 10px;
    overflow: hidden;
}

.pmv__tool {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    color: #fff;
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
    transition: background-color 0.2s ease;
}

.pmv__tool:hover,
.pmv__tool:focus-visible {
    background: rgba(255, 255, 255, 0.16);
}

.pmv__tool:focus-visible {
    outline: 2px solid #FF6B00;
    outline-offset: -2px;
}

.pmv__tool svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* the play glyph is drawn on the 56 canvas it was exported from */
.pmv__tool--slideshow svg {
    width: 56px;
    height: 56px;
}

.pmv__tool[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.22);
}

/* ─── nav discs ─── */
.pmv__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    background: rgba(23, 27, 28, 0.5);
    /* the chevrons are drawn with currentColor; without this they inherit the
       page's near-black body colour and vanish into the disc */
    color: #fff;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.pmv__nav:hover,
.pmv__nav:focus-visible {
    background: rgba(23, 27, 28, 0.8);
}

.pmv__nav:focus-visible {
    outline: 2px solid #FF6B00;
    outline-offset: 2px;
}

.pmv__nav svg {
    display: block;
    width: 56px;
    height: 56px;
}

.pmv__nav--prev {
    left: 50px;
}

.pmv__nav--prev svg {
    transform: rotate(180deg);
}

.pmv__nav--next {
    right: 50px;
}

.pmv__nav[disabled] {
    opacity: 0.35;
    cursor: default;
}

/* ─── stage: the band above the filmstrip, image capped at the mock size ─── */
.pmv__stage {
    position: absolute;
    /* 85 strip + 20 gutter + a 50px gap so the photo never touches it */
    inset: 0 0 155px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 50 clear of the top chrome; the sides clear the 56px nav discs inset 50 */
    padding: 50px 116px 0;
    cursor: grab;
}

.pmv.is-dragging .pmv__stage {
    cursor: grabbing;
}

/* Each slide is a fresh node swapped into the stage, so the change read as a
   hard cut. Fading and easing the new figure in turns the swap into a
   transition without animating layout. */
.pmv__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    /* definite, not max-: a percentage height only resolves against a parent
       that has one, so with max-height alone the image ignored the stage and
       ran under the filmstrip */
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    animation: pmv-slide-in 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    will-change: opacity, transform;
}

@keyframes pmv-slide-in {
    from {
        opacity: 0;
        transform: translate3d(var(--pmv-from, 24px), 0, 0) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* stepping backwards should come from the other side */
.pmv.is-prev .pmv__figure {
    --pmv-from: -24px;
}

.pmv__figure img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(1235px, 100%);
    max-height: min(875px, 100%);
    object-fit: contain;
    border-radius: 8px;
}

/* iframe (3D wrap view) and video take the full stage box — the builder needs
   the room and handles its own drag */
.pmv__figure--frame,
.pmv__figure--video {
    width: min(1235px, 100%);
    height: min(875px, 100%);
}

.pmv__figure--frame iframe,
.pmv__figure--video video {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
    background: #000;
}

/* Zoomed state. Point at the picture and it magnifies under the cursor - no
   click, no drag. transform-origin tracks the pointer, which on a touch screen
   means the magnified area follows the finger while it stays down. */
.pmv.is-zoomed .pmv__stage {
    overflow: hidden;
    cursor: zoom-out;
    touch-action: none;
}

.pmv.is-zoomed .pmv__figure {
    animation: none;
}

.pmv.is-zoomed .pmv__figure img {
    transform: scale(var(--pmv-zoom, 2.4));
    transition: transform 0.15s ease-out;
    will-change: transform;
}

.pmv__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #FF6B00;
    border-radius: 50%;
    animation: pmv-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .pmv,
    .pmv__tool,
    .pmv__nav { transition: none; }
    .pmv__spinner { animation-duration: 2s; }

    /* no travel, but keep a short fade so the swap is still legible */
    .pmv__figure { animation: pmv-fade 0.14s linear both; }
}

@keyframes pmv-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── slideshow progress ─── */
.pmv__progress {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    width: 0;
    height: 3px;
    background: #FF6B00;
    pointer-events: none;
}

.pmv.is-playing .pmv__progress {
    animation: pmv-progress var(--pmv-slideshow, 4s) linear infinite;
}

@keyframes pmv-progress {
    from { width: 0; }
    to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .pmv.is-playing .pmv__progress { animation: none; width: 100%; opacity: 0.4; }
}

/* ─── filmstrip ─── */
.pmv__thumbs {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 3;
    display: flex;
    gap: 20px;
    /* a short strip reads as an accident when it hugs the left edge; `safe`
       keeps the first frame reachable once the row does overflow */
    justify-content: center;
    justify-content: safe center;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.pmv__thumbs::-webkit-scrollbar {
    display: none;
}

.pmv__thumb {
    position: relative;
    flex: 0 0 auto;
    width: 120px;
    height: 85px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.pmv__thumb--label {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(23, 27, 28, 0.75);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
}

.pmv__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.pmv__thumb:hover {
    opacity: 0.85;
}

.pmv__thumb.is-current {
    opacity: 1;
}

/* An inset shadow paints under the thumbnail, so the image swallowed it whole.
   A pseudo-element sits above the image and stays visible. */
.pmv__thumb.is-current::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid #FF6B00;
    border-radius: 8px;
    pointer-events: none;
}

.pmv__thumb:focus-visible {
    outline: 2px solid #FF6B00;
    outline-offset: 2px;
}

/* the trigger elements advertise themselves */
[data-project-media] {
    cursor: zoom-in;
}

/* Inside a slider the photo is something you drag first and open second, so
   the magnifier fought the strip: let swiper's grab/grabbing cursor through. */
.swiper-slide [data-project-media] {
    cursor: inherit;
}

@media (max-width: 1024px) {
    .pmv__stage { padding: 16px 84px; }
    .pmv__nav--prev { left: 12px; }
    .pmv__nav--next { right: 12px; }
}

/* phones: no room for a strip beside a readable stage */
@media (max-width: 767px) {
    .pmv__thumbs { display: none; }

    .pmv__stage {
        inset: 0;
        padding: 76px 12px 24px;
    }

    .pmv__tool,
    .pmv__nav {
        width: 44px;
        height: 44px;
    }

    .pmv__nav svg { width: 44px; height: 44px; }
    .pmv__tool svg { width: 22px; height: 22px; }
    .pmv__tool--slideshow svg { width: 44px; height: 44px; }
    .pmv__counter { font-size: 16px; }
}
