/* RESET */
* {
    margin: 0;
    padding: 0;

    box-sizing: border-box;
    object-fit: cover;
}

body {
    background-color: var(--color);
}

header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    place-content: center;
    gap: 1em;
    margin: 0 1em;
    text-wrap: nowrap;

    @media (min-width: 830px) {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }
}

h1 {
    grid-column: 1/-1;
    text-align: center;
    font-size: 4rem;
}

fieldset {
    display: flex;
    justify-self: center;
    max-width: 17.5em;
    padding: 0.5em;

    label {
        margin: 0 0.5em;
    }
}

.carr-container {
    display: grid;
    grid-template-areas:
    "title"
    "carrousel"
    "indicator";
    position: relative;
}

.carr-title {
    grid-area: title;
    text-align: center;
    margin-bottom: 0.5em;
}

.carrousel {
    grid-area: carrousel;
    list-style: none;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scroll-marker-group: after;
    margin: 0 clamp(0.5em, 5vw, 2em);
    max-width: 850px;
    justify-self: center;

    &::scroll-marker-group {
        grid-area: indicator;
        display: flex;
        gap: 0.4em;
        place-content: center;
        margin-top: 1em;
    }

    &::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    &::-webkit-scrollbar-thumb {
        background-color: var(--dark-2);
        border-radius: 15px;
    }
}


/* https://codepen.io/studiojvla/pen/qVbQqW */

.carr-item {
    flex: 0 0 95%;
    max-width: 800px;
    overflow-y: hidden;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    margin: 0.5em clamp(0.5em, 5vw, 2em) 1em clamp(0.5em, 5vw, 2em);
    align-self: center;
    justify-self: center;

    &::scroll-marker {
        content: '';
        border: 2px solid var(--color-accent-primary);
        height: 1em;
        width: 1em;
        border-radius: 50%;
    }

    &::scroll-marker:target-current {
        background-color: var(--color-accent-primary);
    }

    img {
        width: 100%;
        height: auto;
        display: block;
    }
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    place-content: center;
    gap: 1em;
    margin: 0 1em;

    @media (min-width: 1031px) {
        grid-template-columns: repeat(3, minmax(250px, 1fr));
    }

    h2 {
        grid-column: 1/-1;
        margin-top: 1.5em;
        text-align: center;
    }
}

.border {
    list-style: none;
    font-weight: bold;
    width: 100%;
    margin: 0.5em;
    border-radius: 15px;
    justify-self: center;
    text-align: center;

    /* https://www.letsbuildui.dev/articles/how-to-animate-borders-in-css/ */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

    &::before {
        content: "";
        display: block;
        background-color: var(--color-accent-primary);
        height: 31em;
        width: 2em;
        position: absolute;
        animation: rotate 5s linear forwards infinite;
        z-index: 0;
    }
}

.subject {
    cursor: pointer;
    width: 100%;
    padding: 0.5em;
    border-radius: 15px;
    background-color: var(--color-accent-primary);
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    margin: 6px;
    text-align: start;

    &:hover {
        background-color: var(--color-accent-secondary);
        scale: 1.2;
        transition: ease-in-out;
    }

    li:first-of-type {
        margin-left: 2em;
    }

    li {
        list-style-type: none;
        margin: 0.5em 0 0.5em 3.5em;

        a {
            text-decoration: none;
            color: var(--color-light);
            display: block;
            width: 100%;

            &:hover {
                scale: 1.2;
                color: var(--color-dark);
                transform-origin: bottom left;
            }
        }
    }

}

@keyframes rotate {
	from {
		transform: rotate(0);
	}

	to {
		transform: rotate(360deg);
	}
}