.gallery, .documents-gallery {
  --gallery-document-total-height: 349px;
  --gallery-document-width: 152px;
  --gallery-document-thumbnail-height: 171px;

  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.5rem 1rem;

  .gallery-buttons {
    margin-top: auto;
  }

  .gallery-document {
    border-radius: 0.25rem;
    height: var(--gallery-document-total-height);
    width: var(--gallery-document-width);
    padding: 0;

    &:hover {
      --bs-border-color: var(--stanford-80-black);
    }

    &.current-document {
      --bs-border-color: var(--stanford-cardinal);
    }

    .bookmark-toggle .bookmark-text {
      display: none;
    }

    .caption {
      display: flex;
      height: calc(var(--gallery-document-total-height) - var(--gallery-document-thumbnail-height));
      flex-direction: column;
      justify-content: flex-end;
      padding: 0.75rem 0.5rem 0.5rem 0.5rem;
    }

    .cover-image, .stacks-image {
      margin: auto;
      max-height: var(--gallery-document-thumbnail-height);
      max-width: var(--gallery-document-width);
    }

    .index-document-functions {
      flex-grow: 0
    }

    .index_title {
      font-size: .925rem;
      height: 3rem;

      a {
        color: var(--stanford-black);
      }
    }

    .item-thumb {
      border-bottom: 1px solid var(--stanford-20-black);
      background-color: var(--stanford-fog-light);
      height: var(--gallery-document-thumbnail-height);
      margin-top: 1px;

      a {
        --bs-link-decoration: none;
        --bs-link-hover-decoration: none;
      }
    }

    .location, .callnumber-bar {
      font-size: 0.875rem;
    }
  }

  .preview-container {
    /* Stop the 'row' class from interfering with the gallery preview controller dynamic margins */
    flex-shrink: unset;
  }

  .preview {
    margin-bottom: 1.5rem;
    width: 100%;
  }

  .truncate-1, .truncate-2{
    padding-bottom: 2px;
  }
}

div.fake-cover-text {
  color: var(--stanford-50-black);
  font-size: 0.875rem;
  padding: 1rem;
}
