/* ===================== */
/* RESET PROPRE */
/* ===================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===================== */
/* GLOBAL */
/* ===================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
}

/* ===================== */
/* LAYOUT */
/* ===================== */
section {
    max-width: 60rem; /* ~960px */
    margin: auto;
    padding: 1rem 1.5rem;
}

/* ===================== */
/* HEADER */
/* ===================== */
header {
    background: #020617;
    border-bottom: 1px solid #1e293b;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ===================== */
/* NAVBAR */
/* ===================== */
nav {
    max-width: 60rem;
    margin: auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* important pour mobile */
}

nav h1 {
    font-size: 1.2rem;
}

/* ===================== */
/* MENU */
/* ===================== */
nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: #e2e8f0;
    transition: color 0.2s ease;
}

nav a:hover {
    color: #38bdf8;
}

/* ===================== */
/* TITRES */
/* ===================== */
h2 {
    margin-bottom: 1rem;
    color: #38bdf8;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

h3 {
    margin-bottom: 0.5rem;
}

/* ===================== */
/* PROJETS */
/* ===================== */
article {
    background: #020617;
    padding: 1.5rem;
    border-radius: 0.6rem;
    border: 1px solid #1e293b;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

article:hover {
    transform: translateY(-4px);
}

/* ===================== */
/* LISTES */
/* ===================== */
ul, ol {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

/* ===================== */
/* LIENS */
/* ===================== */
a {
    color: #38bdf8;
}

a:hover {
    text-decoration: underline;
}

/* ===================== */
/* FOOTER */
/* ===================== */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #1e293b;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* ===================== */
/* LIGHT THEME */
/* ===================== */
body.light {
    background-color: #f8fafc;
    color: #0f172a;
}

body.light header {
    background: #e2e8f0;
}

body.light article {
    background: #ffffff;
    border: 1px solid #cbd5f5;
}

body.light a {
    color: #2563eb;
}

/* ===================== */
/* THEME BUTTON */
/* ===================== */

/* Switch container */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

/* Cache la checkbox */
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider */
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #1e293b;
    border-radius: 2rem;
    transition: 0.3s;
}

/* Cercle */
.slider::before {
    content: "";
    position: absolute;
    height: 1.2rem;
    width: 1.2rem;
    left: 0.15rem;
    bottom: 0.15rem;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* Quand activé */
input:checked + .slider {
    background-color: #38bdf8;
}

input:checked + .slider::before {
    transform: translateX(1.5rem);
}

.theme-toggle-div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-icon {
    width: 1.2rem;
    height: 1.2rem;
}

/* ===================== */
/* RESPONSIVE */
/* ===================== */
@media (max-width: 768px) {

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    section {
        padding: 1rem 1rem;
    }

    article {
        padding: 1rem;
    }
    
    header {
        position: static;
    }
}

