/* =========================================
   MATERI VIEWER
========================================= */
.materi-viewer {
  min-height: 100vh;
  padding: 120px 10% 80px; /* top padding clears the fixed navbar */
  background: linear-gradient(135deg, #e89165, #4273ed);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.materi-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 40px;
  width: 1000px;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.materi-card h1 {
  font-size: 32px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 5px;
  margin-bottom: 30px;
}

.materi-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 30px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Image carousel: arrows on the left & right of the picture */
.materi-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

/* Spacing is handled by the flex row, so drop the image's own bottom margin */
.materi-gallery .materi-image {
  margin-bottom: 0;
  min-width: 0;
}

.gallery-arrow {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: #e91e63;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s;
}

.gallery-arrow:hover {
  background: #c2185b;
}

.gallery-counter {
  color: #555;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Thumbnail strip: one clickable preview per picture in the gallery */
.gallery-thumbs {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  overflow-x: auto;
  max-width: 100%;
  padding: 5px;
  margin: 15px auto 5px;
  scrollbar-width: thin;
}

/* Hidden for single-image galleries — the attribute needs an explicit rule
   because display: flex above would otherwise override it */
.gallery-thumbs[hidden] {
  display: none;
}

.gallery-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 62px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e5e5;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s, border-color 0.3s, transform 0.3s;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gallery-thumb:hover {
  opacity: 1;
}

/* The picture currently shown in the big viewer */
.gallery-thumb.active {
  border-color: #e91e63;
  opacity: 1;
  transform: translateY(-2px);
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 500px) {
  .materi-viewer {
    padding: 100px 5% 60px;
  }

  .materi-card {
    padding: 20px;
  }

  .materi-card h1 {
    font-size: 24px;
    letter-spacing: 3px;
  }

  .gallery-thumbs {
    gap: 8px;
  }

  .gallery-thumb {
    width: 64px;
    height: 48px;
  }
}
