/* Journal-entry photo viewer. This component is separate from the public Gallery. */
[data-journal-lightbox-scope] img[data-journal-lightbox-image],
[data-journal-lightbox-scope] .post-content img {
    cursor: zoom-in;
}

[data-journal-lightbox-scope] img[data-journal-lightbox-image]:focus-visible,
[data-journal-lightbox-scope] .post-content img:focus-visible {
    outline: 3px solid var(--green-light);
    outline-offset: 3px;
}

.pw-journal-lightbox[hidden] { display: none !important; }

.pw-journal-lightbox {
    position: fixed;
    z-index: 2147483001;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100dvh;
    padding: 1rem;
    overflow: hidden;
    isolation: isolate;
}

.pw-journal-lightbox__backdrop {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, .94);
    cursor: zoom-out;
    appearance: none;
}

.pw-journal-lightbox__panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    width: min(96vw, 1320px);
    height: min(94dvh, 920px);
    padding: 3.1rem 1rem 1rem;
    overflow: hidden;
    background: #080d09;
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}

.pw-journal-lightbox__image {
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.pw-journal-lightbox__details {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: .85rem .75rem 0;
    text-align: center;
}

.pw-journal-lightbox__caption {
    margin: 0 0 .35rem;
    color: #fff;
    font-weight: 700;
}

.pw-journal-lightbox__caption:empty { display: none; }

.pw-journal-lightbox__counter {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: .9rem;
}

.pw-journal-lightbox__close {
    position: absolute;
    z-index: 3;
    top: .45rem;
    right: .7rem;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 2.35rem;
    line-height: 1;
    cursor: pointer;
}

.pw-journal-lightbox__nav {
    z-index: 2;
    width: 3rem;
    height: 4.2rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    background: rgba(0, 0, 0, .45);
    font-size: 2rem;
    cursor: pointer;
}

.pw-journal-lightbox__nav:hover,
.pw-journal-lightbox__nav:focus-visible { background: rgba(116, 153, 72, .72); }
.pw-journal-lightbox__nav--previous { grid-column: 1; grid-row: 1; }
.pw-journal-lightbox__nav--next { grid-column: 3; grid-row: 1; }

body.pw-journal-lightbox-open { overflow: hidden !important; }

@media (max-width: 600px) {
    .pw-journal-lightbox { padding: .35rem; }
    .pw-journal-lightbox__panel {
        grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
        width: 100%;
        height: 96dvh;
        padding: 3rem .3rem .8rem;
    }
    .pw-journal-lightbox__nav {
        width: 2.25rem;
        height: 3.4rem;
        font-size: 1.5rem;
    }
    .pw-journal-lightbox__details { padding: .75rem .45rem 0; }
}
