@use "sass:color";
@use "../abstracts/mixins";
@use "../abstracts/variables";

.popin{
    position: fixed;
    z-index: 200;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: auto;
    visibility: hidden;
    opacity: 0;

    &--opened{
        visibility: visible;
        opacity: 1;
    }

    .container{
        @include mixins.respondTo('xs'){
            padding-left: 0;
            padding-right: 52px;
        }
    }

    &_background{
        position: fixed;
        z-index: 0;
        top: 0; left: 0; right: 0; bottom: 0;
        background-color: color.adjust(variables.$cPrimary, $alpha: -0.06);
        opacity: 0;
        cursor: pointer;
    }

    &_scroller{
        padding: 22vh 0 7vh 0;

        @include mixins.respondTo('sm'){
            padding: 10vh 0 5vh 0;
        }
    }

    &_box{
        position: relative;
        z-index: 1;
        background-color: #FFF;
        // opacity: 0;
        min-height: 86vh;
        overflow: hidden;
        width: 49.15%;
        margin-left: 16.95%;

        @include mixins.respondTo('md'){
            width: 60.45%;
        }

        @include mixins.respondTo('sm'){
            width: 80%;
            margin-left: 10%;
        }

        @include mixins.respondTo('xs'){
            width: 100%;
            margin-left: 0;
        }
    }

    &_loading{
        content: "";
        position: absolute;
        z-index: 1;
        top: 7vh; left: 50%;
        margin-left: -30px;
        margin-top: -30px;
        width: 60px;
        height: 60px;
        animation: rotate 0.5s linear infinite;
        border-radius: 100%;
        border-top: 2px solid #CCC;
        border-bottom: 2px solid transparent;
        border-left: 2px solid #CCC;
        border-right: 2px solid transparent;
        opacity: 0;
        transition: opacity 0.2s linear;

        @include mixins.respondTo('xs'){
            margin-left: -20px;
            margin-top: -20px;
            width: 40px;
            height: 40px;
            top: 12vh;
        }

        &--visible{
            opacity: 1;
        }
    }

    &_content{
        opacity: 0;
        transition: opacity 0.2s linear;

        &--visible{
            opacity: 1;
        }
    }

    &_close{
        position: fixed;
        top: 9vh; left: calc(100%  - 25px);
        color: #FFF;
        font-family: variables.$ffC;
        text-transform: uppercase;
        font-size: 20px;
        text-decoration: underline;
        line-height: 1;
        transform: rotate(90deg);
        transform-origin: center left;
        display: none;

        @include mixins.respondTo('xs'){
            display: block;
        }
    }
}

.pNews{
    padding: mixins.vwCol(1,0);

    @include mixins.respondTo('xs'){
        padding: 40px 25px 0 50px;
    }

    &_surtitle{
        font-family: variables.$ffC;
        @include mixins.fontSize(24,24);
        color: variables.$cPrimary;
        padding-bottom: 4vh;
        margin-bottom: 4vh;
        border-bottom: 2px solid #979797;
        text-transform: uppercase;

        @include mixins.respondTo('xs'){
            @include mixins.fontSize(14,14,variables.$baseFontSizeXs);
            padding-bottom: 2vh;
            margin-bottom: 2vh;
        }
    }

    &_title{
        @include mixins.fontSize(64,72);
        color: variables.$cDark;
        margin-bottom: 4vh;

        @include mixins.respondTo('md'){
            @include mixins.fontSize(50,54,variables.$baseFontSizeMd);
        }

        @include mixins.respondTo('sm'){
            @include mixins.fontSize(40,46,variables.$baseFontSizeSm);
        }

        @include mixins.respondTo('xs'){
            @include mixins.fontSize(28,30,variables.$baseFontSizeXs);
        }
    }
    
    &_video{
        margin-bottom: 4vh;

        .plyr__video-wrapper{
            filter: grayscale(100%);
        }
    }

    &_dateAndType{
        @include mixins.respondTo('xs'){
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    }

    &_date{
        @include mixins.fontSize(14,17);
        color: variables.$cDark;
        margin-bottom: 1vh;

        @include mixins.respondTo('xs'){
            margin-bottom: 0;
        }
    }

    &_type{
        @include mixins.fontSize(24,24);
        font-family: variables.$ffC;
        color: variables.$cPrimary;
        text-transform: uppercase;
    }

    &_baseline{
        @include mixins.fontSize(27,38);
        color: #989898;
        margin-bottom: 2vh;
    }

    &_content{
        @include mixins.fontSize(16,27);
        color: #989898;
    }

    &_sharer{
        display: flex;
        align-items: flex-end;
        margin-top: 4vh;
        margin-bottom: 4vh;

        @include mixins.respondTo('xs'){
            margin-top: 1.5vh;
            margin-bottom: 40px;
        }

        &_separator{
            flex: 1;
            height: 2px;
            background-color: #979797;

            @include mixins.respondTo('xs'){
                display: none;
            }
        }

        &_button{
            width: 180px;
            font-size: 0;
            text-align: right;

            @include mixins.respondTo('xs'){
                width: auto;
            }

            .button{
                @include mixins.fontSize(16,16);
                width: 100px;
                text-align: center;

                @include mixins.respondTo('xs'){
                    width: auto;
                }
            }
        }
    }

    &_related{
        position: relative;
        width: calc(100% - 100px);
        padding: 40px 0;

        @include mixins.respondTo('xs'){
            width: 100%;
        }

        &::before{
            content: "";
            position: absolute;
            top: 0; bottom: 0; right: -25px; left: -50px;
            background: #ECECEC;
            display: none;
            
            @include mixins.respondTo('xs'){
                display: block;
            }
        }

        .relatedCarousel{
            position: relative;
            overflow: visible;

            &::before{
                content: "";
                position: absolute;
                top: 0; right: 100%; bottom: 0;
                width: 100vw;
                background-color: #FFF;
                z-index: 2;

                @include mixins.respondTo('xs'){
                    display: none;
                }
            }

            .swiper-slide{
                .newsBloc{
                    margin-right: 80px;
                    margin-bottom: 0;
                    opacity: 0.3;
                    transition: opacity 0.2s linear;

                    @include mixins.respondTo('xs'){
                        margin-right: 6vw;
                    }

                    &_title{

                        @include mixins.respondTo('xs'){
                            @include mixins.fontSize(26,30,variables.$baseFontSizeXs);
                        }
                    }
                }

                &.swiper-slide-active{
                    .newsBloc{
                        opacity: 1;
                    }
                }
            }
        }
    }
}