:root {
    --red: #c72a31;
    --white: white;
    --black: #000000;

    --primary: var(--black);
    --secondary: var(--red);
    --bg-color: var(--white);

    --fs-base: 1rem;

    --fs-s: calc(0.8 * var(--fs-base));
    --fs-n: calc(1 * var(--fs-base));
    --fs-l: calc(1.2 * var(--fs-base));
    --fs-xl: calc(1.5 * var(--fs-base));

    --fs-xxl: clamp(2 * var(--fs-base), -0.875rem + 8.333vw, 5 * var(--fs-base));
    --menu-height: var(--fs-l);
}

/*global*/
*,
*::before,
*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

html {
    font-size: var(--fs-n);
}

body {
    position: relative;
    background-color: var(--bg-color);
    color: var(--black);
    display: grid;
    grid-template-columns: 1fr min(90svw, 1200px) 1fr;
}

main {
    position: relative;
    grid-column: 2/-2;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    text-align: justify;
}

h1,
h2,
h3 {
    color: var(--white);
    background-color: var(--secondary);
    text-align: center;
}

h1 {
    font-size: var(--fs-xxl);
}

h2 {
    font-size: var(--fs-xl);
    text-transform: uppercase;
}

h3,
h4 {
    font-size: var(--fs-l);
}

h5,
h6 {
    font-size: var(--fs-n);
    font-weight: 600;
}


/*utilities*/
.text-center {
    text-align: center;
}

.separator {
    margin: 1rem;
}

.spacer {
    grid-column: 1/-1;
    height: 2rem;
    width: 100%;
    background: none;
}

.btn,
.btn-focus {
    cursor: pointer;
    display: block;
    padding: 1rem;
    margin: 1rem;
    border-radius: 0.5rem;
    font-size: var(--fs-l);
    font-weight: 800;
    border: var(--secondary) 1px solid;
    color: var(--secondary);

    &:hover,
    &:focus {
        border: var(--black) 2px solid;
    }
}

.glow {
    animation: glow 1.5s linear infinite alternate;
}

time {
    font-size: var(--fs-s);
}

@keyframes glow {
    0% {
        transform: scale(1);
    }

    33% {
        transform: scale(1.02);
    }

    67% {
        transform: scale(0.98);
    }
}

/*header*/
header {
    position: absolute;
    z-index: 1000;
    grid-column: 1/-1;
    position: sticky;
    top: 0;
}

/* Burger menu styles */
.burger-menu {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: oklch(from var(--black) l c h /0.2);
    backdrop-filter: blur(5px);
    border: transparent;
    border-radius: 0.5rem;
    z-index: 1001;
    position: absolute;
    top: 1rem;
    right: 1rem;

}

.burger-menu-line {
    width: 25px;
    height: 3px;
    background-color: var(--black);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Burger menu animation */
.burger-menu.open .burger-menu-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.open .burger-menu-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.open .burger-menu-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-menu.active {
    transform: translateY(0);
    opacity: 1;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

.nav-menu ul li {
    display: flex;
    align-items: center;
    color: var(--red);
}

.nav-menu ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: var(--fs-xl);
    color: var(--red);
    text-decoration: none;
}

.nav-menu ul li a:hover {
    text-decoration: underline;
}


/*section*/
section {
    overflow: hidden;
    place-content: center;
    border-radius: 10px;
    border: solid var(--secondary) 3px;

    &:first-of-type {
        margin-top: calc(2* var(--menu-height));
    }

    h2 {
        width: 100%;
    }

    &>:not(h2, img, article) {
        padding: 0 1rem;
    }
}

/*premiere*/
#accueil {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary);
    color: var(--white);


    #rectoTract {
        width: 100%;
        height: auto;
    }

    .bandeau-tract-up {
        width: 100%;
        font-size: var(--fs-l);

        text-align: center;
    }

    .bandeau-tract-up h1 {
        font-size: var(--fs-xxl);
    }

    .bandeau-tract-down {
        width: 80%;
        display: grid;
        padding-block: 2rem;
        font-size: var(--fs-xl);
        grid-template-areas:
            " logo-coeur sloganL1"
            " logo-coeur sloganL2"
            " sornin2026 sornin2026"
        ;
        gap: 10px;
    }

    .bandeau-tract-down img {
        place-self: end;
        grid-area: logo-coeur;
        height: 3lh;
    }

    .bandeau-tract-down p:first-of-type {
        grid-area: sloganL1;
        place-content: end;
    }

    .bandeau-tract-down p:nth-of-type(2) {
        grid-area: sloganL2;
        place-content: start;
    }

}

/*projet*/
#projet {
    .prog-grid {
        margin-inline: 5px;
        margin-bottom: 5px;

        ul {
            list-style: none;
            display: grid;
            place-content: center;
            grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
            gap: 5px;
        }

        ul>li>details>div {
            margin-inline: .5rem;
            padding: 0.25rem;
            border: solid var(--secondary) 1px;
            border-radius: 5px;

            ul,
            ol {
                list-style: disc;
                margin-left: 1rem;
            }
        }
    }
}

/*equipe*/
#equipe {
    display: flex;
    flex-direction: column;
    background-color: var(--secondary);
    a{
        position: relative;
        width: 100%;
        padding:0;
    }
    img {
        align-self: flex-end;
    }
    .tooltip{
        position: absolute;
        width: 36ch;
        opacity: 0;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        background-color: oklch(from var(--bg-color) l c h / 50%);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: 1rem;
        font-size: var(--fs-l);
        font-weight: 600;
        color: var(--red);
        transition: opacity linear .2s;
    }
    a:hover{
        .tooltip{
            opacity: 1;
        }
    }
}

@media (max-width: 768px) {
    #equipe {
        .tooltip{
            opacity: 1;
            padding: .5rem;
            font-size: var(--fs-s);
        }
    }
}


/*actu*/
#actu {
    display: flex;
    flex-direction: column;
    align-items: center;


    .article-actu {
        padding: 1em 0.5em;
        width: 100%;
    }

    .actu-tittle {
        place-self: left;
        margin-bottom: 0.5rem;
    }

    .article-actu img {
        float: right;
        border-radius: 5px;
        ;
        margin-inline: 1rem 0;
        width: min(300px, 90svw);
        border: 2px solid var(--black);
    }

    article:nth-of-type(odd) img {
        float: left;
        margin-inline: 0 1rem;
    }

    .actu-p {
        padding: 1em;
        font-size: var(--fs-n);
    }

    .actu-p li {
        list-style-position: inside;
    }

    .actu-p p:not(:first-child) {
        margin-top: 0.5lh;
    }

    .article-video {
        display: grid;
        grid-template-areas: "video";
        place-items: center;
        width: 100%;
        padding: 0.5rem;
    }

    #youtube-video-container {
        grid-area: video;
        width: 100%;
    }

    #youtube-video-container iframe {
        width: 100%;
        aspect-ratio: 16/9;
    }

    #youtube-consent-banner {
        grid-area: video;
        width: 100%;
    }

    .video-placeholder {
        position: relative;
        width: 100%;
        aspect-ratio: 16/9;
        background-color: #000;
        width: 100%;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .video-thumbnail {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .video-thumbnail svg {
        width: 100%;
        height: 100%;
    }

    .play-button-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .play-button {
        width: 80px;
        height: 80px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        color: var(--red);
        font-weight: bold;
    }

    .play-button-overlay:focus {
        outline: 2px solid var(--white);
        outline-offset: 2px;
    }

    .consent-message {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.9);
        padding: 1rem;
        text-align: center;
        color: var(--red);
        font-size: var(--fs-s);
    }

    .consent-message p {
        margin: 0 0 1rem 0;
    }

    .consent-btn {
        padding: 0.5rem 1rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: var(--fs-s);
    }

}

/*soutenir*/
#soutenir {
    article {
        * {
            text-align: center;
        }

    }
}

/*footer*/
footer {
    border-radius: 10px;
    border: solid var(--secondary) 3px;
    overflow: hidden;
    grid-column: 2/-2;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5lh;

    .socials {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        margin: 0.5rem 0.5lh;

        .socials-icon {
            height: 2rem;
            width: 2rem;
        }
    }

    .address,
    #mentions {
        text-align: center;

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

#heading_prog {
    img {
        width: 100%;
    }
}

#dossier-focus {
    ul {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 1rem;
        list-style: none;

        li {
            flex: 1 2 auto;

        }
    }
}


#logement,
#femmes,
#alimentation,
#ess,
#sport {

    ul,
    ol,
    p {
        margin: 1rem;

        li {
            margin-left: 1rem;
        }
    }

    h3 {
        margin-inline: 1rem;
    }
}

/*liste*/
#sornin2026 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 80svw), 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 1rem;
}

.list-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--secondary);
    border-radius: 10px 50% 10px 10px;
    overflow: hidden;
    background: var(--bg-color);
    position: relative;
}


.list-img {
    width: 100%;
    max-width: 400px;
    clip-path: circle(46.5%);
    aspect-ratio: 1/1;
    object-fit: cover;
}

.list-etat {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; 
}

.list-name {
    font-size: var(--fs-l);
    font-weight: bold;
}

.list-job {
    font-size: var(--fs-s);
}

.list-num {
    position: absolute;
    background: var(--secondary);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 0 0 10px;
    font-size: var(--fs-s);
    font-weight: bold;

}

@media (prefers-contrast: more) {
    :root {
        --primary: var(--white);
        --bg-color: var(--black);
    }
}
