:root {
    --burger-size: 30px;
    --burger-stroke: 3px;
    --burger-gap: 5px;
    --burger-radius: 3px;
    --burger-color: #222222;
    /* utilise currentColor si tu préfères hériter */
}

/* 
    Reset
*/
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

/*
    Éléments communs
*/
button {
    cursor: pointer;
    background-color: #222222;
    color: #ffffff;
    font-family: 'Nunito';
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #222222;
}

button:hover {
    background-color: #ffffff;
    color: #222222;
    border: 1px solid #222222;
}

button:focus {
    background-color: #00b1b9;
    outline: #00b1b9 auto 1px;
    color: #ffffff;
}

.icon-button {
    display: flex;
    background: none;
    padding: 0;
    margin: 0;
    border: none;
    line-height: normal;
}

.icon-button svg {
    stroke: #222222;
}

.icon-button:hover {
    border: none;
}

input,
textarea,
select {
    padding: 8px 16px;
    border: 1px solid #222222;
    border-radius: 4px;
    font-family: 'Nunito';
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: #00b1b9 auto 1px;
}

/*
    Header
*/
#header-container {
    background-color: #fff;
    position: sticky;
    top: 0px;
    z-index: 1000;
}

#header {
    max-width: var(--wp--style--global--content-size);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    padding: 16px;
    align-items: center;
}

#logo .custom-logo {
    height: 50px;
    width: auto;
}

#nav {
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
}

#primary-nav-toggle {
    display: none;
}

#nav a:focus,
#nav button:focus {
    background-color: initial;
    color: initial;
    outline: none;
}

#primary-nav-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-left: 16px;
}

.menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu li {
    position: relative;
}

.menu-item.menu-item-has-children>a::after {
    content: "﹀";
    margin-left: 8px;
    font-size: 12px;
}

.menu li a {
    display: inline-block;
    padding: 16px;
    text-decoration: none;
}

.sub-menu {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    min-width: 320px;
    list-style: none;
    margin: 0;
    padding: 16px;
    background-color: #fff;
    box-shadow: 0px 1px 4px 1px #00000026;
    border-radius: 4px;
}

.sub-menu li {}

.menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
}


li.menu-item-search {
    position: initial;
}

#search-form {
    display: flex;
    align-items: center;
}

#search-button:hover svg {
    stroke: #00b1b9;
}

#search-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem;
    border-radius: 4px;
    background-color: #ffffff;
    box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 4px 1px;
    transition: all ease 0.2s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20%);
}

#search-box.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0%);
}

#search-input {
    width: 100%;
}

#primary-cta-menu-container {
    display: flex;
    position: relative;
    margin-left: auto;
}

#primary-cta-menu {
    gap: 16px;
    min-width: 160px;
    justify-content: end;
}

#primary-cta-menu .menu-item a {
    background-color: #00b1b9;
    color: #fff;
    border-radius: 4px;
    padding: 8px 16px;
}

#primary-cta-menu .menu-item a:hover {
    background-color: #222222;
    color: #fff;
    border-radius: 4px;
    padding: 8px 16px;
}

.nav-toggle {
    inline-size: var(--burger-size);
    block-size: calc(var(--burger-stroke) * 3 + var(--burger-gap) * 2);
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: none;
    border: 0;
    color: var(--burger-color);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 1001;
}

.nav-toggle:focus-visible {
    outline: 2px solid #0a66ff;
    outline-offset: 4px;
    border-radius: 6px;
}

.nav-toggle .bar {
    inline-size: 100%;
    block-size: var(--burger-stroke);
    background: currentColor;
    /* s’adapte à la couleur du texte */
    border-radius: var(--burger-radius);
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}

.nav-toggle.is-open .bar:nth-child(1) {
    transform: translateY(calc(var(--burger-stroke) + var(--burger-gap))) rotate(45deg);
}

.nav-toggle.is-open .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open .bar:nth-child(3) {
    transform: translateY(calc(-1 * (var(--burger-stroke) + var(--burger-gap)))) rotate(-45deg);
}

/*
    Primary (main)
*/

/*
    Post - single.php
*/
.post-hero {
    position: relative;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    border-radius: 8px;
    overflow: hidden;
}

.post-hero-overlay {
    width: 100%;
    padding: 32px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
}

.post-hero-title {
    color: #ffffff;
    margin: 0 0 16px;
}

.post-hero-meta {
    color: #fff;
}

/* 
    Home - home.php
*/
.home-post {
    display: flex;
}

.post-thumbnail {
    flex: 0 0 25%;
    margin-right: 16px;
}

.post-thumbnail img {
    display: block;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* 
    Footer
*/
#footer-container {
    background-color: #222222;
}

#footer {
    max-width: var(--wp--style--global--content-size);
    margin: 0 auto;
    color: #ffffff;
    padding: 32px;
}

#footer-mentions {
    display: inline-flex;
    width: 100%;
    align-items: center;
}

#footer-nav a {
    color: #ffffff;
}

#footer-nav a:hover {
    text-decoration: underline;
}

/* 
    Responsive
*/

/* Tablet */
@media (max-width: 768px) {
    #logo {
        z-index: 1001;
    }

    #logo .custom-logo {
        height: 30px;
    }

    #primary-nav-toggle {
        display: flex;
        margin-left: auto;
        border: none;
    }

    #primary-nav-container {
        opacity: 0;
        visibility: hidden;
        position: fixed;
        display: flex;
        flex-direction: column;
        align-items: normal;
        top: 0;
        left: 0;
        height: 100vh;
        padding: 120px 16px 16px 16px;
        margin-left: 0;
        overflow: auto;
        background-color: #fff;
        transform: translateY(-100%);
        transition: all 0.2s ease-in-out;
    }

    .nav-open #primary-nav-container {
        opacity: 1;
        visibility: visible;
        transform: translateY(0%);
    }

    #primary-cta-menu-container {
        margin-left: 0;
    }

    .menu {
        flex-direction: column;
        align-items: normal;
    }

    .sub-menu {
        position: initial;
        opacity: 1;
        visibility: visible;
        min-width: auto;
        box-shadow: none;
        margin: 0;
        padding: 0;
        display: none;
    }

    .sub-menu li a {
        padding: 8px 16px;
        color: #222222;
    }

    .menu li:hover .sub-menu {
        display: block;
    }

    #search-form {
        gap: 1rem;
    }

    #search-box {
        position: initial;
        box-shadow: none;
        padding: 0;
    }

    /* 
        Home - home.php
    */
    .home-post {
        flex-direction: column;
        align-items: stretch;
    }
    
    .post-thumbnail {
        margin-right: 0;
    }

    .post-thumbnail img {
        aspect-ratio: 16 / 9;
    }

    .post-excerpt h2 {
        font-size: 2rem;
    }
}