// ============================================================
// Alonely — block editor canvas (assets/css/editor.css)
//
// Loaded with add_editor_style(): WordPress prefixes every selector with
// .editor-styles-wrapper and turns body / :root into it. The canvas gets
// the same tokens and the same prose rules as the front end, so a post
// looks in the editor the way it reads on the site.
//
// Light mode only: the reader's light/dark switch does not exist in the
// editor.
// ============================================================

@use 'abstracts' as *;
@use 'base/tokens';
@use 'wordpress/prose';

body {
  background: var(--bg);
  color: var(--ink);
  font-family: $font-sans;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

// ---- The title: the single post's hero title ----
.editor-post-title,
.editor-post-title__input,
.wp-block-post-title {
  font-family: $font-serif;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 400;
  line-height: 1.42;
  color: var(--ink);
  text-align: center;
}

// ---- The content ----
.is-root-container {
  @include prose.rules;

  // The canvas's root container is full width; other blocks are centred by
  // their max-width, but a float sits at the canvas edge. Move it to the
  // edge of the text column, as on the site.
  > .alignleft {
    margin-left: max(0px, calc((100% - var(--wp--style--global--content-size, 700px)) / 2));
  }

  > .alignright {
    margin-right: max(0px, calc((100% - var(--wp--style--global--content-size, 700px)) / 2));
  }
}
