/* The stitch repeat library's entries (/stitch-library), made by tools/site-library/build.py. */
.stitch-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 0.65rem; color: var(--ink); font: 0.8125rem/1.6 var(--mono); }
.stitch-entry p.stitch-meta { color: var(--ink); font-size: 0.8125rem; }
.stitch-entry p.stitch-step-links { margin-top: 0.9rem; font-size: 0.875rem; }
.stitch-step-links a { color: var(--teal); }
.stitch-more { margin-top: 0.75rem; border-top: 1px solid var(--line); }
.stitch-more + .stitch-more { margin-top: 0; }
.stitch-more summary { cursor: pointer; padding: 0.6rem 0; color: var(--teal); font-weight: 600; font-size: 0.9rem; }
.stitch-more summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.stitch-more .written-rounds { margin: 0.25rem 0 0.75rem; font-size: 0.875rem; }
.stitch-more .written-rounds li { color: var(--ink); }
.stitch-entry p.stitch-more-terms, .stitch-entry p.stitch-more-version { margin-top: 0.5rem; color: var(--teal); font: 0.75rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.stitch-entry p.stitch-more-version { color: var(--ink); font-weight: 700; }
.stitch-code { margin: 0.25rem 0 0.9rem; padding: 1rem; border-radius: 3px; background: var(--ink); color: var(--paper); font: 0.75rem/1.75 var(--mono); tab-size: 4; white-space: pre; overflow-x: auto; overflow-wrap: normal; }
.stitch-code:focus-visible { outline: 2px solid var(--yarn); outline-offset: 2px; }

/* Round 3: the multiple and the UK name read as two facts. */
.stitch-meta span + span::before { content: '·'; margin-right: 1rem; color: var(--muted); }

/* One stitch per row: the chart on the left, the name, notes and written pattern on the right,
   a line between stitches. Each family folds away under its heading. */
.stitch-group { border-top: 1px solid var(--line); }
.library-tools { border-bottom: 0; }
.stitch-group:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 3rem; }
.stitch-group > details, .stitch-group > details:first-child { border: 0; }
.stitch-group > details > summary { font: 1rem/1.5 var(--sans, Inter, system-ui, sans-serif); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; padding: 1.4rem 0; cursor: pointer; list-style: none; }
.stitch-group > details > summary::-webkit-details-marker { display: none; }
.stitch-group > details > summary::before { content: ''; align-self: center; width: 0.55rem; height: 0.55rem; margin-right: 0.35rem; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); transition: transform 0.15s ease; }
.stitch-group > details[open] > summary::before { transform: rotate(45deg); }
.stitch-group > details > summary h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.2; }
.stitch-group > details > summary:hover h2 { color: var(--teal); }
.stitch-group > details > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.stitch-group-count { color: var(--teal); font: 0.8125rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.stitch-group-intro { margin-left: auto; color: var(--muted); font-size: 0.95rem; }
.stitch-grid { margin: 0 0 1.5rem; }
.stitch-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 4rem; align-items: start; padding-block: 2rem; scroll-margin-top: 6.5rem; }
.stitch-entry[hidden] { display: none; }
.stitch-entry-chart { position: sticky; top: 6.5rem; }
.stitch-entry-chart .stitch-chart { margin-top: 0; }
.stitch-entry-chart .stitch-chart img { max-height: 24rem; }
.stitch-entry-text h3 { margin-top: 0; }
@media (max-width: 680px) {
  .stitch-group > details > summary { padding: 1.1rem 0; }
  .stitch-group-intro { margin-left: 0; flex-basis: 100%; font-size: 0.9rem; }
  .stitch-entry { grid-template-columns: 1fr; padding-block: 1.5rem; }
  .stitch-entry-chart { position: static; order: 2; }
  .stitch-entry-text { display: contents; }
  .stitch-entry-text .stitch-written, .stitch-entry-text .stitch-more { order: 3; }
}

/* The chart key's post-stitch symbols, drawn as the charts draw them. */
.chart-key .key-post { width: 0.8rem; height: 1.5rem; fill: none; stroke-width: 1.5; stroke-linecap: round; }
.chart-key .key-post + .key-post { margin: 0 0.3rem 0 -0.2rem; }
