.md-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 50%;
  max-width: 630px;
  min-width: 320px;
  height: auto;
  z-index: 2000;
  visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateX(-50%) translateY(-50%);
  -moz-transform: translateX(-50%) translateY(-50%);
  -ms-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
}

.md-show {
  visibility: visible;
}

.md-overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  visibility: hidden;
  top: 0;
  left: 0;
  z-index: 1000;
  opacity: 0;
  background: rgba(40,43,49,.8);
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}

.md-show ~ .md-overlay {
  opacity: 1;
  visibility: visible;
}

/* Content styles */
.md-content {
  color: #333;
  background: #fff;
}

/* Effect 1: Fade in and scale up */
.md-effect-1 .md-content {
  -webkit-transform: scale(0.7);
  -ms-transform: scale(0.7);
  transform: scale(0.7);
  opacity: 0;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}

.md-show.md-effect-1 .md-content {
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
  opacity: 1;
}

/* ===== MODAL POPUP AWAL ===== */
#modaltampil {
  width: 100vw;
  height: 100vh;
  background: rgba(12,12,12,.85);
  text-align: center;
  box-sizing: border-box;
  border: none;
  position: fixed;
  top: 0;
  left: 0;
  transform: none;
  display: none;
  z-index: 2000;
  overflow: hidden;
}

#modaltampil .modal-top #btntutup {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  z-index: 10;
}

#modaltampil .modal-top #btntutup:hover {
  color: white;
  text-shadow: 0 0 15px white;
}

#modaltampil .modal-isi {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 50px 20px 20px 20px;
  box-sizing: border-box;
}

/* Kunci utama: batasi lebar DAN tinggi gambar */
#modaltampil .modal-isi img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

#modaltampil .modal-isi iframe {
  width: 90%;
  max-width: 900px;
  height: 80vh;
  max-height: 80vh;
}