#sidebar {
  font-size: .85rem;
  opacity: 1;
  padding-bottom: 1rem;

  h3 {
    border-bottom: var(--kbin-sidebar-header-border);
    color: var(--kbin-sidebar-header-text-color);
    font-size: .8rem;
    margin: 0 0 1rem;
    text-transform: uppercase;

    button.refresh-random {
      background: none;
      border: none;
      color: inherit;
      cursor: pointer;
    }
  }

  figure, blockquote {
    margin: 0;
  }

  .options {
    grid-template-columns: 1fr;

    menu {
      display: flex;

      li {
        flex-grow: 1;
        flex-shrink: 0;
        text-align: center;
      }
    }
  }

  .section {
    padding: .5rem;
  }

  .sidebar-options {
    .top-options.section {
      padding: 0px;
      overflow: hidden;

      menu {
        display: flex;
        overflow: hidden;

        ul {
          list-style-type: none;
          display: flex;
          flex-direction: row;
          column-gap: 0.5rem;
          padding: 0px;
          margin: 0px;
          width: 100%;
        }

        li {
          display: flex;
          justify-content: center;

          a {
            flex-grow: 1;
          }
        }

        li.close-button,
        li.home-button {
          display: none;
        }
      }

      @include media-breakpoint-down(lg) {
        menu {
          justify-content: flex-start;

          li.close-button,
          li.home-button {
            display: flex;
          }

          li.close-button {
            margin-left: auto;
          }
        }
      }
    }
  }

  .posts,
  .entries {
    color: var(--kbin-meta-text-color);

    .container {
      @include media-breakpoint-down(lg) {
        max-width: 100%;
      }

      @include media-breakpoint-only(md) {
        display: grid;
        gap: 2rem;
        grid-template-columns: repeat(2, 1fr);
      }
    }

    figure {
      border-bottom: var(--kbin-meta-border);
      margin-bottom: 1rem;
      padding-bottom: 1rem;

      &:last-child {
        margin-bottom: 0;
      }

      .row img {
        height: 100px;
        margin-bottom: .5rem;
        -o-object-fit: cover;
        object-fit: cover;
        width: 100%;
      }

      blockquote {
        border: 0;
        padding: 0;

        a {
          @include kbin-btn-link;
        }

        p:last-of-type {
          margin: 0em;
        }

        div {
          margin-top: 0.5em;
        }
      }

      .more {
        opacity: 0;
      }

      figcaption {
        color: var(--kbin-meta-text-color);
        text-align: right;
      }

      figcaption time {
        display: block;
      }
    }
  }

  .entries blockquote {
    font-weight: bold;
  }

  .meta, .info {
    color: var(--kbin-meta-text-color);
    list-style: none;
    margin: 0;
    padding: 0;

    li {
      align-items: center;
      border-bottom: var(--kbin-meta-border);
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      min-height: 3rem;
      padding: .5rem;

      position: relative;

      &:first-child {
        border-top: var(--kbin-meta-border);
      }

      span {
        color: var(--kbin-meta-text-color);
      }

      a {
        font-weight: bold;
        padding: 0;
      }

    }
  }

  .user-list {
    ul {
      margin: 0;
      padding: 0;
    }

    ul li {
      align-items: center;
      border-top: var(--kbin-meta-border);
      display: flex;
      list-style: none;
      position: relative;

      &:first-child {
        border-top: 0;
        padding-top: 0;
      }

      &:last-child {
        border-bottom: var(--kbin-meta-border);
      }

      a {
        padding: 0 .5rem;
      }

      img {
        margin: .5rem 0;
        border-right: 0.25rem;
      }
    }

    footer {
      opacity: .85;
      padding: .5rem 0;
      position: relative;
      text-align: center;

      a {
        color: var(--kbin-meta-text-color);
      }
    }
  }

  .entry-info,
  .user-info {
    .row {
      h4 {
        font-size: 1rem;
        margin-bottom: 0;
        margin-top: .5rem;
      }

      text-align: center;
    }

    a {
      color: var(--kbin-meta-link-color);
    }

    &_name {
      margin-top: 0;
    }

    figure {
      text-align: center;
    }
  }

  .settings {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    align-items: flex-end;
    flex-flow: row wrap;

    & + .settings {
      margin-bottom: .5rem;
    }

    &:last-of-type {
      margin-bottom: 0;
    }

    .theme {
      filter: drop-shadow(1px 2px 3px hsl(0, 0%, 0%, .25));
      height: 2rem;
      width: 2rem;

      &.light {
        background: url("/assets/images/light.svg") no-repeat;
        background-size: 2rem;
        background-position: center;

        .theme--light & {
          outline: 2px solid var(--kbin-sidebar-settings-switch-on-bg);
        }
      }

      &.dark {
        background: url("/assets/images/dark.svg") no-repeat;
        background-size: 2rem;
        background-position: center;

        .theme--dark & {
          outline: 2px solid var(--kbin-sidebar-settings-switch-on-bg);
        }
      }

      &.kbin {
        background: url("/assets/images/kbin.svg") no-repeat;
        background-size: 2rem;
        background-position: center;

        .theme--kbin & {
          outline: 2px solid var(--kbin-sidebar-settings-switch-on-bg);
        }
      }

      &.solarized-light {
        background: url("/assets/images/solarized.svg") no-repeat;
        background-size: 2rem;
        background-position: center;

        .theme--solarized-light & {
          outline: 2px solid var(--kbin-sidebar-settings-switch-on-bg);
        }
      }

      &.solarized-dark {
        background: url("/assets/images/solarized-dark.svg") no-repeat;
        background-size: 2rem;
        background-position: center;

        .theme--solarized-dark & {
          outline: 2px solid var(--kbin-sidebar-settings-switch-on-bg);
        }
      }

      &.tokyo-night {
        background: url("/assets/images/tokyo-night.svg") no-repeat;
        background-size: 2rem;
        background-position: center;

        .theme--tokyo-night & {
          outline: 2px solid var(--kbin-sidebar-settings-switch-on-bg);
        }
      }
    }

    .font-size {
      align-items: center;
      border: 3px solid transparent;
      box-sizing: content-box;
      display: flex;
      height: 30px;
      justify-content: center;
      padding: 3px;
      width: 30px;

      &.active {
        border: var(--kbin-avatar-border);
      }
    }
  }

  .settings-list {
    display: flex;
    flex-flow: row wrap;
    gap: 1px;
    align-items: center;
    color: var(--kbin-meta-text-color);

    &.reload-required .reload-required-section {
      display: block;
    }

    .reload-required-section {
      z-index: 1;
      background: var(--kbin-section-bg);
      position: sticky;
      top: 0;
      display: none;
      text-align: center;
      width: 100%;
      animation: showReloadRequired .25s ease-in-out forwards;
      @keyframes showReloadRequired {
        0% {
          opacity: 0;
          transform: translateY(-.5em);
        }
        75% {
          opacity: 1;
          transform: translateY(.25em);
        }
        100% {
          transform: translateY(0);
        }
      }

      .rounded-edges & {
        border-radius: var(--kbin-rounded-edges-radius);
      }

      .btn {
        width: 100%;
        display: flex;
        gap: .5rem;
        justify-content: center;
        align-items: center;
        width: 100%;

        &:hover {
          color: var(--kbin-button-secondary-text-hover-color);
        }
      }

      &:hover {
        background: var(--kbin-button-secondary-hover-bg);
        color: var(--kbin-button-secondary-text-hover-color);
      }

      /** Faster spin animation than fa-spin */
      button.spin i {
        animation: spin .5s linear infinite;
        @keyframes spin {
          0% {
            transform: rotate(0deg);
          }
          100% {
            transform: rotate(360deg);
          }
        }
      }
    }

    strong {
      margin-top: .5rem;
      display: block;
      flex: 100%;
      font-weight: 700;
      font-variant: all-small-caps;
      margin-left: .3125rem;
      color: var(--kbin-meta-text-color);
      opacity: .5;

      & + .settings-row {
        .rounded-edges & {
          border-top-left-radius: .375rem;
          border-top-right-radius: .375rem;
          overflow: clip;
        }
      }
    }

    .row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex: 100%;
      min-height: 1.5rem;

      div {
        display: flex;
        align-items: center;
        font-size: 0;
        color: var(--kbin-meta-text-color);
        border: var(--kbin-button-secondary-border);
        background: var(--kbin-button-secondary-bg);
        height: 1.5rem;
        overflow: clip;

        a {
          font-weight: 400;
          height: 100%;
          font-size: .85rem;
          padding: 0 .375rem;
          white-space: nowrap;

          &.active {
            font-weight: 700;
            background: var(--kbin-button-secondary-hover-bg);
            color: var(--kbin-button-secondary-text-hover-color);
          }

          &.link-muted:not(.active):hover {
            color: var(--kbin-link-hover-color);
          }
        }
      }

      span {
        line-height: normal;
      }
    }
  }

  #settings, #federation {
    display: none;
  }

  #settings:target, #federation:target {
    display: block;
  }

  .active-users {
    > div {
      display: grid;
      gap: .2rem;
      grid-template-columns: repeat(4, 1fr);
      text-align: center;
    }

    img {
      border: var(--kbin-avatar-border);
    }
  }

  .intro {
    .container {
      background: url('/assets/images/intro-bg.png') no-repeat center 20%;
      background-size: cover;
      color: #ffffff !important;
      font-size: .85rem;
      margin: -.5rem;
      padding: 1rem;

      .rounded-edges & {
        border-radius: .5rem .5rem 0 0;
      }

      h3 {
        border: 0;
        color: white;
        font-size: 1rem;
        font-weight: 500;
        margin: 1rem 0 1rem 0;
        text-transform: none;
      }
    }

    .btn:first-of-type {
      margin-bottom: 1rem;
      margin-top: 2rem;
    }

    .btn {
      .rounded-edges & {
        border-radius: .5rem;
      }

      display: block;
      text-align: center;
      width: 100% !important;
    }
  }

  .kbin-promo {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    position: relative;

    h4 {
      font-size: 1.1rem;
      font-weight: 500;
      margin: 0;
    }

    p {
      font-size: .8rem;
      margin: 0;
    }

    a {
      color: var(--kbin-text-color);
    }
  }

  .mobile-close {
    //display: none;
  }

  .mobile-nav {
    display: none;
  }

  @include media-breakpoint-down(lg) {
    .mobile-nav {
      display: block;
      position: relative;

      li {
        font-size: 1.1rem;
        list-style: none;
        position: relative;
        padding: .85rem 0;
      }

      a {
        color: var(--kbin-meta-link-color);

        &::after {
          bottom: 0;
          content: '';
          left: 0;
          position: absolute;
          right: 0;
          top: 0;
          z-index: 1;
        }
      }

      a.active {
        font-weight: bold;
      }

      .head-title {
        border-bottom: 1px solid var(--kbin-options-text-color);
        font-weight: bold;
        padding-bottom: .5rem;
      }

      .head-title span {
        display: none;
      }
    }
  }

  .support-us-block {
    div {
      text-align: center;
      padding: 1.5rem 0;
    }

    footer {
      opacity: .85;
      padding: .5rem 0;
      position: relative;
      text-align: center;
      border-top: var(--kbin-meta-border);
      margin-top:1rem;

      a {
        color: var(--kbin-meta-text-color);
      }
    }
  }

}

#sidebar.open {
  @include media-breakpoint-down(lg) {
    background: var(--kbin-bg);
    height: 100%;
    left: 0;
    overflow: auto;
    padding-bottom: 100px !important;
    position: fixed;
    top: 3.25rem;
    width: 100%;
    z-index: 98;

    .topbar & {
      top: 4.5rem;
    }

    .mobile-close {
      display: flex;
      font-size: 1.5rem;
      justify-content: space-between;
      padding: 0.5em;

      button {
        height: auto;
      }
    }
  }
}


