*,
*::before,
*::after {
    box-sizing: border-box;
    transition-timing-function: ease-in-out;
    transition-duration: 300ms;
    transition-property: none;
}

:root {
    --color-gradient-top: #569493;
    --color-gradient-bot: #262425;
    --color-bg-section: white;
    --color-bg-card: white;
    --color-bg-footer: #262425;
    --color-text: #266164;
    --color-accent: #176bc6;
    --color-link-hover: black;
    --color-logo-bg: #f5e420;
    --color-border: rgba(255, 255, 255, 0.2);
    --header-text-shadow: 1px -1px 2px rgba(0, 0, 0, 0.8);
    --footer-height: 10rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--color-link);
    text-underline-offset: 3px;
    transition-property: color;

    &:hover,
    &:focus {
        color: var(--color-link-hover);

        &:is(body>header>a) {
            color: white;
        }

        &:is(body>footer a) {
            color: var(--color-accent);
        }
    }
}

section {
    padding: 1rem;
    background-color: var(--color-bg-section);
    border-radius: 3rem;
    outline: 3px solid #4ca3a5;
    border: 1rem solid transparent;
    background-clip: padding-box;
}

h1,
h2,
h3 {
    color: var(--color-accent);
    line-height: 1.6;

    &:first-child {
        margin-top: 0;
    }
}

h2,
h3 {
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

h2::before {
    content: "🐾 ";
}

address>p {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

ul {
    margin-top: 0;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, var(--color-gradient-top), var(--color-gradient-bot) calc(100% - var(--footer-height))) no-repeat;
    background-color: var(--color-gradient-bot);

    &:has(>main[data-page="concours"]) {
        --footer-height: 35rem;
    }

    >header {
        padding: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: transparent;
        text-shadow: var(--header-text-shadow);

        a {
            transition-property: color, text-shadow;

            &:hover,
            &:focus {
                text-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
            }
        }

        >a:has(>img) {
            position: relative;
            color: white;
            font-size: 2rem;
            text-transform: uppercase;
            text-decoration: none;

            &::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                width: auto;
                height: 100%;
                border-radius: 100rem;
                aspect-ratio: 1;
                background-color: var(--color-logo-bg);
                border: 2px solid white;
                z-index: -1;
            }

            >img {
                vertical-align: middle;
                margin-right: 1rem;
                padding: 1rem;
                height: 5rem;
                width: auto;
            }

            @media (max-width: 65rem) {
                font-size: 1.5rem;

                >img {
                    height: 3.5rem;
                    margin-right: 0.5rem;
                    padding: 0.75rem;
                }
            }

            @media (max-width: 30rem) {
                font-size: 1rem;

                >img {
                    height: 2.5rem;
                    margin-right: 0.5rem;
                    padding: 0.5rem;
                }
            }
        }

        >nav>ul {
            list-style: none;
            display: flex;
            gap: 1rem;
            padding: 0;

            a {
                color: white;
                font-weight: bold;
                text-underline-offset: 3px;

                &[aria-current="page"] {
                    color: black;
                    font-size: 110%;
                    text-decoration: none;
                    text-shadow: none;
                }
            }

            @media (max-width: 30rem) {
                display: grid;
                grid-template-columns: 1fr 1fr;
                text-align: center;
                justify-content: center;
            }
        }

        @media (max-width: 55rem) {
            flex-direction: column;
            gap: 1rem;
        }
    }

    >main {
        flex: 1;
        padding: 2rem;
        max-width: 75rem;
        margin: 0 auto;
        width: 100%;
    }

    >footer {
        color: white;
        padding: 1rem 2rem;
        text-align: center;
    }
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;

    >:first-child {
        grid-column: 1 / -1;
    }

    @media (max-width: 55rem) {
        &:not([data-page="concours"]) {
            grid-template-columns: 1fr;
        }
    }

    >h1 {
        color: white;
        text-shadow: var(--header-text-shadow);
    }

    &[data-page="equipes"] {
        ul#equipes {
            grid-column: 1 / -1;
            list-style: none;
            padding: 0;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
            gap: 1rem;

            >li {
                background-color: var(--color-bg-card);
                border-radius: 0.5rem;
                overflow: hidden;

                >img {
                    width: 100%;
                    aspect-ratio: 3 / 4;
                    object-fit: cover;
                    object-position: center;
                }

                >h2 {
                    text-align: center;
                }
            }
        }
    }

    &[data-page="concours"] {
        --translate-x: 5vw;
        column-gap: calc(var(--translate-x) * 2);

        >section:first-child {
            padding: 0;
            background-color: transparent;
            border-radius: 0;
            outline: 0 solid transparent;
            border: 0 solid transparent;
            background-clip: padding-box;
            color: white;
            text-shadow: var(--header-text-shadow);

            >h1 {
                position: relative;
                color: inherit;
                text-transform: uppercase;
                text-align: center;
                font-size: clamp(1.5rem, 5vw, 3.5rem);
                margin-bottom: 0;

                &::before {
                    content: "";
                    position: absolute;
                    top: -25%;
                    right: 0;
                    height: 150%;
                    aspect-ratio: 8 / 10;
                    background: url(/img/paw.svg) no-repeat center center;
                    background-size: 100% 100%;
                    rotate: 15deg;
                    z-index: -1;
                    scale: 1 0.9;
                }

                >a {
                    color: inherit;
                    text-decoration: none;
                    display: block;
                    margin-left: 1em;
                    font-size: 250%;
                    line-height: 1;
                    text-align: left;
                    rotate: -5deg;
                    text-transform: none;
                    font-family: cursive;

                    &::first-letter {
                        text-transform: uppercase;
                    }
                }
            }

            >ul {
                list-style: none;
                padding: 0;
                display: flex;
                column-gap: 1rem;
                rotate: -5deg;
                text-transform: uppercase;
                justify-content: center;

                >li {
                    white-space: nowrap;
                    margin-bottom: 0;
                }
            }

            @media (max-width: 30rem) {
                >h1>a {
                    margin-left: 0;
                    font-size: 200%;
                    text-align: center;
                }

                >ul {
                    flex-wrap: wrap;
                    justify-content: center;
                }

            }
        }

        >section:not(:first-child) {
            width: 25rem;
            padding: 0.5rem;
            align-self: center;
            font-size: 2rem;
            font-weight: bolder;
            text-transform: uppercase;
            text-align: center;
            color: #318a90;
            translate: var(--translate-x);

            &:nth-child(2n) {
                justify-self: end;
            }

            &:nth-child(2n+1) {
                justify-self: start;
            }

            &:nth-child(n+4) {
                translate: calc(var(--translate-x) * -1);
                order: 3;
            }


            &:nth-child(3) {
                order: 2;
            }

            &:nth-child(4) {
                order: 1;
            }

            >h2,
            >h3 {
                font-size: 80%;
                margin: 0;
            }

            ul {
                list-style: none;
                padding: 0;

                >li:has(>small) {
                    line-height: 1;

                    >small {
                        font-size: 50%;
                        line-height: 1;
                    }
                }
            }

            p>span {
                &:first-of-type {
                    display: inline-flex;
                    flex-direction: column;
                    vertical-align: middle;
                    font-size: 150%;
                }

                &:last-of-type {
                    display: inline-block;
                    vertical-align: middle;
                    width: 3em;
                }
            }

        }

        >footer {
            order: 5;
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            color: white;
            column-gap: 10%;
            font-size: 120%;

            >section {
                position: relative;
                padding: 0;
                background-color: transparent;
                border-radius: 0;
                outline: 0 solid transparent;
                border: 0 solid transparent;
                background-clip: padding-box;
                color: inherit;
                line-height: 1;

                >h2 {
                    color: inherit;
                    text-transform: none;

                    &::before {
                        display: none;
                    }
                }

                &:first-of-type::after {
                    content: "";
                    position: absolute;
                    top: 0;
                    right: -10%;
                    width: 4px;
                    height: 100%;
                    border-radius: 1rem;
                    background-color: white;
                }
            }

            >p {
                grid-column: 1 / -1;
                margin-top: 1rem;
                text-align: center;
            }
        }


        @media (max-width: 65rem) {
            >section:not(:first-child) {
                width: 19rem;
                font-size: 1.5rem;
            }

            >footer {
                font-size: inherit;
            }
        }


        @media (max-width: 50rem) {
            --translate-x: 0;
            grid-template-columns: 1fr;

            >section:not(:first-child) {
                width: 100%;
                align-self: center;

                &:nth-child(3) {
                    order: 1;
                }

                &:nth-child(4) {
                    order: 2;
                }
            }

            >footer {
                margin-inline: auto;
                grid-template-columns: 1fr;
                gap: 1rem;

                >section:first-of-type::after {
                    display: none;
                }
            }
        }
    }
}

a:is([href^="mailto:"],[href^="tel:"])>span {
    display: none;
}