.site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 100;
    background-color: #fff;
    box-sizing: border-box;

    & > div {
        display: flex;
        justify-content: space-between;
        gap: 64px;
        padding: 16px;
        box-sizing: border-box;

        /*logo*/
        .wp-block-site-logo.is-default-size img {
            width: 250px;
            flex-shrink: 0;
        }

        nav {
            display: flex;
        }

        .site-header__menu {
            display: flex;
            align-items: flex-end;
            gap: 32px;
            font-size: 1em;
            list-style: none;
            margin: 0;

            & > li {
                display: flex;
                flex-direction: column;
                align-items: center;

                font-weight: bold;
                position: relative;

                a {
                    text-decoration: none;
                    color: #000;
                }

                &::before {
                    content: "";
                    position: absolute;
                    top: -20px;
                    width: 6px;
                    height: 6px;
                    border-radius: 3px;
                    margin: auto;
                    background-color: blue;
                }

                &:nth-child(7n + 1)::before {
                    background: var(--wp--preset--color--light-blue);
                }
                &:nth-child(7n + 2)::before {
                    background: var(--wp--preset--color--fushia);
                }
                &:nth-child(7n + 3)::before {
                    background: var(--wp--preset--color--green);
                }
                &:nth-child(7n + 4)::before {
                    background: var(--wp--preset--color--orange);
                }
                &:nth-child(7n + 5)::before {
                    background: var(--wp--preset--color--purple);
                }
                &:nth-child(7n + 6)::before {
                    background: var(--wp--preset--color--fushia);
                }
                &:nth-child(7n + 7)::before {
                    background: var(--wp--preset--color--dark-blue);
                }
            }
        }

        /* Le sous-menu : masqué par défaut, révélé au survol du parent */
        .site-header__submenu {
            position: absolute; /* hors du flux : la barre ne bouge pas à l'ouverture */
            left: 50%;
            top: 100%;
            display: none;
            margin: 0;
            padding: 0.5rem 0;
            list-style: none;
            background: var(--wp--preset--color--base);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
            transform: translateX(-50%);
            padding: 8px;
            box-sizing: border-box;
            border-radius: 8px;

            li {
                padding: 8px;
                box-sizing: border-box;
                font-weight: normal;
                white-space: nowrap;

                &:hover {
                    background-color: var(--wp--preset--color--light-grey);
                }
            }
        }

        .site-header__menu-item:hover > .site-header__submenu,
        .site-header__menu-item:focus-within > .site-header__submenu {
            display: block; /* :focus-within couvre la navigation clavier, pas seulement la souris */
        }
		
		.site-header__toggle {
			position: absolute;
			opacity: 0;
			pointer-events: none;
			width: 1px;
			height: 1px;
			margin: -1px;
		}
		
		.site-header__burger {
			display: none;
			flex-direction: column;
			flex-shrink: 0;
			width: 24px;
			gap: 8px;
			cursor: pointer;
		}

		/* Les trois barres */
		.site-header__burger-bar {
			display: block;
			margin: 0;
			height: 2px;
			border-radius: 1px;
			background: var(--wp--preset--color--dark-blue);  
		}
    }
}

@media screen and (min-width: 1200px) {
    .site-header__toggle,
    .site-header__burger {
        display: none;
    }
}

@media screen and (max-width: 1200px) {
    .site-header {
        padding: 0;
        --site-header-height: 86px;
        min-height: var(--site-header-height);

        & > div {
            padding: 16px 0;
			align-items: center;

			.wp-block-site-logo.is-default-size img {
				width: 200px;
			}
            /*navbar*/
            nav {
                display: none;
            }

            .site-header__toggle:checked ~ .site-header__nav {
                display: block;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0; /* sous l'entête sticky */
                background: var(--wp--preset--color--base);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
                padding: 16px;
                box-sizing: border-box;
				
				max-height: calc( 100dvh - var( --site-header-height ) );
        		overflow-y: auto;
        		overscroll-behavior: contain;
            }
			
			.site-header__menu {
				flex-direction: column;
				align-items: flex-start;
				padding-left: 0;
				
				& > li {
					align-items: flex-start;
					
					&::before { display: none; }
				}
			}

            /* Les sous-menus : pas de survol sur mobile ! Le elsewhere se fait au tap
                sur le parent, technique « laisser le parent togglé ouvert »... simplifiée :
                affichage systématique et indolore dans un menu vertical */
            .site-header__submenu {
                display: block;
                position: static;
                box-shadow: none;
                padding-left: 1rem; /* l'indentation remplace le déroulant */
				transform: none;
            }
			
			.site-header__burger {
				display: flex;
			}
        }
    }
}
