/*
 * activity.css — the ONE activity feed (DESIGN.md section 12).
 *
 * Days are collapsible groups; entries hang on a vertical rail drawn icon
 * to icon; entries with a body collapse in place. No horizontal rules.
 * Rendered by the activity_feed macro (_macros.html); behaviour in
 * activity.js. Tokens only, no raw hex outside the chart-grade ramp.
 */

.feed { list-style: none; margin: 0; padding: 0 0 var(--space-2); }

.feed-daywrap > summary { list-style: none; }
.feed-daywrap > summary::-webkit-details-marker { display: none; }
.feed-day {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-2);
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}
.feed-day:first-child { margin-top: 0; }
.feed-day .feed-chev { width: 14px; height: 14px; color: var(--color-text-muted); transition: transform var(--duration-fast) var(--ease-out-quart); }
.feed-daywrap[open] > summary .feed-chev { transform: rotate(90deg); }
.feed-day .grp-n { font-weight: 500; color: var(--color-text-muted); }
.feed-day:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; border-radius: var(--radius-xs); }

/* Direct children only: a folded batch's body nests its own <li> (a photo
   card, a child row), and those must not inherit the day rail or the feed
   row's padding. */
.feed > li { position: relative; padding: var(--space-2) 0 var(--space-4); }
.feed-row {
  display: grid;
  grid-template-columns: 20px 28px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: start;
  list-style: none;
}
.feed-row::-webkit-details-marker { display: none; }
summary.feed-row { cursor: pointer; }
summary.feed-row:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; border-radius: var(--radius-xs); }
/* the rail: from below this icon to the next icon */
.feed > li::before { content: ""; position: absolute; left: 41px; top: 36px; bottom: -4px; width: 2px; background: var(--ink-200); border-radius: 1px; }
.feed > li:last-child::before { display: none; }

.feed-tg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 28px; padding: 0; border: 0; background: transparent;
  color: var(--color-text-muted); cursor: pointer; border-radius: var(--radius-xs);
}
.feed-tg .feed-chev { width: 14px; height: 14px; transition: transform var(--duration-fast) var(--ease-out-quart); }
.feed-entry[open] > summary .feed-tg .feed-chev { transform: rotate(90deg); }
summary.feed-row:hover .feed-tg { color: var(--color-text); background: var(--color-surface-muted); }
.feed-tg.is-empty { pointer-events: none; }

.feed-ic {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-surface-muted); color: var(--color-text-muted);
  box-shadow: 0 0 0 3px var(--color-surface);
}
.feed-ic svg { width: 14px; height: 14px; }
.feed-ic.is-mail, .feed-ic.is-mailout, .feed-ic.is-dev { background: var(--sky-50); color: var(--sky-700); }
.feed-ic.is-note, .feed-ic.is-task { background: var(--navy-50); color: var(--navy-700); }
.feed-ic.is-photo, .feed-ic.is-portal { background: var(--leaf-50); color: var(--leaf-700); }
.feed-ic.is-stage { background: var(--butter-50); color: var(--butter-700); }
.feed-ic.is-sys, .feed-ic.is-doc { background: var(--color-surface-muted); color: var(--color-text-muted); }
.feed-ic.act-who { font-size: var(--text-2xs); font-weight: 700; }

.feed-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.feed-t { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.feed-t a { color: inherit; text-decoration: none; }
.feed-t a:hover { color: var(--color-primary); text-decoration: underline; }
summary.feed-row:hover .feed-t { color: var(--color-primary); }
.feed-s { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }
.feed-entry:not([open]) .feed-s { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.feed-entry[open] .feed-s { display: none; }
.feed-time { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; padding-top: 6px; }

.feed-status {
  display: inline-flex; align-items: center; align-self: flex-start;
  margin-top: 2px; padding: 0 var(--space-2);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-surface-muted); color: var(--color-text-muted); font-size: var(--text-2xs); font-weight: 600;
}
.feed-status.is-ok { background: var(--color-success-surface); border-color: var(--color-success-border); color: var(--leaf-700); }
.feed-status.is-warn { background: var(--color-warning-surface); border-color: var(--color-warning-border); color: var(--butter-700); }
.feed-status.is-bad { background: var(--color-danger-surface); border-color: var(--color-danger-border); color: var(--rose-600); }

.feed-detail { margin: var(--space-3) 0 0 56px; padding: var(--space-4) var(--space-5); background: var(--color-surface-muted); border-radius: var(--radius-md); }
.feed-kv { display: grid; grid-template-columns: 64px 1fr; gap: 2px var(--space-3); margin: 0 0 var(--space-3); font-size: var(--text-xs); }
.feed-kv dt { color: var(--color-text-muted); }
.feed-kv dd { margin: 0; color: var(--color-text); }
.feed-body { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--color-text); white-space: pre-line; max-width: 72ch; }
/* A folded batch's body: the children, never a summary of them. */
.feed-children { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.feed-child { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); }
.feed-child a { color: var(--color-text); text-decoration: none; }
.feed-child a:hover { color: var(--color-primary); text-decoration: underline; }
.feed-photos { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.feed-children + .feed-photos { margin-top: var(--space-4); }
.feed-photo { display: flex; flex-direction: column; gap: 4px; }
.feed-photo a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface); }
.feed-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-photo-cap { font-size: var(--text-2xs); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.feed-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
  font-size: var(--text-xs); color: var(--color-text); text-decoration: none;
}
.feed-chip:hover { border-color: var(--color-primary); }
.feed-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.feed-actions .link-action { min-height: 26px; padding: 0; font-size: var(--text-xs); }

.feed-empty { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---- Project updates (UI improvements E, 2026-09-23): an update shows its
   photos as 4:3 thumbnails (click = quickview) and its comments under it,
   with a one-line comment form. ---- */
.feed-photos { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.feed-photo { display: block; width: 132px; aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden; background: var(--ink-100); }
.feed-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feed-photo.is-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); padding: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); text-decoration: none; text-align: center; }
.feed-photo:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.feed-comments { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm); }
.feed-comments p { margin: 2px 0 0; line-height: 1.5; white-space: pre-line; }
.feed-comment-form { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.feed-comment-form input { flex: 1; min-width: 0; height: var(--control-h); padding: 0 var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); font: inherit; font-size: var(--text-sm); }
