@charset "utf-8";

@import "global.css";

.modal-open-mobile {
  position: fixed !important;
  overflow: hidden !important;
  width: 100%;
  height: 100vh;
}

div.modal {
  display: none;
  position: fixed;
  z-index: var(--modal-z-index);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 0 20px;
  touch-action: none;
}

@media only screen and (min-width: 1280px) {
  div.modal {
    padding: 0;
  }
}

div.modal div.modal-content {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 85vh;
  margin: 10% auto;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: modalOpen 0.3s ease-in-out;
  background-color: #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
}

@media only screen and (min-width: 1280px) {
  div.modal div.modal-content {
    margin: 5% auto;
  }
}

@keyframes modalOpen {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

div.modal div.modal-content div.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  border-radius: 16px;
}

div.modal div.modal-content div.modal-header h2.modal-title {
  font-size: 12px;
  font-weight: bold;
  color: #222222;
}

@media only screen and (min-width: 1280px) {
  div.modal div.modal-content div.modal-header h2.modal-title {
    font-size: 24px;
  }
}

div.modal div.modal-content div.modal-header span.close-modal {
  color: #222222;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

@media only screen and (min-width: 1280px) {
  div.modal div.modal-content div.modal-header span.close-modal {
    font-size: 30px;
  }
}

div.modal div.modal-content div.modal-body {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  margin-top: 16px;
  border-radius: 16px;
  padding-bottom: 20px;
}

@media only screen and (min-width: 1280px) {
  div.modal div.modal-content div.modal-body {
    margin-top: 20px;
  }
}

div.modal div.modal-content div.modal-body div.detail {
  width: 100%;
  overflow-y: auto;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

div.modal div.modal-content div.modal-body div.detail img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-bottom: none;
  transition: padding 0.3s ease;
}

/* Add horizontal padding for images with small height-to-width ratio */
div.modal
  div.modal-content
  div.modal-body
  div.detail
  img[style*="aspect-ratio"] {
  padding: 0 15%;
  box-sizing: border-box;
}

/* For browsers that don't support aspect-ratio in style attribute */
@media (min-aspect-ratio: 4/1) {
  div.modal div.modal-content div.modal-body div.detail img {
    padding: 0 15%;
    box-sizing: border-box;
  }
}

@media only screen and (min-width: 768px) {
  div.modal div.modal-content div.modal-body div.detail {
    padding: 16px 0;
    gap: 20px;
  }
}
