/* Dropdown menus in the main navigation (Websites, Client services). Loaded after site.css, premium.css and showcase.css. */
.nav-menu > li { position: relative; }
.sub-toggle { display: none; }
.has-sub > .nav-link::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; }
.has-sub::after { content: ""; position: absolute; left: -8px; right: -8px; top: 100%; height: 16px; } /* keeps the menu open while the pointer crosses the gap */
.sub-menu { list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 10px); left: -14px; min-width: 200px; background: rgba(30, 33, 36, .98); border: 1px solid var(--mid-border, #5B6066); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease, visibility 0s .18s; z-index: 130; }
.has-sub:hover > .sub-menu, .has-sub:focus-within > .sub-menu, .has-sub.open > .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.sub-menu a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--muted-on-mid, #CDD1D5); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.sub-menu a:hover, .sub-menu a:focus-visible, .sub-menu a[aria-current="page"] { background: rgba(141, 187, 234, .14); color: var(--text, #F4F5F6); }

/* The scroll-compact header hides anything that overhangs its menu: let the dropdown out once the menu is open */
@media (min-width: 861px) {
    header.compact:hover .nav-menu, header.compact:focus-within .nav-menu, header.compact.peek .nav-menu {
        overflow: visible; transition: max-width .5s var(--ease), opacity .25s, padding .4s var(--ease), overflow 0s .55s allow-discrete; }
}

/* Phone menu: the submenu opens under its heading with the small arrow button */
@media (max-width: 860px) {
    .has-sub { display: grid; grid-template-columns: 1fr 44px; align-items: center; }
    .has-sub::after { display: none; }
    .has-sub > .nav-link::after { display: none; }
    .sub-toggle { display: block; position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--text, #F4F5F6); cursor: pointer; }
    .sub-toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -6px 0 0 -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
    .has-sub.open > .sub-toggle::before { transform: rotate(-135deg); margin-top: -2px; }
    .sub-menu, .has-sub:hover > .sub-menu, .has-sub:focus-within > .sub-menu { position: static; grid-column: 1 / -1; display: none; opacity: 1; visibility: visible; transform: none; min-width: 0; padding: 0 0 6px 14px; background: transparent; border: 0; box-shadow: none; }
    .has-sub.open > .sub-menu { display: block; }
    .sub-menu a { padding: 10px 0; font-size: 15px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .sub-menu, .sub-toggle::before { transition: none; } }

/* Phones (iOS Safari): the page shows through the translucent browser bar above the fixed header, leaving a strip of content
   over the menu. Paint that strip in the header colour (a shadow copy shifted up never covers the header itself). */
@media (max-width: 860px) {
    header { box-shadow: 0 1px 0 rgba(255, 255, 255, .07), 0 -140px 0 0 rgb(40, 43, 47); }
}

/* Website package blocks: the whole block is the link */
a.pkg-card { display: block; color: inherit; text-decoration: none; }
a.pkg-card h2, a.pkg-card p { color: inherit; }
a.pkg-card .pkg-more { display: inline-block; margin-top: 6px; color: var(--accent, #8DBBEA); font-weight: 700; transition: transform .2s; }
a.pkg-card:hover .pkg-more, a.pkg-card:focus-visible .pkg-more { transform: translateX(4px); }
a.pkg-card:focus-visible { outline: 2px solid var(--accent, #8DBBEA); outline-offset: 3px; }

/* Seven menu items plus the button need a little less room between 861px and 1000px, just above the phone menu */
@media (min-width: 861px) and (max-width: 1000px) {
    .nav-menu { gap: 12px; }
    .nav-link { font-size: 13px; }
    .has-sub > .nav-link::after { margin-left: 5px; }
    .nav-cta { padding: 8px 11px; font-size: 13px; }
}
@media (min-width: 861px) and (max-width: 890px) {
    .nav { gap: 12px; }
    .nav-menu { gap: 8px; }
    .nav-cta { padding: 8px 9px; }
}

/* 1001px to 1100px: eight items still need a little less room than the full desktop spacing */
@media (min-width: 1001px) and (max-width: 1100px) {
    .nav-menu { gap: 18px; }
    .nav-link { font-size: 14px; }
    .nav-cta { padding: 10px 14px; }
}
/* never let the menu labels wrap onto two lines */
@media (min-width: 861px) {
    .nav-menu > li { flex-shrink: 0; }
    .nav-link, .nav-cta { white-space: nowrap; }
}
