/*
 * Primary navigation.
 *
 * Menu design follows the reference at https://ayelite.com/: a white bar with
 * the logo left, light 16px links pushed right, an outlined pill "Contact Us"
 * as the last item, and a shadow once the header sticks.
 *
 * Loaded after theme.css so these rules win over the MyTravel template, whose
 * .u-header__nav-link colours and paddings we deliberately do not use.
 */

.site-header {
    --nav-ink: #333;
    --nav-accent: #297cbb;
    --nav-rule: #eef1f6;
}

/* ------------------------------------------------------------------ bar -- */

.site-header .u-header__section,
.site-header #logoAndNav {
    background-color: #fff;
}

.site-header #logoAndNav {
    padding-top: 0;
    padding-bottom: 0;
    transition: box-shadow .3s ease;
}

/* The template stamps .js-header-fix-moment on the header once the page has
   scrolled past data-header-fix-moment. That is our stuck state. */
.site-header.js-header-fix-moment #logoAndNav {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
}

/* --------------------------------------------------------------- brand -- */

.site-nav {
    padding-top: 0;
    padding-bottom: 0;
}

.site-nav .navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
    margin-right: 0;
}

.site-nav .navbar-brand img {
    width: 180px;
    height: auto;
    transition: width .3s ease;
}

/* --------------------------------------------------------------- links -- */

@media (min-width: 1200px) {
    .site-nav__list {
        align-items: center;
    }
}

.site-nav__item + .site-nav__item {
    margin-left: 30px;
}

.site-nav__link {
    /* Drives both the bar height (34 + 26 + 34 = 94px, matching the header we
       are replacing) and where the underline sits, so the two stay in step
       when the stuck header tightens up. */
    --nav-pad-y: 34px;

    display: block;
    position: relative;
    color: var(--nav-ink);
    font-size: 16px;
    font-weight: 400;
    line-height: 26px;
    padding: var(--nav-pad-y) 0;
    transition: color .3s ease, padding .3s ease;
}

.site-nav__link:hover,
.site-nav__link:focus,
.site-nav__item.active .site-nav__link {
    color: var(--nav-accent);
    text-decoration: none;
}

/* Underline grows from the left on hover and stays put on the current page. */
.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: calc(var(--nav-pad-y) - 8px);
    height: 2px;
    background-color: var(--nav-accent);
    transition: right .3s ease;
}

.site-nav__link:hover::after,
.site-nav__link:focus::after,
.site-nav__item.active .site-nav__link::after {
    right: 0;
}

.site-header.js-header-fix-moment .site-nav__link {
    --nav-pad-y: 24px;
}

.site-header.js-header-fix-moment .site-nav .navbar-brand img {
    width: 150px;
}

/* ----------------------------------------------------------------- cta -- */

.site-nav__cta-item {
    margin-left: 30px;
}

.site-nav__cta {
    display: inline-block;
    color: var(--nav-accent);
    background-color: #fff;
    border: 1px solid var(--nav-accent);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 24px;
    padding: 11px 35px;
    white-space: nowrap;
    transition: color .3s ease, background-color .3s ease;
}

.site-nav__cta:hover,
.site-nav__cta:focus,
.site-nav__cta-item.active .site-nav__cta {
    color: #fff;
    background-color: var(--nav-accent);
    text-decoration: none;
}

/* ------------------------------------------------------------ hamburger -- */

.site-nav .navbar-toggler {
    color: var(--nav-ink);
    border: 0;
    font-size: 20px;
    padding: 0 0 0 12px;
}

.site-nav .navbar-toggler:focus {
    outline: 0;
    color: var(--nav-accent);
}

/* --------------------------------------------------------------- mobile -- */

/* navbar-expand-xl, so the menu collapses below 1200px. */
@media (max-width: 1199.98px) {
    .site-nav {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .site-nav .navbar-brand img,
    .site-header.js-header-fix-moment .site-nav .navbar-brand img {
        width: 132px;
    }

    /* The stacked rows carry dividers, so they have to span the drawer. */
    .site-nav__list {
        align-items: stretch;
    }

    .site-nav__item + .site-nav__item,
    .site-nav__cta-item {
        margin-left: 0;
    }

    .site-nav__link,
    .site-header.js-header-fix-moment .site-nav__link {
        --nav-pad-y: 14px;
        border-bottom: 1px solid var(--nav-rule);
    }

    /* The growing underline reads as a glitch against the row dividers. */
    .site-nav__link::after {
        display: none;
    }

    .site-nav__cta-item {
        padding: 18px 0 6px;
    }

    .site-nav__cta {
        display: block;
        text-align: center;
    }
}
