.sidebar {
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  height: fit-content;
  background-color: white;
}

.trending-post-item {
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
}
.trending-thumb {
  width: 70px;
  height: 70px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.trending-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trending-info {
  flex: 1;
}
.trending-meta {
  font-size: 12px;
  color: #888;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 70px;
}
.trending-cat {
  color: #b71c1c;
  font-weight: bold;
  margin-right: 6px;
}
.trending-date {
  color: #888;
  font-size: 12px;
}
.trending-title {
  color: #222;
  font-size: 16px;
  text-decoration: none;
  display: block;
  white-space: wrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1em;
}
.trending-title:hover {
  color: #b71c1c;
}
.widget-title {
  font-size: 16px;
  font-weight: bold;
  border-bottom: 2px solid #eee;
  margin-bottom: 15px;
  padding-bottom: 5px;
}

.related-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 18px;
  border-bottom: 2px solid #2196f3;
  padding-bottom: 6px;
  letter-spacing: 0.5px;
}
.related-posts-grid {
  margin-left: -8px;
  margin-right: -8px;
}
.related-posts-grid .col-md-3 {
  padding-left: 8px;
  padding-right: 8px;
}
.related-card {
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.related-card:hover {
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.12);
}
.related-thumb {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #eee;
}
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-cats {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
}
.related-cat {
  display: inline-block;
  background: #b71c1c;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 4px;
}
.related-content {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1 1 auto;
}
.related-title-link {
  color: #222;
  font-size: 16px;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  max-height: 2.5em; /* 2 lines * line-height */
  white-space: normal;
}
.related-title-link:hover {
  color: #b71c1c;
}
.related-meta {
  font-size: 12px;
  color: #888;
  margin-top: auto;
}
.related-author,
.related-date {
  display: flex;
  align-items: center;
  font-size: 12px;
}
.related-author i,
.related-date i {
  margin-right: 3px;
  font-size: 12px;
}

.sidebar .search-widget .input-group .form-control {
  border-radius: 0;
  border: 1px solid #ccc;
  box-shadow: none;
}
.sidebar .search-widget .input-group .btn-primary {
  border-radius: 0;
  background: #16376b;
  border: none;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

@media (min-width: 992px) {
  .related-posts-grid .col-lg-4:nth-child(4) {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .sidebar {
    background-color: transparent;
  }

  .sidebar .search-widget .input-group .btn-primary {
    width: 25%;
  }

  .trending-posts-grid .col-md-6:nth-child(5) {
    display: none !important;
  }
}

@media (max-width: 575px) {
  .related-posts-grid .col-lg-4:nth-child(4) {
    display: none !important;
  }

  .trending-posts-grid .col-md-6:nth-child(5) {
    display: block !important;
  }
}
