/**
 * Berco layer: header, menu and footer, matching the original
 * bercoalaska.com look. Loaded on the front end after site.css.
 *
 * Contents
 *   1. Header
 *   2. Menu (desktop)
 *   3. Menu (mobile drawer)
 *   4. Footer
 */


/* ------------------------------------------------------------------
 * 1. Header
 * ------------------------------------------------------------------ */

.berco-header {
    position: relative;
    top: auto;
    background-color: var(--wp--custom--header--background);
    border-top: 3px solid var(--wp--preset--color--primary);
}

.berco-header.is-scrolled {
    box-shadow: none;
}

.berco-header__top {
    flex-wrap: wrap;
    gap: 16px;
    min-height: 0;
    padding: 30px 0;
}

.berco-header .hc-logo__image {
    width: 207px;
    max-width: 100%;
    max-height: none;
}

.berco-header__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    margin-left: auto;
    font-family: var(--wp--preset--font-family--heading);
    text-align: right;
}

a.berco-header__cta {
    font-size: 22px;
    line-height: 1.3;
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
}

a.berco-header__cta:hover {
    color: var(--wp--preset--color--contrast);
}

.berco-header__phone {
    font-size: 20px;
    line-height: 1.3;
    color: var(--wp--preset--color--contrast);
}

.berco-header__phone a {
    color: inherit;
    text-decoration: none;
}


/* ------------------------------------------------------------------
 * 2. Menu (desktop, 1080px and up)
 * ------------------------------------------------------------------ */

@media (min-width: 1080px) {

    .berco-header__nav {
        display: block;
        background-color: var(--wp--custom--header--nav-background, #fff);
    }

    .berco-header .hc-nav__menu {
        gap: 0;
        flex-wrap: wrap;
    }

    .berco-header .hc-nav__menu > li > a {
        display: block;
        padding: 11px 15px;
        font-size: 15px;
        font-weight: 400;
        color: var(--wp--preset--color--contrast);
        border-radius: 0;
    }

    .berco-header .hc-nav__menu > li > a:hover,
    .berco-header .hc-nav__menu > li:hover > a,
    .berco-header .hc-nav__menu > li > a[aria-current="page"],
    .berco-header .hc-nav__menu > li.current-menu-item > a,
    .berco-header .hc-nav__menu > li.current-menu-ancestor > a,
    .berco-header .hc-nav__menu > li.current-menu-parent > a {
        color: #fff;
        text-decoration: none;
        background-color: var(--wp--preset--color--primary);
    }

    /* The old menu opens its dropdown on hover and has no arrow button. */
    .berco-header .hc-nav__menu > li > .hc-submenu-toggle {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .berco-header .hc-nav__menu .sub-menu {
        min-width: 200px;
        padding: 0;
        background-color: #fff;
        border-top: 3px solid var(--wp--preset--color--primary);
        border-radius: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .berco-header .hc-nav__menu .sub-menu a {
        padding: 8px 15px;
        font-size: 14px;
        color: var(--wp--preset--color--contrast);
        border-bottom: 1px solid var(--wp--preset--color--border);
    }

    .berco-header .hc-nav__menu .sub-menu a:hover,
    .berco-header .hc-nav__menu .sub-menu a[aria-current="page"] {
        color: #fff;
        background-color: var(--wp--preset--color--primary);
    }
}


/* ------------------------------------------------------------------
 * 3. Menu (mobile drawer, below 1080px)
 * ------------------------------------------------------------------ */

@media (max-width: 1079px) {

    .berco-header__top {
        padding: 20px 0;
    }

    .berco-header .hc-nav-toggle {
        color: var(--wp--preset--color--contrast);
    }

    .berco-header__nav {
        background-color: #fff;
    }

    .berco-header .hc-nav__menu li {
        border-bottom-color: var(--wp--preset--color--border);
    }

    .berco-header .hc-nav__menu a {
        font-size: 16px;
        font-weight: 400;
        color: var(--wp--preset--color--contrast);
    }

    .berco-header .hc-nav__menu a[aria-current="page"] {
        color: var(--wp--preset--color--primary);
        text-decoration: none;
    }
}

@media (max-width: 600px) {

    .berco-header__info {
        order: 3;
        align-items: flex-start;
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .berco-header .hc-logo__image {
        width: 170px;
    }
}


/* ------------------------------------------------------------------
 * 4. Footer
 * ------------------------------------------------------------------ */

.berco-footer {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--wp--custom--footer--text);
    background-color: transparent;
}

.berco-footer__main {
    background-color: var(--wp--custom--footer--background);
}

.berco-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px 40px;
    padding-top: 40px;
    padding-bottom: 50px;
}

.berco-footer__column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
}

.berco-footer__column p {
    margin: 0;
}

.berco-footer__column .berco-widget__title {
    margin: 0;
    font-size: 22px;
    color: var(--wp--custom--footer--heading);
}

.berco-footer__column .berco-widget__title:not(:first-child) {
    margin-top: 10px;
}

.berco-footer a {
    color: inherit;
    text-decoration: none;
}

.berco-footer a.berco-footer__strong {
    font-weight: 500;
    color: #fff;
}

.berco-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.berco-footer__bottom {
    font-size: 13px;
    color: var(--wp--custom--footer--bottom-text, #777);
    background-color: var(--wp--custom--footer--bottom-background, #f8f8f8);
    border-top: 3px solid var(--wp--preset--color--primary);
}

.berco-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
}

.berco-footer__copyright {
    margin: 0;
}

.berco-footer__bottom a {
    font-weight: 400;
    color: var(--wp--preset--color--contrast);
}

.berco-footer__bottom a:hover,
.berco-footer__menu .current-menu-item > a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
}

.berco-footer__menu {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}
