/* IMPORT DES VARIABLES */
@import url(./config.css);

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--accent);
    color: var(--foreground);
}

body {
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "outfit";

    & h2:not(.about-text h2) {
        font-size: var(--fontLarge);
        color: var(--accent);
        font-weight: 600;
    }

    /* HEADER */
    & header {
        background-color: var(--background);
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        max-height: 110px;
        transition: opacity 0.3s ease, transform 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--padSmall);

        &.active {
            position: relative;
        }

        &.hidden {
            opacity: 0;
            transform: translateY(-100%);
            pointer-events: none;
        }

        & .logo-link {
            & .logo {
                height: 60px;

                /* RESPONSIVE */
                @media screen and (max-width: 950px) {
                    height: var(--padMedium);
                }

                &:hover {
                    opacity: 0.75;
                }
            }
        }

        & .hamburger {
            width: var(--padMedium);
            height: var(--padMedium);
            position: fixed;
            top: var(--padSmall);
            right: var(--padSmall);
            cursor: pointer;
            z-index: 2;
            display: none;
            flex-direction: column;
            gap: 5px;

            @media screen and (max-width: 950px) {
                display: flex;
            }

            & span.line {
                display: block;
                position: absolute;
                height: 2px;
                width: 100%;
                background: var(--accent);
                border-radius: var(--radius);
                opacity: 1;
                left: 0;
                -webkit-transform: rotate(0deg);
                -moz-transform: rotate(0deg);
                -o-transform: rotate(0deg);
                transform: rotate(0deg);
                -webkit-transition: 0.25s ease-in-out;
                -moz-transition: 0.25s ease-in-out;
                -o-transition: 0.25s ease-in-out;
                transition: 0.25s ease-in-out;
            }

            & span:nth-child(1) {
                top: 0px;
            }

            & span:nth-child(2),
            & span:nth-child(3) {
                top: 10px;
            }

            & span:nth-child(4) {
                top: 20px;
            }

            &.open span:nth-child(1) {
                top: 10px;
                width: 0%;
                left: 50%;
            }

            &.open span:nth-child(2) {
                -webkit-transform: rotate(45deg);
                -moz-transform: rotate(45deg);
                -o-transform: rotate(45deg);
                transform: rotate(45deg);
            }

            &.open span:nth-child(3) {
                -webkit-transform: rotate(-45deg);
                -moz-transform: rotate(-45deg);
                -o-transform: rotate(-45deg);
                transform: rotate(-45deg);
            }

            &.open span:nth-child(4) {
                top: 10px;
                width: 0%;
                left: 50%;
            }
        }

        nav {
            ul {
                list-style: var(--listType);
                display: flex;
                gap: var(--padSmall);
                align-items: center;
                justify-content: space-between;

                @media screen and (max-width: 950px) {
                    flex-direction: column;
                }

                & li a {
                    text-decoration: none;
                    color: var(--foreground);
                    font-weight: 400;
                    transition: color 0.2s;

                    &:hover,
                    &.active {
                        color: var(--accent);
                    }

                    &.icons img {
                        width: var(--padSmall);
                        height: var(--padSmall);
                        object-fit: contain;
                    }
                }
            }

            @media screen and (max-width: 950px) {
                flex-direction: column;
                gap: 5px;
                padding: var(--padMedium);
                position: fixed;
                top: 0;
                right: 0;
                left: 0;
                background: var(--background);
                transform: translateY(-100%);
                transition: all 0.3s ease;
                border-bottom: 1px solid var(--accent);
            }

            &.visible {
                transform: translateY(0);
            }
        }
    }

    /* MAIN */
    & main {
        display: flex;
        flex-direction: column;

        /* SEPARATION ENTRE SECTION */
        & .separator {
            width: 75%;
            margin: var(--padMedium) auto;
            height: 1px;
            background-color: var(--shadow);
            border-radius: 2px;
            opacity: 0.25;
        }

        /* HERO SECTION */
        & .hero {
            background: url("../img/main_lucien.webp") no-repeat top/cover;
            background-attachment: fixed;
            color: var(--background);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: var(--padSmall);
            height: 100vh;
            position: relative;

            @media screen and (max-width: 950px) {
                padding-top: 120px;
                align-items: flex-start;
                justify-content: flex-start;
            }

            & .overlay {
                width: 100%;
                height: 100%;
                position: absolute;
                left: 0;
                top: 0;
                right: 0;
                bottom: 0;
                background: linear-gradient(
                    135deg,
                    var(--accent) 0%,
                    var(--errors) 100%
                );
                opacity: 0.5;
                pointer-events: none;
            }

            & h1 {
                font-family: var(--fontPrimary);
                font-size: var(--fontSizeLarge);
                margin-bottom: 20px;
                z-index: 1;
                position: relative;
                text-shadow: 2px 2px 5px #25242250;

                @media screen and (max-width: 950px) {
                    font-size: var(--padMedium);
                    line-height: 120%;
                }
            }

            & .slogan {
                font-size: var(--fontSizeMedium);
                margin-bottom: var(--padMedium);
                z-index: 1;
                position: relative;
                text-shadow: 2px 2px 5px #25242250;
            }

            & .cta-buttons {
                display: flex;
                gap: var(--padMedium);
                justify-content: center;
                z-index: 1;
                position: relative;

                @media screen and (max-width: 950px) {
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    gap: var(--padSmall);
                    width: 100%;
                }

                & .btn {
                    padding: var(--padSmall) var(--padMedium);
                    border-radius: var(--radius);
                    text-decoration: none;
                    font-weight: 600;
                    transition: background-color 0.3s;

                    @media screen and (max-width: 950px) {
                        width: 100%;
                    }
                }
            }

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

            & .primary:hover {
                filter: brightness(0.85);
            }

            & .secondary {
                background-color: var(--shadow);
                color: var(--background);
            }

            & .secondary:hover {
                background-color: #536a77;
            }
        }

        & .ssaProject-hero {
            background: url("/assets/img/benevole.webp") no-repeat center/cover;
            background-attachment: fixed;

            & h1 {
                max-width: 75%;
                text-align: center;
                text-wrap: balance;
            }
        }

        /* BACKGROUND POUR CLIP PATH WAVES */
        & .background {
            background: var(--background);
            display: flex;
            flex-direction: column;
            gap: var(--padMedium);
            justify-content: center;
        }

        /* SECTION ABOUT */
        & .about {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            clip-path: var(--clipPath);

            & h2 {
                color: var(--background);
            }

            @media screen and (max-width: 950px) {
                flex-direction: column;
                clip-path: none;
            }

            & .text,
            & .illustration {
                flex: 1;
                height: 100vh;
            }

            & .text {
                padding: var(--padMedium);
                display: flex;
                flex-direction: column;
                gap: var(--padSmall);
                color: var(--background);
                background: var(--accent);

                @media screen and (max-width: 950px) {
                    padding: var(--padSmall);
                    clip-path: none;
                }

                p span {
                    font-weight: 600;
                }

                ul {
                    padding-left: var(--padSmall);
                    display: flex;
                    flex-direction: column;
                    gap: var(--padSmall);

                    li {
                        list-style-type: "→ ";
                    }
                }

                a {
                    color: var(--accent);
                    font-weight: 600;
                    padding: 5px var(--padSmall);
                    text-decoration: none;
                    background: var(--background);
                    border-radius: var(--radius);
                }

                a.btn,
                button {
                    width: fit-content;
                    padding: var(--padSmall) var(--padMedium);
                    outline: none;
                    border: none;
                    border-radius: var(--radius);
                    background: var(--background);
                    color: var(--accent);
                    text-transform: uppercase;
                    font-weight: 700;
                    cursor: pointer;
                    text-decoration: none;

                    &:hover {
                        opacity: 0.75;
                    }

                    &:active {
                        transform: scale(0.98);
                    }
                }
            }

            & .about-text {
                background: var(--background);
                clip-path: none;
                color: var(--foreground);

                & h2 {
                    color: var(--accent);
                }
            }

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

        /* PAGE PROJET SSA */
        & .projet-ssa {
            clip-path: var(--clipPath);
            align-items: flex-start;
            height: 100vh;

            @media screen and (max-width: 950px) {
                clip-path: none;
            }

            & .projet-ssa-illustration,
            & .text {
                height: 100%;
            }

            & .text {
                clip-path: none;
            }

            & .projet-ssa-illustration {
                position: relative;
                transition: 2s ease;
                background: url("/assets/img/banner.webp") no-repeat
                    center/cover;
            }
        }

        & .dessin {
            width: 50%;
            border-radius: var(--radius);
            box-shadow: #00000015;
            margin: 0 auto;
            max-height: 80vh;
            object-fit: contain;

            @media screen and (max-width: 950px) {
                width: calc(100% - var(--padMedium));
            }
        }

        /* ACTUALITES */
        & .news {
            padding: var(--padMedium);
            background-color: var(--background);
            display: flex;
            flex-direction: column;
            gap: var(--padSmall);

            @media screen and (max-width: 950px) {
                padding: var(--padSmall);
            }

            & .news-grid {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                flex-wrap: wrap;
                gap: var(--padSmall);

                .news-item {
                    flex: 1;
                    min-width: 270px;
                    background-color: #b8b8b850;
                    padding: var(--padSmall);
                    border-radius: var(--radius);
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                    gap: var(--padSmall);

                    & h3 {
                        font-size: var(--fontSizeLarge);
                    }

                    img {
                        width: 100%;
                        aspect-ratio: 16/9;
                        border-radius: var(--radius);
                        object-fit: cover;
                    }

                    & .read-more {
                        color: var(--background);
                        background: var(--accent);
                        padding: 5px var(--padSmall);
                        border-radius: var(--radius);
                        text-decoration: none;
                        font-weight: 600;

                        &:hover {
                            opacity: 0.75;
                        }
                    }
                }
            }
        }

        /* ARTICLE DETAILS */
        & .details {
            width: 75%;
            margin: 0 auto;
            margin-top: 100px;
            display: flex;
            flex-direction: column;
            padding: var(--padMedium);
            position: relative;

            & .heading {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: var(--padMedium);

                & .date {
                    background: #84a59d25;
                    border-radius: var(--padMedium);
                    padding: 5px var(--padSmall);
                    color: var(--accent);
                    width: fit-content;
                }
            }

            & .description {
                margin-top: var(--padSmall);
            }

            & img {
                width: 100%;
                max-height: 400px;
                object-fit: contain;
            }
        }

        /* SECTION PARTENAIRES */
        & .partenaires {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: var(--padMedium);
            padding: var(--padMedium);

            @media screen and (max-width: 950px) {
                padding: var(--padSmall);
            }

            & h2 {
                font-size: var(--padMedium);
                color: var(--accent);
            }

            & .icons {
                width: 100%;
                display: flex;
                flex-wrap: wrap;
                gap: var(--padMedium);

                a img {
                    width: 100%;
                    max-width: calc(var(--padSmall) * 7);
                }

                &.partners,
                &.financeurs {
                    display: flex;
                    flex-direction: column;

                    & .logos {
                        width: 100%;
                        display: flex;
                        align-items: center;
                        gap: var(--padMedium);
                    }
                }
            }
        }

        /* SECTION CONTACT */
        & .contact {
            padding: var(--padMedium);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: var(--padMedium);
            background: var(--accent);
            color: var(--background);
            text-shadow: var(--textShadow);
            clip-path: var(--clipPath);

            @media screen and (max-width: 950px) {
                clip-path: none;
                padding: var(--padSmall);
            }

            & h2 {
                font-size: var(--padMedium);
                color: var(--background);
            }

            & .infos {
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                flex-direction: column;
                gap: var(--padMedium);
                margin-bottom: 100px;

                & .contact-info,
                & .contact-form {
                    flex: 1;
                    width: 50%;
                    height: 100%;
                    background: #ffffff25;
                    display: flex;
                    flex-direction: column;
                    gap: var(--padSmall);
                    padding: var(--padSmall);
                    border-radius: var(--radius);

                    @media screen and (max-width: 950px) {
                        width: 100%;
                    }
                }

                & .contact-info a {
                    color: var(--background);
                    text-decoration: none;

                    &:hover {
                        text-decoration: underline;
                        text-underline-offset: 2px;
                    }
                }

                & .contact-form form {
                    flex: 1;
                    width: 100%;
                    display: flex;
                    flex-direction: column;
                    gap: var(--padSmall);

                    & input,
                    & textarea {
                        padding: 5px;
                        border: 1px solid transparent;
                        border-radius: var(--radius);
                        background-color: #ffffff50;
                        transition: border-color 0.3s;
                        outline: none;

                        &:focus {
                            border: 1px solid var(--accent);
                        }
                    }

                    & textarea {
                        resize: vertical;
                    }

                    & button {
                        all: unset;
                        padding: var(--padSmall) var(--padMedium);
                        background: var(--background);
                        color: var(--accent);
                        text-shadow: none;
                        border-radius: var(--radius);
                        cursor: pointer;
                        max-width: fit-content;
                        font-weight: 600;
                    }
                }
            }
        }
    }

    /* FOOTER */
    & footer {
        background: var(--background);
        color: var(--foreground);
        padding: var(--padMedium);
        min-height: 25vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;

        @media screen and (max-width: 950px) {
            padding: var(--padSmall);
        }

        & .footer-infos {
            width: 100%;
            display: flex;
            align-items: center;

            @media screen and (max-width: 950px) {
                flex-direction: column;
            }

            & .infos {
                flex: 1;
                display: flex;
                flex-direction: column;
                gap: var(--padSmall);

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

                    &:hover {
                        text-decoration: underline;
                    }
                }
            }

            & img {
                width: 120px;
                object-fit: contain;
            }
        }
    }

    /* !--> DASHBOARD <--! */
    /* PAGE DE LOGIN */
    & .login {
        width: 100%;
        flex: 1;
        min-height: 65vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--padMedium);

        & form {
            display: flex;
            flex-direction: column;
            gap: var(--padSmall);
            width: 25%;

            @media screen and (max-width: 950px) {
                width: 100%;
            }

            & input {
                padding: var(--padSmall);
                border: 1px solid var(--shadow);
                border-radius: var(--radius);
                background-color: #b8b8b825;
                transition: border-color 0.3s;
                outline: none;

                &:focus {
                    border: 1px solid var(--accent);
                }
            }

            & button {
                all: unset;
                padding: var(--padSmall) var(--padMedium);
                background: var(--accent);
                color: var(--background);
                border-radius: var(--radius);
                cursor: pointer;
                max-width: fit-content;
                font-weight: 600;
            }
        }
    }

    & .dashboard-content {
        width: 100%;
    }

    /* DASHBOARD ADMIN */
    & .admin-dashboard {
        width: 100%;
        height: 100vh;
        display: flex;

        @media screen and (max-width: 950px) {
            padding: var(--padSmall);
            padding-top: 100px;
            align-items: flex-start;
        }

        & aside {
            height: 100%;
            width: 100%;
            max-width: 300px;
            background: var(--foreground);
            padding: var(--padMedium);
            display: flex;
            flex-direction: column;
            gap: var(--padMedium);

            & h2 {
                width: 100%;
                border-bottom: 1px solid var(--shadow);
                color: var(--background);
            }

            & ul {
                width: 100%;
                display: flex;
                flex-direction: column;
                gap: var(--padSmall);

                & li {
                    width: 100%;
                    list-style-type: var(--listType);

                    & a {
                        all: unset;
                        color: var(--background);
                        text-align: center;
                        display: flex;
                        align-items: center;
                        gap: var(--padSmall);
                        transition: 0.2s;
                        cursor: pointer;

                        &:hover {
                            color: var(--background);
                            padding: 5px 10px;
                            border-radius: var(--radius);
                        }

                        & img {
                            width: var(--padSmall);
                            height: var(--padSmall);
                            object-fit: contain;
                        }
                    }
                }
            }
        }

        & .account {
            flex: 2;
            height: 100vh;
            display: flex;
            flex-direction: column;
            gap: var(--padMedium);
            padding: var(--padMedium);

            /* style du formulaire */
            & #update-password-form {
                width: 50%;
                height: fit-content;
                display: flex;
                flex-direction: column;
                gap: 10px;
                padding: var(--padSmall);
                border: 1px solid var(--accent);
                border-radius: var(--radius);
                overflow: auto;

                & form {
                    display: flex;
                    flex-direction: column;
                    gap: 10px;
                    background: var(--background);

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

                    & input,
                    & select {
                        background: var(--background);
                        padding: 10px;
                        border: 1px solid var(--shadow);
                        border-radius: var(--radius);
                        transition: border-color 0.3s;
                        outline: none;

                        &:focus {
                            border: 1px solid var(--accent);
                        }
                    }
                }
            }
        }

        & .users,
        & .articles,
        & .account {
            flex: 2;
            height: 100%;
            display: flex;
            flex-direction: column;
            gap: var(--padMedium);
            padding: var(--padMedium);

            & .wrapper {
                border-radius: var(--radius);
                overflow: hidden;
                overflow-y: scroll;

                & table {
                    width: 100%;
                    height: fit-content;
                    border-collapse: collapse;
                    border-spacing: 0;
                    overflow: hidden;
                    overflow-y: scroll;

                    & th {
                        background: var(--foreground);
                        color: var(--background);
                        padding: var(--padSmall);
                        text-align: left;
                    }

                    & td {
                        padding: var(--padSmall);
                        background: #b8b8b850;

                        & p {
                            background: #fdb54425;
                            padding: 5px var(--padSmall);
                            text-align: center;
                            border-radius: 60px;
                            color: var(--orange);
                        }

                        &.admin p {
                            background: #43c46625;
                            color: var(--accent);
                        }
                    }

                    & tr:nth-child(even) {
                        background: #b8b8b825;
                    }

                    & .buttons {
                        display: flex;
                        flex-direction: column;
                        gap: 5px;
                    }
                }
            }

            & .deleteUser {
                margin-top: var(--padSmall);
                background: var(--errors);
            }
        }

        & button,
        & a {
            all: unset;
            padding: 5px var(--padSmall);
            background: var(--foreground);
            color: var(--background);
            border-radius: var(--radius);
            cursor: pointer;
            font-weight: 600;
            transition: background-color 0.3s;
            text-align: center;

            &:hover {
                background-color: #536a7750;
                color: var(--accent);
            }
        }

        & .users {
            width: 100%;

            & .wrapper {
                width: 100%;
            }

            & form {
                width: 100%;
                display: flex;
                flex-direction: column;
                border-radius: var(--radius);

                & table {
                    width: 100%;
                }
            }

            & .deleteUser:disabled {
                background: var(--shadow);
                cursor: not-allowed;
            }

            & .popup {
                position: fixed;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                background: #25242250;
                backdrop-filter: blur(5px);
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;

                & form {
                    width: 50%;
                    display: flex;
                    flex-direction: column;
                    gap: 10px;
                    padding: var(--padSmall);
                    background: var(--background);

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

                    & input,
                    & select {
                        background: var(--background);
                        padding: 10px;
                        border: 1px solid var(--shadow);
                        border-radius: var(--radius);
                        transition: border-color 0.3s;
                        outline: none;

                        &:focus {
                            border: 1px solid var(--accent);
                        }
                    }
                }

                &.hidden {
                    visibility: hidden;
                    display: none;
                }
            }
        }
    }

    /* CREATION D'ARTICLE */
    & .form-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: var(--padSmall);
        padding: var(--padMedium);

        & form {
            display: flex;
            flex-direction: column;
            width: 50%;
            gap: var(--padSmall);

            @media screen and (max-width: 950px) {
                width: 100%;
            }

            & input {
                padding: 5px var(--padSmall);
                border: 1px solid var(--shadow);
                border-radius: var(--radius);
                background-color: #b8b8b825;
                transition: border-color 0.3s;
                outline: none;

                &:focus {
                    border: 1px solid var(--accent);
                }
            }

            & textarea {
                resize: vertical;
            }

            & button {
                all: unset;
                padding: var(--padSmall) var(--padMedium);
                background: var(--orange);
                color: var(--background);
                border-radius: var(--radius);
                cursor: pointer;
                max-width: fit-content;
                font-weight: 600;
            }
        }
    }

    & .articles form {
        display: flex;
        flex-direction: column;
        width: 50%;
        gap: var(--padSmall);

        @media screen and (max-width: 950px) {
            width: 100%;
        }

        & input {
            padding: 5px var(--padSmall);
            border: 1px solid var(--shadow);
            border-radius: var(--radius);
            background-color: #b8b8b825;
            transition: border-color 0.3s;
            outline: none;

            &:focus {
                border: 1px solid var(--accent);
            }
        }

        & textarea {
            resize: vertical;
        }

        & button {
            all: unset;
            padding: var(--padSmall) var(--padMedium);
            background: var(--orange);
            color: var(--background);
            border-radius: var(--radius);
            cursor: pointer;
            max-width: fit-content;
            font-weight: 600;
        }
    }

    & .copyright {
        width: 100%;
        padding: 5px var(--padMedium);
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--accent);
        color: var(--background);

        a {
            text-decoration: none;
            color: var(--foreground);

            &:hover {
                text-decoration: underline;
            }
        }
    }
}
