.nav-pages-menu {
    position: relative;
    align-self: center;
}

.nav-pages-menu summary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.nav-pages-menu summary::-webkit-details-marker {
    display: none;
}

.nav-pages-menu summary::after {
    width: 7px;
    height: 7px;
    margin-top: -4px;
    transform: rotate(45deg);
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transition: transform 160ms ease;
}

.nav-pages-menu[open] summary::after {
    margin-top: 4px;
    transform: rotate(225deg);
}

.nav-pages-menu summary:hover,
.nav-pages-menu summary[aria-current="page"] {
    color: var(--brand-primary);
}

.nav-pages-menu summary[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.3em;
}

.nav-pages-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    z-index: 1002;
    width: min(440px, calc(100vw - 32px));
    max-height: min(72vh, 640px);
    overflow-y: auto;
    padding: 20px;
    transform: translateX(-50%);
    border: 1px solid var(--color-border-soft);
    border-radius: 14px;
    background: var(--color-white);
    box-shadow: var(--shadow-popover);
    white-space: normal;
}

.nav-pages-menu-services .nav-pages-panel {
    width: min(620px, calc(100vw - 32px));
}

.nav-pages-menu-insights .nav-pages-panel {
    width: min(540px, calc(100vw - 32px));
}

.nav-pages-heading {
    margin-bottom: 14px;
    padding: 0 2px 12px;
    border-bottom: 1px solid var(--color-border-soft);
}

.nav-pages-heading h2 {
    margin: 0 0 4px;
    color: var(--brand-deep);
    font-size: 1.1rem;
    line-height: 1.35;
}

.nav-pages-heading p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

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

.nav-pages-list a {
    display: block;
    height: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--color-body);
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.nav-pages-list a:hover,
.nav-pages-list a:focus-visible,
.nav-pages-list a[aria-current="page"] {
    border-color: var(--color-border-soft);
    background: var(--brand-soft);
    color: var(--brand-hover);
    text-decoration: none;
}

.nav-pages-list a > span:first-child {
    display: block;
    margin-bottom: 3px;
    color: var(--brand-deep);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.4;
}

.nav-page-description {
    display: block;
    color: var(--color-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.nav-pages-list a[aria-current="page"] > span:first-child {
    color: var(--brand-hover);
}

.nav-contact-cta {
    white-space: nowrap;
}

.footer .footer-content {
    grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(150px, 1fr));
    align-items: start;
}

.footer .footer-section h2 {
    margin-bottom: 14px;
}

.footer .footer-section ul {
    display: grid;
    gap: 8px;
}

.footer .footer-section li {
    line-height: 1.5;
}

.footer .footer-section a {
    text-underline-offset: 0.18em;
}

@media (max-width: 1180px) {
    .nav-menu {
        align-items: stretch;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-pages-menu {
        align-self: stretch;
    }

    .nav-pages-menu summary {
        display: flex;
        justify-content: space-between;
        padding: 0 8px;
    }

    .nav-pages-panel,
    .nav-pages-menu-services .nav-pages-panel,
    .nav-pages-menu-insights .nav-pages-panel {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        padding: 14px 8px 8px;
        transform: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .nav-pages-list {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .nav-pages-list a {
        padding: 10px;
    }

    .nav-contact-cta {
        align-self: stretch;
    }

    .footer .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .nav-pages-panel,
    .nav-pages-menu-services .nav-pages-panel,
    .nav-pages-menu-insights .nav-pages-panel {
        padding-right: 0;
        padding-left: 0;
    }

    .footer .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-pages-menu summary::after,
    .nav-pages-list a {
        transition: none;
    }
}
