/* Terminal style of the home page.
   - The "latest updates" blocks, written by scripts/generate_sota.py
     (render_latest): one line per reference.
   - The intro panel (div.term-panel) and the buttons (a.term-btn), written
     by hand in docs/index.md. */

.md-typeset div.latest-term {
  background: #2c2c2a;
  color: #f1efe8;
  border-radius: .2rem;
  padding: .6rem .9rem;
  margin: 1em 0;
  font-family: var(--md-code-font-family);
  font-size: .85em;
  line-height: 1.75;
}

.md-typeset div.latest-term p {
  margin: 0;
}

.md-typeset div.latest-term ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* One line per reference: a title too long for the width ends with "…";
   the full title shows on hover. */
.md-typeset div.latest-term ul li {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-typeset div.latest-term .term-prompt,
.md-typeset div.latest-term .term-comment {
  color: #b4b2a9;
}

.md-typeset div.latest-term .term-date {
  color: #5dcaa5;
  margin-right: 1.2ch;
}

.md-typeset div.latest-term a {
  color: #b5d4f4;
  text-decoration: none;
}

.md-typeset div.latest-term a:hover,
.md-typeset div.latest-term a:focus {
  color: #e6f1fb;
  text-decoration: underline;
}

/* Intro panel on the home page: same terminal as the "latest" blocks,
   but the text wraps. */
.md-typeset div.term-panel {
  background: #2c2c2a;
  color: #f1efe8;
  border-radius: .2rem;
  padding: .6rem .9rem;
  margin: 1em 0;
  font-family: var(--md-code-font-family);
  font-size: .85em;
  line-height: 1.7;
}

.md-typeset div.term-panel p {
  margin: 0 0 .9em;
}

.md-typeset div.term-panel p:last-child {
  margin-bottom: 0;
}

.md-typeset div.term-panel .term-prompt {
  color: #b4b2a9;
}

.md-typeset div.term-panel a {
  color: #b5d4f4;
  text-decoration: none;
  border-bottom: 1px dotted #b5d4f4;
}

.md-typeset div.term-panel a:hover,
.md-typeset div.term-panel a:focus {
  color: #e6f1fb;
  border-bottom-style: solid;
}

/* The "latest updates" blocks end on a prompt waiting for the next
   command: "$" and a green block cursor. It blinks 4 times (about 4.4 s),
   then stays on: blinking that lasts over 5 s would need a way to stop it
   (WCAG 2.2.2). Still from the start when the reader asks for less motion.
   Drawn here, so the sync's render_latest is unchanged. */
.md-typeset div.latest-term::after {
  content: "$";          /* browsers without the alternative-text syntax */
  content: "$" / "";
  display: block;
  color: #b4b2a9;
  background: linear-gradient(#5dcaa5, #5dcaa5) 2ch 50% / .6em 1.1em no-repeat;
  animation: term-blink 1.1s steps(1) 4;
}

@keyframes term-blink {
  50% { background-size: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset div.latest-term::after { animation: none; }
}

/* Terminal buttons: [ View SOTA → ]  [ Join at IEEE SA → ]
   Written in Markdown as [View SOTA →](p3579/index.md){ .term-btn } */
.md-typeset a.term-btn {
  display: inline-block;
  margin: 0 .6rem .6rem 0;
  padding: .25rem .7rem;
  background: #2c2c2a;
  color: #5dcaa5;
  border: 1px solid #5f5e5a;
  border-radius: .2rem;
  font-family: var(--md-code-font-family);
  font-size: .8em;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}

.md-typeset a.term-btn::before { content: "[ "; content: "[ " / ""; color: #888780; }
.md-typeset a.term-btn::after  { content: " ]"; content: " ]" / ""; color: #888780; }

.md-typeset a.term-btn:hover,
.md-typeset a.term-btn:focus-visible {
  background: #5dcaa5;
  color: #2c2c2a;
  border-color: #5dcaa5;
}

.md-typeset a.term-btn:hover::before,
.md-typeset a.term-btn:hover::after,
.md-typeset a.term-btn:focus-visible::before,
.md-typeset a.term-btn:focus-visible::after {
  color: #2c2c2a;
}
