/* TRELLAN: the Resources screens. Report 258.

   Boards Resources and m-resources. Decision 6: a folder is a Mist row; an
   open folder's items are white, inset, with a green rule on their left.
   Scoped to `.lib-page` / `.res-page` (resources/index.html). */

/* A collection's heading is a label: caps, gray, its count after a dot. */
.lib-page .lib-folder-name {
  font-family: var(--font-display); font-weight: 500; font-size: 12px;
  letter-spacing: 3px; text-transform: uppercase; color: var(--gray);
}
.lib-page .lib-folder-name .lib-count { font-family: var(--font-display); font-size: 12px; color: var(--gray); }
.lib-page .lib-folder-name .lib-count::before { content: "· "; }

/* Rows: names in their own case, regular weight. */
.lib-page .lib-item-name { font-weight: 400; color: var(--ink); font-size: 15px; }
.lib-page .lib-item-head:hover { background: var(--mist); }
.lib-page .lib-ico { color: var(--charcoal); }

/* A row's kind ("Policy", "NM") is a plain grey tag, not a status. */
.lib-page .lib-item-head .ui-pill--kind {
  background: var(--mist); color: var(--gray); font-weight: 400; min-height: 0; padding: 3px 8px;
}
.lib-page .lib-item-head .ui-pill--kind::before { display: none; }

/* Decision 6. */
.res-page .lib-subfolder { border: 1px solid var(--hairline); background: var(--mist); }
.res-page .lib-subfolder > summary { background: var(--mist); font-weight: 400; color: var(--ink); min-height: 52px; }
.res-page .lib-subfolder > summary:hover { background: #EDEDEB; }
.res-page .lib-subfolder > summary .lib-ico { color: var(--leaf); }
.res-page .lib-subfolder > summary .lib-count { margin-left: auto; color: var(--gray); }
.res-page .lib-subfolder[open] > summary { background: #EEEEEC; border-bottom: 0; }
.res-page .lib-subfolder[open] > .lib-cards.of-list {
  margin: 0 0 0 20px; background: #FFFFFF; border-left: 2px solid var(--green);
}
.res-page .lib-subfolder > summary .ui-pill { background: #FFFFFF; border: 1px solid var(--hairline); }
.res-page .lib-subfolder > summary .ui-pill::before { display: none; }

/* The filter chips are the shared chips. */
.lib-page .lib-filters .filter {
  height: 38px; border: 1px solid var(--edge); background: #FFFFFF; color: var(--ink);
}
.lib-page .lib-filters .filter.active { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.lib-page .lib-filters .filter .lib-count { font-weight: 700; }

/* Report 301: Rename, Replace file, Edit text, and a folder's Rename and
   Delete folder. A <details> whose summary looks like the row's other quiet
   buttons; open, its form takes the whole width under the buttons. */
.lib-page .lib-edit > summary { list-style: none; cursor: pointer; }
.lib-page .lib-edit > summary::-webkit-details-marker { display: none; }
.lib-page .lib-edit[open] { flex-basis: 100%; order: 10; }
.lib-page .lib-edit[open] > summary { background: var(--mist); }
.lib-page .lib-edit-form {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 8px; padding: 12px; border: 1px solid var(--hairline); background: #FFFFFF;
}
.lib-page .lib-edit-label {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--gray);
}
.lib-page .lib-edit-label input,
.lib-page .lib-edit-label textarea {
  width: 100%; box-sizing: border-box; min-height: 44px;
  font-family: inherit; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink);
}
.lib-page .lib-edit-label textarea { font-family: var(--font-body, inherit); resize: vertical; }
.lib-page .lib-edit-hint { margin: 0; font-size: 13px; color: var(--gray); }
.lib-page .lib-edit-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.res-page .lib-folder-tools { padding: 8px 12px 12px 20px; background: var(--mist); }
@media (max-width: 720px) {
  .lib-page .lib-edit-bar .ui-btn { flex: 1 1 0; min-height: 44px; }
}

/* Report 350: a text resource's open card (design review of ADE-705,
   planning/design/resource-full-details-review.md). Labels are the shared
   `.tr-label`; each sits 6px over its own text. The words keep to 68ch; the
   buttons, tags and meta stay full width. */
.lib-page .lib-item-body--text { padding-top: 20px; }
.lib-page .lib-item-body--text .lib-label { margin: 0 0 6px; }
.lib-page .lib-item-body--text .lib-label--full { margin-top: 24px; }
.lib-page .lib-prose { max-width: 68ch; }
/* The firm's own words on Mist, set apart from the AI's on white. The open
   card is Mist itself, so its body turns white to let the panel show. */
.lib-page .lib-item.open .lib-item-body--text { background: #FFFFFF; }
.lib-page .lib-fullbox {
  max-width: 68ch; margin-bottom: 20px; padding: 16px;
  background: var(--mist); border: 0; border-radius: 0;
}
.lib-page .lib-full {
  white-space: pre-line; overflow-wrap: anywhere;
  font-size: 15px; line-height: 1.55; color: var(--ink);
}
.lib-page .lib-full a { color: var(--leaf); text-decoration: underline; overflow-wrap: anywhere; }
.lib-page .lib-full a:hover { color: var(--leaf-deep); }
.lib-page .lib-full a[href^="tel:"] { white-space: nowrap; }
/* Long text: 12 lines, fading over the last, then "Show all ›". Only when
   the browser has `:has`; without it the text shows whole. */
.lib-page .lib-fullbox--long:has(> .lib-more:not([open])) .lib-full {
  position: relative; max-height: calc(12 * 1.55em); overflow: hidden;
}
.lib-page .lib-fullbox--long:has(> .lib-more:not([open])) .lib-full::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.55em;
  background: linear-gradient(to bottom, rgba(245, 245, 245, 0), var(--mist));
}
.lib-page .lib-more { margin-top: 10px; }
.lib-page .lib-more > summary { list-style: none; cursor: pointer; }
.lib-page .lib-more > summary::-webkit-details-marker { display: none; }
.lib-page .lib-more[open] .lib-more-all,
.lib-page .lib-more:not([open]) .lib-more-less { display: none; }
/* The more/less word is only useful where the text is clamped. */
@supports not selector(:has(*)) { .lib-page .lib-more { display: none; } }

/* Order: buttons, tags, meta, staff tools. The meta is gray 13px. */
.lib-page .lib-item-body .lib-actions { margin-top: 0; }
.lib-page .lib-item-body .lib-actions + .lib-topics { margin-top: 12px; }
.lib-page .lib-item-body .lib-meta { margin-top: 8px; font-size: 13px; color: var(--gray); }
.lib-page .lib-staff {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline);
}
.lib-page .lib-staff .lib-remove { margin-left: auto; }
@media (max-width: 720px) {
  /* Call / Email side by side, 44px tall; one action takes the width. */
  .lib-page .lib-actions > .ui-btn { flex: 1 1 0; min-height: 44px; justify-content: center; }
  /* Rename, Edit text and Remove on one line at 360. */
  .lib-page .lib-staff { gap: 4px; }
  .lib-page .lib-staff .ui-btn { padding: 0 6px; letter-spacing: 1px; }
  .lib-page .lib-staff .lib-move { flex-basis: 100%; }
}
