/* Recent Updates: generated dates, headlines, categories, and source links.
   v6 follows the Welcome page's margin card (v5): a title that opens its
   source ends with a small arrow, and "In <chapter>" beneath it replaces the
   repeated "Read in the handbook" (Bryan, 22 October 2026).
   Canonical copy: handbook-recursive/kit/styles/recent-updates-v6.css.
   Published stylesheets are immutable; future changes need a new version. */

.recent-updates {
  --ru-link: #1765ad;
  --ru-muted: #5b6b7f;
  --ru-rule: #e3e8ef;
  --ru-milestone: #a16207;
  --ru-evidence: #0f766e;
  --ru-policy: #4338ca;
  --ru-developments: #0369a1;
  --ru-content: #047857;
  --ru-accuracy: #be123c;
  margin: 0.25rem 0 2rem;
}

.quarto-dark .recent-updates,
[data-bs-theme="dark"] .recent-updates {
  --ru-link: #8ecaff;
  --ru-muted: #abb8c7;
  --ru-rule: #454d58;
  --ru-milestone: #facc15;
  --ru-evidence: #2dd4bf;
  --ru-policy: #a5b4fc;
  --ru-developments: #7dd3fc;
  --ru-content: #6ee7b7;
  --ru-accuracy: #fda4af;
}

.recent-updates > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-updates > ul > li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(10rem, 14rem);
  gap: 0.3rem 1rem;
  align-items: baseline;
  margin: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--ru-rule);
}

.recent-updates > ul > li:first-child {
  border-top: 1px solid var(--ru-rule);
}

.recent-updates .ru-date {
  color: var(--ru-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The headline takes its own line; "In" and the chapter link share the next. */
.recent-updates .ru-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.3em;
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.recent-updates .ru-title > .ru-headline {
  flex: 0 1 100%;
  min-width: 0;
  font-weight: 600;
}

.recent-updates .ru-title > a {
  color: var(--ru-link);
  font-weight: 600;
  text-decoration: none;
}

/* A title that opens the source ends with a small arrow, kept on the line of
   the title's last word. The same mark as the margin card's. */
.recent-updates .ru-tail {
  white-space: nowrap;
}

.recent-updates .ru-external .ru-tail::after {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.28em;
  vertical-align: 0.06em;
  background-color: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2h6v6M10 2 3 9' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2h6v6M10 2 3 9' stroke='black' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.recent-updates .ru-title > .ru-in,
.recent-updates .ru-title > .ru-chapter {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-weight: 400;
}

.recent-updates .ru-title > .ru-in {
  color: var(--ru-muted);
}

.recent-updates .ru-title > .ru-chapter {
  color: var(--ru-muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.recent-updates .ru-title > .ru-chapter:hover {
  color: var(--ru-link);
}

.recent-updates .ru-title > .ru-chapter-duplicate {
  display: none;
}

.recent-updates a:hover {
  text-decoration: underline;
}

.recent-updates a:focus-visible {
  outline: 2px solid var(--ru-link);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration: underline;
}

.recent-updates .ru-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 0;
  text-align: right;
}

.recent-updates .ru-cat {
  color: var(--ru-cat, var(--ru-muted));
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.recent-updates .ru-cat-milestone { --ru-cat: var(--ru-milestone); }
.recent-updates .ru-cat-evidence { --ru-cat: var(--ru-evidence); }
.recent-updates .ru-cat-policy { --ru-cat: var(--ru-policy); }
.recent-updates .ru-cat-developments { --ru-cat: var(--ru-developments); }
.recent-updates .ru-cat-content { --ru-cat: var(--ru-content); }
.recent-updates .ru-cat-accuracy { --ru-cat: var(--ru-accuracy); }

.recent-updates .ru-sources {
  color: var(--ru-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.recent-updates .ru-sources a {
  color: var(--ru-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Recent Updates stays clear of citation badges; article pages retain them. */
.recent-updates .citation-badge,
.recent-updates .citation-favicon-wrapper {
  display: none !important;
}

/* Preserve the existing empty-state and license treatment. */
.recent-updates > p:not(:last-child) {
  color: var(--ru-muted);
  margin: 0;
  padding: 0.7rem 0;
  border-top: 1px solid var(--ru-rule);
  border-bottom: 1px solid var(--ru-rule);
}

.recent-updates .ru-all {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.home-license {
  margin: 2.5rem 0 0.5rem;
  color: #5b6b7f;
  font-size: 0.9rem;
}

.quarto-dark .home-license,
[data-bs-theme="dark"] .home-license {
  color: #9aa7b6;
}

@media (max-width: 767.98px) {
  .recent-updates > ul > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .recent-updates .ru-meta {
    align-items: flex-start;
    margin-top: 0.2rem;
    text-align: left;
  }
}
