/* Modal dialogs rendered by app/views/ui/_dialog.html.erb. */
@layer components {
  .dialog {
    inline-size: min(32rem, calc(100vw - var(--space-8)));
    padding: var(--space-6);
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);

    &::backdrop { background: oklch(0% 0 0 / 0.5); }

    &[open] { display: flex; flex-direction: column; gap: var(--space-4); }
  }

  /* The close button is a 44px target, taller than the title's line, so
     the two align on their first baselines: the × sits on the title's
     first line however tall the button is or however the title wraps. */
  .dialog__header {
    display: flex;
    align-items: first baseline;
    justify-content: space-between;
    gap: var(--space-4);
  }

  .dialog__close {
    min-inline-size: 2.75rem;
    background: none;
    border: none;
    color: var(--color-text-subtle);
    font-size: var(--text-lg);
    cursor: pointer;
  }
}
