/* Bibliothèque: the books one can open */
.library {
  margin-inline: auto;
  max-inline-size: 1040px;
  padding: 8px clamp(16px, 4vw, 40px) 48px;
  text-align: start;
}

.library__header {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-block: 16px 28px;
}

.library__grid {
  display: grid;
  gap: 28px 22px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.library__book {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  transition: transform 150ms ease;

  &:hover {
    transform: translateY(-2px);
  }

  .book__cover {
    aspect-ratio: 5 / 8;
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    inline-size: 100%;
    max-block-size: none;
    object-fit: cover;
    transition: box-shadow 150ms ease;
  }

  &:hover .book__cover {
    box-shadow: var(--shadow-card-hover);
  }
}

.library__cover {
  display: grid;
  position: relative;

  .book__cover-wrapper {
    display: grid;

    > * {
      grid-area: 1 / 1;
    }
  }
}

.library__caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
}

.library__title {
  font-family: var(--font-book);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library__meta {
  color: var(--ink-3);
  font-size: 11.5px;
}

.library__shared-badge {
  align-items: center;
  background-color: var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sel);
  display: flex;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  justify-content: center;
  padding: 5px;
  position: absolute;

  img {
    opacity: 0.7;
  }
}
