/* footer.css */
.footer-links {
  margin-top: 40px;
  padding: clamp(15px, 3vw, 20px);
  background-color: #f5f5f5;
  border-radius: 8px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(15px, 3vw, 20px);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-link {
  text-align: center;
  padding: 15px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.footer-link:hover {
  transform: translateY(-3px);
}

.footer-link img {
  width: 100%;
  height: clamp(120px, 30vw, 200px);
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 10px;
  background-color: #f8f9fa;
}

.footer-link span {
  display: block;
  color: var(--secondary-color);
  font-weight: bold;
  margin-top: 8px;
  font-size: clamp(14px, 2vw, 16px);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  width: min(90vw, 1200px);
  height: min(90vh, 800px);
}

.modal-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  padding: 8px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  transition: opacity 0.2s ease;
}

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

/* Handle landscape mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .modal-content {
    height: min(80vh, 600px);
  }
  
  .footer-link img {
    height: clamp(100px, 25vw, 150px);
  }
}

/* Handle very wide screens */
@media screen and (min-width: 1600px) {
  .footer-links-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Handle smaller screens */
@media (max-width: 768px) {
  .footer-links-grid {
    gap: clamp(10px, 2vw, 15px);
  }

  .footer-link {
    padding: 10px;
  }
}

/* Handle very small screens */
@media (max-width: 480px) {
  .footer-links {
    padding: 10px;
  }

  .footer-link img {
    height: clamp(100px, 25vw, 150px);
  }
}

/* Modal caption styling */
#modalCaption {
  color: #1e90ff; /* Blue color for the caption */
  text-align: center;
  margin-bottom: 25px;
  padding: 0 20px;
  font-size: clamp(16px, 2.5vw, 20px);
  max-width: 100%;
  overflow-wrap: break-word;
  position: absolute;
  top: -60px;
  left: 0;
  width: calc(100% - 50px); /* Leave space for close button */
}

/* Adjust modal content to accommodate the caption */
.modal-content {
  position: relative;
  width: min(90vw, 1200px);
  height: min(90vh, 800px);
  margin-top: 60px; /* Add space for the caption */
}

/* Handle touch interactions for mobile devices */
.modal-content img {
  touch-action: pan-y pinch-zoom;
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
  #modalCaption {
    font-size: clamp(14px, 2vw, 16px);
    top: -50px;
  }
  
  .modal-content {
    margin-top: 50px;
  }
  
  .close-modal {
    top: -45px;
    font-size: 26px;
  }
}

/* Adjustments for very small screens */
@media (max-width: 480px) {
  #modalCaption {
    font-size: 14px;
    top: -45px;
  }
  
  .close-modal {
    top: -40px;
    font-size: 24px;
  }
  
  .modal-content {
    margin-top: 40px;
  }
}