/* style-gallery.css */

/* === BAGIAN PENCARIAN === */
.search-wrapper {
  max-width: 600px;
  margin: 0 auto 40px auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 15px 20px 15px 50px;
  border-radius: 50px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.15);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 1.1rem;
}

/* === BAGIAN HEADER BULAN/TAHUN === */
.section-badge {
  display: inline-block;
  background-color: #e7f1ff;
  color: #0d6efd;
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.month-section {
  margin-bottom: 40px;
  animation: fadeIn 0.5s ease-in-out;
}

.month-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.month-badge {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-line {
  flex-grow: 1;
  height: 2px;
  background-color: #e0e0e0;
  margin-left: 15px;
  border-radius: 2px;
}

/* === BAGIAN KARTU (CARD) UMUM === */
/* Digunakan untuk Materi & Visitasi */
.gallery-card {
  border: none;
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  overflow: hidden;
  height: 100%;
  text-decoration: none;
  display: block;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  padding-top: 75%; /* Aspect Ratio 4:3 */
  background-color: #f8f9fa;
}

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

.gallery-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-body {
  padding: 1.25rem;
  text-align: center;
}

.card-title {
  font-weight: 600;
  color: #333;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  /* Limit text 2 baris */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === BAGIAN DETAIL GALERI FOTO (Dr. Lubbi dll) === */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  background-color: #fff;
  color: #555;
  padding: 8px 16px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #eee;
  margin-bottom: 20px;
}

.btn-back:hover {
  background-color: #e9ecef;
  color: #333;
  transform: translateX(-3px);
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

.gallery-item {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  aspect-ratio: 4/3;
  background-color: #ddd;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.zoom-icon {
  color: white;
  font-size: 2rem;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Lightbox Modal */
.modal-fullscreen .modal-content {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.modal {
  /* Wajib lebih besar dari z-index navbar (9999) */
  z-index: 10000 !important;

  background-color: rgba(0, 0, 0, 0.9); /* Latar belakang gelap */
  backdrop-filter: blur(5px);
}

/* Pastikan elemen di dalamnya juga aman */
.modal-nav,
.close-modal {
  z-index: 10001 !important; /* Harus lebih tinggi dari modalnya sendiri */
}

.modal-img-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#modalImage {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 1060;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}
.prev {
  left: 20px;
}
.next {
  right: 20px;
}

.close-modal {
  position: fixed;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 35px;
  cursor: pointer;
  z-index: 1070;
  opacity: 0.8;
}

.close-modal:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .search-wrapper {
    width: 90%;
  }
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
@media (max-width: 480px) {
  .gallery-container {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
