.tst-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 576px) {
  .tst-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .tst-grid { grid-template-columns: repeat(3, 1fr); }
}

.tst-card {
  border-radius: 18px;
  border: 1px solid #D7DDE2;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: box-shadow .2s;
}
.tst-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.09);
}

.tst-card-img-link {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  aspect-ratio: 5 / 3;
}
.tst-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.tst-card-img-link:hover .tst-card-img {
  transform: scale(1.04);
}

.tst-card-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tst-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tst-avatars {
  display: flex;
  align-items: center;
}
.tst-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  object-fit: cover;
  flex-shrink: 0;
  z-index:3;
}
.tst-avatars .tst-avatar + .tst-avatar {
  margin-left: -8px;
  z-index:2;
}
.tst-avatars .tst-avatar + .tst-avatar + .tst-avatar {
  z-index:1;
}
.tst-author-name {
  font-size: 12px;
  font-weight: 600;
  color: #434A57;
  font-family: Inter, sans-serif;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tst-card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 4px;
  font-family: Inter, sans-serif;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tst-card-title a {
  color: #1F2937;
  text-decoration: none;
}
.tst-card-title a:hover {
  color: #45bc60;
}
@media (min-width: 992px) {
  .tst-card-title { font-size: 22px; }
}

.tst-card-desc {
  font-size: 15px;
  color: #697488;
  line-height: 1.5;
  margin: 0;
  font-family: Inter, sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Теги — одна строка, скрываем лишнее */
.tst-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 35px;
  overflow: hidden;
  align-items: center;
}

a.tst-tag,
button.tst-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid #D7DDE2;
  font-size: 13px;
  font-weight: 600;
  color: #1F2937;
  line-height: 1;
  white-space: nowrap;
  font-family: Inter, sans-serif;
  text-decoration: none;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
a.tst-tag:hover,
button.tst-tag:hover {
  background: #f0f5f2;
  border-color: #45bc60;
  color: #2e8a47;
}

/* Кнопка "···" */
.tst-more-wrap {
  flex-shrink: 0;
}
button.tst-tag-more {
  letter-spacing: 2px;
  padding: 7px 10px;
}

/* Дропдаун вынесен в body через JS — position: fixed */
.tst-tag-dropdown {
  display: none;
  position: fixed;
  background: #fff;
  border: 1px solid #D7DDE2;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  z-index: 9999;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100vw - 16px);
}
.tst-tag-dropdown.tst-open {
  display: flex;
}
.tst-tag-dropdown a.tst-tag {
  justify-content: flex-start;
}

.tst-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-top: 32px;
  justify-content: center;
}
.tst-page-item {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #858C97;
  font-family: Inter, sans-serif;
  text-decoration: none;
  padding: 0 4px;
  transition: background .15s, color .15s;
}
.tst-page-item:hover {
  background: #f0f2f5;
  color: #1F2937;
}
.tst-page-item.active {
  color: #1F2937;
  font-weight: 700;
}
.tst-page-item.dots {
  color: #B4BBC3;
  cursor: default;
  pointer-events: none;
}


.challenge-content {
  max-width: 880px;
}

.challenge-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.challenge-title {
  font-family: Inter;
  font-size: 40px;
  font-weight: 600;
  line-height: 52px;
  color: #1F2937;
  margin: 0;
  text-align: center;
}

.challenge-announcement {
  font-family: Inter;
  font-size: 18px;
  font-weight: 400;
  line-height: 27px;
  color: #697488;
  max-width: 748px;
  margin: 0 auto;
  text-align: center;
}

.author-name {
  color: #1F2937;
  transition: color .15s;
  font-family: Inter;
  font-size: 18px;
  font-weight: 400;
  line-height: 27px;
  text-decoration: none;
  display: inline;
}

.author-name:hover:not(.disabled) {
  color: var(--ar-navbar-hover-color, var(--ar-primary)) !important;
}

.challenge-share {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.challenge-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.challenge-body h1,
.challenge-body h2,
.challenge-body h3,
.challenge-body h4,
.challenge-body h5,
.challenge-body h6,
.challenge-body ol,
.challenge-body ul
{
	margin-bottom: 0
}

.challenge-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.challenge-section h2 {
  font-family: Inter;
  font-size: 32px;
  font-weight: 600;
  line-height: 42px;
  color: #1F2937;
  margin: 0;
  padding-top: 2px;
}

.challenge-body p,
.challenge-section p {
  margin: 0;
}

.challenge-image {
  width: 100%;
  height: auto;
  border-radius: 18px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.challenge-meta {
  padding: 24px 0;
  gap: 20px;
  border-top: 1px solid #E3E9EF;
}

.challenge-meta__details i {
  color: #858C97;
  font-size: 16px;
  line-height: 1;
}

.challenge-meta__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.challenge-authors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 324px;
}

.challenge-author__avatars {
  display: flex;
  align-items: flex-start;
  isolation: isolate;
}

.challenge-author__avatars .challenge-author__avatar {
  margin-right: -8px;
}

.challenge-author__avatars .challenge-author__avatar:nth-child(1) {
  z-index: 2;
}

.challenge-author__avatars .challenge-author__avatar:nth-child(2) {
  z-index: 1;
}

.challenge-author__avatars .challenge-author__avatar:nth-child(3) {
  z-index: 0;
}

.challenge-author__avatars .challenge-author__avatar:last-child {
  margin-right: 0;
}

.challenge-author__avatar {
  width: 56px;
  height: 56px;
  border: 2px solid #FFFFFF;
  border-radius: 28px;
  object-fit: cover;
}

.challenge-author__names {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 4px;
  max-width: 324px;
  text-align: center;
}

.tags-container {
  flex: 1 1 auto;
  gap: 8px;
}

.tags-container a {
  transition: background .15s, border-color .15s, color .15s;
  padding: 6px 9px;
  border: 1px solid #BCCBDA;
  border-radius: 800px;
  font-family: Inter;
  font-size: 12px;
  font-weight: 600;
  line-height: 12px;
  color: #434A57;
  text-decoration: none;
}

.tags-container a:hover {
  background: #f0f5f2;
  border-color: var(--ar-primary) !important;
  color: var(--ar-primary) !important;
}

.challenge-head nav ol.breadcrumb {
	margin-bottom: 0;
	padding-bottom: 0;
}


/* Search + Filter bar */
.tst-search-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 100px;
    margin-top: 20px;
}

@media (min-width: 576px) {
    .tst-search-bar {
        flex-direction: row;
        align-items: center;
    }
}

.tst-search-wrap {
    flex: 1;
    min-width: 0;
}

.tst-search-form {
    position: relative;
    width: 100%;
}

.tst-search-input {
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0 16px 0 48px;
    border: 1px solid #d7dde2;
    border-radius: 16px;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.tst-search-input::placeholder {
    color: #b4bbc3;
    font-weight: 400;
}

.tst-search-input:focus {
    border-color: #1f2937;
}

@media (min-width: 992px) {
    .tst-search-bar {
        max-width: 861px;
    }
}

.tst-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.tst-filter-wrap {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

@media (min-width: 576px) {
    .tst-filter-wrap {
        flex: 1;
        width: auto;
    }
}

@media (min-width: 992px) {
    .tst-filter-wrap {
        flex: none;
        width: 220px;
    }
}

.tst-filter-btn {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    width: 100%;
    height: 48px;
    box-sizing: border-box;
    border: 1px solid #d7dde2;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #697488;
    transition: border-color 0.2s;
}

.tst-filter-btn:hover {
    border-color: #b0b8c1;
}

.tst-filter-btn.tst-open {
    border-color: #1f2937;
}

.tst-filter-chevron {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tst-filter-btn.tst-open .tst-filter-chevron {
    transform: rotate(180deg);
}

.tst-filter-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 100%;
    min-width: 220px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d7dde2;
    border-radius: 16px;
    padding: 8px 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    flex-direction: column;
}

@media (min-width: 992px) {
    .tst-filter-dropdown-menu {
        width: 220px;
    }
}

.tst-filter-dropdown-menu.tst-open {
    display: flex;
}

.tst-filter-group {
    display: flex;
    flex-direction: column;
}

.tst-filter-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    height: 37px;
    box-sizing: border-box;
    width: 100%;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #697488;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
    white-space: nowrap;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tst-filter-item:hover {
    background: #f6f8fa;
}

.tst-filter-item.tst-active {
    background: #f6f8fa;
    color: #1f2937;
}

.tst-filter-divider {
    width: 100%;
    height: 1px;
    background: #d7dde2;
    flex-shrink: 0;
}