/* Light navigation controls and their counterparts on the midnight surfaces. */
:is(.site-header, .cp-header, .blog-header, .home-index-footer) {
  --nav-button-bg: #f3f6f8;
  --nav-button-border: #798c9e;
  --nav-button-text: #17364c;
  --nav-button-hover: #e1ebf1;
  --nav-button-focus: #1b6688;
}
:is(.ci-phone-strip, .credass-product-nav, .cp-footer, .blog-footer,
    .credass-identity-footer) {
  --nav-button-bg: #1c354e;
  --nav-button-border: #71899d;
  --nav-button-text: #f3f6fa;
  --nav-button-hover: #2b4c67;
  --nav-button-focus: #f0ca81;
}

/* Leave visibility to the existing responsive menus. */
:is(#main-nav, #cp-navigation, #blog-nav) {
  gap: .35rem;
  min-width: 0;
}
:is(#main-nav, #cp-navigation, #blog-nav) > a,
:is(#cp-navigation, #blog-nav) .credass-education-menu > summary,
:is(#cp-navigation, #blog-nav) .credass-education-links > a,
.ci-phone-strip .ci-phone-list a,
header .credass-product-nav a,
footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
  :is(.credass-footer-entries, .credass-footer-navigation, .home-footer-links,
      .credass-footer-shortcuts, .home-footer-legal, .blog-footer-bottom,
      .credass-identity-legal-links, .credass-public-profiles, .credass-institutional-heading) a {
  box-sizing: border-box;
  border: 1px solid var(--nav-button-border);
  border-radius: .5rem;
  background-color: var(--nav-button-bg);
  color: var(--nav-button-text);
  min-height: 2.75rem;
  max-width: 100%;
  padding: .52rem .72rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

:is(#main-nav, #cp-navigation, #blog-nav) > a,
:is(#cp-navigation, #blog-nav) .credass-education-menu > summary {
  align-content: center;
  padding-inline: clamp(.45rem, .65vw, .75rem);
  font-size: .875rem;
}
:is(#cp-navigation, #blog-nav) .credass-education-links > a + a { margin-top: .3rem; }
:is(#main-nav, #cp-navigation, #blog-nav) > a[aria-current="page"],
header .credass-product-nav a[aria-current="page"] {
  background: #f5e6c9;
  border-color: #b99862;
  color: #17364c;
}
#blog-nav > a[aria-current="page"]::after { content: none; }

header .credass-product-nav > div {
  box-sizing: border-box;
  gap: .35rem;
  padding: .3rem .65rem;
}
header .credass-product-nav a { padding-inline: .35rem; }
.ci-phone-strip .ci-phone-list {
  gap: .35rem;
  padding-block: .3rem;
}
.ci-phone-strip .ci-phone-list a { padding-block: .25rem; }
.ci-phone-strip .ci-phone-list a strong,
.ci-phone-strip .ci-phone-list .ci-practice-shortcut { text-decoration: none; }

@media (max-width: 760px) {
  :is(#main-nav.is-open, #cp-navigation.is-open, #blog-nav.open),
  .cm-home .site-header #main-nav.is-open {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    align-items: stretch;
    gap: .4rem;
    padding: .7rem max(1rem, env(safe-area-inset-right)) .85rem max(1rem, env(safe-area-inset-left));
  }
  :is(#main-nav.is-open, #cp-navigation.is-open, #blog-nav.open) > a,
  .cm-home #main-nav.is-open > a {
    min-width: 0;
    padding: .6rem .7rem;
    border: 1px solid var(--nav-button-border);
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: .9375rem;
  }
  :is(#cp-navigation.is-open, #blog-nav.open) .credass-education-menu { grid-column: 1 / -1; }
  :is(#cp-navigation.is-open, #blog-nav.open) .credass-education-links {
    margin-block: .35rem;
    border-radius: .5rem;
  }
}

footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
  :is(.credass-footer-navigation > div, .credass-footer-entries, .home-footer-links) {
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: .35rem;
}
footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
  :is(.credass-footer-navigation, .home-footer-links, .credass-footer-google,
      .credass-footer-shortcuts, .home-footer-legal, .blog-footer-bottom,
      .credass-identity-legal-links, .credass-institutional-heading) a {
  display: inline-flex;
  width: auto;
  align-items: center;
  overflow-wrap: anywhere;
  font-size: .875rem;
}
footer :is(.credass-footer-entries, .credass-footer-navigation) a { min-width: 0; }
footer .credass-footer-entries > a { display: grid; align-content: center; }
footer .credass-footer-entries strong { overflow-wrap: anywhere; }
footer :is(.credass-footer-shortcuts, .credass-public-profiles, .credass-footer-google,
           .credass-identity-legal-links, .blog-footer-bottom > div),
.cm-home .home-index-footer .home-footer-legal { gap: .4rem; }
footer .credass-footer-google { margin-top: .3rem; }
footer .credass-public-profiles img { width: 1.2rem; height: 1.2rem; padding: .15rem; }
footer .credass-public-profiles a:hover span { text-decoration: none; }

.cm-home .home-index-footer .home-resource-fold > summary,
.cm-home .home-index-footer [data-home-secondary] > summary {
  box-sizing: border-box;
  margin-block: .45rem;
  padding-inline: .75rem;
  border: 1px solid var(--nav-button-border);
  border-radius: .5rem;
  background: var(--nav-button-bg);
}

@media (max-width: 760px) {
  /* The floating WhatsApp control is the single mobile chat entry. */
  body:has(.ci-menu-access):has(#credass-whatsapp) .ci-phone-strip .ci-phone-list > a[href^="tel:"] {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .2rem .5rem;
  }
  .cm-home .home-index-footer .home-resource-fold { border-top: 0; }
}

@media (hover: hover) {
  :is(#main-nav, #cp-navigation, #blog-nav) :is(a, summary):hover,
  header .credass-product-nav a:hover,
  .ci-phone-strip .ci-phone-list a:hover,
  footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
    :is(.credass-footer-entries, .credass-footer-navigation, .home-footer-links,
        .credass-footer-shortcuts, .home-footer-legal, .blog-footer-bottom,
        .credass-identity-legal-links, .credass-public-profiles, .credass-institutional-heading) a:hover,
  .cm-home .home-index-footer summary:hover {
    border-color: var(--nav-button-focus);
    color: var(--nav-button-text);
    background-color: var(--nav-button-hover);
    text-decoration: none;
  }
}
:is(.site-header, .cp-header, .blog-header, .home-index-footer, .cp-footer, .blog-footer,
    .ci-phone-strip, .credass-identity-footer)
  :is(a, summary, button):focus-visible {
  outline: 3px solid var(--nav-button-focus);
  outline-offset: 2px;
}

@media (min-width: 761px) {
  :is(#main-nav, #cp-navigation, #blog-nav) { flex-wrap: wrap; }
}
