@import url('tentang-jl-base.css');

/* =========================================================
   GALERI PAGE - Premium Compact UI
   ========================================================= */
body.galeri-page {
  background: #f8fafc;
  padding: 30px 15px;
  font-family: var(--font-utama);
  color: #1e293b;
}

/* Header */
.gallery-header {
  text-align: center;
  margin-bottom: 24px;
}
.gallery-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.gallery-header p {
  color: #64748b;
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Tombol filter */
.btn-filter-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-filter-group button {
  border-radius: 50px;
  padding: 8px 20px;
  border: 1px solid rgba(0, 74, 173, 0.1);
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.btn-filter-group button.active,
.btn-filter-group button:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 15px rgba(0, 74, 173, 0.25);
  transform: translateY(-2px);
}

/* === Galeri === */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  justify-items: center;
}

.gallery-item {
  width: 100%;
}

.gallery-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px -5px rgba(0, 74, 173, 0.08);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

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

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

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

/* Overlay & Info Info */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 1; /* Always show minimal info on compact layout */
}

.gallery-info {
  text-align: left;
}

.gallery-info h5 {
  color: #ffffff;
  text-transform: uppercase;
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gallery-info p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-size: 0.8rem;
}

.zoom-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.gallery-card:hover .zoom-icon {
  opacity: 1;
  transform: scale(1);
}

/* === Modal === */
.custom-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.custom-modal.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.custom-modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 15px;
  max-width: 800px;
  width: 92%;
  position: relative;
  text-align: center;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  right: 15px;
  top: 12px;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.25s ease;
  z-index: 10;
}

.modal-close:hover {
  color: var(--danger);
}

.fullscreen-btn {
  position: absolute;
  left: 15px;
  top: 12px;
  background: #f1f5f9;
  color: var(--primary);
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.25s ease;
  z-index: 10;
}

.fullscreen-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
}

.modal-title {
  margin: 0;
  font-size: 1rem;
  color: #1e293b;
  font-weight: 800;
  text-transform: uppercase;
}

/* Gambar besar */
.modal-image-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #f8fafc;
  border-radius: 12px;
  padding: 4px;
}

.modal-img {
  max-width: 100%;
  max-height: 50vh;
  border-radius: 8px;
  user-select: none;
  transition: opacity 0.25s ease;
  display: block;
  opacity: 0;
}

.modal-img.show {
  opacity: 1;
}

.modal-desc {
  text-align: center;
  color: #475569;
  font-size: 0.9rem;
  padding: 4px 12px;
}

/* Thumbnail navigasi */
.thumbnail-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none; /* Hide scrollbar for neatness */
}

.thumbnail-nav::-webkit-scrollbar {
  display: none;
}

.thumbnail-nav button {
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.thumbnail-nav img {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.thumbnail-nav button.active img,
.thumbnail-nav button:hover img {
  opacity: 1;
  border-color: var(--primary);
  transform: scale(1.05);
}

/* Tombol kontrol */
.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 5px 0;
}

.controls button {
  border-radius: 50px;
  padding: 8px 18px;
  background: #f1f5f9;
  color: var(--primary);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.controls button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 74, 173, 0.2);
}

/* =========================================================
   RESPONSIVE (MOBILE OPTIMIZATIONS)
   ========================================================= */
@media (max-width: 576px) {
  body.galeri-page {
    padding: 20px 15px;
  }
  
  .gallery-header h1 {
    font-size: 1.4rem;
  }
  
  .gallery-container {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }
  
  .gallery-img {
    height: 140px;
  }
  
  .btn-filter-group {
    gap: 8px;
  }
  
  .btn-filter-group button {
    padding: 6px 14px;
    font-size: 0.75rem;
  }
  
  .custom-modal-content {
    padding: 12px;
  }
  
  .modal-img {
    max-height: 40vh;
  }
}
