/* News list — cards + sidebar widgets.
   Theme tokens only (--accent-color, --border-color, --surface-color, ...), so dark mode
   follows automatically. */

.news-result-line {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--secondary-color);
}

/* ------------------------------------------------------------------ cards */

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
  color: inherit;
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.news-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--surface-alt-color);
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.04);
}

.news-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--secondary-color);
}

.news-card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--contrast-color, #fff);
  background-color: var(--accent-color);
}

.news-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 16px;
}

.news-card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--heading-color);
}

.news-card:hover .news-card-title {
  color: var(--accent-color);
}

.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
  font-size: 13px;
  color: var(--secondary-color);
}

.news-card-meta i {
  margin-right: 4px;
}

/* ---------------------------------------------------------------- widgets */

.news-widget {
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
}

.news-widget:last-child {
  margin-bottom: 0;
}

.news-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--secondary-color);
}

.news-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  color: var(--heading-color);
}

.news-cat-item:hover,
.news-cat-item.active {
  color: var(--accent-color);
  background-color: var(--surface-alt-color);
}

.news-cat-count {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--secondary-color);
  background-color: var(--surface-alt-color);
}

.news-cat-item:hover .news-cat-count,
.news-cat-item.active .news-cat-count {
  color: var(--accent-color);
}

/* Most-viewed list. Always populated when any news exists — this is what keeps the
   sidebar from rendering as an empty column. */
.news-popular-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
}

.news-popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-popular-rank {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-color);
  background-color: var(--surface-alt-color);
}

.news-popular-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.news-popular-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--heading-color);
}

.news-popular-item:hover .news-popular-title {
  color: var(--accent-color);
}

.news-popular-meta {
  font-size: 12px;
  color: var(--secondary-color);
}

/* ------------------------------------------------- latest (with thumbnail) */

.news-latest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
}

.news-latest-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-latest-thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  color: var(--secondary-color);
  background-color: var(--surface-alt-color);
}

.news-latest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-latest-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.news-latest-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--heading-color);
  /* Two lines max, so a long headline can't push the widget out of shape. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-latest-item:hover .news-latest-title {
  color: var(--accent-color);
}

/* ----------------------------------------------------- chips (archive etc) */

.news-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--heading-color);
  background-color: var(--surface-alt-color);
  border: 1px solid var(--border-color);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.news-chip:hover,
.news-chip.active {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.news-chip-count {
  font-size: 11px;
  color: var(--secondary-color);
}

.news-chip.active .news-chip-count {
  color: var(--accent-color);
}

.news-active-filters .news-chip i {
  font-size: 11px;
  opacity: 0.7;
}

.news-widget-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .news-widget {
    margin-top: 4px;
  }
}
