/* ===== Чипсы ===== */
#blog .blog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
#blog .chip {
  padding: 14px 18px;
  border-radius: 30px;
  border: 1px solid #cbd2dc;
  background: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 18px;
  cursor: pointer;
  transition: all 0.2s;
  color: #141b31;
}

#blog .chip--active {
  background: #89c1f0;
  border: 1px solid #cbd2dc;
  border-radius: 30px;
  color: #ffffff;
}

#blog .chip--small {
  padding: 9px 15px;
  font-weight: 400;
  font-size: 12px;
  line-height: 12px;
  color: #141b31;
  border: none;
  cursor: default;
}

/* ===== Поиск ===== */
#blog .blog-search-close {
  position: absolute;
  top: 18px;
  right: 15px;
  height: 15px;
  width: 15px;
}
#blog .blog-search-wrapper {
  display: flex;
  gap: 6px;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}
#blog .blog-search {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #cbd2dc;
  border-radius: 5px;
  padding: 10px 10px 10px 20px;
  width: 100%;
}
#blog .blog-search-input {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #cbd2dc;
  border-radius: 5px;
  width: 100%;
  padding-right: 11px;
}
#blog .blog-search-input input {
  flex: 1;
  border: none;
  outline: none;
  font-weight: 400;
  font-size: 12px;
  line-height: 12px;
  background: transparent;
  color: #8291a7;
  padding: 10px 10px 10px 20px;
  height: 100%;
}
#blog .blog-search-input input::placeholder {
  color: #8291a7;
}
#blog .blog-search-input input:-ms-input-placeholder {
  color: #8291a7;
}
#blog .blog-search__btn {
  height: 22px;
  width: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#blog .blog-search__btn img {
  height: 100%;
  width: 100%;
}
#blog .blog-search-wrapper:not(.blog-search-wrapper--popup).popup-open {
  opacity: 0;
  pointer-events: none;
}
#blog .blog-search__clear {
  padding: 14px 28px;
  border-radius: 5px;
  border: 1px solid #cbd2dc;
  background: #fff;
  font-weight: 400;
  font-size: 12px;
  line-height: 12px;
  cursor: pointer;
  color: #8291a7;
}

/* ===== Оверлей ===== */
#blog .search-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}
#blog .search-popup-overlay.active {
  display: block;
}
#blog .search-popup-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}
#blog .search-popup-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  padding: 0;
}
#blog .blog-search-wrapper--popup {
  pointer-events: auto;
  width: 100%;
  margin: 0 auto;
  z-index: 1001;
  padding: 33px 20px 33px 33px;
  background-color: #f6f7f8;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 16px;
  flex-direction: column;
}
#blog .blog-search-header {
  display: flex;
  gap: 6px;
  padding-right: 38px;
}
#blog .search-result-count {
  font-weight: 400;
  font-size: 14px;
  line-height: 12px;
  color: #8291a7;
  margin-top: 10px;
}
#blog .search-result-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 20px;
  padding-right: 38px;
}
#blog .search-result-list::-webkit-scrollbar {
  width: 5px;
}
#blog .search-result-list::-webkit-scrollbar-track {
  background: transparent;
}
#blog .search-result-list::-webkit-scrollbar-thumb {
  width: 4px;
  border: 4px solid #5e6272;
  border-radius: 10px;
  margin: 9px 0;
}
#blog .search-result-list::-webkit-scrollbar-button {
  height: 5px;
  width: 5px;
}
#blog .search-result-list::-webkit-scrollbar-button:vertical:start {
  background: url("/blog/images/arrow-scroll.svg") center no-repeat;
}
#blog .search-result-list::-webkit-scrollbar-button:vertical:end {
  background: url("/blog/images/arrow-scroll-down.svg") center no-repeat;
}
#blog .search-result-list::-webkit-scrollbar-button:vertical:start:decrement,
#blog .search-result-list::-webkit-scrollbar-button:vertical:end:increment {
  display: block;
}
#blog .search-result-list::-webkit-scrollbar-button:vertical:start:increment,
#blog .search-result-list::-webkit-scrollbar-button:vertical:end:decrement {
  display: none;
}
#blog .search-result-item {
  gap: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 26px 10px 10px;
  border-radius: 8px;
  background-color: white;
}
#blog .search-result-content {
  display: flex;
  gap: 19px;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}
#blog .search-result-photo {
  height: 60px;
  width: 60px;
  flex: none;
}
#blog .search-result-photo img {
  height: 100%;
  width: 100%;
  border-radius: 3px;
}
#blog .search-result-content img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 3px;
}
#blog .search-result-text {
  display: flex;
  justify-content: center;
  flex-direction: column;
  max-width: 85%;
  gap: 5px;
}
#blog .search-result-title {
  font-weight: 700;
  font-size: 18px;
  line-height: 18px;
  color: #2d77e8;
}
#blog .search-result-description {
  font-weight: 400;
  font-size: 14px;
  line-height: 16px;
  color: #5e6272;
}
#blog .search-result-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1; /* Количество строк до обрезки */
  -webkit-box-orient: vertical;
}
#blog .search-result-link {
  white-space: nowrap;
  font-weight: 700;
  font-size: 16px;
  line-height: 12px;
  text-decoration-line: underline;
  color: #2d77e8;
}
body.no-scroll {
  overflow: hidden;
  height: 100%;
}

/* ===== Сетка карточек ===== */
#blog .blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  min-height: 504px;
}

#blog .blog-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
#blog .blog-card__img-wrap {
  overflow: hidden;
  background: #f0f0f0;
  height: 220px;
}
#blog .blog-card__img-wrap .tablet {
  display: none;
}
#blog .blog-card__img-wrap .mobile {
  display: none;
}
#blog .blog-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
#blog .blog-card:hover .blog-card__img-wrap img {
  transform: scale(1.05);
}
#blog .blog-card__link {
  text-decoration: none;
  color: inherit;
}

#blog .blog-card__body {
  display: flex;
  flex-direction: column;
  padding: 10px 20px 30px 20px;
}

#blog .blog-card__meta {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 10px 0 20px 0;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: #8291a7;
}
#blog .blog-card__meta div {
  display: flex;
  align-items: center;
  gap: 3px;
}
#blog .blog-card__meta .calendar img {
  height: 11px;
  width: 11px;
}
#blog .blog-card__meta .time img {
  height: 13px;
  width: 13px;
}
#blog .blog-card__meta .watch img {
  height: 13px;
  width: 16px;
}
#blog .blog-card__tags {
  display: flex;
  gap: 8px;
  padding: 10px 0 0;
  flex-wrap: wrap;
}
#blog .blog-card__title {
  color: #2d77e8;
  font-weight: 600;
  font-size: 20px;
  line-height: 20px;
  margin-top: 10px;
}

#blog .blog-card__title a {
  text-decoration: none;
}

#blog .blog-card__preview {
  color: #666;
  margin-top: 10px;
  font-weight: 400;
  font-size: 14px;
  line-height: 18px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Количество строк до обрезки */
  -webkit-box-orient: vertical;
  color: #5e6272;
}
#blog .blog-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 29px;
}
#blog .blog-card__readmore {
  color: #2d77e8;
  font-weight: 700;
  font-size: 16px;
  line-height: 12px;
  text-decoration-line: underline;
}

#blog .blog-card__share {
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}
#blog .blog-card__share img {
  height: 10px;
  width: 12px;
}

/* ===== Пагинация / Load More ===== */
#blog .blog-pager {
  text-align: center;
  margin-top: 40px;
}
#blog .blog-load-more {
  padding: 14px 40px;
  border-radius: 999px;
  border: none;
  background: #f1f3f5;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  transition: background 0.2s;
}
#blog .blog-load-more:hover {
  background: #e4e6e9;
}
#blog .blog-load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

#blog .blog-loader {
  display: inline-flex;
  gap: 6px;
  margin-top: 16px;
}
#blog .blog-loader__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b35;
  animation: blogBounce 1.2s infinite ease-in-out;
}
#blog .blog-loader__dot:nth-child(2) {
  animation-delay: 0.15s;
}
#blog .blog-loader__dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blogBounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Анимация появления карточки */
#blog .blog-card--enter {
  animation: blogFadeIn 0.4s ease both;
}
@keyframes blogFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1023px) {
  #blog .blog-card__img-wrap .desktop {
    display: none;
  }
  #blog .blog-card__img-wrap .tablet {
    display: block;
  }
  #blog .blog-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  #blog .search-result-content {
    gap: 8%;
  }
  #blog .blog-search-wrapper--popup {
    width: calc(100% - 54px);
  }
  #blog .search-result-text span {
    -webkit-line-clamp: 2;
  }
  #blog .search-result-text span:last-child {
    -webkit-line-clamp: 2;
  }
  #blog .search-result-photo {
    height: 90px;
    width: 90px;
  }
  #blog .search-result-list {
    padding-right: 18px;
  }
  #blog .blog-search-header {
    padding-right: 18px;
  }
}

@media (max-width: 767px) {
  #blog .blog-card__img-wrap .tablet {
    display: none;
  }
  #blog .blog-card__img-wrap .mobile {
    display: block;
  }
  #blog .blog-search-wrapper--popup {
    width: calc(100% - 10px);
  }
  #blog .search-result-text {
    max-width: none;
  }
  #blog .search-result-text span {
    -webkit-line-clamp: 2;
  }
  #blog .search-result-text span:last-child {
    -webkit-line-clamp: 3;
  }
  #blog .search-result-item {
    gap: 8px;
    align-items: flex-start;
  }
  #blog .search-result-photo {
    height: 50px;
    width: 50px;
  }
  #blog .search-result-content {
    flex-direction: column;
    align-items: start;
    gap: 20px;
  }
  #blog .blog-search-header {
    flex-direction: column;
  }
  #blog .blog-search__btn img {
    display: none;
  }
}
