/*
 * Slide-out menu.
 *
 * Shared by the desktop sidebar panel and the mobile popup — both include
 * partials/menu.php, so both get these styles. Loaded sitewide from
 * partials/head.php.
 *
 * Three row treatments rather than one flat list. Sixteen identically-weighted
 * links means reading all sixteen to find one; giving top-level destinations,
 * services and legal pages distinct weights lets the eye skip.
 */

.site-menu {
    padding-bottom: 8px;
}

.menu-group + .menu-group {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--color-gray);
    font-family: var(--font-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
}

/* Hairline trailing the label, so the group reads as a band without needing a
   heavier heading. */
.menu-group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.site-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-menu a {
    text-decoration: none;
}


/* --- primary: top-level destinations ------------------------------------ */

.menu-primary a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: var(--color-heading);
    font-family: var(--font-primary);
    font-size: 19px;
    font-weight: 600;
    line-height: 28px;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.menu-primary a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 2px;
    height: 0;
    border-radius: 2px;
    background: var(--color-primary);
    transform: translateY(-50%);
    transition: height 0.22s ease;
}

.menu-primary a:hover,
.menu-primary a:focus-visible {
    padding-left: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-primary);
}

.menu-primary a:hover::before,
.menu-primary a:focus-visible::before,
.menu-primary a[aria-current="page"]::before {
    height: 22px;
}

/* The arrow is an affordance, not information: hover-only, and aria-hidden. */
.menu-chevron {
    font-size: 13px;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-primary a:hover .menu-chevron,
.menu-primary a:focus-visible .menu-chevron {
    opacity: 1;
    transform: translateX(0);
}


/* --- detail: icon tile + label + descriptor ----------------------------- */

.menu-detail a {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.menu-detail a:hover,
.menu-detail a:focus-visible {
    background: rgba(255, 255, 255, 0.04);
}

.menu-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-gray);
    font-size: 15px;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.menu-detail a:hover .menu-icon,
.menu-detail a:focus-visible .menu-icon,
.menu-detail a[aria-current="page"] .menu-icon {
    border-color: rgba(150, 191, 72, 0.45);
    background: rgba(150, 191, 72, 0.1);
    color: var(--color-primary);
}

.menu-text {
    min-width: 0;
}

.menu-detail .menu-label {
    display: block;
    color: var(--color-heading);
    font-family: var(--font-secondary);
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    transition: color 0.2s ease;
}

.menu-detail a:hover .menu-label,
.menu-detail a:focus-visible .menu-label {
    color: var(--color-primary);
}

.menu-desc {
    display: block;
    margin-top: 2px;
    color: var(--color-gray);
    font-family: var(--font-secondary);
    font-size: 12.5px;
    line-height: 18px;
}

/* Free tools: the two conversion assets, lifted out of the run of services. */
.menu-group--detail.is-accent .menu-icon {
    border-color: rgba(150, 191, 72, 0.3);
    color: var(--color-primary);
}

.menu-group--detail.is-accent a {
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.menu-group--detail.is-accent li + li {
    margin-top: 10px;
}

.menu-group--detail.is-accent a:hover,
.menu-group--detail.is-accent a:focus-visible {
    border-color: rgba(150, 191, 72, 0.4);
}


/* --- compact: policies -------------------------------------------------- */

.menu-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.menu-compact a {
    color: var(--color-gray);
    font-family: var(--font-secondary);
    font-size: 13px;
    line-height: 24px;
    transition: color 0.2s ease;
}

.menu-compact a:hover,
.menu-compact a:focus-visible {
    color: var(--color-primary);
}


/* --- current page ------------------------------------------------------- */
/* Marked by a rule and a fill as well as colour, so it never depends on colour
   alone to be distinguishable. */

.site-menu a[aria-current="page"] {
    color: var(--color-primary);
}

.menu-primary a[aria-current="page"],
.menu-detail a[aria-current="page"] {
    background: rgba(150, 191, 72, 0.08);
}

.menu-detail a[aria-current="page"] .menu-label {
    color: var(--color-primary);
}


/* --- conversion foot ---------------------------------------------------- */

.menu-foot {
    position: sticky;
    bottom: 0;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    /* Matches the panel background so menu rows scrolling underneath are
       occluded cleanly rather than showing through. */
    background: var(--color-gray-2);
}

.menu-foot-links {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.menu-foot-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--color-heading);
    font-family: var(--font-secondary);
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.menu-foot-link:hover,
.menu-foot-link:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-heading);
}

.menu-foot-link i {
    width: 18px;
    flex-shrink: 0;
    color: var(--color-primary);
    font-size: 15px;
    text-align: center;
}

.menu-foot-link em {
    display: block;
    color: var(--color-gray);
    font-size: 12px;
    font-style: normal;
    line-height: 17px;
}

.menu-social {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 16px 2px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--color-heading);
    font-size: 13px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.menu-social a:hover,
.menu-social a:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.menu-social svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.menu-location {
    margin-left: auto;
    color: var(--color-gray);
    font-family: var(--font-secondary);
    font-size: 12px;
}


/* --- panel plumbing ----------------------------------------------------- */
/* The sticky foot needs the panel to be the scroll container and the content
   wrapper to be a full-height column. */

.tmp-sidebar-area .inner .content-wrapper {
    display: flex;
    flex-direction: column;
    /* 71px is the .top-area logo bar above it. */
    min-height: calc(100% - 71px);
    padding: 26px 24px 0;
}

.tmp-sidebar-area .inner .content-wrapper .site-menu {
    flex: 1;
}

.tmp-popup-mobile-menu .site-menu {
    margin-top: 26px;
}

/* Narrow phones: the icon tiles and descriptors are the first thing to give,
   since the label alone still identifies the page. */
@media (max-width: 380px) {
    .menu-detail .menu-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .menu-desc {
        display: none;
    }

    .menu-primary a {
        font-size: 17px;
    }
}


/*
 * Footer: four equal columns on desktop, accordions below lg.
 *
 * Lives here rather than in custom.css because it is the same navigation
 * problem — the footer link groups mirror the slide-out menu's groups.
 */

.footer-grid > [class*="col-"] {
    min-width: 0;
}

/* Desktop: the toggle must look and behave like the plain heading it replaced.
   A <button> brings its own centred text, border, background and font stack,
   so all four are reset explicitly — an unreset button in here reads as a form
   control sitting in the footer. It carries tabindex="-1" from footer.js at
   this width, so it is inert as well as looking inert. */
.ft-title-toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: left;
    text-transform: none;
    cursor: default;
    appearance: none;
    -webkit-appearance: none;
}

/* The heading's accent bar is on the h2, so the button must not add spacing
   between the text and it. */
.footer-style-two .ft-title > .ft-title-toggle {
    padding-bottom: 0;
}

.ft-title-icon {
    display: none;
}

@media (max-width: 991.98px) {
    /* One group per row, so a tap target spans the width. */
    .footer-grid > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* g-5 leaves a 48px gutter, which is far too much between collapsed
       accordion headers. */
    .footer-grid.row.g-5 {
        --bs-gutter-y: 0;
    }

    .footer-accordion.is-collapsible {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .footer-accordion.is-collapsible .ft-title {
        margin: 0;
    }

    .footer-accordion.is-collapsible .ft-title-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        /* 18px + line-height clears the 44px minimum target height. */
        padding: 18px 2px;
        cursor: pointer;
    }

    .footer-accordion.is-collapsible .ft-title-icon {
        display: block;
        flex-shrink: 0;
        color: var(--color-primary);
        font-size: 13px;
        transition: transform 0.28s ease;
    }

    /* The plus becomes a minus by rotating one stroke onto the other. */
    .footer-accordion.is-collapsible.is-open .ft-title-icon {
        transform: rotate(135deg);
    }

    .footer-accordion.is-collapsible .ft-panel {
        overflow: hidden;
        height: 0;
        transition: height 0.28s ease;
    }

    .footer-accordion.is-collapsible .ft-panel .ft-link {
        padding-bottom: 14px;
    }

    /* The brand column keeps its own spacing and never collapses. */
    .footer-grid .single-footer-wrapper.border-right {
        margin-right: 0 !important;
        padding-bottom: 8px;
        border-right: 0 !important;
    }
}

/* No JS: panels must not be stuck shut. .is-collapsible is only ever added by
   footer.js, so the collapsed height above never applies without it — this is
   belt and braces for the icon, which is CSS-only. */
.footer-accordion:not(.is-collapsible) .ft-panel {
    height: auto !important;
}
