/*=================================================================*/
/*                      BLOG STYLES
/*=================================================================*/
.blog-item {
  overflow: hidden;
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
  /* Optimize: Only transition specific properties instead of 'all' */
  -webkit-transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  -moz-transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  /* Add will-change for smoother animations */
  will-change: transform, box-shadow;
  /* Updated modern gradient background */
  background: linear-gradient(145deg, #ffffff 0%, #f8f8fc 100%);
  display: flex;
  flex-direction: column;
  height: 100%;
  /* More modern rounded corners */
  border-radius: 20px;
  /* More subtle shadow with slight color */
  box-shadow: 0px 4px 15px rgba(69, 67, 96, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
  position: relative;
}
.blog-card-link:hover .blog-item {
  -webkit-transform: translateY(-8px);
  -ms-transform: translateY(-8px);
  transform: translateY(-8px);
  /* Enhanced hover shadow with slight color */
  box-shadow: 0px 12px 30px rgba(69, 67, 96, 0.08), 
              0px 4px 8px rgba(255, 76, 97, 0.05);
}

/* Remove will-change on hover to prevent memory issues */
.blog-card-link:hover .blog-item {
  will-change: auto;
}
.blog-item .thumb {
  position: relative;
  overflow: hidden;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  /* Add modern aspect ratio */
  aspect-ratio: 16/9;
}

/* Blog card link styling - make entire card clickable */
.blog-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  /* Prevent text selection on click */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  /* Optimize tap performance on mobile */
  -webkit-tap-highlight-color: transparent;
}

.blog-card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Add focus styles for accessibility */
.blog-card-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 20px;
}

.blog-card-link:focus:not(:focus-visible) {
  outline: none;
}

/* Improved overlay effect */
.blog-item .thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Modern gradient overlay */
    background: linear-gradient(180deg, 
                rgba(0,0,0,0) 50%, 
                rgba(0,0,0,0.5) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    pointer-events: none; /* Ensure overlay doesn't block clicks */
}
.blog-card-link:hover .thumb::after {
    opacity: 1;
}
.blog-item .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Better image scaling */
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
  /* Optimize: Only transition transform and filter */
  -webkit-transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.3s ease;
  -moz-transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.3s ease;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.3s ease;
  /* Prepare for transform changes */
  will-change: transform;
}
.blog-card-link:hover .thumb img {
  -webkit-transform: scale(1.08);
  -ms-transform: scale(1.08);
  transform: scale(1.08);
  filter: brightness(1.03); /* Subtle brightness increase */
}

.blog-item .details {
  padding: 24px 28px 28px 28px; /* More generous padding */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-item .details h4.title {
  font-size: 20px; /* Slightly larger title */
  line-height: 1.5;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 14px;
  /* Added text overflow for long titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 3em;
}
.blog-item .details h4.title {
  color: #353353;
  transition: color 0.3s ease;
}

.blog-card-link:hover .blog-item .details h4.title {
  color: var(--color-primary);
}

/* Updated Blog Item Styles */
.blog-date {
  font-size: 12px;
  color: #8b88b1;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  /* Add modern badge style for date */
  display: inline-block;
  padding: 4px 0;
  position: relative;
}
/* Add subtle decorative element */
.blog-date:before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  background-color: var(--color-primary);
  opacity: 0.5;
  transition: width 0.3s ease;
}
.blog-card-link:hover .blog-date:before {
  width: 60px;
}

.blog-excerpt {
  font-size: 15px;
  color: #5e5c7f;
  margin-bottom: 25px;
  line-height: 1.7;
  opacity: 0.9;
  /* Better excerpt display */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: calc(1.7em * 3);
  flex-grow: 1;
  transition: all 0.3s ease;
}
.blog-card-link:hover .blog-excerpt {
  transform: translateY(-2px);
  opacity: 1;
}

.blog-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.05); /* More subtle divider */
  margin-top: auto;
}

.author-name {
  font-size: 13px;
  color: #8b88b1;
  font-weight: 500;
  /* Add author style */
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Optional: Add pseudo avatar */
.author-name:before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgba(255, 76, 97, 0.1);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff4c61"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  background-size: 60%;
  background-repeat: no-repeat;
  background-position: center;
}

.category-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  transition: all 0.3s ease;
  border-radius: 30px;
  background-color: #FF4C61;
  color: #fff;
  margin-bottom: 8px;
}
.blog-card-link:hover .category-badge {
  background-color: rgba(255, 76, 97, 1);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(255, 76, 97, 0.25);
}

/* Add reading time badge */
.blog-item .thumb .reading-time,
.blog-item .reading-time {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  opacity: 0.8;
}
.blog-card-link:hover .reading-time {
  opacity: 1;
  transform: translateY(-1px);
}

/* Dark Mode Adjustments */
body.dark .blog-item {
  background: linear-gradient(145deg, #353353 0%, #302f4e 100%);
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
}
body.dark .blog-card-link:hover .blog-item {
  box-shadow: 0px 12px 30px rgba(0, 0, 0, 0.3),
              0px 4px 8px rgba(255, 76, 97, 0.1);
}
body.dark .blog-item .details h4.title {
  color: #fff;
}
body.dark .blog-card-link:hover .blog-item .details h4.title {
  color: var(--color-primary);
}
body.dark .blog-date,
body.dark .blog-excerpt,
body.dark .author-name {
  color: #9c9ab3;
}
body.dark .blog-meta-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}
body.dark .category-badge {
  color: #fff;
  background-color: rgba(255, 76, 97, 0.8);
}
body.dark .blog-card-link:hover .category-badge {
  background-color: rgba(255, 76, 97, 1);
}
body.dark .reading-time {
  background-color: rgba(0, 0, 0, 0.7);
}

.blog-item .thumb .language-badge,
.blog-item .language-badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: absolute;
  bottom: 15px;
  left: 15px;
  border-radius: 30px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  z-index: 1;
}

.blog-card-link:hover .language-badge {
  transform: translateY(-2px);
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.blog-post-header .meta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.blog-post-header .meta .separator {
  margin: 0 8px;
  opacity: 0.5;
}

.blog-post-header .meta .category,
.blog-post-header .meta .language {
  font-weight: 500;
}

.blog-post-header .meta .language {
  color: var(--color-primary);
}
