@use 'variables' as *;
@use 'functions' as *;

$maximum-width: 1235px;
$fluid-breakpoint: $maximum-width + 20px;

.container {
  box-sizing: border-box;
  max-width: $maximum-width;
  margin: 0 auto;
  position: relative;

  @media screen and (max-width: $fluid-breakpoint) {
    width: 100%;
    padding: 0 10px;
  }
}

.brand {
  position: relative;
  text-decoration: none;
}

.rules-list {
  font-size: 15px;
  line-height: 22px;
  counter-reset: list-counter;

  li {
    position: relative;
    border-bottom: 1px solid var(--background-border-color);
    padding: 1em 1.75em;
    padding-inline-start: 3em;
    font-weight: 500;
    counter-increment: list-counter;
    min-height: 4ch;

    button {
      background: transparent;
      border: 0;
      padding: 0;
      margin: 0;
      text-align: start;
      font: inherit;

      &:hover,
      &:focus,
      &:active {
        background: transparent;
      }

      &[aria-expanded='false'] .rules-list__hint {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        @supports (-webkit-line-clamp: 2) {
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          white-space: normal;
        }
      }
    }

    &::before {
      content: counter(list-counter);
      position: absolute;
      inset-inline-start: 0;
      top: 1em;
      background: $highlight-text-color;
      color: $ui-base-color;
      border-radius: 50%;
      width: 4ch;
      height: 4ch;
      font-weight: 500;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    &:last-child {
      border-bottom: 0;
    }
  }

  &__text {
    color: $primary-text-color;
  }

  &__hint {
    font-size: 14px;
    font-weight: 400;
    color: $darker-text-color;
  }
}

.rules-languages {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;

  > label {
    font-size: 14px;
    font-weight: 600;
    color: $primary-text-color;
  }

  > select {
    appearance: none;
    box-sizing: border-box;
    font-size: 14px;
    color: $primary-text-color;
    display: block;
    width: 100%;
    outline: 0;
    font-family: inherit;
    resize: vertical;
    background: $ui-base-color;
    border: 1px solid var(--background-border-color);
    border-radius: 4px;
    padding-inline-start: 10px;
    padding-inline-end: 30px;
    height: 41px;

    @media screen and (width <= 600px) {
      font-size: 16px;
    }
  }

  &::after {
    display: block;
    position: absolute;
    width: 15px;
    height: 15px;
    content: '';
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14.933' height='18.467' viewBox='0 0 14.933 18.467'><path d='M3.467 14.967l-3.393-3.5H14.86l-3.392 3.5c-1.866 1.925-3.666 3.5-4 3.5-.335 0-2.135-1.575-4-3.5zm.266-11.234L7.467 0 11.2 3.733l3.733 3.734H0l3.733-3.734z' fill='currentColor' /></svg>")
      no-repeat 50% 50%;
    mask-size: contain;
    right: 8px;
    background-color: lighten($ui-base-color, 12%);
    pointer-events: none;
  }
}
