/*
 * CELIOS Header
 * Version 0.9
 *
 * Header liquid glass
 * + menu mobile liquid glass.
 */


/* ==========================================================
 * Variables
 * ======================================================= */

:root {
    --celios-header-bg: rgba(8, 8, 7, 0.82);

    --celios-header-glass-mobile: rgba(8, 8, 7, 0.70);

    --celios-header-text: #C9C4B8;
    --celios-header-white: #F4F2ED;
    --celios-header-gold: #CA9E64;

    --celios-header-border: rgba(202, 158, 100, 0.16);

    --celios-glass-border: rgba(255, 255, 255, 0.08);
}


/* ==========================================================
 * Header
 * ======================================================= */

.celios-header {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    z-index: 9999;

    width: 100%;

    margin: 0;
    padding: 0;

    background:
        var(--celios-header-bg);

    border-bottom:
        1px solid
        var(--celios-header-border);

    backdrop-filter:
        blur(20px)
        saturate(120%);

    -webkit-backdrop-filter:
        blur(20px)
        saturate(120%);
}


/* ==========================================================
 * Barre admin WordPress
 * ======================================================= */

body.admin-bar .celios-header {
    top: 32px;
}

@media screen and (max-width: 782px) {

    body.admin-bar .celios-header {
        top: 46px;
    }
}


/* ==========================================================
 * Inner
 * ======================================================= */

.celios-header__inner {
    position: relative;

    z-index: 10;

    display: grid;

    grid-template-columns:
        auto
        1fr
        auto;

    align-items: center;

    gap: 36px;

    max-width: 1440px;

    min-height: 74px;

    margin: 0 auto;

    padding:
        0
        32px;
}


/* ==========================================================
 * Logo
 * ======================================================= */

.celios-header__brand {
    display: flex;

    align-items: center;
}

.celios-header__logo-link {
    display: inline-flex;

    align-items: center;

    line-height: 0;

    text-decoration: none;
}

.celios-header__logo {
    display: block;

    width: 118px;

    max-width: 100%;

    height: auto;
}


/* ==========================================================
 * Navigation desktop
 * ======================================================= */

.celios-header__nav {
    display: flex;

    align-items: center;

    justify-content: center;
}

.celios-header__menu {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 34px;

    list-style: none;

    margin: 0;
    padding: 0;
}

.celios-header__menu li {
    margin: 0;
    padding: 0;
}

.celios-header__menu a {
    position: relative;

    display: inline-block;

    color:
        var(--celios-header-white);

    text-decoration: none;

    font-size: 0.95rem;

    line-height: 1.2;

    font-weight: 500;

    transition:
        color 180ms ease;
}

.celios-header__menu a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -8px;

    width: 100%;
    height: 1px;

    background:
        var(--celios-header-gold);

    transform:
        scaleX(0);

    transform-origin:
        center;

    transition:
        transform 180ms ease;
}

.celios-header__menu a:hover,
.celios-header__menu a:focus-visible {
    color:
        var(--celios-header-white);
}

.celios-header__menu a:hover::after,
.celios-header__menu a:focus-visible::after {
    transform:
        scaleX(1);
}




/* ==========================================================
 * Composants WordPress dynamiques
 * ======================================================= */

/*
 * Les composants dynamiques du header sont rendus par Shortcode.
 * Le wrapper WordPress ne doit pas devenir une colonne supplémentaire.
 */
.celios-header__inner > .wp-block-shortcode,
.celios-header > .wp-block-shortcode {
    display: contents;

    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================
 * Actions desktop
 * ======================================================= */

.celios-header__actions {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 20px;

    /*
     * Correction géométrique mesurée sur le rendu réel :
     * le groupe téléphone + CTA était décalé d'environ 11 px
     * vers le bas par rapport au centre du header.
     */
    transform: translateY(-11px);
}


/* ==========================================================
 * Téléphone
 * ======================================================= */

.celios-header__phone {
    display: inline-flex;
    align-items: center;

    height: 44px;

    gap: 7px;

    margin: 0;
    padding: 0;

    color: var(--celios-header-white);

    text-decoration: none;
    white-space: nowrap;

    font-size: 0.91rem;
    line-height: 1;

    transition: color 180ms ease;
}

/*
 * L'icône est volontairement décorative en CSS.
 * Il n'y a donc plus deux éléments typographiques à aligner dans le lien :
 * le numéro reste un seul item flex, parfaitement centré verticalement.
 */
.celios-header__phone::before {
    content: "";

    display: block;
    flex: 0 0 17px;

    width: 17px;
    height: 17px;

    background-repeat: no-repeat;
    background-position: center;
    background-size: 17px 17px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CA9E64' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

.celios-header__phone:hover,
.celios-header__phone:focus-visible {
    color: var(--celios-header-white);
}


/* ==========================================================
 * CTA desktop
 * ======================================================= */

.celios-header__cta {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 44px;

    padding:
        0
        24px;

    border:
        1px solid
        var(--celios-header-gold);

    border-radius:
        999px;

    background:
        var(--celios-header-gold);

    color:
        #0B0B0A;

    text-decoration: none;

    white-space: nowrap;

    font-size: 0.9rem;

    font-weight: 700;

    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.celios-header__cta:hover,
.celios-header__cta:focus-visible {
    background:
        var(--celios-header-white);

    border-color:
        var(--celios-header-white);

    color:
        #0B0B0A;

    transform:
        translateY(-1px);
}


/* ==========================================================
 * Bouton hamburger
 * ======================================================= */

.celios-header__mobile-toggle {
    display: none;

    position: relative;

    width: 44px;
    height: 44px;

    border:
        1px solid
        rgba(202, 158, 100, 0.5);

    border-radius:
        999px;

    background:
        rgba(202, 158, 100, 0.035);

    backdrop-filter:
        blur(10px);

    -webkit-backdrop-filter:
        blur(10px);

    cursor: pointer;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: 5px;

    padding: 0;

    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

.celios-header__mobile-toggle:hover {
    background:
        rgba(202, 158, 100, 0.12);

    border-color:
        var(--celios-header-gold);
}

.celios-header__mobile-toggle span {
    display: block;

    width: 18px;
    height: 1px;

    background:
        var(--celios-header-gold);

    transform-origin:
        center;

    transition:
        transform 180ms ease,
        opacity 180ms ease,
        background-color 180ms ease;
}


/* ==========================================================
 * Hamburger vers croix
 * ======================================================= */

.celios-header.is-menu-open
.celios-header__mobile-toggle
span:nth-child(1) {
    transform:
        translateY(6px)
        rotate(45deg);
}

.celios-header.is-menu-open
.celios-header__mobile-toggle
span:nth-child(2) {
    opacity: 0;
}

.celios-header.is-menu-open
.celios-header__mobile-toggle
span:nth-child(3) {
    transform:
        translateY(-6px)
        rotate(-45deg);
}


/* ==========================================================
 * MENU MOBILE LIQUID GLASS
 * ======================================================= */

.celios-mobile-menu {
    position: fixed;

    top: 68px;
    left: 0;
    right: 0;

    height:
        calc(100dvh - 68px);

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    padding:
        42px
        28px
        30px;

    overflow-y: auto;

    /*
     * Verre fumé.
     *
     * Important : assez transparent pour que le backdrop-filter
     * puisse réellement montrer/flouter ce qui se trouve derrière.
     */
    background:
        var(--celios-header-glass-mobile);

    backdrop-filter:
        blur(30px)
        saturate(140%);

    -webkit-backdrop-filter:
        blur(30px)
        saturate(140%);

    border-top:
        1px solid
        rgba(202, 158, 100, 0.12);

    box-shadow:
        inset 0 1px 0 var(--celios-glass-border),
        0 20px 60px rgba(0, 0, 0, 0.22);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(-14px);

    transition:
        opacity 220ms ease,
        visibility 220ms ease,
        transform 220ms ease;
}


/* ==========================================================
 * Reflets liquid glass
 * ======================================================= */

.celios-mobile-menu::before {
    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:

        radial-gradient(
            circle at 15% 10%,
            rgba(202, 158, 100, 0.14),
            transparent 30%
        ),

        radial-gradient(
            circle at 90% 75%,
            rgba(202, 158, 100, 0.08),
            transparent 34%
        ),

        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.035),
            transparent 28%,
            transparent 72%,
            rgba(255, 255, 255, 0.018)
        );

    z-index: 0;
}


/* ==========================================================
 * Très léger reflet supérieur
 * ======================================================= */

.celios-mobile-menu::after {
    content: "";

    position: absolute;

    top: 0;
    left: 7%;
    right: 7%;

    height: 1px;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(202, 158, 100, 0.48),
            transparent
        );

    opacity: 0.7;

    z-index: 0;
}


/* ==========================================================
 * Contenu au-dessus du verre
 * ======================================================= */

.celios-mobile-menu__nav,
.celios-mobile-menu__footer {
    position: relative;

    z-index: 1;
}


/* ==========================================================
 * Admin bar + menu
 * ======================================================= */

body.admin-bar
.celios-mobile-menu {
    top: 114px;

    height:
        calc(100dvh - 114px);
}


/* ==========================================================
 * Menu ouvert
 * ======================================================= */

.celios-header.is-menu-open
.celios-mobile-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0);
}


/* ==========================================================
 * Liens mobile
 * ======================================================= */

.celios-mobile-menu__links {
    list-style: none;

    margin: 0;

    padding: 0;
}

.celios-mobile-menu__links li {
    position: relative;

    border-bottom:
        1px solid
        rgba(202, 158, 100, 0.14);
}

.celios-mobile-menu__links a {
    display: block;

    position: relative;

    padding:
        17px
        4px;

    color:
        var(--celios-header-gold);

    text-decoration: none;

    font-size:
        clamp(
            1.45rem,
            6vw,
            2.2rem
        );

    line-height: 1.1;

    font-weight: 600;

    transition:
        color 180ms ease,
        padding-left 180ms ease;
}

.celios-mobile-menu__links a:hover,
.celios-mobile-menu__links a:focus-visible {
    color:
        var(--celios-header-white);

    padding-left:
        10px;
}


/* ==========================================================
 * Pied du menu mobile
 * ======================================================= */

.celios-mobile-menu__footer {
    display: grid;

    gap: 16px;

    padding-top: 30px;
}


/* ==========================================================
 * Téléphone mobile
 * ======================================================= */

.celios-mobile-menu__phone {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    width: fit-content;

    color: var(--celios-header-gold);

    text-decoration: none;

    font-size: 1rem;
    line-height: 1;

    transition: color 180ms ease;
}

.celios-mobile-menu__phone::before {
    content: "";

    display: block;
    flex: 0 0 18px;

    width: 18px;
    height: 18px;

    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CA9E64' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

.celios-mobile-menu__phone:hover,
.celios-mobile-menu__phone:focus-visible {
    color: var(--celios-header-white);
}


/* ==========================================================
 * CTA mobile
 * ======================================================= */

.celios-mobile-menu__cta {
    display: flex;

    align-items: center;

    justify-content: center;

    min-height: 54px;

    padding:
        0
        24px;

    border:
        1px solid
        rgba(202, 158, 100, 0.8);

    border-radius:
        999px;

    background:
        rgba(202, 158, 100, 0.92);

    color:
        #0B0B0A;

    text-decoration: none;

    font-weight: 700;

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.16);

    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

.celios-mobile-menu__cta:hover,
.celios-mobile-menu__cta:focus-visible {
    background:
        var(--celios-header-white);

    border-color:
        var(--celios-header-white);
}


/* ==========================================================
 * Blocage scroll
 * ======================================================= */

body.celios-menu-open {
    overflow:
        hidden;
}


/* ==========================================================
 * Focus clavier
 * ======================================================= */

.celios-header a:focus-visible,
.celios-header button:focus-visible {
    outline:
        2px solid
        var(--celios-header-white);

    outline-offset:
        4px;
}


/* ==========================================================
 * Header overlay
 * ======================================================= */

body {
    padding-top:
        0;
}


/* ==========================================================
 * Desktop intermédiaire
 * ======================================================= */

@media (max-width: 1180px) {

    .celios-header__inner {
        gap:
            24px;

        padding:
            0
            24px;
    }

    .celios-header__menu {
        gap:
            22px;
    }

    .celios-header__phone {
        width: 17px;
        gap: 0;
        overflow: hidden;

        font-size: 0;
    }
}


/* ==========================================================
 * Mobile
 * ======================================================= */

@media (max-width: 960px) {

    .celios-header {
        background:
            rgba(8, 8, 7, 0.78);

        backdrop-filter:
            blur(22px)
            saturate(125%);

        -webkit-backdrop-filter:
            blur(22px)
            saturate(125%);
    }

    .celios-header__inner {
        grid-template-columns:
            auto
            1fr
            auto;

        min-height:
            68px;
    }

    .celios-header__nav,
    .celios-header__actions {
        display:
            none;
    }

    .celios-header__mobile-toggle {
        display:
            inline-flex;

        grid-column:
            3;
    }
}


/* ==========================================================
 * Petit mobile
 * ======================================================= */

@media (max-width: 520px) {

    .celios-header__inner {
        padding:
            0
            18px;
    }

    .celios-header__logo {
        width:
            104px;
    }

    .celios-mobile-menu {
        padding:
            32px
            24px
            24px;

        background:
            rgba(8, 8, 7, 0.68);

        backdrop-filter:
            blur(28px)
            saturate(140%);

        -webkit-backdrop-filter:
            blur(28px)
            saturate(140%);
    }

    .celios-mobile-menu__links a {
        padding:
            15px
            4px;
    }
}


/* ==========================================================
 * Réduction des animations
 * ======================================================= */

@media (prefers-reduced-motion: reduce) {

    .celios-header *,
    .celios-header *::before,
    .celios-header *::after {
        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;
    }

    .celios-header__cta:hover,
    .celios-header__cta:focus-visible {
        transform:
            none;
    }

    .celios-mobile-menu {
        transform:
            none;
    }
}
