:root {
  --primary: #56595a;
  --primary-hover: #00599d;
  --background: #f9fafb;
  --card-bg: #ffffff;
  --text-color: #242424;
  --muted-text: #32415f;
  --border-radius: 25px;
  --transition: all 0.3s ease;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --badge-bg: #e0e7ff;
  --badge-hover: #c7d2fe;
  --icon-bg: #f3f4f6;
}

body {
  background: var(--background);
  color: var(--text-color);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
}

/* Ad block */
.ad-block {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: var(--transition);
}

/* Badge Styling */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  background-color: #d7d7d7;
  color: var(--text-color);
  border-radius: var(--border-radius);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.badge:hover {
  background-color: var(--primary-hover);
  color: #47afff;
}

.badge-latest-on-image {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #ff7b00, #fbab00);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 0.25em 0.5em;
  box-shadow: 0 0 3px #f9d42388; /* subtle shadow only */
  cursor: default;
  z-index: 10;
  user-select: none;
  gap: 0.35em;
  width: 32px;            /* start small - just icon */
  height: 32px;
  overflow: hidden;
  transition:
    width 0.35s ease,
    box-shadow 0.35s ease;
}

.badge-latest-on-image i {
  color: #fff;
  font-size: 18px;
  filter: drop-shadow(0 0 1.5px #fff);
  flex-shrink: 0;
  transition: filter 0.35s ease;
}

/* Text hidden by default */
.latest-text {
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  margin-left: 0;
  transition:
    opacity 0.35s ease,
    margin-left 0.35s ease;
  pointer-events: none;
  user-select: none;
}

/* On hover: expand width, show text */
.badge-latest-on-image:hover {
  width: 110px; /* enough for text */
  box-shadow: 0 0 5px #f9d423cc; /* keep subtle shadow */
}

.badge-latest-on-image:hover i {
  filter: drop-shadow(0 0 2px #fff);
}

.badge-latest-on-image:hover .latest-text {
  opacity: 1;
  margin-left: 0.5em;
}

.card,
.blog-card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  background: var(--card-bg);
  overflow: hidden;
}

.blog-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.card-title a {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
}

.card-title a:hover {
  color: var(--primary-hover);
}

.card-text {
  color: var(--muted-text);
  margin-bottom: 1rem;
}

/* Blog Image Styling */
.blog-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  transition: transform 0.3s ease;
}

.blog-card:hover img {
  transform: scale(1.03);
}

.btn-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.btn-custom:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
}

.pagination-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  gap: 1rem;
}

/* ✨ Minimal sticky independent scroll category styling */
.category-wrapper {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.category-list .list-group-item {
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-radius: var(--border-radius);
  margin-bottom: 0.2rem;
  transition: var(--transition);
  color: var(--text-color);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
}

.category-list .list-group-item:nth-child(n) {
  animation-delay: calc(0.03s * var(--i));
}

.category-list .list-group-item a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-icon {
  width: 28px;
  height: 28px;
  background: var(--icon-bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--primary);
  flex-shrink: 0;
}

.category-list .list-group-item:hover {
  background-color: #eef2ff;
  color: var(--primary);
}

.category-list .badge {
  background: var(--badge-bg);
  color: var(--primary);
  font-weight: 500;
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  transition: var(--transition);
  min-width: 28px;
  text-align: center;
}

.category-list .badge:hover {
  background: var(--badge-hover);
  color: #38434b;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .blog-card img {
    height: 180px;
  }
}

/* Published Date Styling */
.card-body small.text-muted {
  margin-bottom: 0.8rem;
  display: block;
  font-size: 0.85rem;
  color: var(--muted-text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-align: center;
  gap: 0.5rem;
}

/* Primary button - matte glass with hover glow and movement */
.btn-custom {
  background: #1e92e5;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: var(--shadow-light);
  width: auto;
}

.btn-custom::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0)
  );
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition);
}

.btn-custom:hover {
  background: linear-gradient(
    45deg,
    rgba(74, 198, 255, 0.834),
    rgba(30, 193, 234, 0.862)
  );
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(48, 130, 197, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Optional: focus state */
.btn-custom:focus {
  outline: 2px solid var(--primary-hover);
  outline-offset: 3px;
}

/* Outline variant */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(48, 130, 197, 0.15);
}

.emoji {
  font-size: 30px;
}
