/* Container and Slider Track */
.latest-news-section {
  padding: 40px 0;
  background-color: #cedef8; /* Optional: gives the section a soft background */
}

.ig-slider-wrapper {
  width: 100%;
  overflow: hidden;
}

.ig-slides {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* Hide scrollbar for a cleaner look */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.ig-slides::-webkit-scrollbar {
  display: none;
}

/* Individual Slide Widths (Mobile First) */
.ig-slide-item {
  flex: 0 0 100%; /* 1 post visible on mobile */
  scroll-snap-align: center;
  display: flex;
  justify-content: center;
}

/* Tablet */
@media (min-width: 768px) {
  .ig-slide-item {
    flex: 0 0 calc(50% - 10px); /* 2 posts visible */
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .ig-slide-item {
    flex: 0 0 calc(33.333% - 14px); /* 3 posts visible */
  }
}

/* Card Styling */
.ig-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.ig-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Force perfect square images for consistency */
.ig-image-link {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #eee;
}

.ig-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Prevents stretching */
}

/* Text Formatting */
.ig-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ig-caption {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.5;
  margin: 0 0 15px 0;
  flex-grow: 1;
}

.ig-timestamp {
  color: #888;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ig-empty-state {
  width: 100%;
  text-align: center;
  padding: 40px 20px;
}

/* Container to hold absolute positioned buttons */
.ig-carousel-container {
  position: relative;
  padding: 0 40px; /* Make room for the arrows */
}

/* Arrow Button Styling */
.ig-nav-btn {
  display: none; /* Hidden on mobile by default */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-nav-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.ig-prev {
  left: 0;
}

.ig-next {
  right: 0;
}

/* Show buttons on tablet and desktop */
@media (min-width: 768px) {
  .ig-nav-btn {
    display: flex;
  }
}

.ig-nav-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
