src / styles / features / contribution-panels.css
/* ============================================================================
Contribution · feature panels
----------------------------------------------------------------------------
Scoped strictly to `.wiki-page--contribution`. Colours come from the Project
route palette (`--route-*`) and all spacing from the global rhythm tokens
(`--wiki-space-block` / `-p`), so this sheet adds no new scale of its own and
changes nothing for the other Project pages.
Four things live here, all keyed off markup the shared renderer already
emits — no new block type, no bespoke page furniture:
1. Figure scale. This page's diagrams are wide scans and screenshots; at full
column width one of them fills the viewport and pushes its own caption off
screen, so every figure here is height-capped and centred.
2. `.contribution-gallery` — a grid of consecutive `.wiki-figure` items. The
manuscript prints ONE caption for each photograph set ("Figure 7-10.
Activity photos from SynbioClassroom."), so the figures sit side by side
and the reader's existing `FIG. nn` counter numbers them in document
order. The global `.wiki-figure` rule is centre-aligned with a 24px block
margin; inside the grid that margin would double the gap, so it collapses
and the grid's own gaps become the single source of spacing (铁律 1/2:
measure the box once, in one place).
3. "Click to learn" hints — a paragraph whose last element is the
"click to learn" link is an instruction pointing at a resource, so it is
dressed as one.
4. `.wiki-table--parts` — the 23-row Registry table, whose first column is a
hyperlinked accession rather than a name with its URL printed below it.
========================================================================== */
/* --- 1. Figure scale ------------------------------------------------------ */
/* The cap goes on the picture, not the figure: the figure carries no intrinsic
size, so capping it would only clip the caption. `width: auto` keeps the
aspect ratio while `max-height` decides how much room the image may take —
about a third of the viewport, which is what keeps a figure and its caption
together on one screen. */
.wiki-page--contribution .wiki-figure img {
width: auto;
max-width: 100%;
max-height: clamp(220px, 36vh, 380px);
object-fit: contain;
}
/* --- 2. Photograph sets --------------------------------------------------- */
.wiki-page--contribution .contribution-gallery {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
column-gap: 16px;
row-gap: 16px;
align-items: start;
width: 100%;
}
/* Every frame is cut alike, so a four-photo set reads as a true 2x2 block and a
two-photo set as one row. The fixed ratio is what makes the rows line up. */
.wiki-page--contribution .contribution-gallery__item img {
width: 100%;
max-height: none;
aspect-ratio: 4 / 3;
border-radius: 12px;
object-fit: cover;
}
/* Reset figure margin: must use !important to override the global .wiki-figure margin */
.wiki-page--contribution .contribution-gallery .contribution-gallery__item {
margin: 0 !important;
}
.wiki-page--contribution .contribution-gallery__item figcaption {
max-width: none;
margin-top: 8px;
font-size: 12.5px;
line-height: 1.45;
text-wrap: pretty;
}
/* 3-item sets: fit 3 in one row on desktop as explicitly requested */
.wiki-page--contribution .contribution-gallery[data-count="3"] {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 767px) {
.wiki-page--contribution .contribution-gallery[data-count="3"] {
grid-template-columns: minmax(0, 1fr);
}
}
/* Card sheets & playing cards (FIG 12 & 13): portrait aspect, contained, scaled down */
.wiki-page--contribution .contribution-gallery--cards {
max-width: 620px;
margin: 0 auto;
}
.wiki-page--contribution .contribution-gallery--cards .contribution-gallery__item img {
aspect-ratio: auto;
max-height: 360px;
object-fit: contain;
}
/* 4-photo sets: scaled down & centered so all 4 photos comfortably fit on screen together with reduced gap */
.wiki-page--contribution .contribution-gallery[data-count="4"],
.wiki-page--contribution .contribution-gallery--compact-grid {
max-width: 820px;
margin-left: auto !important;
margin-right: auto !important;
column-gap: 16px;
row-gap: 14px;
}
.wiki-page--contribution .contribution-gallery[data-count="4"] .contribution-gallery__item img,
.wiki-page--contribution .contribution-gallery--compact-grid .contribution-gallery__item img {
max-height: 210px;
aspect-ratio: 16 / 10;
object-fit: cover;
}
/* --- 3. "Click to learn" hints -------------------------------------------- */
/* A paragraph that ENDS in the "click to learn" link is an instruction, not
part of the argument: it points at a resource. It stays in the same place in
the same run of prose, and only its dress changes — a rule, a tint and a
nudge in from the margin — so a reader skimming the page can see where a
resource waits. The `:has(> a:last-child)` test is what identifies them, and
it is why the data layer puts nothing after the link. */
.wiki-page--contribution
.wiki-prose
p:has(> a.wiki-prose-link:last-child) {
margin: var(--wiki-space-p, 16px) 0;
padding: 11px 16px;
border-left: 3px solid var(--route-accent);
border-radius: 0 8px 8px 0;
background: color-mix(in srgb, var(--route-soft, #dfee91) 40%, transparent);
font-size: 14.5px;
line-height: 1.6;
}
/* "click to learn" IS the link: route accent and bold (it takes over from the
old emphasised phrase), with an underline that only firms up on hover — the
same restraint as the parts table and the Design page's prose links. */
.wiki-page--contribution
.wiki-prose
p:has(> a.wiki-prose-link:last-child)
.wiki-prose-link {
color: var(--route-accent);
font-weight: 700;
text-decoration: underline;
text-decoration-color: color-mix(
in srgb,
var(--route-accent) 46%,
transparent
);
text-decoration-thickness: 1px;
text-underline-offset: 3px;
}
.wiki-page--contribution
.wiki-prose
p:has(> a.wiki-prose-link:last-child)
.wiki-prose-link:is(:hover, :focus-visible) {
color: var(--route-heading-ink, var(--route-ink));
text-decoration-color: currentColor;
}
/* --- 4. The Registry parts table ------------------------------------------ */
.wiki-page--contribution .wiki-table--parts {
min-width: 860px;
table-layout: fixed;
}
.wiki-page--contribution .wiki-table--parts th:nth-child(1),
.wiki-page--contribution .wiki-table--parts td:nth-child(1) {
width: 182px;
}
.wiki-page--contribution .wiki-table--parts th:nth-child(2),
.wiki-page--contribution .wiki-table--parts td:nth-child(2) {
width: 210px;
}
/* An accession is a link, so it is dressed as one: route accent, and an
underline that only firms up on hover. No box, no pill, no icon — the same
restraint the page's own prose links get. */
.wiki-page--contribution .wiki-table--parts .wiki-table__part-link {
color: var(--route-accent);
font-family: var(--font-mono);
font-size: 12px;
font-weight: 700;
letter-spacing: 0.01em;
text-decoration: underline;
text-decoration-color: color-mix(
in srgb,
var(--route-accent) 42%,
transparent
);
text-underline-offset: 3px;
word-break: break-word;
}
.wiki-page--contribution .wiki-table--parts .wiki-table__part-link:hover,
.wiki-page--contribution
.wiki-table--parts
.wiki-table__part-link:focus-visible {
text-decoration-color: var(--route-accent);
}
/* --- 5. The circularity-fraction equation --------------------------------- */
/* Rendered through the shared `feature` slot; typeset like the reader's
display equations on the Education page (Georgia serif, centred, scrollable
when narrow) with a stacked fraction built from two bordered spans. */
.contribution-equation {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 20px 12px;
overflow-x: auto;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(19px, 2vw, 26px);
white-space: nowrap;
}
.contribution-equation var {
font-style: italic;
}
.contribution-equation sup sub {
font-size: 0.72em;
}
.contribution-equation__fraction {
display: inline-flex;
flex-direction: column;
vertical-align: middle;
margin: 0 0.35em;
text-align: center;
}
.contribution-equation__fraction > span {
padding: 0 0.5em;
}
.contribution-equation__fraction > span:first-child {
border-bottom: 1px solid currentColor;
}
/* --- 6. Narrow screens ---------------------------------------------------- */
@media (max-width: 980px) {
.wiki-page--contribution .contribution-gallery {
row-gap: var(--wiki-space-p, 16px);
}
.wiki-page--contribution .wiki-figure img {
max-height: clamp(200px, 34vh, 320px);
}
}