/* Bottom Bar
   ========================================================================== */
.bottom-bar {
    pointer-events: none;
    
    position: fixed;
    inset: auto 16px 20px;
    
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-index--bottom-bar);
}
.bottom-bar__menu {
    pointer-events: all;
    
    padding: 14px 13px 13px;
    text-transform: uppercase;
    font-size: 9px;
    font-weight: 500;
    background-color: var(--mdr--eggplant-purple--90);
    backdrop-filter: blur(1px);
    color: var(--mdr--pure-white);
    box-sizing: content-box;
    border: 1px solid var(--mdr--pure-white--20);
    border-radius: 10px;
    
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: stretch;
    column-gap: 16px;
}
.bottom-bar__link {
    height: 100%;
    
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    row-gap: 8px;
    
    line-height: 1em;
}
.bottom-bar__icon {
    width: 23px;
    height: 23px;
    object-fit: contain;
}
.bottom-bar__link__label {
    flex: 1;
    text-align: center;
    
    display: flex;
    justify-content: center;
    align-items: center;
}
.bottom-bar__item:nth-child(1) {
    order:3;
}
/* 
 // This rule was meant for the JPO logo (which is contributed black) to be inverted to white.
 // Since the JPO logo has been recently removed, the rule has been temporarily disabled.
.bottom-bar__item:nth-child(1) img {
    filter:invert(1);
}
*/
.bottom-bar__item:nth-child(1) .bottom-bar__link {
        padding: 0px 5px;
    }
.bottom-bar__item:nth-child(4) {
    order:4;
}
.bottom-bar__item:nth-child(5) {
    order:5;
}

@media screen and (min-width: 768px) {
    .bottom-bar {
        inset: auto 16px 46px;
    }
    .bottom-bar__menu {
        font-size: 12px;
        padding: 0px;
        column-gap: 0px;
        
        overflow: hidden;
    }
    .bottom-bar__item:not(:last-child) {
        border-right: 1px solid var(--mdr--pure-white--20);
    }
    .bottom-bar__link {
        position: relative;
        padding: 12px 16px 10px;
        row-gap: 11px;
    }
    .bottom-bar__item:nth-child(1) .bottom-bar__link {
        padding: 12px 22px 10px;
    }
    .bottom-bar__link::before {
        content: "";
        position: absolute;
        inset: 0px;
        background-color: var(--mdr--pure-white);
        opacity: 0;
        transition: opacity 0.125s ease 0s;
    }
    .bottom-bar__link:hover::before {
        opacity: 0.2;
    }
    .bottom-bar__icon {
        width: 25px;
        height: 25px;
        width: auto;
    }
}



/* Site Menu - Grid settings
   ========================================================================== */
.site-menu {
    z-index: var(--z-index--header);
    position: fixed;
    inset: var(--wp-admin--admin-bar--height, 0px) 0px auto;
}
.site-menu[data-is-open="true"] {
    position: fixed;
    inset: var(--wp-admin--admin-bar--height, 0px) 0px 0px;
}


.site-menu__inner {
    height: 100%;
    display: grid;
    align-items: stretch;
    grid-template-areas: "logo  toggle"
                         "nav   nav"
                         "extra extra";
    grid-template-columns: 1fr 82px;
    overflow: hidden;
    grid-template-rows: var(--mdr--header--height);
}
.site-menu[data-is-open="true"] .site-menu__inner {
    grid-template-rows: var(--mdr--header--height) 1fr auto;
}

.site-menu__nav__toggle {
    grid-area: toggle;
    
    justify-self: flex-end;
    align-self: center;
    
    margin-right: var(--mdr--padding-horizontal);
    translate: 10px 0px;
}

.site-menu__nav {
    background-color: var(--mdr--pure-white);
    grid-area: nav;
    position: relative;
}
.site-menu[data-is-megamenu-open="true"] .site-menu__logo {
    display: none;
}
.site-menu__logo {
    grid-area: logo;
    align-self: center;
    justify-self: flex-start;
    
    margin-left: var(--mdr--padding-horizontal);
}
.site-menu__extra {
    grid-area: extra;
    position: sticky;
    bottom: 0px;
    box-sizing: border-box;
    padding: 1rem;
    /* margin-top: 1rem; */
    gap: 20px;
    
    display: none; /* will be flex */
    flex-flow: row wrap;
    justify-content: center;
    background-color: var(--mdr--pure-white);
}
.site-menu__extra .cta {
    flex: 1 0 auto;
    text-align: center;
    max-width: 323px;
}
.site-menu[data-is-open="true"] .site-menu__extra {
    display: flex;
}


.site-menu__logo__img {
    width: auto;
    height: 47px;
}

/* Site Menu - Burger Button
   ========================================================================== */
.site-menu__nav__toggle {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: var(--mdr--pure-white);
}
.site-menu__nav__toggle__burger-icon {
    width: 100%;
    height: 2px;
    background-color: var(--mdr--eggplant-purple);
    
    position: relative;
    pointer-events: none;
}
.site-menu__nav__toggle__burger-icon::before,
.site-menu__nav__toggle__burger-icon::after {
    content: "";
    position: absolute;
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--mdr--eggplant-purple);
}
.site-menu__nav__toggle__burger-icon::before {
    translate: 0px -250%;
}   
.site-menu__nav__toggle__burger-icon::after {
    translate: 0px 250%;
}


.site-menu__nav__toggle__burger-icon {
    --animation-playstate: paused;
    --animation-direction: reverse;
    --animation-details: 0.3s ease 0s 1 var(--animation-direction) both var(--animation-playstate);
}
.site-menu[data-is-open="true"] .site-menu__nav__toggle__burger-icon {
    --animation-direction: normal;
}
.site-menu__nav__toggle__burger-icon {
    animation: burger-bar-to-cross var(--animation-details);
}
.site-menu__nav__toggle__burger-icon::after {
    animation: burger-topbar-to-cross var(--animation-details);
}
.site-menu__nav__toggle__burger-icon::before {
    animation: burger-bottombar-to-void var(--animation-details);
}
@keyframes burger-bar-to-cross {
    0% { transform: none; }
    50% { transform: none; }
    100% { transform: rotateZ(45deg); }
}
@keyframes burger-topbar-to-cross {
    0% { transform: translateY(0); }
    50% { transform: translateY(-250%); }
    100% { transform: translateY(-250%) rotateZ(90deg); }
}
@keyframes burger-bottombar-to-void {
    0% { transform: translateY(0); }
    50% { transform: translateY(250%); }
    100% { transform: translateY(250%); }
}


/* Site Menu - Megamenu
   ========================================================================== */
.mm {
    position: absolute;
    inset: 0px var(--mdr--padding-horizontal) 0px;
    overflow-x: hidden;
    overflow-y: auto;
}
.mm__lvl-0__ul,
.mm__lvl-1 {
    overflow-x: hidden;
    overflow-y: auto;
}
.mm__lvl-1 {
    background-color: var(--mdr--pure-white);
}
.mm__lvl-0__mobile-label { /* looks like I need to remove two parents overflow:hidden */
    position: absolute;
    inset: calc(-1 * var(--mdr--header--height)) 0px auto;
    height: var(--mdr--header--height);
    
    font-size: 11.5px;
    line-height: 1.1em;
    
    display: flex;
    justify-content: center;
    align-items: center;
}
.mm__lvl-1__mobile-label {
    display: none;
}
.mm__lvl-0__ul {
    display: flex;
    flex-flow: column nowrap;
}
.mm__lvl-0__li:not(:first-child),
.mm__lvl-1__li:not(:first-child) {
    border-top: 1px solid var(--mdr--dark-grey--30);
}
.mm__lvl-0__item,
.mm__lvl-1__item {
    width: 100%;
    font-family: "Black Mango";
    font-size: 24px;
    line-height: 1em;
    padding: 25px 0px; /* TO MOVE */
    
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
}
.mm__lvl-0__item__label {
    text-align: start;
}
a.mm__lvl-0__item:hover,
a.mm__lvl-1__item:hover,
button.mm__lvl-0__item:hover,
button.mm__lvl-1__item:hover {
    color: var(--mdr--eggplant-purple);
}
.mm__lvl-0__item--has-children {
    --arrow--width: 0.75em;
    --arrow--margin: 0.83em;
    --arrow--hr-space: calc(var(--arrow--margin) + var(--arrow--width));
    --transition: 0.3s ease 0s;
    
    
    transition: transform var(--transition);
}
.mm__lvl-0__item--has-children::before,
.mm__lvl-0__item--has-children::after {
    content: "";
    display: inline-block;
    width: var(--arrow--width);
    height: 1em;
    
    background-size: auto 0.792em;
    background-position: left center;
    background-repeat: no-repeat;
    
    transition: opacity var(--transition);
}
.mm__lvl-0__item--has-children::before {
    background-image: url('../images/svg/arrow-right--eggplant-purple.svg');
    position: absolute;
    padding-right: var(--arrow--margin);
    opacity: 0;
    transform: translateX(calc(-1 * var(--arrow--hr-space)));
}
.mm__lvl-0__item--has-children::after {
    margin-left: auto;
    background-image: url('../images/svg/arrow-right--dark-grey.svg');
}
.mm__lvl-0__item--has-children:hover {
    transform: translateX(var(--arrow--hr-space));
}
.mm__lvl-0__item--has-children:hover::before {
    opacity: 1;
}
.mm__lvl-0__item--has-children:hover::after {
    opacity: 0;
}



.mm__lvl-1 {
    position: absolute;
    inset: 0px;
    opacity: 0;
    pointer-events: none;
}
.mm__lvl-1.visible {
    opacity: 1;
    pointer-events: all;
    z-index: 2;
}


.site-menu {
    --text-color: var(--mdr--pure-white); /* or dark grey, depending on first block of page */
}
.site-menu:hover {
    --text-color: var(--mdr--dark-grey);
}
.site-menu__inner::before {
    content: "";
    display: block;
    grid-row: logo;
    grid-column: logo / toggle;
    
    background: var(--mdr--pure-white);
    z-index: -1;
    opacity: 0; 
}
.site-menu[data-is-open="true"] > .site-menu__inner::before {
    opacity: 1;
}
.site-menu:hover::before {
    opacity: 1;
}



.site-menu__nav__backwards-btn {
    grid-area: logo;
    align-self: center;
    
    display: none;
    
    min-width: 0.9cm;
    min-height: 0.9cm;
    width: 40px;
    height: 40px;
    
    background-size: 18px 19px;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url('../images/svg/arrow-right--eggplant-purple.svg');
    margin-left: var(--mdr--padding-horizontal);
    rotate: z 180deg;
    translate: -10px 0px;
}
.site-menu[data-is-megamenu-open="true"] .site-menu__nav__backwards-btn {
    display: block;
}

.mm__lvl-2__inner {
    margin-bottom: 25px;
}


/* lvl-1 && lvl-2 links rollover */
a.mm__lvl-2__item:hover {
    color: var(--mdr--eggplant-purple);
}
a.mm__lvl-1__item,
a.mm__lvl-2__item {
    --arrow--width: 0.776em;
    --arrow--margin: 0.5em;
    --arrow--hr-space: calc(var(--arrow--margin) + var(--arrow--width));
    --transition: 0.3s ease 0s;
    
    
    display: inline-flex;
    align-items: flex-start;
}
.mm__lvl-1__item__label,
.mm__lvl-2__item__label {
    display: inline-block;
    transition: transform var(--transition);
}
a.mm__lvl-1__item::before,
a.mm__lvl-2__item::before {
    content: "";
    display: inline-block;
    pointer-events: none;
    
    width: var(--arrow--width);
    height: 1lh;
    
    background-image: url('../images/svg/arrow-right--eggplant-purple.svg');
    background-size: auto 0.795em;
    background-position: left center;
    background-repeat: no-repeat;
    
    transition: var(--transition);
    transition-property: transform opacity;
    position: absolute;
    padding-right: var(--arrow--margin);
    opacity: 0;
    transform: translateX(calc(-1 * var(--arrow--hr-space)));
}
a.mm__lvl-1__item:hover .mm__lvl-1__item__label,
a.mm__lvl-2__item:hover .mm__lvl-2__item__label {
    transform: translateX(var(--arrow--hr-space));
}
a.mm__lvl-1__item:hover::before,
a.mm__lvl-2__item:hover::before {
    opacity: 1;
    transform: translateX(0px);
}

.site-menu[data-is-homepage="false"] .site-menu__logo__img {
    filter: invert(1);
}

/* desktop display */
@media screen and (min-width: 1085px) {
    .site-menu__inner {
        position: relative;
        grid-template-areas: "nav logo extra";
        grid-template-columns: 1fr 207px 1fr;
        grid-template-rows: 162px;
        overflow: visible;
        /* max-width: 1440px; */
        /* margin: 0px auto; */
        
        padding: 0px calc(0.75 * var(--mdr--padding-horizontal));
    }
    
    .site-menu__nav {
        align-self: stretch;
        position: static;
        background-color: unset;
    }
    
    
    .site-menu__logo {
        margin-left: 0px;
    }
    .site-menu__logo__img {
        width: 207px;
        height: auto;
    }
    
    .site-menu__extra {
        height: 100%;
        display: flex;
        flex-flow: row-reverse nowrap;
        justify-content: flex-start;
        align-items: flex-end;
        
        margin-top: 0px;
        padding-bottom: 34px;
        background-color: unset;
    }

    .site-menu__nav__toggle {
        display: none;
    }
    
    .mm {
        position: static;
        overflow: visible;
        height: 100%;
    }
    .mm__lvl-0__ul {
        height: 100%;
        flex-direction: row;
        align-items: flex-end;
        column-gap: 20px;
    }
    .mm__lvl-0__li {
        padding-top: 0px;
        padding-bottom: 24px;
        
        display: flex;
        flex-flow: row nowrap;
        justify-content: center;
        align-items: flex-start;
    }
    .mm__lvl-0__li:not(:first-child),
    .mm__lvl-1__li:not(:first-child) {
        border-top: none;
    } 
    .mm__lvl-0__item--has-children:hover {
        transform: none;
    }
    .mm__lvl-0__item--has-children::before,
    .mm__lvl-0__item--has-children::after {
        content: none;
    }
    .mm__lvl-0__item {
        font-family: "Work Sans";
        font-size: 13px;
        line-height: 1em;
        font-weight: 500;
        text-transform: uppercase;
    }
    .mm__mobile-label {
        display: none;
    }
    
    /* .mm__lvl-0__li:hover, */
    .mm__lvl-1 {
        background: var(--mdr--pure-white);
    }
    
    .mm__lvl-0__li--has-children:hover > .mm__lvl-1 {
        opacity: 1;
        pointer-events: all;
        z-index: 2;
    }
    .mm__lvl-1 {
        width: 100%;
        top: 100%;
        bottom: auto;
    }
    .mm__lvl-1__inner {
        padding: 30px var(--mdr--padding-horizontal) 65px;
        /* max-width: 1440px; */
        /* margin: 0px auto; */
    }
    .mm__lvl-1__ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    [data-has-push="true"] > .mm__lvl-1__ul {
        display: flex;
        flex-flow: column nowrap;
    }
    .mm__lvl-1__inner[data-has-push="true"] {
        display: grid;
        grid-template-columns: 1fr 430px;
        grid-column-gap: var(--mdr--padding-horizontal);
    }
    [data-push] {
        --img-url: var(--active-img-url, var(--fallback-img-url));
        width: 430px;
        height: 330px;
        background-image: var(--img-url);
        background-size: cover;
        background-position: center center;
        
        border-radius: 10px;
    }
    .mm__lvl-1__item--has-children {
        padding: 34px 0px 44px;
    }
    .mm__lvl-2__ul {
         display: flex; 
         flex-flow: column nowrap; 
         row-gap: 8px; 
    }
    
    .site-menu__extra .cta {
        flex: 0 1 auto;
    }
    
    /* scroll mgmt */
    .site-menu {
        --header--translate--transition-duration: 0.35s;
        --header--translate--transition-timing-function: ease;
        transition: translate var(--header--translate--transition-duration) var(--header--translate--transition-timing-function) 0s;
    }
    .site-menu[data-is-up="true"]:not([data-is-locked="true"]) {
        translate: 0px -100%; 
    }
    
    
    /* transparence mgmt */
    .site-menu__inner {
        --header--transparence--transition-details: var(--header--translate--transition-duration) var(--header--translate--transition-timing-function) var(--header--translate--transition-duration);
        color: var(--mdr--pure-white);
        /* on scroll, color change should have delay in order to not be visible */
        transition: background-color var(--header--transparence--transition-details);
    }
    .site-menu[data-is-locked="true"] .site-menu__inner {
        /* on rollover, no delay */
        --header--transparence--transition-details: var(--header--translate--transition-duration) var(--header--translate--transition-timing-function) 0s;
    }
    .mm__lvl-0__item__label {
        transition: color var(--header--transparence--transition-details);
    }
    .mm__lvl-1__item--has-children .mm__lvl-1__item__label {
        padding-right: 40px;
    }
    .mm__lvl-1__item__label {
        min-height: 2lh;
    }
    [data-has-push="true"] .mm__lvl-1__item__label {
        min-height: auto;
    }
    .site-menu[data-is-homepage="true"] .site-menu__extra .cta--outlined {
        --primary-color: var(--mdr--pure-white);
        --secondary-color: var(--mdr--dark-grey);
        --border-color: var(--mdr--pure-white--30);
        transition: color var(--header--transparence--transition-details), 
                    border-color var(--header--transparence--transition-details);
    }
    .site-menu[data-is-homepage="false"] .site-menu__inner {
        color: var(--mdr--dark-grey);
    }
    .site-menu[data-is-transparent="false"] .site-menu__inner,
    .site-menu[data-is-locked="true"] .site-menu__inner {
        background: var(--mdr--pure-white);
        color: var(--mdr--dark-grey);
    }
    .site-menu__logo__img {
        transition: filter var(--header--transparence--transition-details);
    }
    .site-menu[data-is-transparent="false"] .site-menu__logo__img,
    .site-menu[data-is-locked="true"] .site-menu__logo__img {
        filter: invert(1);
    }
    .site-menu[data-is-transparent="false"] .site-menu__extra .cta--dark-grey,
    .site-menu[data-is-locked="true"] .site-menu__extra .cta--dark-grey {
        --primary-color: var(--mdr--dark-grey);
        --secondary-color: var(--mdr--pure-white);
        --border-color: var(--mdr--dark-grey--30);
    }
    
    
}