/* The header menus, shared by every page. The markup comes from navHtml() in
   assets/nav.js, which also opens and closes them (wireNav). */

@media (min-width: 981px) {
  .cc-navi {
    position: relative;
    display: flex;
  }
  .cc-navb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #103f31;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
  }
  .cc-navb:hover,
  .cc-navi[data-open] > .cc-navb {
    background: #eceee5;
    color: #0b3c2e;
  }
  a.cc-navb[aria-current="page"],
  .cc-navi:has(a[aria-current="page"]) > .cc-navb {
    background: #e3eadb;
    color: #0b3c2e;
    font-weight: 600;
  }
  .cc-chev {
    transition: transform 0.2s;
  }
  .cc-navi[data-open] .cc-chev {
    transform: rotate(180deg);
  }

  /* The panel. Its clear top edge bridges the gap below the button, so a mouse can
     travel from one to the other without the menu closing. */
  .cc-mega {
    position: absolute;
    left: calc(-16px + var(--shift, 0px));
    top: 100%;
    z-index: 30;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding-top: 18px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
      opacity 0.16s ease,
      transform 0.16s ease,
      visibility 0s linear 0.16s;
  }
  .cc-navi[data-open] > .cc-mega,
  :not([data-wired]) > .cc-navi:hover > .cc-mega,
  :not([data-wired]) > .cc-navi:focus-within > .cc-mega {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }
  .cc-mega-in {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #d9dfd3;
    border-radius: 22px;
    background: #fffefa;
    box-shadow:
      0 30px 80px #173e2529,
      0 2px 6px #0b3c2e0f;
  }
  .cc-mega-product {
    grid-template-columns: 236px 330px;
  }
  .cc-mega-company {
    grid-template-columns: 372px;
  }
  .cc-mhead {
    display: none;
  }
  .cc-mlist {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }

  .cc-mitem {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #103f31;
    text-decoration: none;
    transition: background 0.15s;
  }
  .cc-mitem:hover,
  .cc-mitem:focus-visible,
  .cc-mitem[aria-current="page"] {
    background: #f1efe6;
    color: #0b3c2e;
  }
  .cc-micon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #d9dfd3;
    border-radius: 12px;
    background: #fffefa;
    color: #256149;
    box-shadow: 0 1px 2px #0b3c2e14;
    transition:
      background 0.15s,
      color 0.15s,
      border-color 0.15s;
  }
  .cc-mitem:hover .cc-micon,
  .cc-mitem:focus-visible .cc-micon {
    border-color: #0b3c2e;
    background: #0b3c2e;
    color: #f3bb45;
  }
  .cc-mitem strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
  }
  .cc-mitem small {
    display: block;
    margin-top: 2px;
    color: #576b60;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
  }

  /* Each menu's card: Ace in Product, the founders in Company. */
  .cc-feat {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: 18px;
    border-radius: 16px;
    background: radial-gradient(120% 80% at 100% 100%, #256149 0%, #0b3c2e 70%);
    color: #fffefa;
    text-decoration: none;
  }
  /* Each page's own link hover colour is dark green, which would hide the card's text. */
  .cc-feat:hover,
  .cc-feat:focus-visible {
    color: #fffefa;
  }
  .cc-feat:focus-visible {
    outline: 2px solid #f3bb45;
    outline-offset: -4px;
  }
  .cc-feat-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }
  .cc-feat-label {
    color: #f3bb45;
    font-size: 13px;
    font-weight: 600;
  }
  .cc-feat strong {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }
  .cc-feat small {
    color: #c3d1c4;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
  }
  /* Hover, like the plain items beside it: no underline. The card lightens a little and its
     title turns gold, the way an item's icon does. */
  .cc-feat::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fffefa;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
  }
  .cc-feat strong {
    transition: color 0.15s;
  }
  .cc-feat:hover::after,
  .cc-feat:focus-visible::after {
    opacity: 0.07;
  }
  .cc-feat:hover strong,
  .cc-feat:focus-visible strong {
    color: #f3bb45;
  }
  .cc-feat-ace {
    min-height: 268px;
  }
  .cc-feat-ace .cc-feat-art img {
    position: absolute;
    right: -12px;
    bottom: -12px;
    width: 122px;
    height: 122px;
    object-fit: contain;
    transition: transform 0.25s ease;
  }
  .cc-feat-ace:hover .cc-feat-art img {
    transform: translateY(-4px);
  }
  .cc-feat-people {
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .cc-feat-people .cc-feat-art {
    display: flex;
    flex-shrink: 0;
  }
  .cc-feat-people .cc-feat-art img {
    width: 54px;
    height: 54px;
    border: 2px solid #0b3c2e;
    border-radius: 50%;
    object-fit: cover;
  }
  .cc-feat-people .cc-feat-art img + img {
    margin-left: -14px;
  }
}

/* Pages built on the shared shell (assets/site-shell.js) fold the same markup into
   their phone menu: one flat list under each menu's name. The landing pages draw
   their own phone menu from the same data. */
@media (max-width: 980px) {
  .site-header .cc-navb[aria-expanded] {
    display: none;
  }
  .site-header .cc-mega-in {
    display: flex;
    flex-direction: column;
  }
  .site-header .cc-mlist {
    display: contents;
  }
  .site-header .cc-mhead {
    margin: 14px 0 0;
    color: #576b60;
    font-size: 13px;
    font-weight: 600;
  }
  .site-header .cc-mega a {
    display: flex;
    align-items: center;
    min-height: 56px;
    border-bottom: 1px solid #d9dfd3;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
  }
  .site-header .cc-mega a strong {
    font-weight: inherit;
  }
  .site-header .cc-mega a small,
  .site-header .cc-micon,
  .site-header .cc-feat-art,
  .site-header .cc-feat-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-mega,
  .cc-chev,
  .cc-feat-ace .cc-feat-art img {
    transition: none;
  }
  .cc-feat-ace:hover .cc-feat-art img {
    transform: none;
  }
}
