.pg-grid-slot img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.pg-grid-slot img:hover { 
  opacity: 0.85; 
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pg-grid-slot {
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px rgb(76 73 73);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px inset #00000021;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  float: left;
}

.pg-grid-instance {
  display: flex;
  flex-direction: column;         /* Stack grid & nav vertically */
  align-items: center;            
  justify-content: center;
  padding: 1rem;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}
  
.pg-grid-display {
  display: grid;
  gap: 2rem;
  justify-content: center;        
  align-items: center;           
  box-sizing: border-box;
}
  
/* Navigation Box — inside the instance but centered */
.pg-grid-nav-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  padding-top: 25px;
}
  
/* Navigation Buttons */
.pg-grid-nav-button {
  background-color: #fff;
  border: 2px solid #999;
  border-radius: 50%;
  font-size: 1.2rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
  
.pg-grid-nav-button:hover {
  background-color: #eee;
  border-color: #333;
  transform: scale(1.1);
}

.pg-modal {
  display: none;
  position: fixed;
  z-index: 9999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
}

.pg-modal-button {
  position: absolute;
  top: 60px;
  right: 60px;
  width: 40px;
  height: 40px;
  font-size: 28px;
  font-weight: bold;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.pg-modal-button:hover {
  color: #f00;
  transform: scale(1.2);
}
  
.pg-modal-content {
  z-index: 9999999;
  max-width: 30vw;
  max-height: 60vh;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s ease;
  animation: fadeIn 0.5s ease;
}

@media (max-width: 600px) {
  .pg-modal-content {
    max-width: 60vw;
    max-height: 60vw;
    object-fit: contain;
  }

  .pg-modal-button {
    width: 36px;
    height: 36px;
    font-size: 24px;
    top: 45px;
    right: 45px;
  }
}

@media (max-width: 768px) {
  .pg-modal-content {
    max-width: 80vw;
    object-fit: contain;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}