.sticky-nav {
  --sticky-nav-color: rgb(var(--color-black));
  --sticky-nav-font-size: inherit;
  --sticky-nav-font-size\@sm: var(--sticky-nav-font-size);
  --sticky-nav-font-weight: inherit;
  --sticky-nav-text-decoration: none;
  --sticky-nav-font-family: inherit;
  --sticky-nav-font-style: inherit;
  --sticky-nav-button-group-border-width: 4px;
}

.sticky-nav:not(.p-sm, .p-lg) {
  font-size: 11px;
}

@media (min-width: 600px) {
  .sticky-nav:not(.p-sm, .p-lg) {
    font-size: 0.85rem;
  }
}

@media (min-width: 900px) {
  .sticky-nav:not(.p-sm, .p-lg) {
    font-size: 0.95rem;
  }
}

.sticky-nav {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  transition: 0.4s all;
  z-index: var(--site-z-2);
}

/* for dnd section */
@supports selector(:has(*)) {
  body .dnd-section:has(.sticky-nav) {
    margin-block: 0;
    padding-block: 0;
    position: sticky;
    top: 1.5rem;
    z-index: var(--site-z-2);
  }

  body .dnd-section:has(.sticky-nav) > .row-fluid {
    margin-block: 0;
    max-width: none;
    padding-inline: 0;
  }

  .site-header:has(sticky-header) ~ main .sticky-nav,
  .site-header:has(sticky-header) ~ main .dnd-section:has(.sticky-nav) {
    top: calc(var(--nav-height, 0) + 1rem);
  }
}

.sticky-nav.js-inactive,
.dnd-section.js-inactive {
  opacity: 0;
  transform: translateY(-100%);
  transition: 0.2s all;
  visibility: hidden;
}

.sticky-nav__inner {
  overflow-x: auto;
  padding: 0 var(--site-gutter) !important;
}

.sticky-nav__inner {
  -webkit-mask-image: linear-gradient(
    to right,
    hsl(0 0% 0% / 1) calc(100% - var(--site-gutter) - 2.5rem),
    hsl(0 0% 0% / 0)
  );
  mask-image: linear-gradient(to right, hsl(0 0% 0% / 1) calc(100% - var(--site-gutter) - 2.5rem), hsl(0 0% 0% / 0));
}

.sticky-nav__items-wrapper {
  display: flex;
  justify-content: center;
  width: auto;
}

.sticky-nav__items {
  display: flex;
  list-style: none !important;
  line-height: 1.2;
  margin: 0 -0.6rem;
  position: relative;

  background: rgb(var(--color-white));
  border-radius: 100rem;
  padding: var(--sticky-nav-button-group-border-width);
}

.sticky-nav__indicator {
  background: rgb(var(--color-black));
  border-radius: 100rem;
  height: calc(100% - var(--sticky-nav-button-group-border-width) * 2);
  display: none;
  width: 0;
  opacity: 0;
  position: absolute;
  top: var(--sticky-nav-button-group-border-width);
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.sticky-nav__items:has(> li > .js-active) .sticky-nav__indicator {
  opacity: 1;
}

.sticky-nav__item {
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.sticky-nav__item:last-child {
  padding-right: 2em;
}

.sticky-nav__link {
  display: block;

  color: var(--sticky-nav-color);
  font-family: var(--sticky-nav-font-family);
  font-weight: var(--sticky-nav-font-weight);
  font-size: var(--sticky-nav-font-size\@sm);
  font-style: var(--sticky-nav-font-style);
  text-decoration: var(--sticky-nav-text-decoration);

  padding: 1rem 0.6rem;

  background: transparent;
  border-radius: 100rem;

  &:is(:hover, :focus) {
    box-shadow: inset 0 0 0 2px rgb(var(--color-black));
  }
}

@media (min-width: 768px) {
  .sticky-nav__link {
    font-size: var(--sticky-nav-font-size);
  }
}

@media (min-width: 900px) {
  .sticky-nav__link {
    align-items: center;
    display: flex;
  }
}

.sticky-nav__link.js-active {
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: currentColor;
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .sticky-nav__link.js-active {
    background: transparent;
    color: rgb(var(--color-white));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-nav__link.js-active {
    background: rgb(var(--color-black));
    color: rgb(var(--color-white));
  }

  .sticky-nav__indicator {
    display: none !important;
  }
}

.sticky-nav__icon {
  display: block;
  margin: 0 auto 0;
}

@media (min-width: 900px) {
  .sticky-nav__icon {
    margin: 0 var(--mh-sn-icon-gap, 10px) 0 0;
  }
}

@media (min-width: 768px) {
  .sticky-nav--jc-left\@tablet {
    justify-content: flex-start;
  }

  .sticky-nav--jc-center\@tablet {
    justify-content: center;
  }

  .sticky-nav--jc-right\@tablet {
    justify-content: flex-end;
  }

  .sticky-nav__items {
    margin: 0 -0.8rem;
  }

  .sticky-nav__item:last-child {
    padding-right: 0;
  }

  .sticky-nav__link {
    padding: 1rem calc(var(--sticky-nav-gap, 56px) / 2);
  }
}

@media (min-width: 1025px) {
  .sticky-nav--jc-left\@desktop {
    justify-content: flex-start;
  }

  .sticky-nav--jc-center\@desktop {
    justify-content: center;
  }

  .sticky-nav--jc-right\@desktop {
    justify-content: flex-end;
  }

  .sticky-nav__items {
    justify-content: center;
    transform: translateX(-20px);
  }
}
