/* Components shared by the posts: links, citations, references (shortcodes references / ref), timelines and steps (shortcodes timeline / event).
   One file, loaded from layouts/partials/extra-header.html. See content/posts/agent.md for how to use them. */

/* Links in a post: the theme leaves them almost the colour of the text (navy, no underline, faint border), so references and inline links are hard to spot. Navy, bold, yellow underline */
body .post-body .content a:not(.btn) { text-decoration: underline; text-decoration-color: var(--bs-warning); text-decoration-thickness: 2px; text-underline-offset: 3px; border-bottom: 0; font-weight: 600; }
body .post-body .content a:not(.btn):hover { background: #fff1c2; text-decoration-color: var(--navy); }

/* References at the end of a post: a card like the callouts and stat cards (cream border, yellow left bar, light navy shadow). Each reference is one link: the whole line is clickable, numbered with the navy mono label of the site */
body .post-body .content .refs { list-style: none; counter-reset: ref; margin: 1rem 0 0; padding: 0.25rem 0; background: #fff; border: 1px solid #d6cfba; border-left: 6px solid var(--bs-warning); border-radius: 12px; box-shadow: 3px 3px 0 rgba(2, 74, 152, 0.08); font-size: 0.93rem; line-height: 1.5; text-align: left; overflow: hidden; }
body .post-body .content .refs > li { counter-increment: ref; position: relative; padding: 0; }
body .post-body .content .refs > li + li { border-top: 1px dashed #d6cfba; }
body .post-body .content .refs > li::before { content: "[" counter(ref) "]"; position: absolute; left: 1.2rem; top: 0.7rem; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.8rem; font-weight: 700; color: var(--navy); pointer-events: none; }
body .post-body .content .refs a:not(.btn) { display: block; padding: 0.7rem 1.2rem 0.7rem 3.8rem; font-weight: 400; color: #3b4756; text-decoration: none; border-bottom: 0; }
body .post-body .content .refs a:not(.btn):hover { background: #fff7db; color: var(--navy); }
body .post-body .content .refs .ref-domain { margin-left: 0.5em; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.76rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
/* Citations in the text: small "[n]", underlined in yellow on hover */
body .post-body .content a[href="#references"] { font-weight: 600; font-size: 0.82em; text-decoration: none; }
body .post-body .content a[href="#references"]:hover { text-decoration: underline; text-decoration-color: var(--bs-warning); text-decoration-thickness: 2px; }

/* Vertical timeline (shortcodes timeline / event): date in mono on the left, a rail with one coloured dot per event, a card per event */
.tl { --rail: 5.2rem; margin: 1.6rem 0; }
.tl-standard { --tl-c: #024a98; } .tl-cyclone { --tl-c: #1f7a5a; } .tl-fastdds { --tl-c: #c2591a; } .tl-ros2 { --tl-c: #6b3fa0; } .tl-step { --tl-c: #024a98; } .tl-key { --tl-c: #e0a800; }
.tl-key .tl-tag { color: #1a1a1a; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.2rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.tl-legend span { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.7rem 0.2rem 0.55rem; border: 1px solid #d6cfba; border-radius: 999px; background: #fff; color: #3b4756; }
.tl-legend span::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--tl-c); }
.tl-item { position: relative; display: grid; grid-template-columns: var(--rail) 1fr; column-gap: 1.7rem; padding-bottom: 1rem; }
.tl-item::before { content: ""; position: absolute; top: 1.1rem; bottom: -1.1rem; left: calc(var(--rail) + 0.85rem - 1px); width: 2px; background: #d6cfba; }
.tl-item:last-child::before { display: none; }
.tl-item::after { content: ""; position: absolute; top: 0.78rem; left: calc(var(--rail) + 0.85rem - 8px); width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%; background: var(--tl-c); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--tl-c); }
.tl-date { padding-top: 0.7rem; text-align: right; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.82rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.tl-card { margin-left: 0.9rem; background: #fff; border: 1px solid #d6cfba; border-left: 5px solid var(--tl-c); border-radius: 12px; padding: 0.7rem 1rem 0.8rem; box-shadow: 3px 3px 0 rgba(2, 74, 152, 0.08); }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem; margin-bottom: 0.25rem; }
.tl-title { font-weight: 800; color: var(--navy); }
.tl-tag { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--tl-c); color: #fff; }
.tl-text { font-size: 0.95rem; line-height: 1.55; color: #1f2933; }
@media (max-width: 575.98px) {
  .tl { --rail: 1.4rem; }
  .tl-item { grid-template-columns: var(--rail) 1fr; column-gap: 0.5rem; }
  .tl-item::before { left: calc(0.7rem - 1px); top: 0.9rem; }
  .tl-item::after { left: calc(0.7rem - 8px); top: 0.25rem; }
  .tl-date { grid-column: 2; text-align: left; padding: 0 0 0.25rem 0.9rem; }
  .tl-card { grid-column: 2; }
}

/* The theme styles any element with id="references" (top border, extra margin): it hits the References heading of the posts */
body .post-body .content h2#references { border-top: 0; padding-top: 0; margin-top: 2.4rem; }

/* Quick remember: the last list of a post, a light blue card (same family as the callouts and the reference card) with a navy check for each point */
body .post-body .content h2#quick-remember + ul { list-style: none; margin: 1rem 0 0; padding: 0.3rem 1.4rem; background: #eef4fc; color: #1f2933; border: 1px solid #c9d9ee; border-left: 6px solid var(--navy); border-radius: 12px; box-shadow: 3px 3px 0 rgba(2, 74, 152, 0.08); }
body .post-body .content h2#quick-remember + ul > li { position: relative; padding: 0.8rem 0 0.8rem 2.2rem; line-height: 1.55; }
body .post-body .content h2#quick-remember + ul > li + li { border-top: 1px dashed #bcd0ea; }
body .post-body .content h2#quick-remember + ul > li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 1.15rem; height: 1.15rem; border-radius: 6px; background: var(--navy); }
body .post-body .content h2#quick-remember + ul > li::after { content: ""; position: absolute; left: 0.42rem; top: 1.18rem; width: 0.3rem; height: 0.58rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
body .post-body .content h2#quick-remember + ul > li strong { color: var(--navy); }

/* ---------- Changelog of a post (front matter "changelog", see layouts/posts/single.html) ---------- */
.changelog { margin-top: .9rem; }
.changelog > summary {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #024a98; background: #eef4fc; border: 1.5px solid #024a98; border-radius: 999px; padding: .25rem .75rem;
}
.changelog > summary::-webkit-details-marker { display: none; }
.changelog > summary::after { content: "+"; font-weight: 800; }
.changelog[open] > summary::after { content: "\2212"; }
.changelog > summary:hover { background: #dbe8f8; }
.changelog-count { background: #FFC107; color: #1f2933; border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.changelog ol { list-style: none; margin: .8rem 0 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid #FFC107; }
.changelog li { display: flex; gap: .9rem; align-items: baseline; padding: .3rem 0; font-size: .92rem; line-height: 1.45; }
.changelog time { flex: 0 0 6.2rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; font-weight: 700; color: #024a98; }
.changelog li span { min-width: 0; color: #1f2933; }
@media (max-width: 575.98px) { .changelog li { flex-direction: column; gap: .1rem; } .changelog time { flex-basis: auto; } }
