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

.@{prefix}-search-result {
  > dl {
    margin: 2px 0;

    > dt {
      height: 30px;
      padding: 0 16px;
      font-weight: bold;
      font-size: 14px;
      line-height: 30px;
      color: @c-text-secondary;
      background-color: @c-border-light;

      @{dark-selector} & {
        color: @c-text-secondary-dark;
        background-color: @c-border-less-dark;
      }

      &:first-child {
        margin-top: -2px;
      }

      + dd {
        margin-top: 2px;
      }
    }

    > dd {
      margin: 0 4px;
      padding: 2px 0;

      + dd {
        border-top: 1px dashed @c-border-light;

        @{dark-selector} & {
          border-top-color: @c-border-less-dark;
        }
      }

      + dt {
        margin-top: 2px;
      }

      > a {
        position: relative;
        display: flex;
        height: 60px;
        flex-direction: column;
        justify-content: center;
        padding-top: 6px;
        padding-bottom: 8px;
        padding-inline-start: 54px;
        padding-inline-end: 12px;
        text-decoration: none;
        box-sizing: border-box;
        border-radius: 4px;

        &[data-active],
        &:hover {
          background-color: @c-primary;

          @{dark-selector} & {
            background-color: darken(@c-primary-dark, 28%);
          }

          > h4,
          > p {
            color: #fff;

            @{dark-selector} & {
              color: darken(#fff, 20%);
            }
          }

          > svg {
            fill: #fff;

            @{dark-selector} & {
              fill: darken(#fff, 20%);
            }
          }
        }

        > svg {
          position: absolute;
          top: 14px;
          inset-inline-start: 14px;
          width: 32px;
          height: 32px;
          fill: darken(@c-border, 5%);

          @{dark-selector} & {
            fill: lighten(@c-border-dark, 5%);
          }
        }

        > h4,
        > p {
          margin: 0;
          line-height: 1.4;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }

        > h4 {
          color: @c-text-secondary;
          font-size: 14px;

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

        > p {
          margin-top: 2px;
          font-size: 13px;
          color: @c-text-note;

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

          &:empty {
            display: none;
          }
        }
      }
    }
  }

  mark {
    color: rgb(72, 70, 7);
    padding: 0 2px;
    border-radius: 2px;
    background-color: rgb(255, 249, 197);

    @{dark-selector} & {
      color: rgb(147, 145, 71);
      background-color: rgb(56, 37, 6);
    }
  }

  .@{prefix}-search-empty {
    display: flex;
    height: 140px;
    align-items: center;
    justify-content: center;
    color: @c-text-note;
    font-size: 16px;

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

    > svg {
      margin-inline-end: 8px;
      width: 48px;
      fill: lighten(@c-text-note, 20%);

      @{dark-selector} & {
        fill: darken(@c-text-note-dark, 20%);
      }
    }
  }
}
