/* CW3 candidate diagram/media presentation.
 * Appearance is owned by theme tokens. No independent mode detection.
 */
.cw3-diagram{
    display:block;
    max-width:100%;
    height:auto;
    margin:1.25rem auto;
    border-radius:.65rem;
    background:var(--cw-surface,#fff);
    color:var(--cw-text,#17202a);
    box-shadow:0 1px 0 rgba(15,23,42,.08)
}
.cw3-diagram--svg{padding:.6rem}
.cw3-diagram-library__intro{margin:0 0 1.25rem;color:var(--cw-text,#17202a)}
.cw3-diagram-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem}
.cw3-diagram-card{
    margin:0;
    padding:.75rem;
    border:1px solid var(--cw-border,rgba(100,116,139,.24));
    border-radius:.8rem;
    background:var(--cw-surface,#fff);
    color:var(--cw-text,#17202a)
}
.cw3-diagram-card img{margin:0 auto;max-height:260px;object-fit:contain;box-shadow:none}
.cw3-diagram-card figcaption{display:flex;flex-wrap:wrap;gap:.35rem .65rem;align-items:baseline;margin-top:.65rem;font-size:.88em;color:var(--cw-text,#17202a)}
.cw3-diagram-card figcaption span,.cw3-diagram-card figcaption em{color:var(--cw-muted,#667085);opacity:1}
@media(max-width:600px){.cw3-diagram-grid{grid-template-columns:1fr}.cw3-diagram-card{padding:.6rem}}
.cw3-diagram-credit{display:inline-block;font-size:.82em;line-height:1.45;color:var(--cw-muted,#667085)}
.cw3-diagram-credit a{color:var(--cw-brand,#3457d5);text-decoration:underline;text-underline-offset:.12em}

/* v0.7.0 public-safe legacy-media hold — remains active and reversible. */
.cw3-media-hold{
    margin:1rem 0;
    padding:.7rem .9rem;
    border:1px solid var(--cw-border,currentColor);
    border-radius:.5rem;
    background:var(--cw-soft,transparent);
    color:var(--cw-muted,currentColor);
    font-size:.9em
}

/* CW3_RC2_DIAGRAM_CANVAS_V1
 * The page/card follows Light/Dark/Read; the educational artwork gets a stable
 * figure canvas so transparent black labels/axes remain legible in Dark mode.
 * No image inversion, recolouring or filter is used.
 */
.cw3-diagram-card > a{
	display:block;
	box-sizing:border-box;
	padding:10px;
	background:var(--cw-figure-canvas,#fff);
	border:1px solid var(--cw-border);
	border-radius:10px;
	overflow:hidden;
}
.cw3-diagram-card > a > .cw3-diagram,
.cw3-diagram-card > a > img{
	display:block;
	max-width:100%;
	height:auto;
	margin-inline:auto;
	filter:none;
}

/* CW3_DIAGRAM_REDRAW_STABLE_CANVAS_V1
 * The CW redraw SVGs are transparent/light-first assets. Historical Diagram CSS
 * can still apply dark backgrounds and/or invert() under prefers-color-scheme.
 *
 * Scope only the 73 renderer-tagged CW redraws:
 * - stable white figure canvas;
 * - force the embedded SVG to use its light colour scheme;
 * - explicitly defeat historical filter/inversion rules;
 * - remove the temporary outer matte/frame from RC2.
 *
 * Open-license / externally attributed SVGs are not tagged and are untouched.
 */
.cw3-diagram-card > a{
	display:block;
	box-sizing:border-box;
	padding:0;
	background:transparent;
	border:0;
	border-radius:0;
	overflow:visible;
}

html .cw3-diagram-card img.cw3-diagram--svg.cw3-diagram--redraw{
	box-sizing:border-box;
	display:block;
	max-width:100%;
	height:auto;
	margin:0 auto;
	padding:.6rem;
	background:#ffffff !important;
	border-radius:.65rem;
	filter:none !important;
	color-scheme:only light !important;
	box-shadow:none;
}
