/* Hero Section */
.blog-hero {
  background-size: cover;
  background-position: center;
  padding: 100px 0;
  padding-top: 160px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.blog-hero h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.blog-hero p {
  font-size: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.blog-section {
  padding: 60px 0;
}

.blog-filters {
  margin-bottom: 40px;
}

.filter-btn {
  background: none;
  border: 1px solid #014AB9;
  color: #014AB9;
  padding: 8px 18px;
  margin: 0 6px 10px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: #014AB9;
  color: white;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  transition: 0.3s ease;
}

.card {
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img-top {
  height: 220px;
  width: 100%;
  object-fit: cover;
}

.card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: #014AB9;
}

.text-muted {
  font-size: 13px;
  color: #777;
}

.card-text {
  color: #444;
  font-size: 15px;
  margin-bottom: 15px;
}

.text-theme {
  color: #014AB9 !important;
}

.btn-outline-theme {
  border: 1px solid #014AB9;
  color: #014AB9;
  border-radius: 30px;
  padding: 6px 18px;
  font-weight: 500;
  transition: 0.3s;
  text-align: center;
}

.btn-outline-theme:hover {
  background: #014AB9;
  color: white;
}

/* Tag Styling */
.card-body .tag {
  display: inline-block;
  text-decoration: none;
  background-color: #e6f0ff;
  color: #014AB9;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.card-body .tag a {
  text-decoration: none;
}

/* Filters */
.blog-filters .filter-btn {
  background: none;
  border: 1px solid #014AB9;
  color: #014AB9;
  padding: 8px 18px;
  margin: 0 6px 10px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.3s ease;
}

.blog-filters .filter-btn.active,
.blog-filters .filter-btn:hover {
  background: #014AB9;
  color: white;
}

/* Pagination */
.pagination-wrapper .page-numbers {
  display: inline-block;
  margin: 0 6px;
  padding: 8px 16px;
  border-radius: 30px;
  background: #014AB9;
  color: white;
  text-decoration: none;
}

.pagination-wrapper .current {
  background: #021f52;
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  .card-title {
    font-size: 18px;
  }
  .card-text {
    font-size: 14px;
  }
  .card-img-top {
    height: 180px;
  }
}

.blog-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: flex-start;
}

.blog-card {
  flex: 1 1 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: 0.3s ease;
}

.blog-flex .blog-card {
  order: 0;
}

.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.card-img-top {
  height: 220px;
  object-fit: cover;
  width: 100%;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: #014AB9;
}

.card-text {
  font-size: 15px;
  flex-grow: 1;
  margin-bottom: 15px;
}

.btn-outline-theme {
  align-self: flex-start;
  text-decoration: none;
}

.blog-flex::before,
.blog-flex::after {
  content: "";
  flex: 1 1 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
  visibility: hidden;
  order: 99; /* push to the end */
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .blog-card {
    flex: 1 1 calc(50% - 15px);
    max-width: calc(50% - 15px);
  }

  .blog-flex::after,
  .blog-flex::before {
    flex: 1 1 calc(50% - 15px);
    max-width: calc(50% - 15px);
  }
}

@media (max-width: 576px) {
  .blog-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .blog-flex::after,
  .blog-flex::before {
    display: none;
  }
}
