/* Carousel Styles */
.section-carousel {
  width: 100%;
  overflow: hidden;
  margin: 1rem 0 0 0; /* 1rem top margin on desktop */
  position: relative;
}

.section-title {
  text-align: left;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: bold;
  padding-left: 0.5rem;
}

.container-fluid {
  width: 100%;
  padding-right: 20px;
  padding-left: 20px;
  margin-right: auto;
  margin-left: auto;
}

.posts-carousel {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth easing */
  margin: 0 -15px;
  width: 100%;
  flex-wrap: nowrap;
}

.carousel-item {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  padding: 0 15px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
  height: auto;
  display: flex;
}

/* Navigation buttons with news card background color */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 80%;
  transform: translateY(-50%);
  background: #E8c0b9; /* Same as news cards */
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: #d12027; /* Red accent color on hover */
  color: white; /* White text for better contrast */
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev:active,
.carousel-next:active {
  transform: translateY(-50%) scale(0.95);
}

/* Post card styles */
.post-card.carousel {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.post-card.carousel:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Image sizing and positioning fixes */
.post-card.carousel .post-card__media {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  display: block;
}

.post-card.carousel .post-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.post-card.carousel:hover .post-card__img {
  transform: scale(1.1);
}

/* Adjust content spacing */
.post-card.carousel .post-card__content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Tag/category styling */
.post-card.carousel .post-card__tag {
  color: #db2323;
  font-size: 1.125rem;
  font-weight: bold;
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: text-decoration 0.2s ease;
}

.post-card.carousel .post-card__tag:hover {
  text-decoration: underline;
}

/* Make carousel responsive */
@media (max-width: 992px) {
  .carousel-item {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 576px) {
  .section-carousel {
    margin: 0.8rem 0 0 0; /* 0.8rem top margin on mobile */
  }
  
  .carousel-item {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Hide swipe hints on mobile */
  .swipe-hint {
    display: none !important;
  }
}

/* Loading indicator */
.loading-indicator {
  width: 100%;
  text-align: center;
  padding: 40px;
  font-style: italic;
  color: #666;
}
