
/* Cutoon responsive/gallery enhancements */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

#header {
    box-sizing: border-box;
}

#header h1 {
    min-width: 0;
    max-width: calc(100% - 5.5em);
    display: flex;
    align-items: center;
    height: 100%;
}

#header h1 a {
    display: block;
    max-width: 100%;
    line-height: 0;
}

#header h1 img {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    max-height: 2.6em;
    object-fit: contain;
}

.image.fit img {
    display: block;
    width: 100%;
    height: auto;
}

.cutoon-gallery-item {
    cursor: zoom-in;
}

/* Lightbox */
#cutoon-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4.5rem;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

#cutoon-lightbox.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#cutoon-lightbox .cutoon-lightbox-image {
    max-width: min(92vw, 1500px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.45);
    user-select: none;
    -webkit-user-drag: none;
}

#cutoon-lightbox .cutoon-close,
#cutoon-lightbox .cutoon-prev,
#cutoon-lightbox .cutoon-next {
    position: absolute;
    z-index: 2;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

#cutoon-lightbox .cutoon-close:hover,
#cutoon-lightbox .cutoon-prev:hover,
#cutoon-lightbox .cutoon-next:hover {
    background: rgba(255,255,255,.25);
}

#cutoon-lightbox .cutoon-close {
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
}

#cutoon-lightbox .cutoon-prev,
#cutoon-lightbox .cutoon-next {
    top: 50%;
    transform: translateY(-50%);
    width: 3.25rem;
    height: 5rem;
    border-radius: .4rem;
    font-size: 2.5rem;
    line-height: 1;
}

#cutoon-lightbox .cutoon-prev { left: 1rem; }
#cutoon-lightbox .cutoon-next { right: 1rem; }

#cutoon-lightbox .cutoon-counter {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    color: rgba(255,255,255,.9);
    font-size: .9rem;
    letter-spacing: .08em;
    white-space: nowrap;
}

@media screen and (max-width: 736px) {
    #header {
        padding: 0 .75em;
    }

    #header h1 {
        max-width: calc(100% - 4.25em);
    }

    #header h1 img {
        width: 125px;
        max-height: 2.1em;
    }

    #wrapper > header .inner {
        padding-left: 1.25em;
        padding-right: 1.25em;
    }

    .wrapper {
        margin-top: 4.5em;
    }

    #cutoon-lightbox {
        padding: 3.25rem .75rem 3.5rem;
    }

    #cutoon-lightbox .cutoon-lightbox-image {
        max-width: 96vw;
        max-height: 82vh;
    }

    #cutoon-lightbox .cutoon-prev,
    #cutoon-lightbox .cutoon-next {
        width: 2.6rem;
        height: 3.8rem;
        font-size: 1.9rem;
    }

    #cutoon-lightbox .cutoon-prev { left: .35rem; }
    #cutoon-lightbox .cutoon-next { right: .35rem; }
}

@media screen and (max-width: 480px) {
    #header h1 img {
        width: 110px;
    }

    #cutoon-lightbox .cutoon-prev,
    #cutoon-lightbox .cutoon-next {
        background: rgba(255,255,255,.08);
    }
}


/* Improved main / page header logo */
#wrapper > header .inner {
    box-sizing: border-box;
}

#wrapper > header .logo {
    width: 100%;
    margin: 0 0 1.25rem 0;
    line-height: 0;
}

#wrapper > header .logo img {
    display: block;
    width: min(400px, 100%);
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

#wrapper > header p {
    max-width: 100%;
    margin-bottom: 0;
}

@media screen and (max-width: 980px) {
    #wrapper > header .inner {
        width: 100%;
    }
}

@media screen and (max-width: 736px) {
    #wrapper > header {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    #wrapper > header .logo {
        margin-bottom: 1rem;
    }

    #wrapper > header .logo img {
        width: min(300px, 100%);
    }

    #wrapper > header p {
        font-size: .78em;
        line-height: 1.8;
        letter-spacing: .07em;
    }
}

@media screen and (max-width: 420px) {
    #wrapper > header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #wrapper > header .logo img {
        width: min(250px, 100%);
    }

    #wrapper > header p {
        font-size: .72em;
        letter-spacing: .045em;
    }
}
