/* News Posts 2 Column Layout with Pagination */
.custom-news-slider {
  position: relative;
  padding: 20px 0;
  box-sizing: border-box;
}

.custom-news-slider * {
  box-sizing: border-box;
}

/* Main Grid Layout */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  align-items: start;
}

/* Featured Post Column (Left) */
.featured-post-column {
  position: relative;
  min-width: 0; /* Allow grid item to shrink */
  overflow: hidden; /* Prevent content overflow */
}

.featured-post {
  position: relative;
}

.featured-post .post-thumbnail {
  position: relative;
  overflow: hidden;
}

.featured-post .post-thumbnail img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-post .post-content {
  padding: 25px 0;
}

.featured-post .post-title {
  margin-bottom: 15px;
}

.featured-post .post-title a {
  font-size: 1em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-color);
  text-decoration: none;
  display: block;
}

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

/* News Posts Column (Right) */
.news-posts-column {
  position: relative;
  min-width: 0; /* Allow grid item to shrink */
  overflow: hidden; /* Prevent content overflow */
}

.posts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* News Pagination */
.news-pagination {
  margin-top: 24px;
  text-align: center;
}

.pagination-numbers {
  display: inline-flex;
  align-items: center;
}

.news-pagination .page-btn {
  background: #fff !important;
  border: 1px solid #e5e5e5 !important;
  color: #374151 !important;
  padding: 0 !important;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
}

.news-pagination .page-btn:first-child {
  border-top-left-radius: 6px !important;
  border-bottom-left-radius: 6px !important;
}

.news-pagination .page-btn:last-child {
  border-top-right-radius: 6px !important;
  border-bottom-right-radius: 6px !important;
}

.news-pagination .page-btn:not(:first-child) {
  border-left: none !important;
}

.news-pagination .page-btn:hover:not(.active) {
  background: #f9fafb !important;
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  z-index: 1;
  position: relative;
}

.news-pagination .page-btn.active {
  background: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
  z-index: 2;
  position: relative;
}

.loading-indicator {
  color: var(--primary-color);
  font-size: 13px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Override any external CSS that might conflict */
.custom-news-slider .news-pagination .page-btn {
  background: #fff;
  border: 1px solid #e5e5e5;
  color: #374151;
  margin: 0px;
}

.custom-news-slider .news-pagination .page-btn:hover:not(.active) {
  background: #f9fafb !important;
  color: var(--primary-color) !important;
  border: 1px solid var(--primary-color) !important;
}

/* Horizontal Post Layout */
.horizontal-post {
  display: grid;
  grid-template-columns: 180px 1fr; /* Reduced from 240px to fit better */
  gap: 12px;
  align-items: start;
  overflow: hidden;
  transition: all 0.3s ease;
  height: auto;
  min-width: 0; /* Allow grid item to shrink */
}

.horizontal-post .post-thumbnail {
  position: relative;
  overflow: hidden;
  width: 180px; /* Reduced from 240px */
  height: 120px; /* Reduced from 160px */
  flex-shrink: 0; /* Prevent thumbnail from shrinking */
}

.horizontal-post .post-thumbnail img {
  width: 100%;
  height: 120px; /* Match thumbnail height */
  object-fit: cover;
  transition: transform 0.3s ease;
}

.horizontal-post .post-content {
  padding: 8px 10px 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0; /* Allow content to shrink and wrap text */
}

.horizontal-post .post-date {
  font-size: 0.8em;
  margin-bottom: 8px;
}

.horizontal-post .post-title {
  margin-bottom: 8px;
  flex: 1;
}

.horizontal-post .post-title a {
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.horizontal-post .post-excerpt {
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

.post-thumbnail {
  position: relative;
  overflow: hidden;
}

.slider-post-column .post-thumbnail img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85em;
  color: #666;
  margin-bottom: 12px;
}

.post-date i {
  color: var(--primary-color);
}

.post-title {
  margin-bottom: 12px;
  flex: 1;
}

.post-title a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1em;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.post-excerpt {
  color: #666;
  font-size: 0.85em;
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85em;
  transition: all 0.3s ease;
  margin-top: auto;
}

.read-more:hover {
  color: #651014;
  gap: 8px;
}

.read-more i {
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

.read-more:hover i {
  transform: translateX(3px);
}

/* Skeleton Loading */
.posts-container.loading .horizontal-post {
  display: none;
}

.posts-container.loading {
  pointer-events: none;
}

.skeleton-posts {
  display: none;
}

.posts-container.loading .skeleton-posts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-post {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: start;
}

.skeleton-thumbnail {
  width: 180px;
  height: 120px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 8px 0;
}

.skeleton-date {
  width: 80px;
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-title {
  width: 100%;
  height: 16px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  margin-bottom: 4px;
}

.skeleton-title:last-of-type {
  width: 70%;
}

.skeleton-excerpt {
  width: 90%;
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  margin-bottom: 2px;
}

.skeleton-excerpt:last-of-type {
  width: 60%;
}

@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

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

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

/* No Posts Message */
.no-posts-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-posts-message p {
  font-size: 1.1em;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .news-grid {
    gap: 25px;
  }

  .featured-post .post-thumbnail img {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .featured-post .post-thumbnail img {
    height: 250px;
  }

  .horizontal-post {
    grid-template-columns: 180px 1fr;
    gap: 12px;
  }

  .horizontal-post .post-thumbnail {
    width: 180px;
    height: 120px;
  }

  .horizontal-post .post-thumbnail img {
    height: 120px;
  }

  .horizontal-post .post-content {
    padding: 10px 10px 10px 0;
  }

  .slide-group {
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .featured-post .post-content {
    padding: 20px 0;
  }

  .featured-post .post-title a {
    font-size: 1.3em;
  }

  .page-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .skeleton-post {
    grid-template-columns: 180px 1fr;
  }

  .skeleton-thumbnail {
    width: 180px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .custom-news-slider {
    padding: 15px 0;
  }

  .news-grid {
    gap: 20px;
  }

  .featured-post .post-thumbnail img {
    height: 200px;
  }

  .horizontal-post {
    grid-template-columns: 140px 1fr;
    gap: 10px;
  }

  .horizontal-post .post-thumbnail {
    width: 140px;
    height: 100px;
  }

  .horizontal-post .post-thumbnail img {
    height: 100px;
  }

  .horizontal-post .post-content {
    padding: 8px 8px 8px 0;
  }

  .horizontal-post .post-title a {
    font-size: 0.85em;
  }

  .horizontal-post .post-excerpt {
    font-size: 0.75em;
    -webkit-line-clamp: 1;
  }

  .slide-group {
    gap: 10px;
  }

  .skeleton-post {
    grid-template-columns: 140px 1fr;
  }

  .skeleton-thumbnail {
    width: 140px;
    height: 100px;
  }
}
