/* Custom styles for pages in papers/ */

.acl-paper-details {
  /* This essentially reimplements the old Bootstrap dl-horizontal class */
  dl {
    &:before, &:after {
      display: table;
      content: "";
      line-height: 0;
    }

    dt {
      clear: left;
      text-align: left;
    }
    @include media-breakpoint-up(sm) {
      dt {
        float: left;
        width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: right;
      }
    }

    dd {
      margin-left: 1rem;
      margin-bottom: .25rem;

      &:empty {
        @extend .text-muted;
      }
      &:empty::before {
        content: '–';
      }
    }

    @include media-breakpoint-up(sm) {
      dd {
        margin-left: 11rem;
        margin-bottom: 0 !important;
      }
    }
  }
}

dt.acl-button-row {
  padding-top: .4rem;
}
dd.acl-button-row .btn {
  @extend .my-1;
}

@include media-breakpoint-down(sm) {
  .acl-abstract {
    padding: .75rem !important;
  }
}

/* Styling related to the paper metadata-editing modal dialog */
.sortable-ghost {
  opacity: 0.4;
}
.author-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
  cursor: grab;
  background: #f8f9fa;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.author-row input {
  flex: 1;
}
.author-row:active {
  cursor: grabbing;
}
.drag-handle {
  cursor: grab;
}
.drag-handle:active {
  cursor: grabbing;
}

/* Bootstrap classes explanation:
   + By default, show this block first and use flexbox to space out buttons
   + On large displays, show this block as a third column in the layout
     and disable flexbox to make buttons full-width instead
*/
.acl-paper-link-block {
  @extend .col-lg-2;
  @extend .order-1;
  @extend .order-lg-last;
  @extend .mb-3;
  @extend .mb-lg-0;
  @extend .d-flex;
  @extend .d-lg-block;
  @extend .flex-wrap;
  @extend .justify-content-around;

  a, button {
    @extend .flex-fill;
    @extend .btn-lg;
    @extend .btn-lg-block;
    @extend .mx-1;
    @extend .mx-lg-0;
    @extend .mb-2;
  }
}

/* A responsive variant of Bootstrap's .btn-block */
@include media-breakpoint-up(lg) {
  .btn-lg-block {
    display: block;
    width: 100%;
  }
}

.list-pl-responsive {
  padding-left: 24px;
}
@include media-breakpoint-up(md) {
  .list-pl-responsive {
    padding-left: 32px;
  }
}
@include media-breakpoint-up(xl) {
  .list-pl-responsive {
    padding-left: 40px; // CSS default
  }
}

/* Abstracts toggling on list pages */
#toggle-all-abstracts {
  &[data-toggle-state="hide"] .on-toggle-state-show {
    display: none;
  }
  &[data-toggle-state="show"] .on-toggle-state-hide {
    display: none;
  }
}

.list-button-row {
  min-width: 6.3rem;
}

/* Papers with Code related styles */

.pwc-icon {
  height: 18px;
  width: 18px;
  fill: #4d8093;
  position: relative;
  top: -2px;
}

.pwc-icon-big {
  height: 20px;
  width: 20px;
  position: relative;
  top: 4px;
}

.pwc-icon-small {
  height: 16px;
  width: 16px;
}

.badge.badge-secondary.pwc-reduced-padding {
  padding-top: 0.12em;
  padding-bottom: 0.12em;
}
