/* Base container */

.amb-anchor-menu {
  --amb-gap: 8px;
  --amb-pad: 8px 12px;
  --amb-radius: 10px;
  display: flex;
  align-items: center;
  gap: var(--amb-gap);
}

/* Links list */
.amb-anchor-menu .amb-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;              /* horizontal on mobile */
  overflow: auto;             /* allow swipe/scroll */
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  scroll-snap-type: x proximity;
}
.amb-anchor-menu .amb-menu li{
  padding: 0;
}
/* Hide scrollbars but keep scrollability */
.amb-anchor-menu .amb-menu::-webkit-scrollbar { display: none; }
.amb-anchor-menu .amb-menu { scrollbar-width: none; -ms-overflow-style: none; }

.amb-anchor-menu .amb-link {
  display: inline-block;
font-size: var(--font-down-1);
    padding: 0.25rem 1rem 0.25rem 1rem;
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: start;
  color: #0A1120;
}
.amb-anchor-menu .amb-link.is-active {
  color: #1650CC;
}

/* Prev/Next control buttons */
.amb-anchor-menu .amb-prev,
.amb-anchor-menu .amb-next {
  padding: 8px 10px;
  border: none;
  background: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  font-size: 0;
}
.amb-anchor-menu .amb-prev{
  background-image: url("../../themes/semaphoreci_v8/img/previous.svg");
}
.amb-anchor-menu .amb-next {
background-image: url("../../themes/semaphoreci_v8/img/next.svg");
}
/* Make it sticky on MOBILE too (after auto-reparent) */
@media (max-width: 780px){
  .amb-anchor-menu {
    position: sticky;
    top: var(--amb-sticky, 0px);  /* JS sets this var, includes admin bar offset */
    z-index: 20;
    border: solid 0.05rem #D2D4D6;
    border-radius: 16px;
    background-color: white;
    padding: 5px;
  }
}

/* Desktop: vertical sticky (put block in sidebar) */
@media (min-width: 781px) {
  .amb-anchor-menu {
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: var(--amb-sticky, 16px);
    max-height: calc(100vh - var(--amb-sticky, 16px));
    overflow: visible;
  }
  .amb-anchor-menu .amb-menu {
    flex-direction: column;   /* vertical on desktop */
    overflow: auto;           /* mouse wheel scroll */
    scroll-snap-type: none;
  }
  .amb-anchor-menu .amb-prev,
  .amb-anchor-menu .amb-next {
    display: none; /* hide prev/next on desktop; remove if you want vertical paging */
  }
  .amb-anchor-menu .amb-link {
    width: 100%;
    text-align: left;
    white-space: normal;
  }
}

/* Editor niceties */
.amb--editor .amb-config .amb-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.amb--editor .amb-preview {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Safety: prevent common ancestors from killing sticky (overflow/transform) */
@media (max-width: 780px){
  .wp-block-group,
  .wp-block-columns,
  .wp-block-column { overflow: visible !important; }
}