/*
 * The enlarged picture, shared by every gallery on the site.
 *
 * These rules used to live in product-page.css, which is loaded on a product
 * and a service and nowhere else. When the front page started opening its
 * patents the same way, the script was there and the styles were not: the scan
 * opened at full size across the page, with no ground behind it and the buttons
 * as bare little boxes in the corner.
 */

/* -------------------------------------------------------------- lightbox */

/*
 * The photograph opens.
 *
 * A photograph of a part is what the page is for, and it was 482 pixels wide
 * with no way to see it larger: a click did nothing and there was nothing to
 * swipe. The frame now says so with the cursor, and the picture opens over the
 * page with the rest of the gallery behind the arrows.
 */
.tk-product__main--zoom {
    cursor: zoom-in;
}

/* The picture is dragged sideways to turn the gallery, so it is not picked up. */
.tk-product__main img,
.tk-lightbox__image {
    -webkit-user-drag: none;
    user-select: none;
}

/* The strip is pulled by hand where there is no finger and no trackpad. */
.tk-product__thumbs {
    cursor: grab;
}

.tk-product__thumbs--dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

body.tk-lightbox-open {
    overflow: hidden;
}

.tk-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 16, 18, .92);
    /* Above the fixed header, which sits at nine nines of its own. */
    z-index: 999999999999;
    padding: 40px 72px;
    box-sizing: border-box;
}

.tk-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
}

.tk-lightbox__close,
.tk-lightbox__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease;
    font-family: Montserrat, sans-serif;
}

.tk-lightbox__close:hover,
.tk-lightbox__nav:hover {
    background: #09B1F6;
}

.tk-lightbox__close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.tk-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 22px;
}

.tk-lightbox__nav--prev {
    left: 14px;
}

.tk-lightbox__nav--next {
    right: 14px;
}

.tk-lightbox__count {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: #E7EBED;
    font-family: Montserrat, sans-serif;
    font-size: 15px;
    letter-spacing: .4px;
}

/* One photograph has nowhere to step to. */
.tk-lightbox--single .tk-lightbox__nav,
.tk-lightbox--single .tk-lightbox__count {
    display: none;
}

@media (max-width: 600px) {
    .tk-lightbox {
        padding: 56px 12px 76px;
    }

    /*
     * Down to the bottom corners. A phone screen is barely wider than the
     * photograph, so arrows at the sides lie across it; and the gesture people
     * reach for here is the swipe anyway.
     */
    .tk-lightbox__nav {
        top: auto;
        bottom: 12px;
        transform: none;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .tk-lightbox__count {
        bottom: 26px;
    }
}
