@use '../../../styles/tools/functions';
@use '../../../styles/settings/colours';
@use '../../../styles/settings/variables';

.Outer {
    overflow: hidden;
}

.Text {
    margin-bottom: functions.pxRem(20);

    @media all and (min-width: functions.em(1024)) {
        margin-bottom: functions.pxRem(48);
    }
}

.MediaColumn {
    width: 100%;
    
    &--LeftIndentation {
        @media all and (min-width: functions.em(768)) {
            width: 66.6666%;
            margin-left: auto;
        }
    }

    &--Columns2 {
        .GridMedia {
            @media all and (min-width: functions.em(768)) {
                width: 50%;
            }
        }
    }

    &--Columns3 {
        .GridMedia {
            @media all and (min-width: functions.em(768)) {
                width: 33.3333%;
            }
        }
    }
}

.FullWidthImage {
    position: relative;
    overflow: hidden;
}

.GridMedia {
    width: 100%;
}

.GridMediaInner {
    position: relative;
}

.Image {
    width: 100%;
    display: block;

    &--Rounded {
        border-radius: functions.pxRem(10);

        @media all and (min-width: functions.em(768)) {
            border-radius: functions.pxRem(20);
        }
    }
}

.Video {
    width: 100%;
    display: block;
    border: none;
    background-color: transparent;
    overflow: hidden;
    z-index: 1;
    border-radius: 0;

    &[data-media-player] {
        display: block;
    }

    &--Rounded {
        border-radius: functions.pxRem(10);

        @media all and (min-width: functions.em(768)) {
            border-radius: functions.pxRem(20);
        }
    }

    &[data-paused] {
        .VideoLayout {
            opacity: 0;
            pointer-events: none;
        }
    }

    &[data-playing] {
        .MediaProviderHidden {
            opacity: 1;
        }
    }
}

.GridCarousel {
    width: 100%;

    .GridCarouselSlide {
        height: auto;
    }
}

.GridCarouselSlide {
    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.CarouselWrap {
    position: relative;

    @media all and (min-width: functions.em(540)) {
        margin-left: functions.pxRem(-6);
        margin-right: functions.pxRem(-6);
    }

    @media all and (min-width: functions.em(768)) {
        margin-left: functions.pxRem(-12);
        margin-right: functions.pxRem(-12);
    }
    
    &:hover, &:focus-within {
        .Navigation {
            opacity: 1;
        }
    }

    .Carousel {
        overflow: visible;
    }

    .CarouselSlide {
        height: auto;
    }
}

.CarouselSlide {
    max-width: functions.pxRem(variables.$container-width);
    padding-right: functions.pxRem(24);

    @media all and (min-width: functions.em(540)) {
        padding-left: functions.pxRem(6);
        padding-right: functions.pxRem(6);
    }

    @media all and (min-width: functions.em(768)) {
        padding-left: functions.pxRem(12);
        padding-right: functions.pxRem(12);
    }
}

.CarouselSlideInner {
    position: relative;
}

.CarouselPaddingLeft {
    margin-right: functions.pxRem(-24);
}

.CarouselPaddingRight {
    margin-left: functions.pxRem(-24);
}

.NavigationWrap {
    margin-top: functions.pxRem(30);

    @media all and (min-width: functions.em(540)) {
        padding-left: functions.pxRem(6);
        padding-right: functions.pxRem(6);
    }

    @media all and (min-width: functions.em(768)) {
        width: 100%;
        position: absolute;
        top: 50%;
        z-index: 1;
        pointer-events: none;
        margin-top: 0;
        padding-left: functions.pxRem(12);
        padding-right: functions.pxRem(12);
        display: block;
    }

    @media (pointer: coarse) {
        display: none;
    }
}

.NavigationWrapInner {
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.Navigation {
    width: functions.pxRem(60);
    height: functions.pxRem(60);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.3s, background-color 0.3s;

    @media all and (min-width: functions.em(1024)) {
        width: functions.pxRem(90);
        height: functions.pxRem(90);
    }

    @media all and (min-width: functions.em(1200)) {
        width: functions.pxRem(110);
        height: functions.pxRem(110);
    }

    svg {
        width: functions.pxRem(8);

        @media all and (min-width: functions.em(1024)) {
            width: functions.pxRem(14);
        }
    }

    &--Prev {
        left: 0;

        @media all and (min-width: functions.em(768)) {
            transform: translateX(#{functions.pxRem(-24)});
        }

        @media all and (min-width: functions.em(1024)) {
            transform: translateX(calc(-50% - #{functions.pxRem(12)}));
        }

        svg {
            margin-right: 6%;
        }
    }

    &--Next {
        right: 0;

        @media all and (min-width: functions.em(768)) {
            transform: translateX(#{functions.pxRem(24)});
        }

        @media all and (min-width: functions.em(1024)) {
            transform: translateX(calc(50% + #{functions.pxRem(12)}));
        }

        svg {
            margin-left: 6%;
        }
    }

    &--White {
        background-color: colours.$orange-light;
        fill: colours.$green;
    }

    &--Green {
        background-color: colours.$green;
        fill: #FFF;

        &:hover {
            background-color: colours.$green-dark;
        }
    }

    &--Hide {
        opacity: 0 !important;
        pointer-events: none;
    }
}

.Caption {
    margin-top: functions.pxRem(10);
}

.PlayButton {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    &--Hide {
        .PlayButtonInner {
            opacity: 0;
        }
    }

    &:hover {
        .PlayButtonText {
            opacity: 0;
        }

        .PlayButtonIcon {
            opacity: 1;
        }
    }
}

.PlayButtonInner {
    width: functions.pxRem(90);
    height: functions.pxRem(90);
    background-color: colours.$orange;
    border-radius: 50%;
    padding-top: 0.2em;
    display: grid;
    fill: #FFF;
    color: #FFF;

    @media all and (min-width: functions.em(768)) {
        width: functions.pxRem(140);
        height: functions.pxRem(140);
        font-size: functions.pxRem(24);
    }
}

.PlayButtonText, .PlayButtonIcon {
    grid-row: 1;
    grid-column: 1;
    margin: auto;
    transition: opacity 0.3s;
}

.PlayButtonText {
    opacity: 1;
}

.PlayButtonIcon {
    width: functions.pxRem(44);
    opacity: 0;

    @media all and (min-width: functions.em(768)) {
        width: functions.pxRem(52);
    }
}
