/* NOTES AND IDEAS: THE TITLE CARRIES THE CARD, AND YOU CAN SORT THEM (Alison, 2026-11-25: "notes do have title
   but they're hard to differentiate"). Drawn by static/js/screens/lab/notes-ideas.js for both pages.
   QUIET ON PURPOSE (the easy on the eyes rule): the sort and Cards | List are the Articles page's own controls
   (.tla-sort, .pd-view-toggle), the new links on an idea are the card's existing quiet words (.idea-act), and
   nothing here is an outlined pill. Every colour is one of the app's own tokens, so dark mode and both looks
   follow without a rule of their own. */

/* THE PAIR OF COLOURS: a title that stands out and words under it that step back. Dark mode's swept text tokens
   all sit at nearly one lightness (so every line clears 4.5:1), which leaves a title and its words looking alike;
   these two are set by hand for each mode. Measured by tests/test_notes_ideas_titles_sort_browser.py: the words
   stay at 4.5:1 or better, and the title stands at least a quarter further from the card than they do. */
:root { --ni-title: #1F3A5F; --ni-quiet: #5C6F80; }
:root[data-theme="dark"] { --ni-title: #E6ECF2; --ni-quiet: #A3ADB7; }
.tl-notecard-title { color: var(--ni-title); }
.tl-notecard-body.tl-notecard-under { color: var(--ni-quiet); }

/* The search and the controls on one row; they wrap on a phone. The search still starts where the cards start
   (the 2145 walk's rule), and on Ideas the whole row of controls still fits on one line at desktop width. */
.ni-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 10px 14px;
  width: 100%; box-sizing: border-box; margin: 0 0 1.5rem;
}
.ni-bar .tl-notes-search { flex: 1 1 16rem; margin: 0; }
#tl-feed .idea-bar .idea-search { flex: 1 1 8rem; min-width: 8rem; }
.ni-viewctl { flex: 0 0 auto; }
.ni-viewctl .tla-sort select { min-height: 32px; max-width: 100%; }

/* The kept row's small mark: a sage dot before "Kept at top". */
.ni-kept-mark {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.45rem; vertical-align: middle;
  background: var(--lka-8db88aff, #8DB88A);
}
.ni-ideas-group { margin-top: 1.25rem; }
.ni-ideas-group .tl-week-header { margin-bottom: 0.5rem; }
.ni-ideas-group .idea-grid { margin-top: 0; }
.idea-grid.ni-add-only { margin-bottom: 0; }

/* AN IDEA WITH A TITLE. The title takes the card's own serif face, larger; the idea under it goes quieter and is
   cut to two lines. An idea with no title is exactly the card it always was. */
.idea-title {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 1.42rem; line-height: 1.2;
  color: var(--ni-title); margin: 0 0 0.4rem; overflow-wrap: anywhere;
}
.idea-title-edit { cursor: text; border-radius: 6px; }
.idea-title-edit:focus-visible { outline: 2px solid #2D4860; outline-offset: 2px; }
.idea-card.has-title .idea-text {
  font-family: 'Inter', system-ui, sans-serif; font-weight: 400; font-size: 0.92rem; line-height: 1.5;
  color: var(--ni-quiet);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.idea-text[data-ni="idea-open"] { cursor: pointer; }
.idea-text[data-ni="idea-open"]:focus-visible { outline: 2px solid #2D4860; outline-offset: 3px; border-radius: 4px; }
.idea-card:not(.is-open) .ni-when-open { display: none; }
.idea-card.is-open.has-title .idea-text { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.idea-card.is-pinned { border-color: var(--lka-8db88ab2, rgba(141, 184, 138, 0.7)); }
.idea-actions { flex-wrap: wrap; row-gap: 0.5rem; }
.ni-idea-keep.is-on { color: var(--lka-green-dark, #4E7A4A); }
.ni-title-input, .idea-add-field.ni-add-title {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 1.25rem;
}
.ni-title-input {
  display: block; width: 100%; box-sizing: border-box; min-height: 40px; margin: 0 0 0.4rem; padding: 2px 8px;
  color: var(--ni-title); background: var(--dkb-ffffffff, #fff);
  border: 1px solid rgba(108, 149, 179, 0.7); border-radius: 8px;
}
.ni-title-input:focus { outline: 2px solid #2D4860; outline-offset: 1px; }
.idea-add-field.ni-add-title { margin-bottom: 0.35rem; }

/* THE LIST: one row an item. Title, one line of its words, the date. */
.ni-list {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  background: var(--dkb-ffffffff, #fff); border: 1px solid var(--dkl-d5dce3ff, #D5DCE3); border-radius: 16px;
}
.ni-row + .ni-row { border-top: 1px solid var(--dkl-d5dce3ff, #D5DCE3); }
.ni-row-open {
  display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline;
  width: 100%; min-height: 44px; padding: 11px 18px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: var(--dkb-ffffffff, #fff); border: 0;
}
.ni-row-untitled .ni-row-open { grid-template-columns: minmax(0, 1fr) auto; }
.ni-row-open:hover { background: var(--dkb-f4f7faff, #F4F7FA); }
.ni-row-open:focus-visible { outline: 3px solid #3B6283; outline-offset: -3px; }
.ni-row-title {
  font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 1.16rem; line-height: 1.25;
  color: var(--ni-title); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-row-words {
  font-size: 0.86rem; line-height: 1.45; color: var(--ni-quiet);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-row-untitled .ni-row-words { color: var(--dkt-navy, var(--navy, #2D4860)); font-size: 0.92rem; }
.ni-row-date { font-size: 0.78rem; color: var(--ni-quiet); white-space: nowrap; }
.ni-row.is-pinned .ni-row-open { box-shadow: inset 3px 0 0 var(--lka-8db88aff, #8DB88A); }

/* Keep in Scrapbook on the open note is there only for the person who may keep it. */
#note-detail-scrapbook[hidden] { display: none; }

@media (max-width: 600px) {
  .ni-bar { margin-bottom: 1rem; }
  .ni-viewctl { flex: 1 1 100%; justify-content: space-between; }
  .ni-row-open, .ni-row-untitled .ni-row-open { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: 11px 14px; }
  .ni-row-title { grid-column: 1; grid-row: 1; }
  .ni-row-date { grid-column: 2; grid-row: 1; text-align: right; }
  .ni-row-words { grid-column: 1 / -1; grid-row: 2; }
  .ni-row-untitled .ni-row-words { grid-column: 1; grid-row: 1; }
  .ni-row-untitled .ni-row-date { grid-column: 2; grid-row: 1; }
  .idea-title { font-size: 1.3rem; }
}
