/**
 * TGWV Widget: Sidebar bài viết mới nhất
 * (.widget-tgwv-sidebar-recent-articles)
 */

.tgwv-w-sidebar-recent {
  --tgwv-sidebar-recent-brand: #e5372b;
  --tgwv-sidebar-recent-item-title: #241818;

  margin: 0 0 1.25rem;
  overflow: hidden;
  border: 1px solid var(--tgwv-sidebar-recent-brand);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 7, 171, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* —— Tiêu đề widget —— */
.tgwv-w-sidebar-recent__head {
  padding: 0.75rem 1rem;
  background: rgb(25, 135, 84);
  border-bottom: 1px solid rgb(25, 135, 84);
}

.tgwv-w-sidebar-recent__title {
  margin: 0;
  padding: 0 0 0 0.625rem;
  border-left: 3px solid #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}

/* —— Nội dung —— */
.tgwv-w-sidebar-recent__body {
  padding: 0.5rem 0.75rem 0.75rem;
  background: #fff;
}

.tgwv-w-sidebar-recent__empty {
  margin: 0.5rem 0;
  padding: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  color: #666;
  background: #f8f9fa;
  border-radius: 6px;
}

.tgwv-w-sidebar-recent__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tgwv-w-sidebar-recent__item {
  margin: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tgwv-w-sidebar-recent__item:last-child {
  border-bottom: none;
}

.tgwv-w-sidebar-recent__link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  margin: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.tgwv-w-sidebar-recent__link:hover,
.tgwv-w-sidebar-recent__link:focus-visible {
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.tgwv-w-sidebar-recent__link:focus-visible {
  outline: 2px solid var(--tgwv-sidebar-recent-brand);
  outline-offset: 1px;
}

.tgwv-w-sidebar-recent__thumb-wrap {
  flex: 0 0 80px;
  width: 80px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #eef0f3;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.tgwv-w-sidebar-recent__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tgwv-w-sidebar-recent__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.125rem;
}

.tgwv-w-sidebar-recent__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--tgwv-sidebar-recent-item-title);
  transition: color 0.15s ease;
}

.tgwv-w-sidebar-recent__link:hover .tgwv-w-sidebar-recent__name,
.tgwv-w-sidebar-recent__link:focus-visible .tgwv-w-sidebar-recent__name {
  color: var(--tgwv-sidebar-recent-brand);
}

.tgwv-w-sidebar-recent__date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #888;
}

.tgwv-w-sidebar-recent__date::before {
  content: "";
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  opacity: 0.7;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 3v11h12V3H2z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM2 3v11h12V3H2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Không ảnh */
.tgwv-w-sidebar-recent__list:not(.tgwv-w-sidebar-recent__list--with-thumb) .tgwv-w-sidebar-recent__link {
  align-items: center;
}

/* Không có tiêu đề: body có padding trên */
.tgwv-w-sidebar-recent:not(:has(.tgwv-w-sidebar-recent__head)) .tgwv-w-sidebar-recent__body {
  padding-top: 0.75rem;
}
