#main-nav .nav-split {
  position: relative;
  display: flex;
  align-items: center;
}

#main-nav .nav-split > a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline-end: .25rem;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

#main-nav .nav-split > a:is(:hover, :focus-visible),
#main-nav > details > summary:is(:hover, :focus-visible),
#main-nav > a:not(.nav-book):is(:hover, :focus-visible) {
  color: #ee3224;
  text-decoration: none;
}

#main-nav .nav-split > details {
  position: static;
}

#main-nav .nav-split > details > summary {
  position: relative;
  box-sizing: border-box;
  display: flex;
  width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 0;
}

#main-nav > details > summary,
#main-nav .nav-split > details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 5px;
  list-style: none;
}

#main-nav summary:has(> .nav-chevron)::after {
  content: none;
}

#main-nav summary:has(> .nav-chevron)::-webkit-details-marker {
  display: none;
}

#main-nav .nav-chevron {
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #f1eee8;
}

#main-nav summary:is(:hover, :focus-visible) > .nav-chevron,
#main-nav details[open] > summary > .nav-chevron {
  background: #fce4df;
}

#main-nav .nav-chevron::before {
  content: "";
  width: 7px;
  height: 7px;
  box-sizing: content-box;
  border-right: 2px solid #ee3224;
  border-bottom: 2px solid #ee3224;
  transform: translateY(-2px) rotate(45deg);
}

#main-nav details[open] > summary .nav-chevron::before {
  transform: translateY(2px) rotate(225deg);
}

#main-nav .nav-split > a:focus-visible,
#main-nav summary:has(> .nav-chevron):focus-visible {
  outline: 2px solid #163047;
  outline-offset: -2px;
  border-radius: 6px;
}

@media (max-width: 1240px) {
  #main-nav .nav-split {
    display: block;
  }

  #main-nav .nav-split > a {
    position: absolute;
    inset: 0 44px auto 0;
    padding-inline-start: 8px;
  }

  #main-nav .nav-split > details > summary {
    margin-inline-start: auto;
  }
}

@media (min-width: 1241px) {
  .site-header .header-inner {
    width: min(1160px, calc(100% - 2 * var(--page-gutter, 28px)));
    max-width: 1160px;
    gap: 24px;
  }

  .site-header .header-inner > .logo {
    flex: 0 0 auto;
  }

  .site-header #main-nav {
    gap: 8px;
    justify-content: flex-end;
    justify-content: safe flex-end;
  }

  #main-nav .nav-split > details > summary {
    width: 36px;
  }

  .site-header #main-nav .nav-book {
    padding-inline: 14px;
  }

  .site-header #main-nav > a[href="/contact/"] + .nav-book {
    margin-inline-start: 8px;
  }
}

/* Use the regular compact navigation slightly earlier, before the row crowds the logo. */
@media (min-width: 1201px) and (max-width: 1240px) {
  .site-header .header-inner {
    height: 88px;
  }

  .site-header .logo, .site-header .logo img {
    width: 145px;
  }

  .site-header .menu-toggle {
    display: block;
  }

  .site-header #main-nav {
    display: none;
    position: absolute;
    top: 88px;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 24px;
    flex-direction: column;
    align-items: stretch;
    background: #fffefa;
    font-size: 16px;
    gap: 10px;
    max-height: calc(100vh - 88px);
    overflow: auto;
  }

  .site-header #main-nav.open {
    display: flex;
  }

  .site-header #main-nav .dropdown {
    position: static;
    width: 100%;
    box-shadow: none;
    border: 0;
    padding: 12px 0;
  }

  .site-header #main-nav .nav-book {
    font-size: 18px;
    width: 100%;
    min-height: 56px;
    justify-content: space-between;
    padding: 16px 22px;
  }

  .site-header #main-nav summary {
    justify-content: space-between;
  }
}
