/* Image Modal */
.modal {
  display: none; 
  position: fixed; 
  z-index: 3000; 
  padding-top: 50px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgb(0,0,0); 
  background-color: rgba(0,0,0,0.9); 
}

.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  object-fit: contain;
}

.modal-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

.modal-content, .modal-caption {  
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

.card img {
    cursor: pointer;
    transition: 0.3s;
}

.card img:hover {
    opacity: 0.7;
}

/* Text Modal Variant */
.text-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%; 
    max-width: 800px;
    border-radius: 10px;
    position: relative;
    color: #333;
    animation-name: zoom; /* reuse zoom */
    animation-duration: 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

body.high-contrast .text-modal-content {
    background-color: #000;
    border: 2px solid #fff;
    color: #fff;
}

.text-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.text-modal-close:hover,
.text-modal-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

body.high-contrast .text-modal-close:hover {
    color: #ff0;
}
