<template>
  <div>
    <router-link
      class="quote-card"
      :to="{ name: 'conversation', params: { id: status.id } }"
    >
      <QuoteCardContent
        :status="status"
      />
    </router-link>
  </div>
</template>

<script src="./quote_card"></script>

<style lang="scss">
@import '../../_variables.scss';

.quote-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  margin-block-start: 0.5em;

  .card-image {
    flex-shrink: 0;
    inline-size: 120px;
    max-inline-size: 25%;
    img {
      inline-size: 100%;
      block-size: 100%;
      object-fit: cover;
      border-radius: $fallback--attachmentRadius;
      border-radius: var(--attachmentRadius, $fallback--attachmentRadius);
    }
  }

  .card-content {
    max-block-size: 100%;
    margin: 0.5em;
    display: flex;
    flex-direction: column;
  }

  .card-host {
    font-size: 0.85em;
  }

  .card-description {
    margin-block: 0.5em 0;
    margin-inline: 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.2em;
    // cap description at 3 lines, the 1px is to clean up some stray pixels
    // TODO: fancier fade-out at the bottom to show off that it's too long?
    max-block-size: calc(1.2em * 3 - 1px);
  }

  .nsfw-alert {
    margin-block: 2em;
    margin-inline: 0;
  }

  color: $fallback--text;
  color: var(--text, $fallback--text);
  border-style: solid;
  border-width: 1px;
  border-radius: $fallback--attachmentRadius;
  border-radius: var(--attachmentRadius, $fallback--attachmentRadius);
  border-color: $fallback--border;
  border-color: var(--border, $fallback--border);
}
</style>
