/* Per-line poster text: drawer summary rows, the per-line editor dialog, and
   the on-poster selection outlines. This file exists because style.css sits
   at the repository's four-hundred-line ratchet cap; add new text-editor
   styles here rather than tipping that baseline. */

/* One collapsed summary row per poster text line. The whole row is the
   control that opens that line's editor, so it is a real button: native
   focus, Enter and Space activation, and the shared focus ring for free.
   It shows the line's current VALUE, not its typography — font, size, and
   visibility live in the editor. */
.line-rows { display: grid; gap: 8px; margin-top: 14px; }
.line-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 4px 12px;
  border: 1px solid #dfe3d5;
  border-radius: 6px;
  background: #f6f7f0;
  text-align: left;
}
.line-row:hover { border-color: #a1af94; }
.line-row.selected { border-color: var(--clay); background: #f9eee3; box-shadow: 0 0 0 1px var(--clay); }
.line-name { flex: 0 0 auto; font-size: 14px; font-weight: 600; color: #5d6852; }
.line-value { flex: 1 1 auto; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-pencil { flex: 0 0 auto; width: 16px; height: 16px; color: #8b9181; }
/* A hidden line keeps its row — the editor owns the show/hide toggle, and
   the row must still open it — but sits dimmed so the state reads at a glance. */
.line-row.line-hidden { opacity: .55; }

/* Where overlay refresh problems surface now that the block drag help is
   gone: one status line under the rows, replacing the old #drag-help. */
#text-status { margin-top: 12px; }

/* The per-line editor: a compact centered dialog on desktop, a bottom sheet
   on phones. One dialog, two states — never a modal on top of the drawer. */
:root { --editor-sheet-max: 45vh; }
.text-editor { width: min(430px, calc(100% - 32px)); }
.editor-body h2 { font-size: 30px; margin-top: 14px; }
#editor-text-fields .field-label { margin-top: 12px; }
.editor-font-open {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 14px 0 4px;
  padding: 8px 12px;
  border: 1px solid #dfe3d5;
  border-radius: 4px;
  background: #f6f7f0;
  font-size: 14px;
}
.editor-font-open span { font-weight: 600; color: var(--clay); }
#editor-size { margin-top: 4px; }
#editor-subtitle-row, #editor-coordinates-row { margin: 12px 0 0; }
.editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.editor-actions .button { min-width: 132px; }

/* The Change font view: one row per option, each row's name set in that
   option's own typeface (inline style from the picker code). */
#editor-font-list { display: grid; gap: 6px; margin-top: 14px; }
.font-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #dfe3d5;
  border-radius: 4px;
  background: var(--white);
  font-size: 18px;
  text-align: left;
}
.font-option:hover { border-color: #a1af94; }
.font-option[aria-pressed=true] { border-color: var(--clay); background: #f9eee3; box-shadow: 0 0 0 1px var(--clay); }
.font-option[aria-pressed=true]::after { content: '✓'; color: var(--clay); font-size: 15px; }

/* The on-poster selection outlines. The button sits on the line's published
   box; its inflated ::before is the touch band, so a narrow line still
   answers to a finger. The canvas editor sizes the inflate per line (this
   root value is only the pre-first-sync fallback) so box plus two insets
   reaches a 44px band in both axes. Styling follows the old drag handle:
   white border, dashed ink outline, translucent fill while active. */
:root { --line-outline-inflate: 12px; }
.line-outline {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  padding: 0;
  cursor: grab;
  touch-action: none;
}
.line-outline::before { content: ''; position: absolute; inset: calc(-1 * var(--line-outline-inflate)); }
.line-outline:hover { border-color: #fff; }
.line-outline[aria-pressed=true] { border-color: #fff; outline: 1px dashed #364c32; background: #fff1; }
.line-outline[aria-pressed=true]:hover { border-color: #fff; }
.line-outline:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.line-outline.dragging { cursor: grabbing; }
@media (max-width: 760px) {
  .text-editor {
    position: fixed;
    inset: auto 0 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: var(--editor-sheet-max);
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
    box-shadow: 0 -12px 40px #18221140;
    padding: 18px 18px calc(14px + env(safe-area-inset-bottom));
  }
  .editor-body h2 { font-size: 26px; margin-top: 8px; }
}
