/* ======= Universal Styles ======= */

/* font family Raleway */
@import url('https://fonts.googleapis.com/css2?family=Belleza&family=Raleway:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* font family Barlow */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* font family Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Custom properties */
:root {
    --light-color: #fff;
    --green-color: #37f0f7;
    --light-color-alt: #afb6cd;
    --primary-background-color: #131417;
    --secondary-background-color: #252830;
    --hover-light-color: var(--light-color);
    --article-content-gradient: linear-gradient(180deg, #1c232e9c, #151d28b7 80%);
    --the-gradient: linear-gradient(to top, #181a1f 20%, transparent);
    --hover-dark-color: var(--primary-background-color);
    --gradient-color: linear-gradient(90deg, #37f0f7, #4af870);
    --transparent-light-color: rgba(255, 255, 255, .05);
    --transparent-dark-color: rgba(0, 0, 0, .75);
    --font-family: 'Poppins', sans-serif;
    --font-size-xsm: 1.2rem;
    --font-size-sm: 1.6rem;
    --font-size-md: 2.4rem;
    --font-size-lg: 3rem;
    --font-size-xl: 4rem;
    --gap: 2rem;
    --margin-sm: 2rem;
    --margin-md: 3rem;
    --item-min-height-sm: 20rem;
    --item-min-height-md: 30rem;
}

/* Base Styles */


* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
}

html {
    font-size: 62.5%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--light-color-alt);
    background-color: var(--primary-background-color);
    transition: background-color .25s, color .25s;
    overflow-x: hidden;

    /* Theme color change */
    &.light-theme {
        --light-color: #3d3d3d;
        --light-color-alt: rgba(0, 0, 0, .6);
        --primary-background-color: #fff;
        --secondary-background-color: #f1f1f1;
        --hover-light-color: #fff;
        --transparent-dark-color: var(--secondary-background-color);
        --transparent-light-color: rgba(0, 0, 0, .1);

        header {

            nav {

                .navbar-right-section {

                    .btn {
                        cursor: pointer;

                        .sun-icon {
                            display: none;
                        }

                        .moon-icon {
                            display: block;
                        }
                    }
                }
            }
        }

        /* Featured */

        .featured {

            .contain {

                .featured-articles {

                    .featured-article {

                        .featured-article-content {
                            border: 1px solid #dfdfdf;

                            .featured-article-content-text {
                                color: #fff;

                                h4 {
                                    color: #fff;
                                }
                            }

                            a {

                                i {
                                    color: #fff;
                                }
                            }
                        }
                    }
                }
            }
        }

        /* Quick Read */

        .quick-read {

            .contain {

                .swiper {

                    .swiper-wrapper {

                        .swiper-slide {
                            border: 1px solid #818181;

                            .swiper-slide-content {

                                * {
                                    color: #fff;
                                }

                                .article-data {

                                    span {

                                        &:nth-child(2) {
                                            background: #fff;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    .swiper-pagination-bullet {
                        background: #fff;
                    }
                }
            }
        }
    }
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

input,
button {
    font: inherit;
    color: inherit;
    border: none;
    background-color: transparent;
}

i {
    font-size: var(--font-size-md);
}

/* ======= Scrollbar For the whole site ======= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--hover-dark-color);
}

/* Reusable classes */

.contain {
    max-width: 1280px;
    margin-inline: auto;
    width: 100%;
}

.flex {
    display: flex;
    align-items: center;
    justify-content: center;
}

section {
    padding: 5rem 2rem;
}

/* ======= 1.0 Header ======= */

header {
    background: var(--secondary-background-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    z-index: 999;

    nav {
        display: flex;
        align-items: center;
        justify-content: space-between;

        .logo {
            font-size: var(--font-size-md);
            color: var(--light-color);
        }

        .menu {

            ul {
                display: flex;
                gap: var(--gap);

                li {

                    a {
                        cursor: pointer;
                        transform: .3s ease;
                    }

                    &:hover {

                        a {
                            color: var(--light-color);
                        }
                    }
                }
            }
        }

        .navbar-right-section {

            .btn {
                cursor: pointer;
                margin-right: .5rem;

                .moon-icon {
                    display: none;
                }

                &:hover {
                    color: var(--light-color);
                }
            }

            .menu-toggle-icon {
                scale: 0;
                opacity: 0;

                .close-menu {
                    display: none;
                }

                &.activated {

                    .open-menu {
                        display: none;
                    }

                    .close-menu {
                        display: block;
                    }
                }
            }
        }
    }

    &.activated {
        box-shadow: 0 1px .5rem var(--transparent-light-color);
    }
}

/* ======= 1.1 Search ======= */

.search-form-container {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999999;
    background: var(--primary-background-color);
    opacity: 0;
    scale: 0;
    transition: opacity .5s ease-in;
    display: flex;
    padding-inline: 3rem;

    .form-container-inner {
        margin: auto;
        display: flex;
        flex-direction: column;
        gap: var(--gap);
        text-align: center;

        form {
            display: flex;
            justify-content: center;
            padding: 1rem;

            input,
            .form-btn {
                display: inline-block;
                border: 2px solid var(--secondary-background-color);
                padding: 1.5rem;
            }

            input {
                border-right: none;
                width: 100%;

                &:focus {
                    outline: none;
                }
            }

            .form-btn {
                margin-left: -.5rem;
                background: var(--secondary-background-color);
                border-left: none;
                width: 8rem;
            }
        }

        .form-note {
            font-size: var(--font-size-xsm);
            align-self: flex-end;
        }
    }

    .form-close-btn {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        border: 2px solid var(--secondary-background-color);
        width: 4rem;
        aspect-ratio: 1/1;
    }

    &.activated {
        opacity: 1;
        scale: 1;
    }
}

/* ======== 1.2 Featured Articles =======*/

.featured {
    margin-top: 3rem;

    .contain {
        display: flex;
        flex-direction: row-reverse;
        gap: var(--gap);

        .featured-right-section {
            display: flex;
            flex-direction: column;
            width: 100%;

            .news {
                width: 100%;
                display: flex;
                align-items: center;
                gap: var(--gap);
                background: var(--secondary-background-color);
                padding-right: 1rem;
                height: auto;
                border-radius: 15rem;

                h1 {
                    background: var(--primary-background-color);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    padding: .25rem;
                    border-radius: inherit;
                    font-size: 1em;
                    font-weight: 500;
                    position: relative;
                    overflow: hidden;

                    &::before {
                        content: '';
                        position: absolute;
                        top: 0%;
                        left: 0%;
                        bottom: 0%;
                        right: 0%;
                        background: var(--green-color);
                        border-radius: inherit;
                        animation: bhoda 45s infinite;
                        clip-path: polygon(0% 0%, 50% 50%, 100% 0%, 100% 100%, 50% 50%, 0% 100%);
                    }

                    span {
                        background: var(--secondary-background-color);
                        padding: 1.5rem;
                        border-radius: inherit;
                        z-index: 4;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        text-align: center;
                    }
                }
            }

            .featured-articles {
                display: flex;
                gap: var(--gap);
                margin-top: var(--gap);
                max-height: 800px;
                height: 100%;
                padding: 0 var(--gap) calc(var(--gap) + .75rem);

                .featured-article {
                    position: relative;
                    border-radius: .5rem;
                    overflow: hidden;

                    img {
                        object-fit: cover;
                        height: 100%;
                        transition: .5s ease;
                        width: 100%;
                    }

                    .featured-article-content {
                        position: absolute;
                        bottom: 0;
                        width: 100%;
                        left: 0;
                        z-index: 10;
                        padding: 1rem 2rem;
                        display: flex;
                        justify-content: space-between;
                        color: var(--light-color);
                        background: var(--article-content-gradient);
                        backdrop-filter: blur(.5rem);
                        border-top: none;
                        outline: none;
                        border-top-left-radius: 1.5rem;
                        border-top-right-radius: 1.5rem;
                        border: 1px solid var(--light-color-alt);
                        border-bottom: none;
                        animation: appear 1s ease;

                        .featured-article-content-text {
                            padding-top: 2rem;

                            h4 {
                                font-weight: 200;
                                color: var(--light-color-alt);
                            }

                            h2 {
                                font-size: 1.2em;
                                margin-block: .5rem;
                            }
                        }

                        a {
                            display: flex;
                            align-items: center;
                            padding-inline: 1.5rem 1rem;
                            cursor: pointer;

                            i {
                                font-size: 1.25em;
                                font-weight: 100;
                            }
                        }
                    }

                    &:hover {

                        img {
                            scale: 1.05;
                        }
                    }

                    &:nth-child(1) {
                        grid-column-start: 1;
                        grid-column-end: 2;
                        grid-row-start: 1;
                        grid-row-end: 3;
                    }
                }

                .the-other-two {
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                    gap: var(--gap);

                    .featured-article {
                        height: 100%;
                    }
                }
            }
        }

        .featured-left-section {
            height: 100%;
            background: var(--primary-background-color);
            border-radius: .5rem;
            padding: 1.5rem;

            .top-posts-container {
                display: flex;
                flex-direction: column;
                height: 100%;
                justify-content: space-evenly;
                width: 100%;
                margin-top: 2rem;

                .top-post {
                    border: 2px solid var(--green-color);
                    padding: .5rem;
                    padding: 1.5rem;
                    width: 100%;
                    position: relative;
                    margin-block: 1.15rem;
                    border-radius: 2rem;

                    h2 {
                        position: absolute;
                        top: -1.75rem;
                        background: var(--primary-background-color);
                        padding: .5rem;
                        font-size: 1.25em;
                        border-radius: 50%;
                        color: var(--green-color);
                        z-index: 10;
                        animation: popup .5s ease;
                    }

                    h3 {
                        font-weight: 600;
                        margin-bottom: .75rem;
                        color: var(--light-color);
                        font-size: 1em;
                    }

                    p {
                        font-size: .8em;
                    }
                }
            }
        }
    }
}

/* ======== 1.3 Quick Read ======= */

.quick-read {
    background: var(--secondary-background-color);

    .contain {

        h2 {
            position: relative;
            font-size: var(--font-size-md);
            margin-bottom: 6rem;
            color: var(--green-color);
            text-transform: uppercase;

            &::before {
                content: attr(data-name);
                font-size: var(--font-size-lg);
                text-transform: uppercase;
                opacity: .1;
                position: absolute;
                top: 1.5rem;
                left: 2rem;
            }
        }

        .swiper {

            .swiper-wrapper {
                height: auto;

                .swiper-slide {
                    height: 40rem;
                    position: relative;

                    .swiper-slide-content {
                        position: absolute;
                        z-index: 10;
                        bottom: 0%;
                        width: 100%;
                        left: 0%;
                        padding: 1.5rem 2rem 2rem;
                        background: var(--the-gradient);

                        h3 {
                            font-size: var(--font-size-md);
                            margin-bottom: 1rem;
                            color: var(--light-color);
                        }

                        .article-data {
                            display: flex;
                            align-items: center;
                            gap: var(--gap);
                            font-size: var(--font-size-xsm);
                            margin-bottom: 1rem;

                            span {

                                &:nth-child(2) {
                                    width: .5rem;
                                    height: .5rem;
                                    background-color: var(--light-color-alt);
                                    transform: rotate(45deg);
                                }
                            }
                        }
                    }
                }
            }

            .swiper-controls {
                width: 4.5rem;
                height: 4.5rem;
                border-radius: 50%;
                aspect-ratio: 1/1;
                background: var(--secondary-background-color);

                &::after {
                    font-size: 1em;
                    color: var(--light-color);
                    font-weight: 800;
                }

                &:hover {
                    background: var(--primary-background-color);
                }
            }

            .swiper-pagination {
                bottom: .5rem;
            }

            .swiper-pagination-bullet {
                background: var(--light-color);
            }
        }
    }
}

/* ======== 1.4 Older Posts ======= */

.older-posts {

    .contain {
        margin-inline: auto;

        h2 {
            position: relative;
            font-size: var(--font-size-md);
            margin-bottom: 6rem;
            color: var(--green-color);
            text-transform: uppercase;

            &::before {
                content: attr(data-name);
                font-size: var(--font-size-lg);
                text-transform: uppercase;
                opacity: .1;
                position: absolute;
                top: 1.5rem;
                left: 2rem;
            }
        }

        .older-posts-container {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(32rem, 1fr));
            gap: var(--gap);
            margin-inline: auto;

            .older-post {
                max-width: 50rem;
                border-radius: var(--gap);
                overflow: hidden;
                padding: var(--gap);
                background: var(--secondary-background-color);
                transition: .5s ease;

                .img-box {
                    position: relative;

                    img {
                        border-radius: calc(var(--gap)/2);
                        box-shadow: inset 2px 2px .5rem #0000004c, inset -2px -2px .5rem #ffffff4c;
                        padding: 1px;
                    }

                    .tag {
                        position: absolute;
                        top: 2.5rem;
                        right: -1%;
                        background: #0000007c;
                        padding: .5rem 2rem .5rem 3rem;
                        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 20% 50%);
                        color: #fff;
                        font-size: 1.1em;
                    }
                }

                .older-post-content {
                    padding-block: var(--gap);

                    h3 {
                        font-size: var(--font-size-md);
                        margin-bottom: 1rem;
                        color: var(--light-color);
                        font-weight: 600;
                    }

                    .article-data {
                        display: flex;
                        align-items: center;
                        gap: var(--gap);
                        font-size: var(--font-size-xsm);
                        margin-bottom: 1rem;

                        span {

                            &:nth-child(2) {
                                width: .5rem;
                                height: .5rem;
                                background-color: var(--light-color-alt);
                                transform: rotate(45deg);
                            }
                        }
                    }

                    p {
                        font-size: .85em;
                        margin-bottom: 1rem;
                    }

                    h4 {
                        font-weight: 300;
                        color: var(--light-color);
                    }
                }

                &:hover {
                    cursor: pointer;
                    background: var(--primary-background-color);

                    .img-box {
                        overflow: hidden;
                        border-radius: calc(var(--gap)/2);

                        img {
                            scale: 1.08;
                            border-radius: inherit;
                            transition: .5s ease;
                        }
                    }
                }
            }
        }
    }
}

/* ======== 1.5 Submit ======= */

.submit {
    padding-block: 10rem 4rem;
    background: var(--secondary-background-color);

    h2 {
        position: relative;
        font-size: var(--font-size-md);
        margin-bottom: 6rem;
        color: var(--green-color);
        text-transform: uppercase;
        margin-inline: auto;
        text-align: center;

        &::before {
            content: attr(data-name);
            font-size: var(--font-size-lg);
            text-transform: uppercase;
            opacity: .1;
            position: absolute;
            top: 1.5rem;
            left: 50%;
            transform: translateX(-50%);
        }
    }

    .contain {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-inline: 2rem 7rem;

        .submit-content {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;

            h1 {
                font-size: 3.5em;
                width: 100%;
                padding-left: 1rem;

                span {
                    color: var(--green-color);
                }
            }

            p {
                padding-inline: 1rem 3rem;
                margin-top: 2rem;
            }

            a {
                padding: 1.5rem 2rem;
                background: linear-gradient(90deg, #1b70df, #48cae4);
                width: 160px;
                color: #fff;
                display: flex;
                justify-content: space-evenly;
                align-items: center;
                margin-block: 4rem;
                border-radius: 500px;
                font-size: 1.2em;

                &:hover {
                    cursor: pointer;
                    color: #fefefe;
                }
            }
        }

        .submit-steps {
            width: 100%;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            height: 600px;

            .circle {
                height: 60%;
                border: 1px solid var(--light-color);
                aspect-ratio: 1/1;
                border-radius: 50%;
                position: relative;

                .step {
                    display: flex;
                    flex-direction: column;
                    background: var(--green-color);
                    width: 200px;
                    aspect-ratio: 1/1;
                    position: absolute;
                    align-items: center;
                    justify-content: center;
                    border-radius: 50%;

                    i {
                        font-size: 3em;
                        color: var(--light-color);
                    }

                    h6 {
                        margin-block: .25rem;
                        font-size: .8em;
                    }

                    &:first-child {
                        top: -100px;
                        left: 50%;
                        transform: translateX(-10%);
                        box-shadow: 0 0 0 2px var(--green-color), inset 0 0 0 1.5rem var(--secondary-background-color);
                    }

                    &:nth-child(2) {
                        bottom: -50px;
                        right: -50px;
                        background: #1c2aeb;
                        box-shadow: 0 0 0 2px #1c2aeb, inset 0 0 0 1.5rem var(--secondary-background-color);
                        scale: .9;
                    }

                    &:nth-child(3) {
                        bottom: 20%;
                        left: -100px;
                        background: #9e00f6;
                        box-shadow: 0 0 0 2px #9e00f6, inset 0 0 0 1.5rem var(--secondary-background-color);
                        scale: .8;
                    }
                }
            }
        }
    }
}

/* ======== 1.6 Newsletter ======= */

.newsletter {

    .contain {
        display: flex;
        align-items: center;
        flex-direction: column;
        justify-content: space-evenly;
        padding-block: 5rem;

        h2 {
            position: relative;
            font-size: var(--font-size-md);
            margin-bottom: 6rem;
            color: var(--green-color);
            text-transform: uppercase;
            margin-inline: auto;
            margin-bottom: 10rem;
    
            &::before {
                content: attr(data-name);
                font-size: var(--font-size-lg);
                text-transform: uppercase;
                opacity: .1;
                position: absolute;
                top: 1.5rem;
                left: 50%;
                transform: translateX(-50%);
            }
        }

        .newsletter-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;

            h3 {
                font-size: var(--font-size-lg);
                color: var(--light-color);
                margin-bottom: 2.5rem;
            }

            p {
                margin-bottom: 4rem;
                letter-spacing: 1px;
                font-weight: 400;
                font-size: .9em;
                padding-inline: 2rem;
            }

            form {
                display: flex;
                justify-content: center;
                padding: 1rem;
    
                input,
                .form-btn {
                    display: inline-block;
                    border: 2px solid var(--secondary-background-color);
                    padding: 1.5rem;
                }
    
                input {
                    border-right: none;
                    width: 100%;
    
                    &:focus {
                        outline: none;
                    }
                }
    
                .btn {
                    margin-left: -.5rem;
                    background: var(--secondary-background-color);
                    border-left: none;
                    width: 8rem;
                    cursor: pointer;
                }
            }
    
        }
    }
}

/* ======= 1.7 Footer ======= */ 

.footer{
    background-color: var(--secondary-background-color);
    
    .contain {
        display: flex;
        justify-content: space-evenly;
        padding-block: 6rem;
        gap: var(--gap);
        padding-inline: 3rem;

        div {

            h6 {
                font-size: var(--font-size-sm);
                text-transform: uppercase;
                margin-bottom: var(--margin-sm);
                color: var(--light-color);
            }

            .footer-list {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                gap: var(--gap);
            }

            &:nth-of-type(2),
            &:nth-of-type(3),
            &:nth-of-type(4) {
                flex-basis: 25%;
            }
        }

        .company-data {
            display: flex;
            flex-direction: column;

            a {

                h2 {
                    color: var(--light-color);
                }
            }

            p {
                margin-block: var(--margin-sm);
                max-width: 75%;
            }

            .social-media {
                display: flex;
                gap: var(--gap);
                margin-bottom: var(--margin-md);
            }

            span {
                opacity: .8;
            }
        }
    }
}

/* ======= Animations */

@keyframes bhoda {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(360deg);
    }

    50% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes appear {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0%);
    }
}

@keyframes popup {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes tpost {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* ======= Responsiveness ======= */

@media (max-width:1160px) {

    .featured {

        .contain {
            flex-direction: column;
        }
    }
}

@media (max-width:1140px) {

    .submit {

        .contain {
            flex-direction: column;
            padding-left: 0rem;
            padding-right: 0rem;

            .submit-content {
                align-items: center;
                text-align: center;

                h1 {
                    font-size: 2.5em;
                }

                p {
                    padding-inline: 4rem;
                }
            }

            .submit-steps {
                justify-content: center;

                .circle {
                    transform: translateX(2rem);
                    scale: .9;
                }
            }
        }
    }
}

@media (max-width:950px) {

    footer {

        .contain {
            flex-direction: column-reverse;

            div {
                margin-bottom: 1.5rem;
            }
        }
    }
}

/* Mobile */

@media (max-width:600px) {

    header {

        nav {

            .menu {
                position: absolute;
                top: 8.5rem;
                right: 1.5rem;
                width: 23rem;
                padding: 1.5rem;
                background: var(--secondary-background-color);
                opacity: 0;
                scale: 0;
                transition: opacity .25s ease-in;

                ul {
                    display: flex;
                    align-items: center;
                    gap: var(--gap);
                    flex-direction: column;

                    li {

                        &:first-child {

                            a {
                                color: var(--light-color);
                            }
                        }

                        a {
                            cursor: pointer;

                            &:hover {
                                color: var(--light-color);
                            }
                        }
                    }
                }

                &.activated {
                    opacity: 1;
                    scale: 1;
                    box-shadow: 1px 1px 1rem var(--transparent-light-color);
                }
            }

            .navbar-right-section {

                .menu-toggle-icon {
                    scale: 1;
                    opacity: 1;
                }
            }
        }
    }

    .featured {

        .contain {
            flex-direction: column;

            .featured-right-section {
                padding-inline: 0px;

                .featured-articles {
                    display: flex;
                    flex-direction: column;
                    height: 100%;
                    max-height: none;
                    padding-inline: 0px;

                    .featured-article {

                        img {
                            width: 100%;
                        }

                        .featured-article-content {

                            .featured-article-content-text {
                                padding-top: .25rem;

                                h4 {
                                    font-size: .8em;
                                }

                                h2 {
                                    font-size: 1em;
                                }
                            }
                        }
                    }
                }
            }

            .featured-left-section {
                width: 100%;

                .top-posts-container {

                    .top-post {
                        animation: tpost .75s ease-in-out;
                        animation-timeline: view();
                        animation-range-start: -10vh;
                        animation-range-end: 15vh;
                    }
                }
            }
        }
    }

    .older-posts {
        grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
    }

    .submit {

        h2 {

            &::before {
                font-size: 1.05em;
            }
        }

        .contain {
            align-items: center;
            padding-inline: 0rem;

            .submit-content {
                margin-inline: auto;
                width: 100%;

                h1 {
                    padding-left: 0rem;
                }

                p {
                    padding-inline: 2rem;
                }
            }

            .submit-steps {
                height: 360px;

                .circle {

                    .step {
                        width: 140px;

                        i {
                            font-size: 2.5em;
                        }
                    }
                }
            }
        }
    }
}