/* Quote Reply UX — cap nesting, compact quotes, fade overflow */

.trix-content {
  /* Hide deeply nested blockquotes (depth 3+) */
  blockquote blockquote blockquote {
    display: none;
  }

  /* The visible quoted block (depth 1-2) */
  blockquote {
    position: relative;
    max-height: 5.5em;
    overflow: hidden;
    border: 0 solid var(--color-border-darker) !important;
    border-inline-start-width: 3px !important;
    margin: 0 0 0.25em 0 !important;
    padding: 0.4em 0.6em !important;
    font-size: 0.85em;
    color: color-mix(in srgb, var(--color-text) 60%, transparent);
    background: color-mix(in srgb, var(--color-text) 4%, transparent);
    border-radius: 0 6px 6px 0;
  }

  /* Gradient fade when quote overflows */
  blockquote::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2em;
    background: linear-gradient(
      to bottom,
      transparent,
      color-mix(in srgb, var(--color-bg) 95%, transparent)
    );
    pointer-events: none;
  }

  /* Nested quote (depth 2) — even more compact */
  blockquote blockquote {
    max-height: 3em;
    font-size: 0.9em;
    margin: 0 0 0.25em 0 !important;
    padding: 0.3em 0.5em !important;
    border-inline-start-width: 2px !important;
  }

  /* Cite / attribution line */
  cite {
    display: block;
    margin: 0 0 0.5em 0 !important;
    padding: 0;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 500;
    color: color-mix(in srgb, var(--color-text) 45%, transparent);

    a {
      color: color-mix(in srgb, var(--color-text) 45%, transparent);
      text-decoration: none;
      margin-inline-start: 0.25ch;
    }
  }

  /* Remove default cite ::before dash if present */
  cite::before {
    content: "" !important;
  }
}
