/* Snippets: the list on a narrow sheet, and the New/Edit card. */

.sheet.snippets-sheet { width: min(704px, 100%); padding: 55px 55px 55px; }

.snippets-heading { position: relative; }

.snippets-heading__title {
  position: relative;
  margin: 0 0 24.75px;
  font-size: 44px;
  line-height: 44px;
  font-weight: 700;
  text-align: center;
}


.snippets-heading__new {
  position: absolute;
  top: -33px;
  right: -33px;
  display: inline-flex;
  align-items: center;
  height: 37px;
  padding: 5.28px 14.08px 5.28px 38.72px;
  border: 1px solid var(--color-accent);
  border-radius: 33px;
  background: transparent;
  color: var(--color-accent);
  font-size: 17.6px;
  line-height: 24.64px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.snippets-heading__new:hover { background: var(--color-soft); color: var(--color-ink); }
.snippets-heading__new-icon { position: absolute; left: 13px; width: 18px; height: 18px; }

/* Rows */

.snippet-rows { display: flex; flex-direction: column; margin: 0 -17.5px; padding: 0; list-style: none; }

.snippet-row { position: relative; }

.snippet-row__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 11px;
  min-width: 0;
  height: 60px;
  padding: 14.52px 58.52px 14.52px 66px;
  border-radius: 8.8px;
  color: var(--color-ink);
  font-size: 22px;
  line-height: 30.8px;
  font-weight: 500;
  text-decoration: none;
}

.snippet-row__link:hover { background: rgb(48 114 221 / 0.05); }
.snippet-row__link:focus { outline: none; }
.snippet-row__link:focus-visible { box-shadow: 0 0 0 2px #a4d2ff; }
.snippet-row__icon { position: absolute; top: 50%; left: 24px; width: 24px; height: 24px; translate: 0 -50%; color: var(--color-muted); }
.snippet-row__name { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet-row__preview { min-width: 0; overflow: hidden; color: var(--color-muted); font-size: 15.4px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }

.snippet-row__delete-form { position: absolute; top: 50%; right: 17px; margin: 0; translate: 0 -50%; }

.snippet-row__delete {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.snippet-row__delete svg { width: 18px; height: 18px; }
.snippet-row__delete:hover { background: rgb(var(--ink-rgb) / 0.06); color: var(--color-ink); }

/* Blank slate */

.snippets-blank { margin: 0 -55px 24.75px; border-radius: 0; }

/* New / Edit */

.snippet-form { display: flex; flex-direction: column; align-items: center; }
.snippet-form__title { margin: 0 0 26.4px; font-size: 44px; line-height: 52.8px; font-weight: 700; text-align: center; }

.snippet-form__card {
  width: min(651px, 100%);
  padding: 39.6px;
  border-radius: 29.7px;
  background: var(--color-sheet);
  box-shadow: 0 2.2px 27.5px rgb(var(--warm-rgb) / 0.5);
}

.snippet-form__field { margin-bottom: 22px; }
.snippet-form__label { display: block; margin-bottom: 6.6px; font-size: 19.8px; line-height: 27.72px; font-weight: 700; }

.snippet-form__input {
  width: 100%;
  height: 49px;
  padding: 9.9px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 6.6px;
  color: inherit;
  font: inherit;
  font-size: 17.6px;
  outline: none;
}

trix-editor.snippet-form__editor {
  width: 100%;
  min-height: 99px;
  padding: 9.9px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 6.6px;
  outline: none;
  font-size: 17.6px;
  line-height: 24.64px;
}

trix-editor.snippet-form__editor blockquote { margin: 0; padding-left: 13px; border-left: 1px solid rgb(var(--ink-rgb) / 0.15); }
trix-editor.snippet-form__editor a { color: #3072dd; }

trix-toolbar.snippet-form__toolbar { padding-top: 8.8px; }
.snippet-form__toolbar .composer-toolbar__row { gap: 0; overflow-x: auto; }
.snippet-form__toolbar .composer-toolbar__row button { width: 40px; padding: 0 6px; }

.snippet-form__actions { display: flex; justify-content: center; }

.snippet-form__save {
  width: 76px;
  height: 41px;
  border: 1px solid var(--color-accent);
  border-radius: 33px;
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  font-size: 17.6px;
  font-weight: 500;
  cursor: pointer;
}

.snippet-form__errors { margin: 0 0 22px; padding: 0.6rem 1rem 0.6rem 2rem; border-radius: 8px; background: #fde8e8; color: #8a1f1f; }

@media (max-width: 640px) {
  .sheet.snippets-sheet { padding: 24px 16px; }
  .snippets-heading__new { top: -54px; right: 0; }
  .snippets-heading__title, .snippet-form__title { font-size: 34px; line-height: 40px; }
  .snippets-heading__title::before { top: 20px; }
  .snippet-rows { margin: 12px 0 0; }
  .snippet-row__link { padding-right: 44px; padding-left: 52px; font-size: 19.8px; }
  .snippet-row__icon { left: 16px; }
  .snippet-row__delete-form { right: 8px; }
  .snippet-row__preview { display: none; }
  .snippets-blank { margin-inline: -16px; }
  .snippet-form__card { padding: 24px 16px; }
}
