.fb-jump-nav {
  margin: 0;
  padding: 0;
}

.fb-jump-nav__container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

.fb-jump-nav__button,
.block-editor-writing-flow a.fb-jump-nav__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  background-color: var(--wp--preset--color--ast-global-color-0);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 400;
  line-height: 1;
  transition: all 0.25s ease-in-out;
  white-space: nowrap;
  min-height: 44px;
  border: 2px solid var(--wp--preset--color--ast-global-color-0);
}
.fb-jump-nav__button:hover,
.block-editor-writing-flow a.fb-jump-nav__button:hover {
  color: white;
}

.fb-jump-nav__button:visited,
.block-editor-writing-flow a.fb-jump-nav__button:visited {
  color: white;
}

.fb-jump-nav__button:focus,
.block-editor-writing-flow a.fb-jump-nav__button:focus {
  color: white;
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Mobile modal container */
.fb-jump-nav__modal-container {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: auto;
  z-index: 999;
}

/* Mobile toggle button - hidden by default */
.fb-jump-nav__mobile-toggle {
  position: relative;
  background-color: var(--wp--preset--color--ast-global-color-0);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  padding-right: 2.5rem; /* space for icon on the right */
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  width: auto; /* do not take 100% width */
  text-align: center;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center; /* center the text label */
}

.fb-jump-nav__toggle-text {
  flex: 0 1 auto; /* don't stretch the label */
  text-align: center; /* ensure centered text */
}

.fb-jump-nav__toggle-icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
  position: absolute;
  right: 1rem;
}

/* Mobile modal */
.fb-jump-nav__mobile-modal {
  padding: 0 0.5rem;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.fb-jump-nav__mobile-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fb-jump-nav__mobile-content {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: max-content;
  max-height: calc(100vh - 8rem);
  background-color: white;
  display: flex;
  flex-direction: column;
  transform: translateY(calc(100% + 1rem));
  transition: transform 0.25s ease;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding-bottom: 2rem;
  overflow: hidden;
}

.fb-jump-nav__mobile-modal.is-open .fb-jump-nav__mobile-content {
  transform: translateY(0);
}

.fb-jump-nav__mobile-links {
  padding: 2rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.fb-jump-nav__mobile-link {
  display: block;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 400;
  color: #666;
  text-decoration: none;
  padding: 1.25rem 0;
  transition: color 0.2s ease;
}

.fb-jump-nav__mobile-link:last-child {
  border-bottom: none;
}

.fb-jump-nav__mobile-link:hover {
  color: var(--wp--preset--color--ast-global-color-0);
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fb-jump-nav__container {
    display: none;
  }

  .fb-jump-nav__modal-container {
    display: block;
  }
}
