/*** ---------- Block ---------- ***/
.wpb-header:has(+ .wpb-contact) { padding-bottom: calc(var(--pb) + 9.6rem); }
.wpb-header + .wpb-contact { margin-top: -9.6rem; }

/*** ---------- Media ---------- ***/
.wpb-block--media .wpb-text { margin-bottom: 2rem; }

/*** ---------- Blurb ---------- ***/
.wpb-block--blurb .wpb-text { margin-bottom: 2rem; }

/*** ---------- Carousel ---------- ***/
.wpb-block--carousel {
    .wpb-text { margin-bottom: 3.2rem; }
    .wpb-image { position: relative; 
        img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
        &::after { content: ''; display: block; width: 100%; padding-top: 75%; }
    }
}

/* Continuous scroll (smooth scroll carousel and the hero slider) */
.swiper--linear .swiper-wrapper { transition-timing-function: linear; }

/*** ---------- Header ---------- ***/
.wpb-header {
    input { color: var(--clr-text-light); }

    .wpb-header__toolbar { display: flex; align-items: center; gap: 1.6rem; padding-bottom: 3.2rem; 
        .btn { white-space: nowrap; }
        .wpb-breadcrumbs { margin: 0; --excerpt-line-clamp: 1; display: -webkit-box; -webkit-line-clamp: var(--excerpt-line-clamp); -webkit-box-orient: vertical; overflow: hidden; 
            > span > span:not(.breadcrumb_last) { opacity: .65; }
        }
    }

    /*** Home > Slider ***/
    &.wpb-header--home.wpb-var--slider { --bp: 70%; overflow: hidden; background: linear-gradient(to bottom, var(--clr-primary), var(--clr-primary) var(--bp), var(--clr-background) var(--bp)); 
        .wpb-text * { color: var(--clr-text-primary); }
        .swiper { padding-top: 6.4rem; overflow-y: visible; 
            .wpb-card { height: 16rem; transition: transform var(--ts-duration) ease; 
                .wpb-card__header { height: 100%; }
            }
        }

        @media (min-width: 992px) {
            .swiper .wpb-card { height: 40rem; }
        }
    }

    /*** Subpage ***/
    &.wpb-header--subpage:is(.wpb-bg-clr--primary, .wpb-bg-clr--dark, .has-background-image) { overflow: hidden; 
        &::before { --w: 74rem; --h: 22rem; content: ''; position: absolute; left: calc(-1 * var(--w) / 4); bottom: calc(-1 * var(--h) / 12); background: var(--bg-asset) no-repeat center / contain; width: var(--w); height: var(--h); opacity: .6; z-index: 1; pointer-events: none; }
        .container { z-index: 2; }
        .wpb-breadcrumbs { --home-hover-bg-clr: var(--clr-dark); }

        &:is(.wpb-bg-clr--dark, .has-background-image)::before { filter: invert(1); }

        @media (min-width: 992px) {
            &::before { --w: 102rem; --h: 36rem; }
        }
    }

    /*** Home template ***/
    &.wpb-header--home-template .container { --inline-spacing: var(--p-y-medium); overflow: hidden; min-height: var(--mh, 48rem); display: flex; align-items: end; 
        .wpb-text { position: static; z-index: 99; text-decoration: none; transition: var(--ts-duration) ease;
            &::after { content: ''; position: absolute; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; }
            &:hover + .is-background-image { transform: scale(1.05); }
            h1 { margin-top: 1rem; }
            p { --fs: 28px; --lh: 1; }
        }
        .is-background-image { transition: transform var(--ts-duration) ease; }

        @media (min-width: 576px) { --mh: min(64rem, 50vh); border-radius: var(--radius--large); }
        @media (min-width: 992px) { --mh: min(80rem, 65vh); }
    }

    /*** Blog: wide headers ***/
    &.wpb-header--blog[class*="wide"] .container { --inline-spacing: var(--header-padding); --header-padding: var(--pt); overflow: hidden; min-height: var(--mh, 48rem); display: flex; align-items: end; 
        .wpb-text { position: relative; z-index: 99; }

        @media (min-width: 576px) { --mh: min(64rem, 50vh); border-radius: var(--radius--large); }
        @media (min-width: 992px) { --mh: min(80rem, 65vh); }
    }
    &.wpb-header--blog[class*="wide"][class*="-center"] .container .wpb-text {
        * { text-align: center; }
        .badge-group { justify-content: center; }
    }
    &.wpb-header--blog[class*="wide"][class*="middle-center"] .container { align-items: center; }

    /*** Blog: full width headers ***/
    &.wpb-header--blog[class*="full"] .container { --inline-spacing: var(--header-padding); --header-padding: 1.6rem; overflow: hidden; min-height: var(--mh, 48rem); display: flex; align-items: end; 
        .wpb-text { position: relative; z-index: 99; }

        @media (min-width: 576px) { --mh: min(64rem, 50vh); }
        @media (min-width: 992px) { --mh: min(80rem, 65vh); }
    }
    &.wpb-header--blog[class*="center"] .container { justify-content: center; }
    &.wpb-header--blog[class*="full"][class*="-center"] .container {
        .wpb-text {
            * { text-align: center; }
            .badge-group { justify-content: center; }
        }
        > .wpb-meta-group { right: 0; left: 0; justify-content: center; }
    }
    &.wpb-header--blog[class*="full"][class*="middle-center"] .container { align-items: center; }

    /*** Blog: side by side header ***/
    &.wpb-header--blog.side-by-side { --inline-spacing: var(--header-padding); --header-padding: 1.6rem; overflow: hidden; min-height: var(--mh, 48rem); display: grid; grid-template-columns: repeat(var(--gc, 1), minmax(0, 1fr)); background-color: var(--clr-light); 
        .wpb-text-container { min-height: calc(var(--mh) / 2); padding: var(--header-padding); display: grid; place-content: center; 
            .wpb-text { position: relative; z-index: 99; 
                * { text-align: center; }
                .badge-group { justify-content: center; }
            }
        }
        .wpb-image img { min-height: calc(var(--mh) / 2); border-radius: 0; height: 100%!important; object-fit: cover; }
        > .wpb-meta-group { position: absolute; right: var(--header-padding); bottom: var(--header-padding); z-index: 1; }

        @media (min-width: 576px) { --mh: min(64rem, 50vh); }
        @media (min-width: 768px) { --gc: 2; 
            .wpb-image img { border-radius: var(--radius--large) 0 0 var(--radius--large); }
            > .wpb-meta-group { right: var(--header-padding); top: var(--header-padding); bottom: unset; }
        }
        @media (min-width: 992px) { --mh: min(80rem, 65vh); }
    }
}

/*** ---------- Grids: featured, categories, 404 ---------- ***/
:is(.wpb-block--featured, .wpb-block--featured-home, .wpb-block--categories) .wpb-section__body .container,
.wpb-block--404-posts .inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(32rem, 1fr)); gap: var(--gap, 1.6rem); }

:is(.wpb-block--featured, .wpb-block--featured-home, .wpb-block--404-posts) {
    @media (min-width: 1200px) { --gap: 3.2rem; }
}
.wpb-block--categories {
    @media (min-width: 992px) { --gap: 3.2rem; }
}

/*** ---------- Search ---------- ***/
.wpb-block--search {
    .wpb-block__header { padding-bottom: 3.2rem; 
        .wpb-text p { margin-top: .8rem; }
    }
    .container--results:not(:has(> .wpb-text)) { display: grid; grid-template-columns: repeat(auto-fill, minmax(32rem, 1fr)); gap: var(--gap, 1.6rem); }
    .wpb-search-form input { background-color: var(--clr-light); }
    &.wpb-bg-clr--light input { background-color: var(--clr-background); }

    @media (min-width: 1200px) { --gap: 3.2rem; }
}
