/* ==================================================
   Editor modal reutilizable
================================================== */

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.editor-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.editor-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 760px);
  max-height: calc(100vh - 48px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.65);
}

.editor-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--border);
}

.editor-modal__header h2 {
  margin-bottom: 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.editor-modal__header p:last-child {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.editor-modal__close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-hover);
  font-size: 24px;
  line-height: 1;
}

.editor-modal__close:hover {
  border-color: var(--border-strong);
  background: #2b2f38;
}

.editor-modal__content {
  min-height: 0;
  padding: 26px 28px;
  overflow-y: auto;
}

.editor-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

@media (max-width: 700px) {
  .editor-modal {
    align-items: stretch;
    padding: 12px;
  }

  .editor-modal__dialog {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .editor-modal__header,
  .editor-modal__content,
  .editor-modal__footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .editor-modal__footer {
    flex-direction: column-reverse;
  }

  .editor-modal__footer button {
    width: 100%;
  }
}