/* Application layer: layout helpers owned by this app. */

/* ChenEnd small layout helpers, on top of the Novo theme. */

/* Keep the classic scrollbar gutter reserved: without it the whole layout
   jumps sideways whenever a page with a scrollbar is replaced by a shorter
   one and the scrollbar disappears. */
html {
    scrollbar-gutter: stable;
}

/* Height of the fixed header: 78px on desktop (66px menu links + 6px of
   column padding on both sides) and 66px on the mobile header. The spacer
   that pushes the content below the fixed header has to say the same
   numbers, and the theme pins it with !important below 992px. */
.header-space {
    height: 78px;
}

.site-header .desktop-main-bar-left,
.site-header .desktop-main-bar-right {
    padding-top: 6px;
    padding-bottom: 6px;
}

/* The menu links are table cells 75px tall on wide screens. */
@media (min-width: 1200px) {
    .site-header .navigation>ul>li>a {
        height: 66px;
    }
}

.cz-section {
    margin-bottom: 0;
}

/* Vertical rhythm of the original WPBakery rows: the heading blocks bring
   30px of their own margin, these paddings mirror the `vc_custom` rules. */
.cz-section--portfolio {
    padding-top: 61px;
}

/* Full-bleed rows: the templates flag them with `data-full-bleed`, the exact
   offsets are calculated by app.js. */
[data-full-bleed] {
    position: relative;
}

.cz-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s ease, transform .8s ease;
}

.cz-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* The legacy home page centres the portfolio block inside a 3/5 column. */
.cz-narrow {
    width: 60%;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .cz-narrow {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cz-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 991.98px) {
    .header-space {
        height: 66px !important;
    }

    .site-header.mobile-type .header-main-block {
        min-height: 66px;
    }
}

.search-page-form {
    max-width: 480px;
    margin: 0 auto 2rem;
}

.search-page-form .input {
    width: 100%;
    padding: .75rem 1rem;
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
}

.search-result-block {
    margin-bottom: 2.5rem;
}

/* The Recent Posts list of the post sidebar carries no 70px thumbnail, so the
   90px indent the theme reserves for it would leave an empty block on the
   left of every title. */
.blog-post-card .item .text {
    margin-left: 0;
}

/* Project viewer: a full-screen stage with a thumbnail strip underneath.
   `--cz-header-space` is written by app.js with the measured height of the
   fixed header, so the stage always fills exactly the rest of the viewport. */
.cz-gallery {
    --cz-header-space: 75px;
    --cz-strip-height: 110px;
    --cz-thumb-width: 150px;
    --cz-strip-gap: 8px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--cz-header-space));
    background: #0c0c0c;
    color: #fff;
    overflow: hidden;
}

@supports (height: 100dvh) {
    .cz-gallery {
        height: calc(100dvh - var(--cz-header-space));
    }
}

.cz-gallery-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #000;
}

.cz-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .35s ease;
}

.cz-gallery-image.is-loading {
    opacity: .35;
}

/* Project title: a translucent line laid over the top of the picture, so the
   stage keeps the whole height. Resting the pointer on it (or tabbing into
   the back link) brings it back to full contrast. */
.cz-gallery-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 16px 96px 34px 24px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
    color: #fff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}

.cz-gallery-back {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    color: rgba(255, 255, 255, .6);
    transition: color .3s ease;
}

/* Invisible padding: the icon stays small, the hit area does not. */
.cz-gallery-back:after {
    content: "";
    position: absolute;
    top: -16px;
    right: -22px;
    bottom: -16px;
    left: -14px;
}

.cz-gallery-back:focus-visible {
    color: #fff;
}

@media (hover: hover) {
    .cz-gallery-back:hover {
        color: #fff;
    }
}

.cz-gallery-title {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 62%;
    margin: 0 0 0 auto;
    overflow: hidden;
    /* The theme pins h1 to 48px with !important below 768px. */
    font-size: 15px !important;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .04em;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, .6);
    transition: color .3s ease;
}

.cz-gallery-date {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .45);
    transition: color .3s ease;
}

.cz-gallery-bar:focus-within .cz-gallery-back,
.cz-gallery-bar:focus-within .cz-gallery-title {
    color: #fff;
}

@media (hover: hover) {
    .cz-gallery-bar:hover .cz-gallery-back,
    .cz-gallery-bar:hover .cz-gallery-title {
        color: #fff;
    }
}

.cz-gallery-bar:focus-within .cz-gallery-date {
    color: rgba(255, 255, 255, .8);
}

@media (hover: hover) {
    .cz-gallery-bar:hover .cz-gallery-date {
        color: rgba(255, 255, 255, .8);
    }
}

.cz-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .4);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    transition: opacity .25s ease, background-color .25s ease;
}

@media (hover: hover) {
    .cz-gallery-arrow:hover {
        background: #c48f56;
        opacity: 1;
    }
}

.cz-gallery-arrow:focus-visible {
    background: #c48f56;
    opacity: 1;
}

.cz-gallery-arrow.prev {
    left: 22px;
}

.cz-gallery-arrow.next {
    right: 22px;
}

.cz-gallery-counter {
    position: absolute;
    top: 18px;
    right: 26px;
    z-index: 2;
    font-size: 13px;
    /* Same leading as .cz-gallery-title: the box no longer inherits the
       1.5 of the body, which would push the baseline down. */
    line-height: 1.35;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .8);
    text-shadow: 0 1px 10px rgba(0, 0, 0, .6);
}

.cz-gallery-strip {
    flex: 0 0 auto;
    display: flex;
    gap: var(--cz-strip-gap);
    height: var(--cz-strip-height);
    padding: 10px 12px;
    background: #0c0c0c;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
}

.cz-gallery-strip::-webkit-scrollbar {
    display: none;
}

/* End spacers: let the first and the last thumbnail sit in the middle. */
.cz-gallery-strip:before,
.cz-gallery-strip:after {
    content: "";
    flex: 0 0 auto;
    width: calc(50% - var(--cz-thumb-width) / 2 - var(--cz-strip-gap));
}

.cz-gallery-thumb {
    position: relative;
    flex: 0 0 auto;
    width: var(--cz-thumb-width);
    height: 100%;
    padding: 0;
    border: 0;
    background: #000;
    opacity: .55;
    cursor: pointer;
    transition: opacity .3s ease;
}

.cz-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (hover: hover) {
    .cz-gallery-thumb:hover {
        opacity: .85;
    }
}

.cz-gallery-thumb.is-active {
    opacity: 1;
}

.cz-gallery-thumb.is-active:after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid #c48f56;
    pointer-events: none;
}

.cz-gallery-thumb:focus-visible {
    outline: 2px solid #c48f56;
    outline-offset: -2px;
}

@media (max-width: 768px) {
    .cz-gallery {
        --cz-strip-height: 82px;
        --cz-thumb-width: 108px;
    }

    .cz-gallery-bar {
        gap: 10px;
        padding: 14px 76px 26px 16px;
    }

    .cz-gallery-title {
        font-size: 13px !important;
    }

    .cz-gallery-date {
        font-size: 10px;
    }

    .cz-gallery-counter {
        top: 17px;
        right: 16px;
        font-size: 12px;
    }

    .cz-gallery-arrow {
        display: none;
    }

    .cz-gallery-strip {
        padding: 8px 10px;
    }
}
