@import (reference) '../../../../theme-default/styles/variables.less';

@prefixCls: dumi-site-theme-cases;
@card-radius: 0.8em;

.@{prefixCls} {
  a {
    text-decoration: none;
  }

  &-button {
    padding: 0.3em 1.2em;
    border-radius: 0.4em;
    cursor: pointer;
    font-size: 0.875em;
    display: inline-flex;
    align-items: center;

    &:hover {
      padding-block-end: 0.3em !important;
      border-bottom: none !important;
    }

    &.primary {
      background-color: @c-primary;
      color: #fff !important;

      @{dark-selector} & {
        background-color: @c-primary-dark;
      }
    }

    &.secondary {
      background-color: @c-text-note;
      color: #fff;
      font-size: 0.8em;

      @{dark-selector} & {
        background-color: @c-text-note-dark;
      }
    }
  }

  ul {
    list-style: none;
    width: 100%;
    padding: 0;
  }

  &-center {
    text-align: center;

    p {
      text-align: center;
    }
  }

  &-list {
    margin-top: 2em;
    display: grid;
    gap: 1em;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  &-item {
    display: flex;
    flex-direction: column;
    border-radius: @card-radius;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 5%);
    background-color: #fff;

    @{dark-selector} & {
      border-bottom: @c-border-light;
      background-color: @c-site-bg-dark;
    }
  }

  &-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-bottom: 2px solid @c-border;
    border-radius: @card-radius @card-radius 0 0;

    @{dark-selector} & {
      border-bottom: @c-border-light;
    }

    > img {
      width: 100%;
      max-width: 100%;
      height: auto;
    }
  }

  &-infomation {
    padding: 1em;

    > p {
      font-size: smaller;
      line-height: 1.66;
      margin: 0;
      display: box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }
  }

  &-summary {
    margin-bottom: 1em;
    display: flex;
    align-items: center;

    h4 {
      margin: 0 0.25em 0 0;
      flex: 1 1 auto;
    }

    a:first-child {
      color: @c-primary;

      @{dark-selector} & {
        color: @c-primary-dark;
      }
    }
  }
}
