.c-modal {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 0s linear 200ms;

  max-height: 100%;
  overflow: auto;

  display: grid;
  box-sizing: border-box;
  grid-template-areas:
    "top-start top top-end"
    "center-start center center-end"
    "bottom-start bottom-center bottom-end";
  grid-template-rows: minmax(min-content, auto) minmax(min-content, auto) minmax(
      min-content,
      auto
    );
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.c-modal.show {
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease;
}

.c-modal-bg {
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: #00000091;
  opacity: 0.7;
  top: 0;
  left: 0;
  z-index: 10;
}

.c-modal-box {
  width: 95%;
  max-width: 90vw;
  max-height: 90vh;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 3px 1px var(--spacing-md) var(--color-gray);
  display: flex;
  flex-direction: column;
  z-index: 20;

  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
}

.c-modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 16px 0;
}

.c-modal-close-button {
  display: flex;
  cursor: pointer;
}

.c-modal-close-button svg {
  width: 20px;
  height: 20px;
  display: block;
}

.c-modal-content {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: white;
  border-radius: 8px;
}

.c-modal-content img {
  max-width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
}

@media (max-width: 768px) {
  .c-modal-content {
    padding: 16px;
  }
}

.c-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}

.c-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
