/* Journal (blog) post styles — hero image and lightbox. See templates/Blog/view.php, webroot/js/lightbox.js */

.journal-hero {
    margin-left: 0;
    margin-right: 0;
}
.journal-hero-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 460px;
    width: 100%;
    background: #efece6;
    cursor: zoom-in;
}
.journal-hero-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    transition: transform .6s ease;
}
.journal-hero-link:hover img,
.journal-hero-link:focus-visible img {
    transform: scale(1.03);
}
.journal-hero-link:focus-visible {
    outline: 2px solid #333;
    outline-offset: 3px;
}
.journal-hero-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #222;
    background: rgba(255, 255, 255, .85);
    opacity: .85;
    transition: opacity .3s ease;
}
.journal-hero-link:hover .journal-hero-hint {
    opacity: 1;
}

/* Lightbox */
.js-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 18, 16, .95);
    opacity: 0;
    transition: opacity .25s ease;
}
.js-lightbox[hidden] {
    display: none;
}
.js-lightbox.is-open {
    opacity: 1;
}
.js-lightbox-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 56px 16px;
    touch-action: none;
}
.js-lightbox-img {
    /* Leave room for the close button above and caption below */
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 112px);
    object-fit: contain;
    cursor: zoom-in;
    transition: transform .3s ease;
    user-select: none;
    -webkit-user-drag: none;
}
.js-lightbox.is-zoomed .js-lightbox-img {
    cursor: zoom-out;
}
.js-lightbox.is-dragging .js-lightbox-img {
    transition: none;
}
.js-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}
.js-lightbox-caption {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    padding: 0 16px;
    text-align: center;
    color: rgba(255, 255, 255, .8);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    pointer-events: none;
}
body.js-lightbox-open {
    overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
    .journal-hero-link img,
    .js-lightbox,
    .js-lightbox-img {
        transition: none;
    }
}
.js-lightbox-close:focus:not(:focus-visible) {
    outline: none;
}
