/**
 * @file
 * Latest News Section Styling.
 */

/* Latest News Section Container - Match Blog & Events width */
/* .latest-news-section {
  padding: 60px 0;
  background: #fff;
} */

/* Ensure container width matches Blog & Events section */
.latest-news-section .container {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* Section title style - Same as Video Gallery */
.latest-news-section.dt-section .section-header h2,
.latest-news-section .section-header h2,
.latest-news-section h2 {
  font-weight: 800 !important;
  font-size: 40px !important;
  line-height: 1.2 !important;
  color: #111 !important;
  text-align: center !important;
  margin: 0 0 18px !important;
}

/* News Carousel Container */
.latest-news-carousel-wrapper {
  position: relative;
  margin-bottom: 30px;
}

.news-slider-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
}

.news-items-wrapper {
  position: relative;
  overflow: hidden;
/*   min-height: 400px; */
}

/* Slide Groups - Each contains 4 items in one row */
.news-slide-group {
  display: none !important;
  width: 100%;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  position: relative;
}

.news-slide-group.active {
  display: block !important;
  opacity: 1;
}

/* News Row - Contains 4 items in one row */
.news-slide-group .news-row {
  margin-bottom: 0;
}

/* News Item - In a 4-column grid, single row - Text-only layout */
.news-item {
  padding: 15px;
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  transition: background 0.3s ease;
}

.news-item:hover {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

/* Row spacing for grid */
.news-slide-group .news-row.row.s-15 {
  margin: 0 -15px;
}

.news-slide-group .news-row.row.s-15 > div {
  padding: 0 15px;
}

/* News Image */
/* News Image - Displayed at top of each news item */
.news-item .news-image {
  margin-bottom: 15px;
  overflow: hidden;
  border-radius: 8px;
  height: 220px;
  position: relative;
  flex-shrink: 0;
  display: block;
  background: #f5f5f5;
}

.news-item .news-image a {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.news-item .news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.news-item .news-image:hover img {
  transform: scale(1.05);
}

/* News Content - Below image */
.news-item .news-content {
  padding: 0 5px;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.news-item .news-date {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
  display: block !important;
  visibility: visible !important;
  font-weight: 400;
  line-height: 1.4;
  opacity: 1 !important;
}

.news-item .news-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0;
  min-height: 48px; /* Ensure consistent height for titles */
  color: #1e1e2c;
}

.news-item .news-title a {
  color: #1e1e2c;
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
  line-height: 1.5;
}

.news-item .news-title a:hover {
  color: #007bff;
  text-decoration: underline;
}

.news-item .news-summary {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 10px;
}

/* Navigation Arrows */
.news-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-nav:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.1);
}

.news-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.news-nav.prev {
  left: -25px;
}

.news-nav.next {
  right: -25px;
}

.news-nav svg {
  width: 20px;
  height: 20px;
  stroke: #333;
}

.news-nav:hover svg {
  stroke: #007bff;
}

/* Pagination Dots */
.news-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagination-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.pagination-dot:hover {
  background: #bbb;
  transform: scale(1.2);
}

.pagination-dot.active {
  background: #007bff;
  width: 32px;
  border-radius: 16px;
  border-color: #007bff;
}

/* More Button */
.more-button-wrapper {
  text-align: center;
  margin-top: 40px;
}

.more-button-wrapper .btn {
  min-width: 150px;
}

html[dir="rtl"] .news-item .news-date {
  text-align:right;
}

.news-item .news-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-button-wrapper {
  display:flex;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .news-nav.prev {
    left: -15px;
  }
  
  .news-nav.next {
    right: -15px;
  }
  
  .news-nav {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 992px) {
  /* On tablets, show 2 items per row */
  .news-slide-group .col-lg-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 768px) {
  .latest-news-section {
    padding: 40px 0;
  }
  
  .latest-news-section .section-header .section-title {
    font-size: 28px;
  }
  
  .news-nav.prev,
  .news-nav.next {
    display: none;
  }
  
  /* On mobile, show 1 item per row */
  .news-slide-group .col-lg-3,
  .news-slide-group .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .news-item {
    padding: 0 10px;
    margin-bottom: 20px;
  }
  
  .news-items-wrapper {
    min-height: auto;
  }
  
  .news-item .news-image {
    height: 180px;
  }
  
  .news-item .news-title {
    font-size: 16px;
    min-height: auto;
  }
  
  .pagination-dot {
    width: 10px;
    height: 10px;
  }
  
  .pagination-dot.active {
    width: 24px;
    border-radius: 12px;
  }

  .news-row > div:not(:last-child) .news-item {
    padding-bottom: 5px;
  }
}

@media (max-width: 576px) {
  .latest-news-section .section-header .section-title {
    font-size: 24px;
  }
  
  .news-item .news-image {
    margin-bottom: 15px;
  }
  
  .news-item .news-content {
    padding: 0 5px;
  }
  
  .news-item .news-title {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .news-item .news-date {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .news-pagination {
    gap: 8px;
    margin-top: 20px;
  }
}