/* The Activity feed (S4c, #170; behaviour in privacy-notifications.js and
   activity.js). Day headings like the transcript; each item has its kind's
   mark on the left: "@" in honey, a bell, a pebble in the person's hue, a
   shield in Dusk (hue 5, the same in every scheme), a muted lantern, or an
   info sign. Unread items carry a dot. Uses only existing tokens. */

.privacy-notification-list { gap: 1.25rem; }

.activity-day { display: grid; gap: 0.6rem; }

/* Day headings are Label type in sentence case, like the lists' section labels (L3). */
.activity-day-heading {
  margin: 0;
  padding-inline: 0.25rem;
  color: var(--text-muted);
  font-size: var(--type-label);
  font-weight: 600;
}

.activity-items { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }

/* An item is a row (Lantern Next L6): the mark, the words, and at the end the tick that
   marks it read. A row with somewhere to go is one link you can click anywhere: its link
   is stretched over the row, and the tick sits above it as its own control (nothing is
   nested in anything). Rows are quiet: no outline, a hover tint, the field corner. */
.privacy-notification.activity-item {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-color: transparent;
  border-radius: var(--radius-field);
}
.activity-item-linked:hover { background: color-mix(in srgb, var(--text) 6%, var(--raised)); }
.activity-link {
  color: var(--signature-text);
  font-size: var(--type-label);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.activity-link::after { position: absolute; inset: 0; border-radius: inherit; content: ""; }
/* The focus ring is drawn on the whole row, which is what the link covers. */
.activity-link:focus-visible { outline: none; }
.activity-link:focus-visible::after { outline: 2px solid var(--signature-text); outline-offset: 2px; }
.activity-read-button {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: var(--target-min);
  height: var(--target-min);
  margin: -0.4rem -0.5rem -0.4rem 0;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.activity-read-button svg { width: 1.2rem; height: 1.2rem; }
.activity-read-button:hover { border-color: var(--field-line); background: var(--surface); color: var(--text); }
.activity-read-button:focus-visible { outline: 2px solid var(--signature-text); outline-offset: 2px; }
.activity-read-button:disabled { cursor: progress; opacity: 0.6; }

.activity-body { display: grid; gap: 0.35rem; min-width: 0; }

.activity-kind {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.activity-lead { margin: 0; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.privacy-notification-unread .activity-lead { font-weight: 800; }

.activity-message { margin: 0; color: var(--text-muted); }

.activity-body .privacy-notification-actions { justify-content: flex-start; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }

/* Unread: a dot in the signature colour before the words (with their weight, below). */
.privacy-notification-unread.activity-item { border-inline-start: 1px solid transparent; }
.privacy-notification-unread .activity-lead::before {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-inline-end: 0.45rem;
  border-radius: 50%;
  background: var(--signature-text);
  vertical-align: 0.08em;
  content: "";
}

/* ---- Marks ---- */

.activity-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.activity-icon svg { width: 1.1rem; height: 1.1rem; }

.activity-icon-mention { background: var(--presence); color: var(--hue-ink); }
.activity-icon-shield { background: var(--hue-5); color: var(--hue-ink); }
.activity-icon-lantern { border-radius: 0.75rem; background: var(--surface); color: var(--text-muted); }
.activity-icon-bell { color: var(--signature-text); }

.activity-icon-pebble[data-hue="0"] { background: var(--hue-0); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="1"] { background: var(--hue-1); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="2"] { background: var(--hue-2); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="3"] { background: var(--hue-3); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="4"] { background: var(--hue-4); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="5"] { background: var(--hue-5); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="6"] { background: var(--hue-6); color: var(--hue-ink); }
.activity-icon-pebble[data-hue="7"] { background: var(--hue-7); color: var(--hue-ink); }

/* ---- Empty: the door is always open ---- */

.activity-empty:not(.hidden) { display: grid; justify-items: start; gap: 0.6rem; }
.activity-empty p { margin: 0; font-weight: 650; }

@media (max-width: 40rem) {
  .privacy-notification.activity-item { gap: 0.65rem; padding: 0.75rem; }
  .activity-icon { width: 2rem; height: 2rem; }
  .activity-body .privacy-notification-header { flex-direction: row; align-items: baseline; justify-content: space-between; }
}

@media (forced-colors: active) {
  .activity-icon { border: 1px solid CanvasText; }
  .privacy-notification-unread .activity-lead::before { background: Highlight; forced-color-adjust: none; }
  .privacy-notification.activity-item { border-color: CanvasText; }
  .activity-read-button { border-color: ButtonText; }
}

/* Narrow phones and large text (S7g): the kind and the time share a line only while
   they fit, and the actions wrap instead of running off the screen. */
@media (max-width: 24rem) {
  /* The kind's mark is decoration (the kind is in the words): the words get the row. */
  .privacy-notification.activity-item { grid-template-columns: minmax(0, 1fr) auto; padding: 0.65rem; }
  .activity-item .activity-icon { display: none; }
  .activity-body .privacy-notification-header { flex-wrap: wrap; gap: 0.1rem 0.6rem; }
  .activity-kind { min-width: 0; overflow-wrap: break-word; }
  /* A label that is one long word ("conversation") breaks inside rather than widening the page. */
  .activity-body .privacy-notification-actions > * { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

}

/* ---- Notices first (S7h, CCM J-read) ---- */

/* Mark all as read sits beside the heading as a text button, not a full-width bar. */
.privacy-notifications-heading-row { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
/* End-aligned at every width; it wraps under the heading, still end-aligned, only when it doesn't fit. */
.privacy-notifications-heading-row .text-button { margin-left: auto; }
.privacy-notifications-heading-row h2 { margin: 0; }
.text-button {
  min-height: 2.75rem;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
  color: var(--signature-text);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.text-button:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }
.text-button:focus-visible { outline: 2px solid var(--signature-text); outline-offset: 2px; border-radius: 0.3rem; }

/* What these notices are: under the list, one click away. */
.activity-about { color: var(--text-muted); }
.activity-about summary { width: fit-content; min-height: 2.75rem; padding-block: 0.6rem; color: var(--signature-text); font-weight: 600; cursor: pointer; }
.activity-about summary:focus-visible { outline: 2px solid var(--signature-text); outline-offset: 2px; border-radius: 0.3rem; }
.activity-about p { margin: 0; line-height: 1.55; }

/* Read and unread differ by weight as well as the dot (two of three). */
.privacy-notification.activity-item:not(.privacy-notification-unread) .activity-lead { font-weight: 400; }

/* Below the desktop layout the page header steps back: no installation eyebrow or
   "Signed in as" (that's You's), and a compact title, so the first notice is in view. */
@media (max-width: 47.99rem) {
  #privacy-notifications-shell > .account-header .account-eyebrow,
  #privacy-notifications-identity { display: none; }
  #privacy-notifications-shell > .account-header h1 { font-size: 1.6rem; }
  #privacy-notifications-shell > .account-header { margin-bottom: 0.5rem; }
}
