/*
 * design-system/components/toast.css
 * Editorial Calm — Toast. ТЗ 4.8.
 *
 * Появляется в правом нижнем углу, position: fixed, z-index --z-toast.
 * Auto-close 5s для good/warn. НЕ закрывается для bad — пользователь
 * должен прочитать ошибку.
 *
 * JS-помощник: static/js/design-system/toast.js
 *   ToastManager.show({ kind: 'good', title: '...', body: '...' });
 */

[data-theme="editorial"] .ed-toast-container {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  z-index: var(--z-toast);
  pointer-events: none;  /* контейнер не перехватывает клики */
}

[data-theme="editorial"] .ed-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-width: 280px;
  max-width: 400px;
  padding: var(--s-3) var(--s-4);
  background: var(--paper-edge);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  transform: translateY(8px);
  opacity: 0;
  animation: ed-toast-in var(--motion-base) var(--ease) forwards;
}

[data-theme="editorial"] .ed-toast.is-leaving {
  animation: ed-toast-out var(--motion-base) var(--ease) forwards;
}

[data-theme="editorial"] .ed-toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;  /* выравнивание с baseline заголовка */
}
[data-theme="editorial"] .ed-toast__icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

[data-theme="editorial"] .ed-toast--good .ed-toast__icon { color: var(--good); }
[data-theme="editorial"] .ed-toast--warn .ed-toast__icon { color: var(--warn); }
[data-theme="editorial"] .ed-toast--bad  .ed-toast__icon { color: var(--bad);  }

[data-theme="editorial"] .ed-toast__body {
  flex: 1;
  min-width: 0;
}

[data-theme="editorial"] .ed-toast__title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

[data-theme="editorial"] .ed-toast__text {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-3);
  margin-top: 2px;
}

[data-theme="editorial"] .ed-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink-3);
  border-radius: var(--r-2);
}
[data-theme="editorial"] .ed-toast__close:hover { color: var(--ink); background: var(--paper-2); }
[data-theme="editorial"] .ed-toast__close:focus-visible { outline: 0; box-shadow: var(--shadow-focus); }

@keyframes ed-toast-in {
  to { transform: translateY(0); opacity: 1; }
}
@keyframes ed-toast-out {
  to { transform: translateY(8px); opacity: 0; }
}
