/* =========================================================
   CJ Khmer featured-news slider
   ========================================================= */

.cj-featured-slider {
    --cj-slider-gap: 30px;
    --cj-slider-duration: 600ms;

    position: relative;
    width: 100%;
    margin: 0 0 30px;
}

.cj-featured-slider__viewport {
    width: 100%;
    overflow: hidden;
}

.cj-featured-slider__track {
    display: flex;
    align-items: stretch;
    gap: var(--cj-slider-gap);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.cj-featured-slider__track.cj-is-animating {
    transition: transform var(--cj-slider-duration) ease;
}

/* Three cards on desktop */
.cj-featured-card {
    flex: 0 0 calc(
        (100% - (var(--cj-slider-gap) * 2)) / 3
    );
    min-width: 0;
}

.cj-featured-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.cj-featured-card__image {
    position: relative;
    height: 310px;
    overflow: hidden;
    background-color: #d9dfe5;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.cj-featured-card__image::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image: inherit;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform 0.55s ease;
}

.cj-featured-card:hover .cj-featured-card__image::before {
    transform: scale(1.045);
}

.cj-featured-card__image--empty::before {
    display: none;
}

.cj-featured-card__overlay {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.03) 28%,
        rgba(0, 0, 0, 0.82) 100%
    );
}

.cj-featured-card__content {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 28px 20px 20px;
    color: #fff;
}

.cj-featured-card__title {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    color: #fff;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.45;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.cj-featured-card__date {
    display: flex;
    gap: 5px;
    align-items: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
}

.cj-featured-card__clock {
    font-size: 15px;
    line-height: 1;
}

/* Previous and next buttons */
.cj-featured-slider__button {
    position: absolute;
    z-index: 5;
    top: 50%;
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(24, 44, 93, 0.88);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-50%);
    transition:
        opacity 0.25s ease,
        background-color 0.25s ease;
}

.cj-featured-slider:hover .cj-featured-slider__button,
.cj-featured-slider:focus-within .cj-featured-slider__button {
    opacity: 1;
}

.cj-featured-slider__button:hover,
.cj-featured-slider__button:focus-visible {
    background: #182c5d;
}

.cj-featured-slider__button--previous {
    left: 12px;
}

.cj-featured-slider__button--next {
    right: 12px;
}

/* Tablet */
@media (max-width: 991px) {
    .cj-featured-slider {
        --cj-slider-gap: 20px;
    }

    .cj-featured-card {
        flex-basis: calc(
            (100% - var(--cj-slider-gap)) / 2
        );
    }

    .cj-featured-card__image {
        height: 290px;
    }

    .cj-featured-card__title {
        font-size: 21px;
    }

    .cj-featured-slider__button {
        opacity: 1;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .cj-featured-slider {
        --cj-slider-gap: 14px;
        margin-bottom: 22px;
    }

    .cj-featured-card {
        flex-basis: 100%;
    }

    .cj-featured-card__image {
        height: 285px;
    }

    .cj-featured-card__content {
        padding: 24px 17px 17px;
    }

    .cj-featured-card__title {
        font-size: 20px;
        line-height: 1.5;
    }

    .cj-featured-slider__button {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .cj-featured-slider__button--previous {
        left: 8px;
    }

    .cj-featured-slider__button--next {
        right: 8px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cj-featured-slider__track,
    .cj-featured-card__image::before {
        transition: none !important;
    }
}