/* Weft book theme tweaks.
   Kept small on purpose: mdBook's defaults are good, these only fix the
   places where a language reference needs more room or more contrast than
   a generic book does. */

:root {
  --weft-accent: #7c5cff;
  --weft-accent-soft: rgba(124, 92, 255, 0.14);
}

/* Wider measure. Type tables and port signatures wrap badly at 750px. */
.content main {
  max-width: 860px;
}

/* Code blocks carry a lot of the weight here, so give them air. */
.content pre {
  padding: 1rem 1.1rem;
  border-radius: 8px;
  line-height: 1.55;
}

.content pre > .buttons {
  opacity: 0.35;
}

/* Inline code should read as a token, not as body text. */
.content code {
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.92em;
}

/* Tables: the reference pages lean on them heavily. */
.content table {
  width: 100%;
  display: table;
  border-collapse: collapse;
}

.content table th {
  text-align: left;
  font-weight: 600;
}

.content table td,
.content table th {
  padding: 0.5rem 0.7rem;
  vertical-align: top;
}

/* Callouts. Written as blockquotes whose first line is a bold marker, so
   they degrade to ordinary quotes on GitHub and render as boxes here. */
.content blockquote {
  border-left: 3px solid var(--weft-accent);
  background: var(--weft-accent-soft);
  padding: 0.8rem 1rem;
  margin: 1.4rem 0;
}

.content blockquote > :first-child {
  margin-top: 0;
}

.content blockquote > :last-child {
  margin-bottom: 0;
}

/* Image briefs: while an image file is still missing, the alt text is what
   readers see. Make that legible rather than a broken-icon mess. */
.content img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 1.6rem auto;
}

/* Mermaid diagrams sit better centered with a little breathing room. */
.mermaid {
  margin: 1.8rem auto;
  text-align: center;
}
