/* News Section */
.news-section {
  padding: 40px 20px;
  background: #6c6580;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  min-height: 460px !important;     /* adjust to your taste (360 card + paddings) */
  margin: 2rem auto;
  max-width: 1100px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

/* News Header - Title Only */
.news-header {
  margin-bottom: 30px;
  text-align: center;
}

.news-title {
  margin: 0;
  font-size: 24px;
  text-transform: uppercase;
}

.news-title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-title a:hover {
  color: #e0e0e0;
  text-decoration: underline;
}

/* News Slider Wrapper with Side Navigation */
.news-slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

/* Side Navigation Buttons */
.news-nav-left,
.news-nav-right {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  z-index: 10;
  pointer-events: auto !important;
}

.news-nav-btn {
  cursor: pointer !important;
  pointer-events: auto !important;
}

.news-nav-left:hover,
.news-nav-right:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.news-nav-left:active,
.news-nav-right:active {
  transform: scale(0.95);
}

/* Mobile-only layout: vertical stack of 3 images, arrows paginate triplets */
@media (max-width: 768px) {
  .news-slider-wrapper {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0 36px; /* space for arrows inside edges */
  }

  .news-grid {
    display: block;
  }

  .news-card {
    margin-bottom: 12px;
  }

  .news-card:last-child {
    margin-bottom: 0;
  }

  /* Hide titles/captions on mobile; image is full tap target */
  .news-card p { display: none; }

  /* Force 16:9, full width, cover */
  .news-card a,
  .news-card img {
    display: block;
    width: 100%;
  }

  .news-card img {
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
  }

  /* Arrows visible and vertically centered relative to the stack */
  .news-nav-left,
  .news-nav-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 48px;
    border-radius: 6px;
    pointer-events: auto;
  }

  .news-nav-left { left: 6px; }
  .news-nav-right { right: 6px; }
}

.news-nav-left:disabled,
.news-nav-right:disabled {
  opacity: 0.5;
  transform: none;
}

/* Override disabled cursor when buttons should be clickable */
.news-nav-left:not([data-really-disabled]),
.news-nav-right:not([data-really-disabled]) {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Old navigation styles - keep for backward compatibility but hide */
.news-navigation {
  display: none;
}

.news-nav-btn:not(.news-nav-left):not(.news-nav-right) {
  display: none;
}

.news-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important; /* exactly 3 in one row */
  gap: 20px !important;
  width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
}

/* News Cards */
.news-card {
  color: #333;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 320px !important;        /* uniform card height */
  width: auto !important;           /* let grid control width */
  display: flex !important;         /* vertical layout */
  flex-direction: column !important;
}

.news-card:hover {
  transform: translateY(-6px);
  /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); */
}

.news-card img {
  width: 100%;
  height: 180px !important;         /* fixed so total card height is predictable */
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.news-card:hover img {
  transform: scale(1.15);
}

.news-card p {
  padding: 15px;
  margin: 0;
  flex: 1 1 auto !important;        /* take remaining height under image */
  display: flex !important;
  align-items: center !important;    /* vertical center */
  justify-content: center !important;/* horizontal center */
  text-align: center !important;
  color: #333;
}

.news-card a {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  transition: color 0.3s ease;
}

.news-card a:hover {
  color: #FFFFFF;
}

/* ========================
   Responsive Design
   ======================== */

/* Tablet Styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .news-section {
    padding: 35px 18px;
  }
  
  .news-title {
    font-size: 22px;
  }
  
  .news-grid {
    width: calc(3 * 250px + 2 * 20px); /* 3 cards + gaps */
    gap: 20px;
  }
  
  .news-card {
    width: 250px;
    min-height: 260px;
  }
  
  .news-card img {
    height: 160px;
  }
  
  .news-card p {
    padding: 12px;
    font-size: 15px;
  }
  
  .news-slider-wrapper {
    gap: 25px;
  }
  
  .news-nav-left,
  .news-nav-right {
    width: 45px;
    height: 45px;
    font-size: 22px;
  }
}

/* Mobile Styles (max-width: 767px) */
@media (max-width: 767px) {
  .news-section {
    padding: 25px 12px;
  }
  
  .news-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .news-slider-wrapper {
    gap: 15px;
  }
  
  .news-grid {
    width: calc(2 * 220px + 1 * 15px); /* 2 cards + gap */
    gap: 15px;
  }
  
  .news-card {
    width: 220px;
    min-height: 240px;
  }
  
  .news-card img {
    height: 140px;
  }
  
  .news-card p {
    padding: 10px;
    font-size: 14px;
  }
  
  .news-nav-left,
  .news-nav-right {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

/* Small Mobile Styles (max-width: 480px) */
@media (max-width: 480px) {
  .news-section {
    padding: 20px 10px;
  }
  
  .news-title {
    font-size: 18px;
    margin-bottom: 15px;
  }
  
  .news-slider-wrapper {
    gap: 10px;
  }
  
  .news-grid {
    width: 200px; /* 1 card */
    gap: 10px;
  }
  
  .news-card {
    width: 200px;
    min-height: 220px;
  }
  
  .news-card img {
    height: 120px;
  }
  
  .news-card p {
    padding: 8px;
    font-size: 13px;
  }
  
  .news-nav-left,
  .news-nav-right {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}

/* Strong mobile override placed at end to beat earlier !important rules */
@media (max-width: 768px) {
  .news-slider-wrapper {
    display: block !important;
    padding: 0 36px !important;
  }

  .news-grid {
    display: block !important; /* vertical stack */
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Hide any extra pre-rendered items beyond two until JS paginates */
  .news-grid .news-card:nth-child(n+3) { display: none !important; }

  .news-card {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 0 12px 0 !important; /* vertical space between items */
    background: transparent !important;
  }

  .news-card:last-child { margin-bottom: 0 !important; }

  .news-card p { display: none !important; }

  .news-card a,
  .news-card img { width: 100% !important; display: block !important; }

  .news-card img {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 8px !important;
    transform: none !important;
  }

  .news-nav-left,
  .news-nav-right {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto;
    right: auto;
  }
  .news-nav-left { left: 6px !important; }
  .news-nav-right { right: 6px !important; }
}