html {
  scroll-behavior: smooth;
}

/* ===== Typography ===== */
body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* ===== Links ===== */
a {
  color: #0d6efd;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}
a:hover {
  color: #0a58ca;
  text-decoration: underline;
}

/* ===== Card hover effect ===== */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* ===== Carousel caption style ===== */
.carousel-caption {
  backdrop-filter: blur(6px);
  border-radius: 10px;
}

/* ===== Sidebar spacing ===== */
.sidebar .card {
  margin-bottom: 1rem;
}

/* ===== Tags ===== */
.badge {
  margin: 2px;
  font-size: 0.85rem;
  padding: 0.4em 0.6em;
  transition: background-color 0.2s ease;
}
.badge:hover {
  background-color: #0d6efd;
  cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
  transition: all 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
}

/* ===== Pagination buttons ===== */
.btn-outline-dark {
  border-radius: 20px;
  padding: 0.25rem 0.8rem;
}

/* ===== Titles ===== */
h1, h2, h3, h4, h5 {
  font-weight: 600;
  color: #222;
}

/* ===== Footer (nếu có) ===== */
footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  background: #f8f9fa;
  color: #666;
  text-align: center;
  font-size: 0.9rem;
}

/* ===== Featured Topics Sticky Bar ===== */
.featured-topics.sticky-top {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
  background: #fff;
  z-index: 1030;
}

/* Hiệu ứng xuất hiện cho featured-topics */
.featured-topics {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.featured-topics.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== List view ===== */
#latest-posts[data-view="list"] .post-item {
  display: block;
}
#latest-posts[data-view="list"] .post-card {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}
#latest-posts[data-view="list"] .post-card img {
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}
#latest-posts[data-view="list"] .post-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar.sticky-top {
  max-height: calc(100vh - 2rem); /* để không tràn màn hình */
  overflow-y: auto;               /* cuộn riêng nếu dài */
}

/* ===== Scrollspy active link ===== */
#sidebar-nav .nav-link {
  color: #555;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}
#sidebar-nav .nav-link.active {
  font-weight: 600;
  color: #0d6efd;
}
#sidebar-nav .nav-link:hover {
  color: #0a58ca;
}

/* Search suggestions dropdown */
#search-suggestions {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem; /* match bootstrap rounded */
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#search-suggestions .list-group-item {
  cursor: pointer;
}

#search-suggestions .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Hiệu ứng mở dropdown mềm mại */
.navbar .dropdown-menu {
  margin-top: 0.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);

  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
  z-index: 1050; /* cao hơn sidebar/card */
}

.navbar .dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
}
