/* Knowledge Hub — Case Study Carousel */
.kh-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    margin-top: 68px; /* header height */
    background: #000;
    height: 55vh;
    position: relative;
}

.kh-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 100%;
    animation: kh-scroll 30s linear infinite;
}

.kh-carousel::-webkit-scrollbar {
    display: none;
}

.kh-carousel-item {
    flex: 0 0 45vw;
    scroll-snap-align: start;
    height: 100%;
    position: relative;
}

.kh-carousel-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.kh-carousel-media {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.kh-carousel-media video,
.kh-carousel-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kh-carousel-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-family: "INAREA Sans", Helvetica, Arial, sans-serif;
    font-size: 24px;
    font-weight: 300;
    color: #fff;
    line-height: 1.4em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* When carousel is present, remove extra top padding */
.kh-carousel-wrapper + .site .inside-article .entry-header,
.kh-carousel-wrapper ~ * .entry-header {
    padding-top: 60px;
}

/* Override the default page padding when carousel exists */
body.page-template-default:has(.kh-carousel-wrapper) .entry-header {
    padding-top: 60px !important;
}

body.page-template-default:has(.kh-carousel-wrapper) .rank-math-breadcrumb {
    padding-top: 30px !important;
}

@media (max-width: 767px) {
    .kh-carousel-item {
        flex: 0 0 85vw;
    }
    .kh-carousel-wrapper {
        height: 40vh;
    }
    .kh-carousel-title {
        font-size: 18px;
    }
}

@keyframes kh-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.kh-carousel:hover {
    animation-play-state: paused;
}
