/**
 * Header and footer template parts (parts/header.html, parts/footer.html).
 * Loaded on the site and in the editor, so the Site Editor shows the parts
 * as they look on the site.
 *
 * Colors and sizes come from theme.json, settings.custom.header and
 * settings.custom.footer. Change those first.
 *
 * Breakpoints: 600px (WordPress's own mobile menu), 782px.
 *
 * Contents
 *   1. Header
 *   2. Header navigation
 *   3. Footer
 */


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

.hc-header {
    color: var(--wp--custom--header--text);
    background-color: var(--wp--custom--header--background);
    transition:
        background-color var(--wp--custom--transition--base),
        box-shadow var(--wp--custom--transition--base);
}

.hc-header a {
    color: inherit;
}

.hc-header__inner {
    gap: var(--wp--preset--spacing--40);
    width: 100%;
    max-width: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
    min-height: var(--wp--custom--header--height);
    padding-right: var(--wp--style--root--padding-right);
    padding-left: var(--wp--style--root--padding-left);
    margin-right: auto;
    margin-left: auto;
}

.hc-header__brand {
    flex: 0 0 auto;
    gap: var(--wp--preset--spacing--30);
}

.hc-header .wp-block-site-logo img {
    width: auto;
    max-height: var(--wp--custom--header--logo-height);
}

/* Show the site title only when there is no logo. */
.hc-header__brand:has(.wp-block-site-logo img) .hc-header__site-title {
    display: none;
}

.hc-header__site-title {
    margin: 0;
    font-size: var(--wp--preset--font-size--large);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
}

.hc-header__site-title a {
    text-decoration: none;
}

/* The menu sits on the right on desktop. It is left-aligned in the
   Navigation block itself, so the mobile menu reads left to right. */
.hc-header__nav {
    flex: 1 1 auto;
}

@media (min-width: 600px) {

    .hc-header__nav {
        --navigation-layout-justify: flex-end;
        --navigation-layout-justification-setting: flex-end;
    }

    .hc-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
        --navigation-layout-justification-setting: flex-end;
    }
}

.hc-header__actions {
    flex: 0 0 auto;
    gap: var(--wp--preset--spacing--40);
}

.hc-header__phone {
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    white-space: nowrap;
}

/* Header call to action: inverted so it stands out on the dark header. */
.hc-header .hc-header__cta a.hc-button {
    color: var(--wp--custom--header--background);
    background-color: var(--wp--custom--header--text);
    border-color: var(--wp--custom--header--text);
}

.hc-header .hc-header__cta a.hc-button:hover,
.hc-header .hc-header__cta a.hc-button:focus-visible {
    color: var(--wp--custom--header--text);
    background-color: transparent;
    border-color: var(--wp--custom--header--text);
}

/* Small screens: logo, phone and the menu button. The call to action
   button is hidden; put it in the menu or the page if you need it there. */
@media (max-width: 781px) {

    .hc-header__inner {
        min-height: var(--wp--custom--header--height-mobile);
    }

    .hc-header .hc-header__cta {
        display: none;
    }

    /* Menu button at the far right, after the phone. */
    .hc-header__actions {
        order: 1;
        margin-left: auto;
    }

    .hc-header__nav {
        flex: 0 0 auto;
        order: 2;
    }
}


/* ------------------------------------------------------------------
 * 2. Header navigation (core Navigation block)
 * ------------------------------------------------------------------ */

.hc-header__nav .wp-block-navigation__container {
    gap: var(--wp--preset--spacing--40);
}

.hc-header__nav .wp-block-navigation-item__content {
    padding-block: var(--wp--preset--spacing--20);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    text-decoration: none;
}

.hc-header__nav .wp-block-navigation-item__content:hover,
.hc-header__nav .current-menu-item > .wp-block-navigation-item__content {
    color: var(--wp--custom--header--link-hover);
}

/* Submenus */
.hc-header__nav .wp-block-navigation__submenu-container {
    min-width: 220px;
    padding: var(--wp--preset--spacing--20) 0;
    color: var(--wp--custom--header--text) !important;
    background-color: var(--wp--custom--header--submenu-background) !important;
    border: 0 !important;
    border-radius: var(--wp--custom--radius--medium);
    box-shadow: var(--wp--preset--shadow--md);
}

.hc-header__nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
}

.hc-header__nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    background-color: var(--wp--custom--header--submenu-hover);
}

/* Mobile menu overlay */
.hc-header .hc-header__nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
    padding: var(--wp--preset--spacing--40) var(--wp--style--root--padding-right);
    color: var(--wp--custom--header--text);
    background-color: var(--wp--custom--header--background);
}

.hc-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-size: var(--wp--preset--font-size--large);
}

.hc-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
    background-color: transparent !important;
    box-shadow: none;
}


/* ------------------------------------------------------------------
 * 3. Footer
 * ------------------------------------------------------------------ */

.hc-footer {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--custom--footer--text);
    background-color: var(--wp--custom--footer--background);
}

.hc-footer a {
    color: inherit;
}

.hc-footer__main,
.hc-footer__bottom {
    width: 100%;
    max-width: calc(var(--wp--style--global--wide-size) + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
    padding-right: var(--wp--style--root--padding-right);
    padding-left: var(--wp--style--root--padding-left);
    margin-right: auto;
    margin-left: auto;
}

.hc-footer__main {
    gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
    padding-top: var(--wp--preset--spacing--60);
    padding-bottom: var(--wp--preset--spacing--50);
}

.hc-footer__main > .wp-block-group.hc-footer__column {
    flex: 1 1 160px;
    gap: var(--wp--preset--spacing--30);
    margin: 0;
}

.hc-footer__main > .hc-footer__column--brand {
    flex: 1.6 1 240px;
}

.hc-footer__main > .hc-footer__column--cta {
    flex: 0 0 auto;
}

.hc-footer__column > * {
    margin: 0;
}

.hc-footer__heading {
    margin: 0;
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 600;
    color: var(--wp--custom--footer--heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hc-footer .hc-logo__image {
    max-height: 56px;
}

.hc-footer .hc-info {
    color: var(--wp--custom--footer--muted);
}

.hc-footer__phone .hc-info {
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--custom--footer--text);
}

.hc-footer__menu .wp-block-navigation__container {
    gap: var(--wp--preset--spacing--20);
}

.hc-footer__menu .wp-block-navigation-item__content {
    color: var(--wp--custom--footer--muted);
    text-decoration: none;
}

.hc-footer__menu .wp-block-navigation-item__content:hover {
    color: var(--wp--custom--footer--text);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.hc-footer__bottom {
    gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
    padding-top: var(--wp--preset--spacing--40);
    padding-bottom: var(--wp--preset--spacing--40);
    border-top: 1px solid var(--wp--custom--footer--divider);
}

.hc-footer__bottom > * {
    margin: 0;
}

.hc-footer__copyright {
    color: var(--wp--custom--footer--muted);
}

/* Social icons */
.hc-social {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--20);
    padding: 0;
    margin: 0;
    list-style: none;
}

a.hc-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: inherit;
    border: 1px solid var(--wp--custom--footer--divider);
    border-radius: var(--wp--custom--radius--pill);
    transition: background-color var(--wp--custom--transition--fast), border-color var(--wp--custom--transition--fast);
}

a.hc-social__link:hover {
    color: inherit;
    border-color: currentcolor;
}

.hc-social__link .hc-icon,
.hc-social__link svg {
    width: 18px;
    height: 18px;
}
