/* =========================================================
   APT COURSE CAROUSEL
   ========================================================= */

.apt-carousel-band {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.apt-carousel-band--one {
    background-color: #ffffff;
}

.apt-carousel-band--two {
    background-color: #ffffff;
}

.apt-carousel-band--three {
    background-color: #ffffff;
}


/* =========================================================
   MAIN CAROUSEL WRAPPER
   ========================================================= */

.apt-carousel {
    display: block;
    clear: both;
    float: left;
    width: 100%;
    margin: 0;
    padding: 75px 0 0;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
}


/* =========================================================
   HEADER
   ========================================================= */

.apt-carousel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    gap: 25px;
    margin: 0 0 24px;
}

.apt-carousel__intro {
    flex: 1;
    min-width: 0;
}

.apt-carousel__heading {
    margin: 0 0 12px;
    padding: 0;
    color: #454545;
    font-family: "Open Sans", sans-serif;
    font-size: 27px;
    line-height: 1.25;
    font-weight: 800;
    text-align: left;
}

.apt-carousel__description {
    margin: 0 0 12px;
    padding: 0;
    color: #454545;
    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    text-align: left;
}


/* =========================================================
   CAROUSEL STAGE
   ========================================================= */

.apt-carousel__stage {
    position: relative;
    width: 100%;
    padding-left: 58px;
    padding-right: 58px;
    box-sizing: border-box;
}


/* =========================================================
   EDGE NAVIGATION BUTTONS
   ========================================================= */

.apt-carousel__button {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: auto;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 8px;

    background-color: #47BAC6;
    color: #ffffff;

    cursor: pointer;
    outline: none;
    box-shadow: none;

    transition:
        background-color 0.25s ease,
        opacity 0.25s ease;
}

.apt-carousel__button--previous {
    left: 0;
}

.apt-carousel__button--next {
    right: 0;
}


/* =========================================================
   EDGE NAVIGATION ARROWS
   ========================================================= */

.apt-carousel__button span {
    display: block;
    position: relative;
    top: -2px;

    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 52px;
    font-weight: 300;
    line-height: 1;
}


/* =========================================================
   EDGE NAVIGATION HOVER
   ========================================================= */

.apt-carousel__button:hover {
    background-color: #787878;
    color: #ffffff;
}

.apt-carousel__button:focus,
.apt-carousel__button:focus-visible {
    outline: none;
    box-shadow: none;
}


/* =========================================================
   DISABLED EDGE NAVIGATION
   ========================================================= */

/*
Keeps the unavailable navigation block visible so the
cards remain visually balanced.

Beginning:
left = grey
right = active

End:
left = active
right = grey
*/

.apt-carousel__button:disabled {
    opacity: 1;
    visibility: visible;
    pointer-events: none;

    background-color: #f0f0f0;
    color: #ffffff;

    cursor: default;
}


/* =========================================================
   CAROUSEL LAYOUT
   ========================================================= */

.apt-carousel__viewport {
    width: 100%;
    overflow: hidden;
}

.apt-carousel__track {
    display: flex;
    align-items: stretch;

    /*
    Desktop gap between cards.
    */

    gap: 20px;

    transition: transform 0.7s ease;

    will-change: transform;
}


/*
Three complete cards on desktop.

There are two gaps between three visible cards:
20px + 20px = 40px.
*/

.apt-carousel__slide {
    flex: 0 0 calc((100% - 40px) / 3);
    min-width: 0;
    box-sizing: border-box;
}


/* =========================================================
   NORMAL CLICKABLE CARD
   ========================================================= */

.apt-carousel__card-link {
    display: flex;
    flex-direction: column;
    height: 100%;

    overflow: hidden;

    background-color: #F6F6F6;

    border: 0;
    border-radius: 14px;

    color: #454545;
    text-decoration: none;

    box-sizing: border-box;

    padding-bottom: 12px;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

.apt-carousel__card-link:hover {
    background-color: #ececec;
    color: #454545;
    text-decoration: none;
}

.apt-carousel__card-link:focus,
.apt-carousel__card-link:visited {
    color: #454545;
    text-decoration: none;
}


/* =========================================================
   CARD IMAGE
   ========================================================= */

.apt-carousel__image {
    display: block;
    width: 100%;
    height: 170px;

    object-fit: cover;

    border-radius: 14px 14px 0 0;
}


/* =========================================================
   NORMAL CARD CONTENT
   ========================================================= */

.apt-carousel__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;

    padding: 22px 23px 30px;

    box-sizing: border-box;
}

.apt-carousel__content h2 {
    width: 100%;

    margin: 0 0 14px;
    padding: 0;

    color: #47BAC6;

    font-family: "Open Sans", sans-serif;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;

    text-align: left;
}

.apt-carousel__content p {
    width: 100%;

    margin: 0 0 18px;
    padding: 0;

    color: #454545;

    font-family: "Open Sans", sans-serif;
    font-size: 14.5px;
    line-height: 1.45;
    font-weight: 400;

    text-align: left;
}


/* =========================================================
   COURSE NUMBER
   ========================================================= */

.apt-carousel__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    margin: 5px 0 22px;
    padding: 0;

    background-color: #787878;
    color: #ffffff;

    border-radius: 3px;

    font-family: "Open Sans", sans-serif;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;

    box-sizing: border-box;
}


/* =========================================================
   NORMAL CARD TEXT LINK
   ========================================================= */

.apt-carousel__text-link {
    display: inline-flex;
    align-items: center;

    gap: 13px;

    margin-top: auto;

    color: #1967d2;

    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;

    text-decoration: none;

    transition: color 0.2s ease;
}

.apt-carousel__card-link:hover .apt-carousel__text-link {
    color: #47BAC6;
}


/* =========================================================
   NORMAL CARD THIN ARROW
   ========================================================= */

.apt-carousel__text-arrow {
    display: inline-block;
    position: relative;
    top: 1px;

    width: 31px;
    height: 12px;

    flex-shrink: 0;

    transform: translateX(0);

    transition: transform 0.25s ease;
}

.apt-carousel__text-arrow::before {
    content: "";

    position: absolute;

    top: 5px;
    left: 0;

    width: 30px;
    height: 1px;

    background-color: currentColor;
}

.apt-carousel__text-arrow::after {
    content: "";

    position: absolute;

    top: 2px;
    right: 0;

    width: 6px;
    height: 6px;

    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;

    transform: rotate(45deg);
}

.apt-carousel__card-link:hover .apt-carousel__text-arrow {
    transform: translateX(7px);
}


/* =========================================================
   VIEW ALL CARD
   ========================================================= */

.apt-carousel__view-all-card {
    display: flex;
    flex-direction: column;

    height: 100%;

    overflow: hidden;

    background-color: #47BAC6;
    color: #ffffff;

    border: 0;
    border-radius: 14px;

    text-decoration: none;

    box-sizing: border-box;

    transition: background-color 0.25s ease;
}

.apt-carousel__view-all-card:hover,
.apt-carousel__view-all-card:focus,
.apt-carousel__view-all-card:visited {
    color: #ffffff;
    text-decoration: none;
}

.apt-carousel__view-all-card:hover {
    background-color: #686868;
}


/* =========================================================
   VIEW ALL CARD CONTENT
   ========================================================= */

/*
The entire group of content is vertically centred
within the grey card.
*/

.apt-carousel__view-all-content {
    display: flex;
    flex: 1;
    flex-direction: column;

    justify-content: center;
    align-items: flex-start;

    padding: 32px 28px;

    box-sizing: border-box;
}


/* =========================================================
   VIEW ALL CARD HEADING
   ========================================================= */

.apt-carousel__view-all-content h2 {
    width: 100%;

    margin: 0 0 18px;
    padding: 0;

    color: #ffffff;

    font-family: "Open Sans", sans-serif;
    font-size: 33px;
    line-height: 1.25;
    font-weight: 800;

    text-align: left;
}


/* =========================================================
   VIEW ALL CARD PARAGRAPH
   ========================================================= */

.apt-carousel__view-all-content p {
    width: 100%;

    margin: 0 0 20px;
    padding: 0;

    color: #ffffff;

    font-family: "Open Sans", sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    font-weight: 400;

    text-align: left;
}


/* =========================================================
   VIEW ALL CARD LINK
   ========================================================= */

/*
Unlike the normal course cards, there is deliberately
no margin-top:auto here.

This keeps the link directly beneath the paragraph.
*/

.apt-carousel__view-all-link {
    display: inline-flex;
    align-items: center;

    gap: 13px;

    margin: 0;

    color: #ffffff;

    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;

    text-decoration: none;
}


/* =========================================================
   VIEW ALL CARD ARROW
   ========================================================= */

.apt-carousel__view-all-arrow {
    display: inline-block;
    position: relative;
    top: 1px;

    width: 31px;
    height: 12px;

    flex-shrink: 0;

    transform: translateX(0);

    transition: transform 0.25s ease;
}

.apt-carousel__view-all-arrow::before {
    content: "";

    position: absolute;

    top: 5px;
    left: 0;

    width: 30px;
    height: 1px;

    background-color: #ffffff;
}

.apt-carousel__view-all-arrow::after {
    content: "";

    position: absolute;

    top: 2px;
    right: 0;

    width: 6px;
    height: 6px;

    border-top: 1px solid #ffffff;
    border-right: 1px solid #ffffff;

    transform: rotate(45deg);
}

.apt-carousel__view-all-card:hover
.apt-carousel__view-all-arrow {
    transform: translateX(7px);
}


/* =========================================================
   TABLET
   ========================================================= */

@media only screen and (max-width: 1100px) {

    .apt-carousel {
        padding-top: 36px;
        padding-bottom: 42px;
    }


    /* Space for navigation blocks */

    .apt-carousel__stage {
        padding-left: 54px;
        padding-right: 54px;
    }


    .apt-carousel__button {
        width: 44px;
    }


    /*
    Tablet gap between cards.
    */

    .apt-carousel__track {
        gap: 22px;
    }


    /*
    Two complete cards on tablet.
    */

    .apt-carousel__slide {
        flex-basis: calc((100% - 22px) / 2);
    }


    .apt-carousel__image {
        height: 165px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media only screen and (max-width: 600px) {


    /*
    Match normal mobile page margin.
    */

    .apt-carousel-band .gridContainer {
        width: 100%;
        max-width: none;

        margin: 0;

        padding-left: 23px;
        padding-right: 23px;

        box-sizing: border-box;
    }


    /*
    Mobile carousel spacing.
    */

    .apt-carousel {
        float: none;

        width: 100%;

        margin: 0;

        padding-top: 55px;
        padding-bottom: 0;
    }


    /* Header */

    .apt-carousel__header {
        display: block;

        width: 100%;

        margin: 0;
    }

    .apt-carousel__intro {
        width: 100%;
    }

    .apt-carousel__heading {
        width: 100%;

        margin: 0 0 10px;
        padding: 0;

        font-size: 22px;
        line-height: 1.25;
    }

    .apt-carousel__description {
        width: 100%;

        margin: 0 0 30px;
        padding: 0;

        font-size: 14px;
        line-height: 1.5;
    }


    /*
    Remove navigation block space on mobile.
    */

    .apt-carousel__stage {
        padding-left: 0;
        padding-right: 0;
    }


    /*
    Mobile uses swipe navigation.
    */

    .apt-carousel__button {
        display: none;
    }


    /*
    Extend viewport towards the right-hand
    edge of the screen.
    */

    .apt-carousel__viewport {
        width: calc(100% + 23px);

        overflow: hidden;

        touch-action: pan-y;
    }


    /*
    Mobile gap between cards.
    */

    .apt-carousel__track {
        gap: 18px;
    }


    /*
    Show most of one card plus part
    of the following card.
    */

    .apt-carousel__slide {
        flex-basis: calc(100% - 52px);
    }


    /* Normal mobile card */

    .apt-carousel__image {
        height: 155px;
    }

    .apt-carousel__content {
        padding: 19px 19px 21px;
    }

    .apt-carousel__content h2 {
        font-size: 22px;
    }

    .apt-carousel__content p {
        font-size: 15px;
        line-height: 1.45;
    }

    .apt-carousel__number {
        width: 32px;
        height: 32px;

        margin: 5px 0 12px;

        font-size: 16px;
    }


    /*
    View-all card on mobile.
    Keep its content vertically centred.
    */

    .apt-carousel__view-all-content {
        padding: 28px 24px;
    }

    .apt-carousel__view-all-content h2 {
        font-size: 25px;
        line-height: 1.25;
    }

    .apt-carousel__view-all-content p {
        font-size: 15px;
        line-height: 1.5;
    }

}