/* Shared alignment and navigation for the public desktop layouts. */
@media screen and (min-width: 768px) {
  .ci-phone-strip > .ci-phone-inner,
  .cm-home .site-header > .nav-wrap,
  .cp-header > .cp-nav,
  .blog-header > .blog-navigation,
  header .credass-product-nav > div,
  footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer) > :is(.wrap, .cp-wrap, .blog-wrap, .credass-identity-wrap) {
    box-sizing: border-box;
    width: var(--cd-width);
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
  }

  .ci-phone-strip {
    background: #f0f3f4;
    color: #344c5c;
    --nav-button-focus: #856321;
  }
  .ci-phone-strip .ci-phone-brand { color: inherit; font-size: .875rem; }
  .ci-phone-strip .ci-phone-list { gap: clamp(.8rem, 2.5vw, 2rem); padding: 0; }
  .ci-phone-strip .ci-phone-list a {
    min-height: 2.25rem;
    padding: .25rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #203d50;
    font-size: .875rem;
  }
  .ci-phone-strip .ci-phone-list a[href^="tel:"] { flex-flow: row wrap; align-items: center; gap: .4rem; }
  .ci-phone-strip .ci-phone-list small { color: #496072; font-size: .8125rem; }
  .ci-phone-strip .ci-phone-list strong { font-size: .875rem; font-weight: 650; }

  .cm-home .site-header, .cp-header, .blog-header {
    --nav-button-focus: #886320;
    background: #fff;
    border: 0;
    box-shadow: none;
  }
  .cm-home .site-header > .nav-wrap, .cp-header > .cp-nav, .blog-header > .blog-navigation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 clamp(.8rem, 1.6vw, 1.8rem);
    min-height: 4.5rem;
    padding-block: .35rem;
  }
  :is(.site-header, .cp-header, .blog-header) :is(.brand, .cp-brand, .blog-brand) {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin: 0;
  }
  .cm-home .site-header .brand img, .cp-header .cp-brand img, .blog-header .blog-brand img {
    display: block;
    width: clamp(8rem, 11vw, 10rem);
    height: auto;
  }
  :is(.site-header, .cp-header, .blog-header) :is(.menu-toggle, .cp-menu, .blog-menu) { display: none; }

  /* Keep the primary links in source order and the existing Guide disclosure intact. */
  :is(.site-header, .cp-header, .blog-header) :is(#main-nav, #cp-navigation, #blog-nav) {
    position: static;
    display: flex;
    grid-column: 2;
    grid-row: 1;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 0 clamp(.6rem, 1.05vw, 1rem);
    width: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  :is(.site-header, .cp-header, .blog-header) :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 {
    min-height: 2.75rem;
    padding: .55rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #19364c;
    font: 600 .9375rem/1.35 var(--ci-sans, system-ui, sans-serif);
    text-decoration: none;
  }
  :is(#cp-navigation, #blog-nav) .credass-education-menu .credass-education-links {
    position: absolute;
    inset: 100% auto auto 0;
    min-width: 16rem;
    margin: 0;
    padding: .45rem 1rem;
    border: 1px solid #cdd7df;
    border-radius: .3rem;
    background: #fff;
    box-shadow: 0 .5rem 1.5rem rgb(11 41 58 / 12%);
  }
  :is(#cp-navigation, #blog-nav) .credass-education-links > a + a { margin: 0; }
  :is(.site-header, .cp-header, .blog-header) :is(.header-contact, .cp-header-callback, .blog-header-callback) {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: .6rem 1rem;
    margin: 0;
    border: 0;
    border-radius: .35rem;
    background: #13384c;
    color: #fff;
    font: 650 .9375rem/1.35 var(--ci-sans, system-ui, sans-serif);
    text-decoration: none;
    white-space: nowrap;
  }
  .cm-home .site-header .credass-product-nav, .cp-header .credass-product-nav, .blog-header .credass-product-nav {
    background: #102b42;
    border: 0;
  }
  header .credass-product-nav > div {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: .65rem;
    padding-block: 0;
  }
  header .credass-product-nav a {
    min-height: 2.75rem;
    padding: .45rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: 550 .9375rem/1.3 var(--ci-sans, system-ui, sans-serif);
    text-decoration: none;
  }
  header .credass-product-nav a[aria-current="page"],
  :is(.site-header, .cp-header, .blog-header) :is(#main-nav, #cp-navigation, #blog-nav) > a[aria-current="page"] {
    background: transparent;
    text-decoration: underline;
    text-decoration-color: #b29560;
    text-decoration-thickness: 2px;
    text-underline-offset: .3em;
  }
  header .credass-product-nav a[aria-current="page"] { color: #fff; }

  footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer) {
    --footer-column-gap: clamp(1.5rem, 4vw, 4rem);
    padding-block: clamp(2rem, 4vw, 3.5rem) 2rem;
  }
  footer :is(.credass-footer-directory, .credass-footer-navigation),
  .cm-home .home-index-footer .home-footer-directory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--footer-column-gap);
    border-top: 1px solid var(--footer-rule);
  }
  footer .credass-footer-directory > *,
  footer .credass-footer-navigation > div {
    padding: 1.35rem 0 1.5rem;
    border: 0;
  }
  footer .credass-footer-intro, .cm-home .home-index-footer .home-footer-brand {
    padding-bottom: 1.4rem;
    border: 0;
  }
  .cm-home .home-index-footer :is(.home-resource-fold, [data-home-secondary]) > summary {
    min-height: 2.75rem;
    margin: 0 0 .35rem;
    padding: .5rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #183c56;
  }
  footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
    :is(.credass-footer-directory, .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 {
    min-height: 2.1rem;
    margin: 0;
    padding: .25rem 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--nav-button-text);
    text-decoration: none;
    font-size: .9375rem;
  }
  footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
    :is(.credass-footer-navigation > div, .credass-footer-entries, .home-footer-links) {
    gap: 0;
    justify-items: start;
  }
  footer .credass-footer-directory .credass-footer-entries {
    row-gap: .5rem;
  }
  footer .credass-footer-directory .credass-footer-entries a { justify-items: start; text-align: left; }
  footer .credass-footer-directory .credass-footer-entries a strong {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
    text-underline-offset: .2em;
  }
  footer :is(.credass-public-profiles, .credass-footer-shortcuts, .credass-identity-legal-links, .blog-footer-bottom > div),
  .cm-home .home-index-footer .home-footer-legal { gap: .15rem 1.15rem; }
  footer .credass-institutional-links ul {
    background: #fff;
    gap: .25rem .8rem;
    padding: 1rem;
  }
  footer .credass-institutional-links li > a {
    gap: .35rem;
    padding: .65rem .35rem;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  footer .credass-institutional-links li > a:focus-visible { outline-offset: 0; }
  :is(.cm-home .site-header, .cp-header, .blog-header) :is(a, summary):focus-visible {
    outline: 3px solid var(--nav-button-focus);
    outline-offset: 2px;
  }
  header .credass-product-nav a:focus-visible { outline-color: #f0ca81; outline-offset: -2px; }

  .credass-recovered-page #root nav[aria-label="Navigazione principale"] a[href]:not([hidden]),
  .credass-recovered-page #root header[data-loc*="/MainNav.tsx:"] > div:first-child a[href]:not([hidden]),
  body:has(#document-intake) :is(header nav > a:not(:has(img)), footer a) {
    padding-inline: .35rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .credass-recovered-page #root header[data-loc*="/MainNav.tsx:"] > div { padding-inline: 0; }
  .credass-recovered-page #root header[data-loc*="/MainNav.tsx:"] > div > .mx-auto {
    width: var(--cd-width);
    max-width: none;
    padding-inline: 0;
  }
  body:has(#document-intake) :is(header > nav, footer) { width: var(--cd-width); }
}

@media screen and (min-width: 768px) and (max-width: 80rem) {
  .cm-home .site-header > .nav-wrap, .cp-header > .cp-nav, .blog-header > .blog-navigation {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: .35rem 0;
  }
  :is(.site-header, .cp-header, .blog-header) :is(.header-contact, .cp-header-callback, .blog-header-callback) { grid-column: 2; }
  :is(.site-header, .cp-header, .blog-header) :is(#main-nav, #cp-navigation, #blog-nav) {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }
}

/* At tablet widths split the eight home links evenly across two rows. */
@media screen and (min-width: 768px) and (max-width: 56rem) {
  .cm-home .site-header #main-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: start;
    column-gap: 1rem;
  }
}

@media screen and (min-width: 768px) and (hover: hover) {
  .ci-phone-strip .ci-phone-list a:hover,
  :is(.site-header, .cp-header, .blog-header) :is(#main-nav, #cp-navigation, #blog-nav) :is(a, summary):hover,
  header .credass-product-nav a:hover,
  footer:is(.home-index-footer, .cp-footer, .blog-footer, .credass-identity-footer)
    :is(.credass-footer-directory, .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,
  .credass-recovered-page #root nav[aria-label="Navigazione principale"] a[href]:not([hidden]):hover {
    background: transparent;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: .25em;
  }
  header .credass-product-nav a:hover { color: #fff; }
  :is(.site-header, .cp-header, .blog-header) :is(.header-contact, .cp-header-callback, .blog-header-callback):hover {
    background: #25516a;
    color: #fff;
  }
}
