/* ══════════════════════════════════════════════════
   NEWS.CSS — AutoMart  (mobile-first, no inline styles)
   ══════════════════════════════════════════════════ */

/* ── Toolbar ── */
.news-toolbar {
  background: #fff;
  padding: 14px 24px;
  border-bottom: 1px solid #eaeae0;
  position: relative;
  z-index: 100;
}
.news-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
}
.news-search-wrapper { position: relative; flex: 1; }
.news-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid #deded4;
  border-radius: 24px;
  padding: 10px 18px;
  background: #fafaf8;
}
.news-search-box input {
  border: none;
  outline: none;
  font-size: 15px;
  width: 100%;
  background: transparent;
  font-family: inherit;
  color: var(--text-primary);
}
.news-search-icon { width: 18px; height: 18px; color: #888; flex-shrink: 0; }
.news-search-clear {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 0;
  line-height: 1;
}
.news-search-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eaeae0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 500;
  max-height: 400px;
  overflow-y: auto;
}
.news-search-panel.open { display: block; }
.news-search-panel-empty {
  padding: 24px;
  text-align: center;
  color: #888;
  font-size: 14px;
}
.news-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.news-search-item:last-child { border-bottom: none; }
.news-search-item:hover { background: #fafaf8; }
.news-search-item-img {
  width: 56px; height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8e8de;
  flex-shrink: 0;
}
.news-search-item-img img { width: 100%; height: 100%; object-fit: cover; }
.news-search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-search-item-meta { font-size: 11px; color: #a8a898; margin-top: 3px; }
.news-search-highlight { background: #fff3cd; border-radius: 2px; padding: 0 1px; }

/* ── Tags ── */
.news-tag {
  display: inline-block;
  background: #f5efe0;
  color: #8a6020;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.news-tag-qa { background: #e8f4fd; color: #1a6fa8; }

/* ── Section header ── */
.news-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--accent-primary);
  display: inline-block;
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════
   FEATURED ARTICLE — mobile first (dọc)
   ══════════════════════════════════════════════════ */
.nf-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eaeae0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, border-color 0.25s;
  margin-bottom: 16px;
}
.nf-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
  border-color: #d4c8a8;
}
.nf-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #e8e8de;
  flex-shrink: 0;
}
.nf-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.nf-card:hover .nf-image img { transform: scale(1.03); }
.nf-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nf-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #a8a898;
  flex-wrap: wrap;
  margin-top: 4px;
}
.nf-avatar {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e8e8de;
  flex-shrink: 0;
}
.nf-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

/* ══════════════════════════════════════════════════
   NEWS GRID — danh sách bài (mobile: 1 cột)
   ══════════════════════════════════════════════════ */
.ni-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.ni-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #eaeae0;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.ni-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-color: #d4c8a8;
}
.ni-image {
  width: 100px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8e8de;
}
.ni-image img { width: 100%; height: 100%; object-fit: cover; }
.ni-body { flex: 1; min-width: 0; }
.ni-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ni-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #a8a898;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

/* Tablet 600px+ */
@media (min-width: 600px) {
  .nf-card { flex-direction: row; }
  .nf-image {
    width: 240px;
    height: auto;
    min-height: 160px;
  }
  .nf-body { padding: 20px; }
  .nf-title { font-size: 19px; -webkit-line-clamp: 4; }
  .ni-grid { grid-template-columns: 1fr 1fr; }
  .ni-image { width: 110px; height: 78px; }
}

/* Desktop 960px+ */
@media (min-width: 960px) {
  .nf-image { width: 300px; min-height: 190px; }
  .nf-title { font-size: 20px; }
  .nf-desc { -webkit-line-clamp: 4; }
  .ni-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .ni-image { width: 120px; height: 84px; }
  .ni-title { font-size: 15px; }
}