/* The page that writes a group's note, and the frames that show one (note-editor.js).
 *
 * Not part of the Tailwind build, like lua-editor.css: the script that adds the toolbar holds
 * class names Tailwind does not scan. The form's own fields are daisyUI classes in the template.
 *
 * This is not note.css. That one is the app's, styles whole pages, and lives only inside the
 * frame; this one lays out the site's page around it.
 */

.note-form {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

/* Side by side once there is room for two columns of text. */
@media (min-width: 1024px) {
  .note-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .note-form__preview {
    position: sticky;
    top: 1rem;
  }
}

.note-form__row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .note-form__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.note-form__theirs {
  white-space: pre-wrap;
  max-height: 16rem;
  overflow: auto;
  font-size: 0.8rem;
  padding: 0.5rem;
  background: var(--color-base-200, #f7f7f8);
}

/* The note's page, in a frame of its own. The white is note.css's paper: the frame is always light,
 * as the app's note is, whatever theme the site is in. */
.note-frame {
  display: block;
  width: 100%;
  min-height: 12rem;
  height: 70vh;
  border: 1px solid color-mix(in oklab, var(--color-base-content, #383a42) 20%, transparent);
  border-radius: 0.5rem;
  background: #fff;
}

.note-frame--preview {
  height: 75vh;
}

.note-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0.25rem 0;
}

.note-toolbar__button,
.note-toolbar__select {
  min-height: 2rem;
  padding: 0 0.6rem;
  font-size: 0.9rem;
  line-height: 1;
  border: 1px solid color-mix(in oklab, var(--color-base-content, #383a42) 25%, transparent);
  border-radius: 0.375rem;
  background: var(--color-base-100, #fff);
  color: inherit;
  cursor: pointer;
}

.note-toolbar__button:hover,
.note-toolbar__select:hover {
  background: var(--color-base-200, #f7f7f8);
}

.note-toolbar__button:focus-visible,
.note-toolbar__select:focus-visible {
  outline: 2px solid var(--color-primary, #4078f2);
  outline-offset: 1px;
}

.note-toolbar__bold {
  font-weight: 700;
}

/* A field and its label, one above the other. daisyUI 5 has no `form-control` any more, so the
 * template's labels would run on in a line. */
.note-form label.form-control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
