/* ------------------------------------------------------------------ *
 * Blog editor Phase 5 (session 43): Related Posts picker.
 * Linked from index.html after styles-tools.css.
 * The results list is in normal flow (not a floating popover), so it can
 * never be clipped by a scroll container or run off a 390px screen.
 * ------------------------------------------------------------------ */

.blog-rel { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.blog-rel__controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: var(--s-3); align-items: start; }
@media (max-width: 600px) { .blog-rel__controls { grid-template-columns: minmax(0, 1fr); } }

.blog-rel__count { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.blog-rel__count--full { color: var(--warning, #b45309); font-weight: 600; }
.blog-rel__empty,
.blog-rel__note,
.blog-rel__head { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.blog-rel__note { padding: var(--s-3); border: 1px dashed var(--border); border-radius: var(--r-md); }
.blog-rel__note--error { color: var(--danger, #b91c1c); }
.blog-rel__head { text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-xs, 11px); font-weight: 700; }
.blog-rel__retry { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

.blog-rel__selected,
.blog-rel__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.blog-rel__results { display: flex; flex-direction: column; gap: var(--s-2); }
.blog-rel__results:empty { display: none; }
.blog-rel__list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-1); }

.blog-rel__sel,
.blog-rel__item { display: flex; align-items: center; gap: var(--s-3); min-width: 0; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); }
.blog-rel__sel { border: 1px solid var(--border); background: var(--surface-2, var(--surface-1)); }
.blog-rel__item { width: 100%; border: 0; background: none; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.blog-rel__item:hover:not(:disabled),
.blog-rel__item:focus-visible { background: var(--surface-2, rgba(127, 127, 127, .12)); }
.blog-rel__item:disabled { cursor: default; opacity: .6; }

.blog-rel__num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs, 11px); font-weight: 700; background: var(--border); color: var(--text); }
.blog-rel__thumb { flex: none; width: 48px; height: 32px; border-radius: var(--r-sm, 4px); object-fit: cover; background: var(--border); }
.blog-rel__thumb--none { display: grid; place-items: center; color: var(--text-muted); }
img.blog-rel__thumb--none { visibility: hidden; }
.blog-rel__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.blog-rel__title { font-size: var(--fs-md); font-weight: 500; overflow-wrap: anywhere; }
.blog-rel__meta { font-size: var(--fs-xs, 11px); color: var(--text-muted); overflow-wrap: anywhere; }
.blog-rel__title mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 2px; padding: 0 1px; }
.blog-rel__act { flex: none; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.blog-rel__remove { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-md); background: none; color: var(--text-muted); cursor: pointer; }
.blog-rel__remove:hover, .blog-rel__remove:focus-visible { background: rgba(185, 28, 28, .12); color: var(--danger, #b91c1c); }
