[data-component-id="theodor:scrollytelling_table_of_contents"] {
  position: sticky;
  right: 0;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  max-height: 7rem;
  transition: max-height 0.5s ease-in-out;

  @media (max-width: 1200px) {
    &.mobile-fixed {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      margin-inline: 0.7rem;
    }
  }

  &:has(.menu.expanded) {
    max-height: 400rem
  }

  @media (min-width: 1024px) {
    margin-inline: 0.7rem;
  }

  @media (min-width: 1200px) {
    position: absolute;
    right: -4.5rem;
    left: unset;
    max-width: 20rem;
    height: 100%;
    max-height: 100%
  }

  .menu {
    position: sticky;
    z-index: 1;
    top: 0;
    inset-inline-start: 0;
    background: var(--boe-color-neutral-100);
    background: var(--boe-color-neutral-20);
    padding: 1.25rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    min-height: 4rem;
    overflow: hidden;

    @media (min-width: 1200px) {
      top: 7rem;
      opacity: 0.95;
      height: auto;
      max-width: 20rem;
    }

    li.menu-item {
      position: relative;

      a {
        display: block;
        margin-inline-start: 1rem;
        color: var(--brand-colors-gray-light-1);
        color: var(--boe-color-neutral-100);
        text-decoration: none;
        font-size: 1.1rem;
      }

      &:before {
        display: block;
        content: '';
        min-width: 0;
        min-height: 0;
        background: white;
        background: var(--brand-colors-gray-light-1);
        background: var(--boe-color-neutral-100);
        border-radius: 50%;
        transition: all 0.5s linear;

        @media (min-width: 1200px){
          position: absolute;
          top: calc(50% - 0.25rem);
        }
      }

      &.menu-item.is-active {
        opacity: 1;
        position: relative;
        visibility: visible;
        transform: translateY(0);
        transition: all 0.5s ease-in-out;

        &:before {
          min-width: 0.5rem;
          min-height: 0.5rem;
        }

        a {
          color: var(--brand-colors-gray-light-1);
          color: var(--boe-color-neutral-100);
        }
      }


      @media (max-width: 1200px) {
        position: absolute;
        left: 0;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        visibility: hidden;
        opacity: 0;
        transform: translateY(300%);
        width: 100%;

        .menu.expanded & {
          visibility: visible !important;
          opacity: 1 !important;
          position: relative !important;
          transform: translate(0) !important;

        }


        &.menu-item.is-previous {
          position: absolute;
          opacity: 0;
          transform: translateY(-300%);
        }

        &.menu-item.is-next {
          position: absolute;
          visibility: hidden;
          opacity: 0;
          transform: translateY(300%);

        }

      }

    }

  }


  .expand-menu-button {
    position: absolute;
    height: 100%;
    right: 0;
    top: 0;

    svg {
      position: absolute;
      right: 1rem;
      top: 1.25rem;
      width: 1.5rem;
      height: 1.5rem;
      fill: black;
      z-index: 1;
      cursor: pointer;
      transition: transform 0.25s ease-in-out;
      will-change: transform;

      @media (min-width: 1200px) {
        display: none;
      }


      .expanded + .expand-menu-button & {
        transform: rotate(90deg);
      }
    }

  }


}
