/*
 * Navigation and mobile responsive corrections for theme version 0.1.6.
 *
 * The menu is anchored beneath the sticky header. This avoids the header's
 * backdrop filter turning a fixed descendant into a header-sized containing
 * block in Chromium, which previously exposed the page beneath the menu.
 */

.desktop-nav .current-menu-item > a::after,
.desktop-nav .current_page_item > a::after,
.desktop-nav .current-menu-parent > a::after,
.desktop-nav .current-page-ancestor > a::after {
  right: 0;
}

.header-contact::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -.45rem;
  height: 1px;
  background: currentColor;
  transition: right .25s ease;
}

.header-contact:hover::after,
.header-contact:focus-visible::after,
.khatri-contact-active .header-contact::after {
  right: 0;
}

@media (max-width: 980px) {
  body.khatri-menu-open {
    overflow: hidden;
  }

  body.khatri-menu-open #main-content,
  body.khatri-menu-open .site-footer {
    visibility: hidden;
  }

  .site-header:has(.mobile-menu[open]) {
    isolation: isolate;
    background: var(--paper);
    backdrop-filter: none;
  }

  .mobile-menu[open] nav {
    position: absolute;
    z-index: 1;
    inset: 100% 0 auto;
    width: 100%;
    height: calc(100dvh - 4.7rem - var(--wp-admin--admin-bar--height, 0px));
    min-height: calc(100vh - 4.7rem);
    padding: 2rem var(--gutter) 3rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 1;
    background: var(--paper);
    box-shadow: 0 1rem 2rem rgba(22, 24, 21, .06);
  }

  .mobile-menu nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .22em;
  }
}

@media (max-width: 680px) {
  /*
   * Match the specificity of the desktop :not(:first-child) rule so every
   * discussion item shares the same left edge in the single-column layout.
   */
  .discussion-grid article:not(:first-child) {
    padding: 2rem 0;
  }
}
