/* Full-screen image preview over whatever is on screen (patOpenImage() in assets/js/editor.js). */

.pat-viewer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    background: rgba(8, 17, 36, .93);
}

.pat-viewer.on {
    display: block;
}

body.pat-viewer-open {
    overflow: hidden;
}

.pat-viewer__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    background: #0F172A;
    border-bottom: 1px solid #ffffff1f;
    color: #fff;
}

.pat-viewer__name {
    font-size: var(--fs-md);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

.pat-viewer__count {
    font-size: var(--fs-xs);
    color: var(--faint-ink);
    font-variant-numeric: tabular-nums;
}

.pat-viewer__dl {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    background: #ffffff14;
    border: 1px solid #ffffff2e;
    color: #fff;
    border-radius: 7px;
    padding: 5px 12px;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.pat-viewer__dl:hover {
    background: #ffffff26;
}

.pat-viewer__x {
    background: none;
    border: none;
    color: #CBD5E1;
    font-size: var(--fs-lg);
    cursor: pointer;
    padding: 6px 9px;
    border-radius: 7px;
    line-height: 1;
}

.pat-viewer__x:hover {
    background: #ffffff1a;
    color: #fff;
}

/* margin:auto centres the image and still lets it scroll when zoomed past
   the stage — flex centring would cut off the top and left instead */
.pat-viewer__stage {
    position: absolute;
    inset: 52px 0 0;
    display: flex;
    overflow: auto;
    padding: 24px;
    z-index: 1;
}

/* room for the arrows, so a wide image never slides underneath them */
.pat-viewer.multi .pat-viewer__stage {
    padding-left: 74px;
    padding-right: 74px;
}

.pat-viewer__stage img {
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    cursor: zoom-in;
}

.pat-viewer.zoom .pat-viewer__stage img {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.pat-viewer__nav {
    position: absolute;
    top: calc(50% + 26px);
    transform: translateY(-50%);
    display: none;
    z-index: 2;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(15, 23, 42, .78);
    border: 1px solid #ffffff38;
    color: #fff;
    border-radius: 50%;
    font-size: var(--fs-2xl);
    line-height: 1;
}

.pat-viewer__nav:hover {
    background: rgba(15, 23, 42, .95);
}

.pat-viewer.multi .pat-viewer__nav {
    display: flex;
}

.pat-viewer__nav--prev {
    left: 18px;
}

.pat-viewer__nav--next {
    right: 18px;
}
