.hahn-modal-link {
  display: block;
}

/* --- Trigger --- */
.hahn-modal-link__trigger {
  cursor: pointer;
  font: inherit;
  border: 0;
  padding: 0;
  background: none;
}

.hahn-modal-link__trigger--link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hahn-modal-link__trigger--link:hover {
  opacity: 0.75;
}

.hahn-modal-link__trigger--button {
  display: inline-block;
  padding: 0.4em 1em;
  border-radius: 4px;
  background-color: #333;
  color: #fff;
  font-weight: 600;
  font-size: 0.875em;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.hahn-modal-link__trigger--button:hover {
  background-color: #555;
}

/* --- Overlay / backdrop --- */
.hahn-modal-link__overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.hahn-modal-link__overlay[hidden] {
  display: none;
}

.hahn-modal-link__overlay.is-open {
  opacity: 1;
}

/* --- Dialog --- */
.hahn-modal-link__dialog {
  position: relative;
  background: #fff;
  text-align: left;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  width: 100%;
  padding: 2rem;
  animation: hahnModalFadeIn 0.2s ease;
}

.hahn-modal-link__dialog--sm {
  max-width: 480px;
}

.hahn-modal-link__dialog--md {
  max-width: 640px;
}

.hahn-modal-link__dialog--lg {
  max-width: 800px;
}

/* --- Close button --- */
.hahn-modal-link__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f1f1f1;
  color: #333;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;
}

.hahn-modal-link__close:hover {
  background-color: #ddd;
}

/* --- Content --- */
.hahn-modal-link__content {
  margin-top: 0.5rem;
  text-align: left;
}

@keyframes hahnModalFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Editor-only styles --- */
.hahn-modal-link-editor__trigger--link {
  color: #0073aa;
  text-decoration: underline;
  cursor: text;
}

.hahn-modal-link-editor__trigger--button {
  display: inline-block;
  padding: 0.3em 0.8em;
  border-radius: 4px;
  background: #333;
  color: #fff;
  font-weight: 600;
  font-size: 0.875em;
  cursor: text;
}
