/* ========================================
   Blog Listing (blog.html)
   Page-specific styles for the blog listing page
   ======================================== */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.blog-hero {
  background: #212A3A; /* Fallback */
  background: -webkit-linear-gradient(315deg, #212A3A 0%, #1a2230 100%);
  background: -moz-linear-gradient(315deg, #212A3A 0%, #1a2230 100%);
  background: -o-linear-gradient(315deg, #212A3A 0%, #1a2230 100%);
  background: linear-gradient(135deg, #212A3A 0%, #1a2230 100%);
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.blog-hero::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="rgba(255,255,255,0.03)" x="0" y="0" width="100" height="100"/></svg>') repeat;
  opacity: 0.5;
}

/* Card Structure */
.blog-card {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  height: 100%;
  background: white;
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.blog-card:hover {
  -webkit-transform: translateY(-5px);
  -moz-transform: translateY(-5px);
  -ms-transform: translateY(-5px);
  -o-transform: translateY(-5px);
  transform: translateY(-5px);
  -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Image */
.blog-card .card-img-top {
  height: 240px;
  -o-object-fit: cover;
  object-fit: cover;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Object-fit fallback for older browsers */
@supports not (object-fit: cover) {
  .blog-card .card-img-top {
    width: 100%;
    height: 240px;
  }
}

/* Card Body Layout */
.blog-card .card-body {
  padding: 1.5rem;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -moz-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

/* Category Badge */
.blog-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  background: rgba(101, 113, 255, 0.1);
  color: #05A34A;
  color: var(--primary-color);
  height: 28px;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
}

/* Title */
.blog-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: #212A3A;
  color: var(--text-dark);
  min-height: 3.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Fallback for browsers that don't support -webkit-line-clamp */
@supports not (-webkit-line-clamp: 2) {
  .blog-card h3 {
    max-height: 3.5rem;
    overflow: hidden;
  }
}

/* Description */
.blog-card .text-secondary {
  color: #64748b;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  min-height: 3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@supports not (-webkit-line-clamp: 2) {
  .blog-card .text-secondary {
    max-height: 3rem;
    overflow: hidden;
  }
}

/* Meta Information */
.blog-meta {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-top: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #64748b;
  color: var(--text-light);
}

.blog-meta i {
  width: 14px;
  height: 14px;
  margin-right: 0.5rem;
}

.blog-meta span {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

/* Button */
.blog-card .btn {
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  margin-top: auto;
}

/* Featured Post */
.featured-post {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  margin-top: -100px;
  background: white;
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.featured-post img {
  height: 400px;
  -o-object-fit: cover;
  object-fit: cover;
}

@supports not (object-fit: cover) {
  .featured-post img {
    width: 100%;
    height: 400px;
  }
}

.featured-post-content {
  padding: 2rem;
  margin-top: 15%;
}

/* Search Bar */
.search-bar {
  max-width: 600px;
  margin: 0 auto 3rem;
  position: relative;
}

.search-bar input {
  padding-left: 3rem;
  padding-right: 3rem;
  height: 3.5rem;
  border-radius: 1.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  -webkit-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  color: #7987a1;
  color: var(--secondary-color);
}

/* Filters */
.blog-filters {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  gap: 1rem;
  margin-bottom: 5rem;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: white;
  color: #7987a1;
  color: var(--secondary-color);
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.filter-btn.active {
  background: #05A34A;
  background: var(--primary-color);
  color: white;
  border-color: #05A34A;
  border-color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .blog-card h3 {
    min-height: auto;
  }

  .blog-card .text-secondary {
    min-height: auto;
  }
}

.btn-clear-search {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  color: #7987a1;
  color: var(--secondary-color);
  padding: 0.5rem;
}

.btn-clear-search:hover {
  color: #212A3A;
  color: var(--text-dark);
}

/* Animation for search results */
.blog-card {
  -webkit-transition: opacity 0.3s ease, -webkit-transform 0.3s ease;
  -moz-transition: opacity 0.3s ease, -moz-transform 0.3s ease;
  -o-transition: opacity 0.3s ease, -o-transform 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.blog-card.hidden {
  opacity: 0;
  -webkit-transform: translateY(20px);
  -moz-transform: translateY(20px);
  -ms-transform: translateY(20px);
  -o-transform: translateY(20px);
  transform: translateY(20px);
}

#no-results {
  -webkit-animation: fadeIn 0.3s ease;
  -moz-animation: fadeIn 0.3s ease;
  -o-animation: fadeIn 0.3s ease;
  animation: fadeIn 0.3s ease;
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(20px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@-moz-keyframes fadeIn {
  from {
    opacity: 0;
    -moz-transform: translateY(20px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    -moz-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(20px);
    -moz-transform: translateY(20px);
    -ms-transform: translateY(20px);
    -o-transform: translateY(20px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
  }
}

/* IE11 specific fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .blog-hero {
    background: #212A3A;
  }

  /* Disable transitions in IE11 */
  .blog-card,
  .filter-btn {
    transition: none;
  }

  /* Fix flexbox in IE11 */
  .blog-card {
    display: block;
  }

  .blog-card .card-body {
    display: block;
  }
}

/* Pagination Styles */
.pagination-container {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding: 1rem 0;
}

.pagination-btn {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -moz-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #64748b;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pagination-btn:hover {
  border-color: #05A34A;
  color: #05A34A;
  background: rgba(101, 113, 255, 0.05);
}

.pagination-btn.active {
  background: #05A34A;
  border-color: #05A34A;
  color: white;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-btn svg {
  width: 18px;
  height: 18px;
}

.pagination-info {
  color: #64748b;
  font-size: 0.875rem;
  margin: 0 1rem;
}

@media (max-width: 576px) {
  .pagination-container {
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
    -webkit-order: -1;
    -ms-flex-order: -1;
    order: -1;
  }
}

/* Hide blog cards not on current page */
.blog-card-wrapper.pagination-hidden {
  display: none !important;
}
