/* Styles: Luis Alonso */

/* ==================== IMPORTED FONTS ==================== */
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins-Medium';
    src: url('../assets/fonts/Poppins-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins-Bold';
    src: url('../assets/fonts/Poppins-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ==================== VARIABLES ==================== */
:root {
    --primary-font: 'Inter', sans-serif;
    --secondary-font-medium: 'Poppins-Medium', sans-serif;
    --secondary-font-bold: 'Poppins-Bold', sans-serif;
    --font-color: #222222;
    --neutral-color: #555555;
    --primary-color: #548cda;
    --secondary-color: #800080;
    --alert-color: #de3535;
    --background-color: #fefefe;
    --explication-color: #eeeeee;
}

/* ==================== GENERAL STYLES ==================== */
* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    margin: 0 auto;
    width: 100%;
    max-width: 1024px;
    font-family: var(--primary-font);
    font-optical-sizing: auto;
    color: var(--font-color);
    background-color: var(--background-color);
}

main {
    position: relative;
    flex: 1;
    padding: 0 1rem;
}

h1,
h2,
h3 {
    font-family: var(--secondary-font-medium);
    /* color-mix permite hacer "transparencias" que sobreescriben el color original */
    color: color-mix(in srgb, var(--primary-color), #ffffff 20%);
}

h1 {
    font-size: 2.2rem;
    text-align: center;
}

a {
    position: relative;
    color: color-mix(in srgb, var(--primary-color), #000000 20%);
    font-weight: 600;
    text-decoration: none;

    &::before,
    &::after {
        position: absolute;
        content: '';
        width: 0;
        height: 0.1rem;
        background: var(--secondary-color);
        transition: all 0.3s ease;
    }

    &::before {
        top: 0;
        right: 0;
    }

    &::after {
        bottom: -0.1rem;
        left: 0;
    }

    &:hover {
        color: var(--secondary-color);

        &::before,
        &::after {
            width: 100%;
        }
    }
}

strong {
    font-weight: 500;
    color: var(--secondary-color);
}

/* =============== Header Styles =============== */
header {
    position: sticky;
    top: 0;
    background: var(--background-color);
    z-index: 1;
}

.header-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem;
    overflow: hidden;
}

.logo a {
    font-family: var(--secondary-font-medium);
    font-size: 1.7rem;
    color: var(--secondary-color);
    text-decoration: none;

    span {
        font-family: var(--secondary-font-bold);
        color: var(--primary-color);

    }

    &::before,
    &::after {
        display: none;
    }
}

/* ========== Hamburger menu ========== */
.burger-button {
    /* Default state */
    position: relative;
    display: block;

    input {
        position: absolute;
        display: block;
        width: 1.7rem;
        height: 1.4rem;
        cursor: pointer;
        opacity: 0;
        z-index: 2;
    }

    span {
        position: relative;
        display: block;
        width: 1.7rem;
        height: 0.25rem;
        margin-bottom: 0.3rem;
        border-radius: 0.4rem;
        background: var(--primary-color);
        z-index: 1;

        transform-origin: 0.25rem 0;
        transition: all 0.3s ease;

        &:nth-of-type(1) {
            transform-origin: 0% 0%;
        }

        &:nth-of-type(3) {
            transform-origin: 0% 100%;
        }
    }

    /* Active state (animations) */
    input {
        &:checked~span {
            &:nth-of-type(2) {
                opacity: 0;
            }

            &:nth-of-type(1) {
                background: var(--primary-color);
                transform: rotate(45deg);
            }

            &:nth-of-type(3) {
                background: var(--primary-color);
                transform: rotate(-45deg);
            }
        }

        &:checked~.slide-menu {
            transform: translateX(-100%);
        }
    }
}

.slide-menu {
    position: fixed;
    top: -1rem;
    left: 100%;
    width: 100%;
    height: calc(100dvh - 6rem);
    height: 100dvh;
    padding: 1rem;
    box-sizing: border-box;
    list-style-type: none;
    background-color: #fefefeee;
    transition: transform 0.5s ease;

    a {
        color: var(--neutral-color);
        font-weight: 600;
        text-decoration: none;

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

        &::before,
        &::after {
            display: none;
        }
    }

    li {
        width: fit-content;
        margin-left: auto;
        margin-bottom: 1rem;
        padding: 0.6rem;

        &:first-child {
            margin-top: 3.5rem;
        }

        &:nth-of-type(7) {
            margin: 2.5rem 0 0.3rem auto;
            padding: 0.4rem 0.6rem;
        }

        &:nth-of-type(8),
        &:nth-of-type(9),
        &:nth-of-type(10) {
            margin: 0.3rem 0 0.3rem auto;
            padding: 0.4rem 0.6rem;
        }

        .terms {
            margin-top: 0;
            margin-bottom: 0;
            font-size: 0.8rem;
        }
    }
}

/* =============== Footer Styles =============== */
footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 2;
    background: var(--background-color);

    hr {
        border: var(--neutral-color) 0.05rem solid;
        width: 95%;
    }

    ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        width: 100%;
        margin: 0;
        padding: 0;
        list-style-type: none;
    }

    li {
        text-align: center;
    }

    svg {
        width: 2rem;
        height: 2rem;
        stroke: var(--primary-color);
    }

    p {
        position: relative;
        top: -0.3rem;
    }

    a {
        display: block;
        width: 95%;
        margin: 0 auto;
        padding: 0.5rem 0 0 0;
        font-size: 0.6rem;
        color: var(--primary-color);
        font-weight: 800;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.05rem;

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

        &:focus {
            color: var(--secondary-color);
            transition: all 0.5s ease;

            svg {
                stroke: var(--secondary-color);
                transition: all 0.5s ease;
            }
        }

        &::before,
        &::after {
            display: none;
        }
    }
}