/* Slider Styles */
.slider-content {
  position: relative;
  width: 100%;
  max-width: 700px;
  min-height: 380px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background-color: #ffffff;
}
.slider-item {
  display: none;
  width: 100%;
  height: 100%;
  transition: opacity 0.7s, transform 0.7s;
  opacity: 0;
  transform: translateX(100%);
  position: absolute;
  background-color: rgb(255, 255, 255);
  left: 0;
  top: 0;
}
.slider-item.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
  z-index: 1;
  animation: slideIn 0.7s;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.slider-img-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 54%;
  overflow: hidden;
}
.slider-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slider-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.1) 100%);
  color: #fff;
  padding: 24px 20px 16px 20px;
  border-radius: 0 0 16px 16px;
}
.slider-caption a {
  font-size: 1.2em;
  margin: 0 0 8px 0;
  font-weight: 600;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-weight: bold;
  color: rgb(255, 255, 255);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.slider-caption p {
  margin: 0;
  font-size: 1em;
  font-weight: 500;
  color: #ffe;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* berita terkini */

.berita-terkini {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.berita-terkini h2 {
  font-size: 1.3rem;
  font-weight: bold;
  color: rgb(0, 0, 0);
  border-bottom: 2px solid rgb(41, 115, 188);
  font-family: "Poppins", sans-serif;
}

.berita-item {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: row;
  margin-top: 10px;
  gap: 10px;
}

.berita-item img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.berita-caption {
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.berita-caption a {
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  color: rgb(0, 0, 0);
}

.berita-caption .opt {
  color: rgb(41, 115, 188);
  font-size: 1.2rem;
}

/* Slider Berita Trending */

.slider-horizontal {
  display: flex;
  width: 100%;
  gap: 18px;
  padding: 20px 0;
  flex-direction: column;
  background-color: rgb(239, 239, 239);
}

.slider-horizontal h1 {
  font-size: 1.5em;
  font-weight: bold;
  width: 150px;
  padding: 10px;
  color: rgb(255, 255, 255);
  margin-left: 20px;
  background-color: rgb(41, 115, 188);
  font-family: "Poppins", sans-serif;
}

.slider-tag {
  display: flex;
  flex-direction: row;
  gap: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  margin: 0 20px;
}

.berita-trending-item {
  border-radius: 12px;
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.701);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 390px;
  background-color: rgb(36, 36, 36);
}

.berita-trending-item:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

.berita-trending-item img {
  width: 100%;
  border-radius: 12px 12px 0 0;
  object-fit: cover;
  height: auto;
}

.berita-trending-item .berita-caption {
  padding: 12px 10px 14px 10px;
  text-align: left;
}

.berita-trending-item .berita-caption a.opt {
  color: rgb(33, 121, 192);
  font-weight: bold;
  font-size: 0.95em;
  margin-bottom: 4px;
  display: inline-block;
}

.berita-trending-item .berita-caption a {
  color: #ebebeb;
  font-size: 1em;
  text-decoration: none;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

.slider-tag::-webkit-scrollbar {
  display: none;
}

/* slide-bisnis */
.topic-section {
  width: 100%;
  max-width: 1200px;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
  border-bottom: 3px solid rgb(41, 115, 188); /* Red line similar to the image */
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: inline-block; /* To make the border only under the text */
}

.section-header h2 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 1.8em;
  color: #333;
  text-transform: uppercase;
}

.card-container {
  display: flex;
  gap: 20px;
  overflow-x: auto; /* Enable horizontal scrolling if cards exceed container width */
  padding-bottom: 10px; /* Space for scrollbar */
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.card-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.card {
  min-width: 300px; /* Minimum width for each card */
  flex: 1; /* Allow cards to grow and shrink */
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease-in-out;
  position: relative; /* For the "Kriminal" tag positioning */
}

.card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: auto; /* Fixed height for images */
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.card-content {
  padding: 15px;
}

.card-tag {
  background-color: rgb(33, 121, 192); /* Red tag */
  color: white;
  font-family: "Poppins", sans-serif;
  padding: 5px 10px;
  font-size: 0.8em;
  font-weight: bold;
  border-radius: 4px;
  position: absolute;
  top: 10px;
  left: 10px;
}

.card-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1em;
  font-weight: 700;
  color: #333;
  margin-top: 10px;
  line-height: 1.4;
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.card-link:hover .card-title {
  color: #007bff; /* Blue on hover */
}

@media (max-width: 500px) {
  .berita-trending-item {
    min-width: 75%;
  }
  .slider-content {
    max-width: 92%;
    min-height: 280px;
  }
  .slider-caption {
    padding: 24px 24px 32px 24px;
  }

  .slider-caption a {
    font-size: 1rem;
  }
  .slider-caption p {
    font-size: 0.9rem;
  }

  .slider-img-wrapper {
    height: 100px;
  }

  /* berita terkini */
  .berita-terkini {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
  }

  .berita-terkini h2 {
    font-size: 1rem;
  }

  .berita-item img {
    width: 133.3px;
    height: 100px;
  }

  .berita-caption a {
    font-size: 0.7rem;
  }

  .berita-caption .opt {
    font-size: 0.8rem;
  }

  /* slide-per-topic */

  .section-header {
    margin-left: 20px;
  }
  .card-container {
    margin-left: 20px;
  }
}
