/* Grouped site navigation, footer columns and related cards (inc/site-nav.php). Loaded only
   where the new navigation renders; the old header and footer keep style.css alone. */

/* Header: group buttons look like the plain links beside them */
.fme-site-header--nav .fme-site-header__inner {
    position: relative;
}

.fme-site-header--nav .fme-site-header__menu {
    align-items: center;
}

.fme-site-header--nav .fme-nav-group {
    position: static;
}

.fme-nav-group__toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--fme-color-ink);
    display: inline-flex;
    font-size: var(--fme-font-size-ui);
    font-weight: var(--fme-font-weight-regular);
    gap: 6px;
    letter-spacing: -0.31px;
    line-height: var(--fme-line-height-ui);
    min-height: 48px;
    padding: 0;
}

.fme-nav-group__toggle::after {
    border-bottom: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    content: "";
    height: 7px;
    margin-top: -4px;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    width: 7px;
}

.fme-nav-group__toggle[aria-expanded="true"]::after {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.fme-nav-group__toggle:hover,
.fme-nav-group__toggle:focus,
.fme-nav-group__toggle:active,
.fme-nav-group__toggle.show,
.fme-nav-group__toggle[aria-expanded="true"] {
    /* A reset stylesheet paints every hovered or focused button pink; these are text links. */
    background: transparent !important;
    border: 0;
    box-shadow: none;
    color: var(--fme-color-primary-dark);
}

.fme-nav-group__toggle.fme-site-header__menu-link--active {
    color: var(--fme-color-primary);
    font-weight: var(--fme-font-weight-bold);
}

.fme-nav-group__toggle:focus-visible {
    outline: 2px solid var(--fme-color-primary);
    outline-offset: 4px;
}

/* The wide panel under the header */
.fme-site-header--nav .fme-nav-panel {
    background: var(--fme-color-white);
    border: 1px solid var(--fme-color-border);
    border-radius: var(--fme-radius-lg);
    box-shadow: var(--fme-shadow-md);
    left: 50%;
    margin-top: -4px;
    max-width: calc(100vw - 32px);
    padding: 16px;
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
    width: 880px;
}

.fme-nav-panel__grid {
    display: grid;
    gap: 4px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

body .fme-site-header--nav .fme-nav-panel__link,
.fme-nav-panel__link {
    border-radius: var(--fme-radius-sm);
    color: var(--fme-color-ink);
    display: block;
    min-height: 0;
    padding: 10px 12px;
    text-decoration: none;
}

.fme-nav-panel__link strong {
    display: block;
    font-size: var(--fme-font-size-ui);
    font-weight: var(--fme-font-weight-semibold);
    line-height: 22px;
}

.fme-nav-panel__link span {
    color: var(--fme-color-ink-muted);
    display: block;
    font-size: var(--fme-font-size-caption);
    line-height: 20px;
    margin-top: 2px;
}

body .fme-site-header--nav .fme-nav-panel__link:hover,
body .fme-site-header--nav .fme-nav-panel__link:focus,
.fme-nav-panel__link--active {
    background: var(--fme-color-primary-soft);
    color: var(--fme-color-ink);
}

.fme-nav-panel__link:hover strong,
.fme-nav-panel__link:focus strong {
    color: var(--fme-color-primary-dark);
}

@media (min-width: 992px) and (max-width: 1100px) {
    .fme-site-header--nav .fme-site-header__menu {
        gap: 16px;
    }

    .fme-site-header--nav .fme-site-header__cta {
        min-width: 0;
        padding: 12px 18px;
    }
}

/* Phone menu: groups as an accordion */
/* The whole drawer scrolls, so Blog and Login are never hidden under the trial button */
.fme-mobile-menu {
    overflow-y: auto;
}

.fme-mobile-menu .fme-mobile-menu__footer {
    flex: 0 0 auto;
}

.fme-mobile-menu__link--chevron::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 8px;
    margin-right: 6px;
    transform: rotate(-135deg);
    transition: transform 0.15s ease;
    width: 8px;
}

.fme-mobile-menu__link--chevron.collapsed::after {
    transform: rotate(45deg);
}

.fme-mobile-menu__link--chevron:not(.collapsed),
.fme-mobile-menu__group .collapse,
.fme-mobile-menu__group .collapsing {
    background: var(--fme-color-primary-dark);
}

.fme-mobile-menu__group .fme-mobile-menu__submenu {
    gap: 14px;
    padding: 6px 20px 18px 32px;
}

body.fme-hardcoded-template .fme-mobile-menu .fme-mobile-menu__submenu a,
.fme-mobile-menu__group .fme-mobile-menu__submenu a {
    color: var(--fme-color-white);
    font-size: 15px;
    line-height: 20px;
}

.fme-mobile-menu__submenu a small {
    color: rgba(255, 255, 255, 0.92);
    display: block;
    font-size: 14px;
    line-height: 19px;
    margin-top: 2px;
}

.fme-mobile-menu__submenu a[aria-current] {
    font-weight: var(--fme-font-weight-semibold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fme-mobile-menu .fme-mobile-menu__footer {
    padding-top: 28px;
}

/* Footer: four columns beside the brand (style.css places the brand), each column opening on
   tap on a phone; a platform row and the legal links above the copyright */
.fme-site-footer__nav--groups {
    gap: 8px 24px;
    grid-template-columns: 1fr;
    text-align: left;
}

.fme-site-footer__fold {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: flex;
    font: inherit;
    justify-content: space-between;
    min-height: 44px;
    padding: 0;
    width: 100%;
}

.fme-site-footer__fold:hover,
.fme-site-footer__fold:focus,
.fme-site-footer__fold:active {
    background: transparent !important;
    box-shadow: none;
    color: inherit;
}

.fme-site-footer__fold::after {
    border-bottom: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    content: "";
    height: 7px;
    margin-right: 4px;
    transform: rotate(-135deg);
    width: 7px;
}

.fme-site-footer__fold.collapsed::after {
    transform: rotate(45deg);
}

.fme-site-footer__nav--groups .fme-site-footer__nav-group h2 {
    margin: 0;
}

.fme-site-footer__nav--groups .fme-site-footer__heading {
    display: none;
}

.fme-site-footer__nav--groups .fme-site-footer__nav-group ul {
    padding-bottom: 12px;
}

.fme-site-footer__platforms,
.fme-site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fme-site-footer__platforms a,
.fme-site-footer__legal a {
    align-items: center;
    color: rgba(255, 255, 255, 0.72);
    display: inline-flex;
    font-size: 14px;
    gap: 8px;
    text-decoration: none;
}

.fme-site-footer__platforms a:hover,
.fme-site-footer__legal a:hover {
    color: var(--fme-color-white);
}

.fme-site-footer__platforms svg {
    fill: currentColor;
    height: 18px;
    width: 18px;
}

.fme-site-footer__legal {
    margin-bottom: -16px;
}

@media (min-width: 768px) {
    .fme-site-footer__nav--groups {
        gap: 32px;
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
    }

    /* Columns always open under a plain heading; the tap button is for phones only */
    .fme-site-footer__nav--groups .collapse:not(.show) {
        display: block;
    }

    .fme-site-footer__nav--groups .fme-site-footer__fold-heading {
        display: none;
    }

    .fme-site-footer__nav--groups .fme-site-footer__heading {
        display: block;
        margin-bottom: 18px;
    }

    .fme-site-footer__nav--groups .fme-site-footer__nav-group ul {
        padding-bottom: 0;
    }
}

/* Related cards at the foot of the landing pages */
.fme-related__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
}

.fme-related__card {
    background: var(--fme-color-white);
    border: 1px solid var(--fme-color-border);
    border-radius: var(--fme-radius-lg);
    color: var(--fme-color-ink);
    display: block;
    height: 100%;
    padding: 20px;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fme-related__card:hover,
.fme-related__card:focus {
    border-color: var(--fme-color-primary);
    box-shadow: var(--fme-shadow-sm);
    color: var(--fme-color-ink);
}

.fme-related__card strong {
    display: block;
    font-size: 18px;
    font-weight: var(--fme-font-weight-semibold);
    line-height: 26px;
}

.fme-related__card:hover strong {
    color: var(--fme-color-primary-dark);
}

.fme-related__card span {
    color: var(--fme-color-ink-muted);
    display: block;
    font-size: var(--fme-font-size-ui);
    line-height: 24px;
    margin-top: 6px;
}

.fme-related .fme-landing-section__title {
    text-align: center;
}

/* Bootstrap's .dropdown-item (for arrow-key navigation) must not change the panel links' look */
.fme-nav-panel .dropdown-item {
    white-space: normal;
}

.fme-nav-panel .dropdown-item:active {
    background: var(--fme-color-primary-soft);
    color: var(--fme-color-ink);
}

/* Menu links that jump to a section (/features/#enforced-mode) land below the sticky header */
section[id] {
    scroll-margin-top: 96px;
}

/* 992 to 1199 px: the brand sits above the four columns, so their links do not wrap */
@media (min-width: 992px) and (max-width: 1199px) {
    .fme-site-footer__top:has(.fme-site-footer__nav--groups) {
        grid-template-columns: 1fr;
    }
}
