@import "_variables";

// sidenotes are <aside> after the <p> that references them
// so <p> floats left and <aside> floats right

// make room for sidenotes
article > p, article > ul {
  float: left;
  clear: left;
  width: 100%;
  @media ($bp-liminal) {
    width: $textwidth-simple;
  }
  @media ($bp-full) {
    width: $textwidth-sidenotes;
  }

  a.sidenote-ref {
    // <sup>ish
    vertical-align: super;
    line-height: 0;
    font-size: .83em;

    color: $meta-color;

    pointer-events: inherit;
    cursor: pointer;

    text-decoration: none;
    &:hover {
      color: $accent-color;
      background-color: inherit;
      box-shadow: none;
    }

    @media ($bp-full) {
      pointer-events: none;
      cursor: default;
    }
  }
}

.sidenote {
  position: relative;

  padding-top: 0.75em;
  float: left;
  width: 100%;
  @media ($bp-liminal) {
    width: $textwidth-simple;
  }
  @media ($bp-full) {
    float: right;
    clear: right;
    width: #{100% - $textwidth-sidenotes};
    padding-left: 3rem;

    margin-top: 1em; // to match article > *+*
    // margin-bottom: 1.96rem;
  }

  font-size: 1.0rem;
  vertical-align: baseline;

  font-family: $base-font;
  font-size: $textwidth-sidenotes;
  line-height: 1.0rem;
  padding-left: 1rem;
  .sidenote-ref {
    float: left;
    margin-left: -1.0rem;
    color: $meta-color;
  }
  P {
    clear: none;
  }
}

// but now we have to prevent everything from collapsing
article > *, footer {
  clear: both;
}
