/* The ecosystem handbook: raku.online/ecosystem.
   Everything a module page needs beyond base.css — the facts panel under the
   title, and the index table. The examples themselves are base.css's
   .native-ex / pre.native-code / .expected, the same markup the FAQ and the
   front page use, so a static sample looks the same wherever you meet it. */

/* ---- the facts panel --------------------------------------------------- */
/* Version, dependency, licence, the state of the distribution's own suite,
   and when it was last checked. A reader deciding whether to use a module
   reads these five lines and nothing else, so they sit above the prose rather
   than in a table at the bottom. A two-column grid on a wide screen, one
   column on a phone; <dl> because that is what this is. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: .1rem 2rem;
  margin: 1.4rem 0 2rem;
  padding: 1rem 1.1rem;
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
}
.fact { display: flex; gap: .6rem; padding: .25rem 0; align-items: baseline; }
.facts dt {
  flex: 0 0 7.5rem;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
/* A dependency list is long and is set in code type, so it has to be allowed
   to break: without this it pushed into the next column of the grid. */
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts code { background: var(--code-bg); padding: .1em .4em; border-radius: 4px; font-size: .88em; }

/* Secondary text: the auth string next to a version, the engine pair next to a
   date, the blurb under a module's name on the index. */
.fact-sub { color: var(--muted); font-size: .88em; }

/* The status badge rides on the h1 line, so it needs to sit on the baseline
   rather than in the middle of a 2rem heading. */
.page-head .status { position: relative; top: -.35rem; }

/* ---- the index --------------------------------------------------------- */
.eco-index td { vertical-align: top; }
.eco-index td:first-child a { font-weight: 600; }
.eco-index .num { text-align: right; font-variant-numeric: tabular-nums; }
.eco-index th.num { text-align: right; }
.eco-index .status { margin-left: 0; }

/* ---- the file link on an example --------------------------------------- */
/* Every example is also a file in the repository, and the link to it sits
   beside the Copy button copy.js injects. Both are absolutely positioned inside
   .native-ex (base.css makes it the containing block); this one is offset far
   enough left to clear the Copy pill, and wears the same shape in a quieter
   colour so the pair reads as one control group rather than two decorations. */
.ex-src {
  position: absolute;
  top: .5rem;
  right: 4.3rem;
  z-index: 1;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .12em .55em;
  transition: color .12s ease, border-color .12s ease;
}
/* Not faded like the Copy button beside it: this one is a LINK, and on a narrow
   screen both pills sit over the first line of code — a half-transparent link
   there reads as part of the code rather than as a control. */
.ex-src:hover, .ex-src:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ---- examples ---------------------------------------------------------- */
/* An example and its output are one unit: the gap between a block and the
   output it produced has to be smaller than the gap to the next paragraph, or
   the page reads as alternating unrelated blocks. */
.native-ex + .expected { margin-top: .35rem; }
.expected + h2, .expected + h3, .native-ex + h2, .native-ex + h3 { margin-top: 2rem; }

/* A note the reader must not skip — the "this returns zeros on 3.5.1" kind. */
blockquote.note {
  margin: 1.4rem 0;
  padding: .9rem 1.1rem;
  background: var(--note-bg);
  border: 1px solid var(--note-bd);
  border-radius: 8px;
}
blockquote.note p { margin: 0; }
