/* Custom Blog Styles */

/* Latest Posts - Title truncate with ellipsis and tooltip */
.sidebar__post-content h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: 2.8em;
  /* 2 lines * 1.4 line-height */
}

.sidebar__post-content h3 a {
  display: block;
  cursor: pointer;
}

/* Temporarily comment out sidebar post list padding */
/* .sidebar__post-list li {
  padding: 20px 0;
} */

/* No results message */
.blog-no-results {
  text-align: center;
  padding: 60px 20px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 40px;
}

.blog-no-results__icon {
  font-size: 64px;
  color: #ddd;
  margin-bottom: 20px;
}

.blog-no-results__title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.blog-no-results__text {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
}

.blog-no-results__button {
  display: inline-block;
  padding: 12px 30px;
  background: #856dfc;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.blog-no-results__button:hover {
  background: #6b4fd9;
  color: #fff;
  transform: translateY(-2px);
}

/* Hide Latest Posts and Comments sections on blog listing page */
.blog-sidebar .sidebar__post {
  display: none;
}

.blog-sidebar .sidebar__comments {
  display: none;
}

/* Limit image size in blog detail content */
.blog-details__text-1 img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 4px;
}

/* If image is too large, limit max height */
.blog-details__text-1 img[style*="width"] {
  max-height: 600px;
  width: auto !important;
  max-width: 100%;
}


/* Blog Popup Styles */
.blog-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.blog-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.blog-popup-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border-radius: 8px;
  padding: 30px;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.blog-popup-overlay.active .blog-popup-content {
  transform: translateY(0);
}

.blog-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f7f7f9;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  color: #777181;
  transition: all 0.3s ease;
  z-index: 10;
}

.blog-popup-close:hover {
  background: #856dfc;
  color: #fff;
}

.blog-popup-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.blog-popup-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #856dfc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.blog-popup-header {
  margin-bottom: 20px;
}

.blog-popup-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  font-size: 14px;
  color: #777181;
}

.blog-popup-meta i {
  margin-right: 5px;
  color: #856dfc;
}

.blog-popup-title {
  font-size: 28px;
  font-weight: 700;
  color: #1b1525;
  margin-bottom: 20px;
  line-height: 1.3;
}

.blog-popup-image {
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.blog-popup-image img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-popup-body {
  font-size: 16px;
  line-height: 1.8;
  color: #777181;
}

.blog-popup-body p {
  margin-bottom: 20px;
}

.blog-popup-body img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 8px;
}

.blog-popup-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e9e9ee;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .blog-popup-content {
    width: 95%;
    padding: 20px;
  }

  .blog-popup-title {
    font-size: 22px;
  }
}

/* Blog Slider Navigation Hover Effect */
.blog-one__carousel-outer {
  position: relative;
}

.blog-one__nav {
  opacity: 1;
  /* Keep opacity 1 but change color for better visibility */
  visibility: visible;
  transition: all 500ms ease;
}

/* Ensure buttons are positioned correctly if they are not by theme */
.blog-one__nav .swiper-button-prev,
.blog-one__nav .swiper-button-next {
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  z-index: 10;
  cursor: pointer;
  color: #777181;
  /* Default grey color */
  opacity: 0.4;
  /* Faded effect */
  transition: all 400ms ease;
}

.blog-one__carousel-outer:hover .blog-one__nav .swiper-button-prev,
.blog-one__carousel-outer:hover .blog-one__nav .swiper-button-next {
  color: #856dfc;
  /* Theme base color on hover */
  opacity: 1;
  /* Fully visible on hover */
}

.blog-one__nav .swiper-button-prev:after,
.blog-one__nav .swiper-button-next:after {
  /* content: none !important; */
  /* Let theme icons show if they are used via :after */
}

.blog-one__nav .swiper-button-prev {
  left: 10px;
}

.blog-one__nav .swiper-button-next {
  right: 10px;
}

@media (max-width: 1200px) {
  .blog-one__nav .swiper-button-prev {
    left: 0;
  }

  .blog-one__nav .swiper-button-next {
    right: 0;
  }
}