a.card__label,
span.card__label {
  color: var(--text-color-1);
  z-index: 1;
  font-size: var(--fs-label);
  text-decoration: none;
  display: block;
  font-weight: 500;
  line-height: 100%;
  width: max-content;
}

.card__label span {
  display: block;
  padding: 8px;
  position: relative;
  background: var(--color-3);
  transition: all 0.3s;
  border-radius: var(--br-label);
  border: 2px solid var(--color-12);
}

.card__tags {
  position: relative;
}

[data-abs-tags="true"] .card__tags {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
}

.card__tags[data-all-visible="true"] {
  z-index: 2;
}

.card__tags[data-all-visible="false"] [data-under-dots="true"] {
  display: none;
}

.card__tags[data-all-visible="true"] .card__tags_more_btn_wrapper {
  display: none;
}

.card__tags_list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

.card__tags_list_item {
  padding-inline: 0 !important;
}

.card__tags_list_item[data-under-dots="false"] + .card__tags_more_btn_wrapper {
  display: none;
}

.card__tag {
  width: max-content;
  display: block;
  padding: 4px 8px;
  background: var(--color-3);
  transition: all 0.3s;
  border-radius: var(--br-label);
  border: 2px solid var(--color-12);

  color: var(--text-color-1);
  font-size: var(--fs-label);
  text-decoration: none;
  font-weight: 500;
  line-height: 100%;
}

.card__tags_more_btn_wrapper {
  width: 24px;
}

.card__tags_more_btn {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.card__tags_more_btn:focus {
  outline: none;
}

body.theme-dark .card__tag {
  background: var(--color-8);
  color: var(--text-color-3);
}

.card__title {
  font-size: var(--fs-card-title);
  color: var(--text-color-1);
  position: relative;
  font-weight: 800;
  margin: 0;
}

.card__title a {
  color: var(--text-color-1);
  text-decoration: none;
}

.card__author {
  position: relative;
  font-size: var(--fs-card-author);
  text-decoration: none;
  line-height: 100%;
  color: var(--color-7);

  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  min-width: 0;
}

.card__author__avatar {
  border-radius: 100%;
}

.card__author_wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
}

.card__author_wrapper .news__item__meta {
  align-items: center;
}

.card__avatar_wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card__avatar_wrapper img {
  border-radius: 100%;
}

.card__info_wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  padding: 0 10px 10px;
}

.card__info__top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.card__info__top[data-abs-tags="true"] {
  padding-top: 34px;
}

.card__info_wrapper h3 {
  margin-bottom: 0;
}

.card__short__dec {
  font-size: 15px;
  color: var(--color-10);
  font-weight: 400;
}

.card__author__time__read {
  font-size: var(--fs-card-author);
  color: var(--color-7);
}

.card__image_wrapper {
  border-radius: var(--br-card);
  overflow: hidden;
}

.card__image {
  display: block;
  width: 100%;
  height: 370px;
}

.card__image_wrapper img {
  border-radius: var(--br-content);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__short__desc {
  font-size: 14px;
  color: var(--text-color-2);
}

.news__item__meta {
  display: flex;
  gap: 8px;
}

.news__item__meta__icon {
  width: 20px;
  height: 20px;
}

.news__item__meta__time {
  color: var(--text-color-2);
  font-size: 15px;
}

.card.news__list__card {
  flex-direction: row;
  gap: 20px;
  align-items: stretch;
}

.card.news__list__card .card__image {
  height: 160px;
  width: 285px;
}

.card.news__list__card .card__info_wrapper {
  padding: 10px 0;
}

.news__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.theme-dark .card__label span {
  background: var(--color-8);
  color: var(--text-color-3);
}

body.theme-dark .card__title,
body.theme-dark .card__title a {
  color: var(--text-color-3);
}

body.theme-dark .card__short__dec,
body.theme-dark .news__item__meta__time {
  color: var(--color-11);
}

.card {
  padding: 10px;
  transition: all 0.3s;
  border-radius: var(--br-card);
  background: var(--color-3);
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}
body.theme-dark .card {
  background: var(--color-9);
}

.news__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  background: var(--color-3);
  border-radius: var(--br-card);
  padding: 20px;
}

.news__grid__item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  padding-right: 16px;
  border-bottom: 1px solid var(--border-color);
}

.news__grid__item[data-pinned="true"]::before {
  content: "";
  width: 3px;
  height: 100%;
  position: absolute;
  top: 0;
  left: -6px;
  background-color: var(--color-13);
  border-radius: 3px;
}
.news__grid__item[data-pinned="true"] .pin-icon {
  position: absolute;
  top: 0;
  right: 0;
  color: var(--color-13);
}
body.theme-dark .news__grid__item[data-pinned="true"]::before {
  background-color: var(--color-2);
}
body.theme-dark .news__grid__item[data-pinned="true"] .pin-icon {
  color: var(--color-2);
}
.news__grid__item .card__title {
  font-size: var(--h3);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  padding-bottom: 2px;
}

body.theme-dark .news__grid {
  background: var(--color-9);
}

body.theme-dark .news__grid__item {
  border-bottom: 1px solid var(--border-color-dark);
}

.news__grid__item:nth-last-child(-n + 2),
body.theme-dark .news__grid__item:nth-last-child(-n + 2) {
  border-bottom: none;
  padding-bottom: 0;
}

.news__grid__item-comments {
  position: absolute;
  right: 0;
  bottom: 4px;
}

.news__grid__item:has(.news__grid__item-comments) {
  min-height: 52px;
}

@media (max-width: 1024px) {
  .card__image {
    height: 200px;
  }

  .news__grid__item .card__title {
    -webkit-line-clamp: 5;
  }
}

@media (max-width: 500px) {
  .card.news__list__card {
    flex-direction: column;
  }

  .card.news__list__card .card__image {
    height: 200px;
    width: 100%;
  }

  .card {
    padding: 0;
    gap: 10px;
    min-width: 0;
  }

  .card__info_wrapper {
    padding: 0 10px 10px;
  }

  .card .card__title {
    padding-left: 0;
    padding-right: 0;
  }

  .card.news__list__card {
    gap: 10px;
  }

  .card.news__list__card .card__info_wrapper {
    padding: 0 10px 10px;
  }

  .news__grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .news__grid__item:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
  }

  body.theme-dark .news__grid__item:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border-color-dark);
    padding-bottom: 16px;
  }

  .news__grid__item:nth-last-child(-n + 1),
  body.theme-dark .news__grid__item:nth-last-child(-n + 1) {
    border-bottom: none;
  }
}

/* Hide the three-dots button while list is opened */
.more__tags.active {
  display: none;
}
