Video2Guide / app /templates /_doc_styles.html
Claude
a11y pass for accessibility expert review
5a2d8c8
Raw History Blame Contribute Delete
12.8 kB
<style>
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Source+Sans+3:wght@400;600;700&family=JetBrains+Mono:wght@400&display=swap');
/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
--color-bg: #FFFFFF;
--color-surface: #FFFFFF;
--color-text: #1A1A1A;
--color-text-secondary: #555555;
--color-accent: #333333;
--color-accent-light: #F5F5F5;
--color-accent-dark: #1A1A1A;
--color-border: #D0D0D0;
--color-border-light: #E5E5E5;
--color-focus: #1A1A1A;
--color-note-bg: #F5F5F5;
--color-note-border: #999999;
--color-banner: #750014;
--color-banner-text: #FFFFFF;
--color-banner-secondary: #f5d5db; /* lightened for 4.5:1 against #750014 */
--color-warn-bg: #fff8db;
--color-warn-fg: #5a4500;
--font-heading: 'Merriweather', 'Georgia', serif;
--font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
--font-mono: 'JetBrains Mono', 'Consolas', monospace;
--measure: 72ch;
--space-xs: 0.25rem;
--space-sm: 0.5rem;
--space-md: 1rem;
--space-lg: 1.5rem;
--space-xl: 2.5rem;
--space-2xl: 4rem;
--radius: 6px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
font-size: 100%;
scroll-behavior: smooth;
scroll-padding-top: 5rem;
}
body {
font-family: var(--font-body);
font-size: 1.125rem;
line-height: 1.7;
color: var(--color-text);
background: var(--color-bg);
-webkit-font-smoothing: antialiased;
}
.skip-link {
position: absolute;
top: -100%;
left: var(--space-md);
background: var(--color-focus);
color: #fff;
padding: var(--space-sm) var(--space-md);
border-radius: var(--radius);
z-index: 1000;
font-weight: 600;
text-decoration: none;
}
.skip-link:focus { top: var(--space-md); }
/* Outline + box-shadow double-ring keeps focus visible on both light
page background AND the maroon banner / pressed-toggle background.
The inner ring is white (always pops on dark), the outer ring is
near-black (pops on light); whichever the surface is, one of the two
is high-contrast. WCAG 1.4.11 / 2.4.7. */
:focus-visible {
outline: 2px solid var(--color-focus);
outline-offset: 2px;
box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--color-focus);
border-radius: 2px;
}
a:focus-visible { border-radius: var(--radius); }
/* ========== DOCUMENT HEADER ========== */
.doc-header {
background: var(--color-banner);
color: var(--color-banner-text);
padding: var(--space-2xl) var(--space-lg);
text-align: center;
}
.doc-header__eyebrow {
font-family: var(--font-body);
font-size: 0.85rem;
font-weight: 600;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--color-banner-secondary);
margin-bottom: var(--space-sm);
}
.doc-header h1 {
font-family: var(--font-heading);
font-size: clamp(1.75rem, 4vw, 2.75rem);
font-weight: 700;
line-height: 1.25;
max-width: 20em;
margin: 0 auto var(--space-md);
}
.doc-header__meta {
font-size: 0.95rem;
color: var(--color-banner-secondary);
line-height: 1.5;
}
.doc-header__meta span + span::before {
content: "·";
margin: 0 0.5em;
}
/* ========== TABLE OF CONTENTS ========== */
.toc {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius);
max-width: 40rem;
margin: var(--space-xl) auto;
padding: var(--space-lg) var(--space-xl);
}
.toc h2 {
font-family: var(--font-heading);
font-size: 1.15rem;
margin-bottom: var(--space-md);
color: var(--color-accent-dark);
}
.toc ol {
list-style: none;
counter-reset: toc-counter;
padding: 0;
}
.toc li {
counter-increment: toc-counter;
margin-bottom: var(--space-sm);
}
.toc li::before {
content: counter(toc-counter) ".";
font-weight: 600;
color: var(--color-accent);
margin-right: 0.5em;
font-variant-numeric: tabular-nums;
}
/* The default-state underline used --color-border (#D0D0D0) which
only hits ~1.4:1 against the white TOC panel — a WCAG 1.4.11
Non-text Contrast fail for the link's idle indicator. Bump to
--color-text-secondary (#555) for ~7.4:1 so the underline is
perceivable as a link affordance at rest, not only on hover. */
.toc a {
color: var(--color-text);
text-decoration: underline;
text-decoration-color: var(--color-text-secondary);
text-underline-offset: 3px;
transition: text-decoration-color 0.15s;
}
.toc a:hover, .toc a:focus-visible {
text-decoration-color: var(--color-accent);
color: var(--color-accent-dark);
}
/* ========== MAIN CONTENT ========== */
.content {
max-width: var(--measure);
margin: 0 auto;
padding: var(--space-lg);
counter-reset: section-counter;
}
/* ========== SECTIONS ========== */
.section {
margin-bottom: var(--space-2xl);
padding-bottom: var(--space-xl);
border-bottom: 1px solid var(--color-border-light);
counter-increment: section-counter;
}
.section:last-child { border-bottom: none; }
.section__heading {
font-family: var(--font-heading);
font-size: 1.65rem;
color: var(--color-accent-dark);
margin-bottom: var(--space-md);
line-height: 1.3;
}
.section__heading::before {
content: counter(section-counter) ". ";
color: var(--color-accent);
font-variant-numeric: tabular-nums;
}
.section h3 {
font-family: var(--font-heading);
font-size: 1.25rem;
color: var(--color-text);
margin-top: var(--space-xl);
margin-bottom: var(--space-sm);
}
.section p { margin-bottom: var(--space-md); }
.section .meta-time {
font-family: var(--font-mono);
font-size: 0.85rem;
color: var(--color-text-secondary);
margin-top: -0.5rem;
margin-bottom: var(--space-md);
}
/* ========== FIGURES ========== */
.figure {
margin: var(--space-xl) 0;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius);
overflow: hidden;
}
.figure img {
display: block;
width: 100%;
height: auto;
}
.figure figcaption {
padding: var(--space-sm) var(--space-md);
font-size: 0.9rem;
color: var(--color-text-secondary);
border-top: 1px solid var(--color-border-light);
line-height: 1.5;
}
.figure__timestamp {
display: inline-block;
font-family: var(--font-mono);
font-size: 0.78rem;
background: var(--color-accent-light);
color: var(--color-accent-dark);
padding: 0.1em 0.5em;
border-radius: 3px;
margin-right: 0.4em;
vertical-align: middle;
}
/* ========== ON-SCREEN TEXT (OCR) ========== */
.onscreen-text {
margin: var(--space-lg) 0;
padding: var(--space-md) var(--space-lg);
border-left: 4px solid var(--color-accent);
background: var(--color-accent-light);
border-radius: 0 var(--radius) var(--radius) 0;
font-size: 1rem;
}
.onscreen-text > summary {
list-style: none;
cursor: pointer;
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--color-accent-dark);
margin-bottom: var(--space-xs);
}
.onscreen-text > summary::-webkit-details-marker { display: none; }
.onscreen-text > summary::after {
content: "▸";
margin-left: 0.4em;
transition: transform 0.15s;
display: inline-block;
}
.onscreen-text[open] > summary::after { transform: rotate(90deg); }
.onscreen-text__body {
white-space: pre-wrap;
margin-top: var(--space-sm);
}
/* ========== TRANSCRIPT ========== */
.narration { margin-top: var(--space-md); }
/* When rendered as <details>, surface the disclosure summary like
the onscreen-text block — banner colour, weight, pointer. */
details.narration > summary {
cursor: pointer;
font-weight: 600;
color: var(--color-banner, #750014);
padding: 0.3em 0;
}
details.narration > .narration__body {
margin-top: var(--space-xs);
}
.narration__label {
display: block;
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--color-text-secondary);
margin-bottom: var(--space-xs);
}
/* ========== FOOTER ========== */
.doc-footer {
text-align: center;
padding: var(--space-xl) var(--space-lg);
font-size: 0.85rem;
color: var(--color-text-secondary);
border-top: 1px solid var(--color-border-light);
max-width: var(--measure);
margin: 0 auto;
}
/* ========== KEY TERMS ========== */
dl.key-term {
margin: var(--space-lg) 0;
padding: var(--space-md) var(--space-lg);
background: var(--color-accent-light);
border-left: 4px solid #999999;
border-radius: 0 var(--radius) var(--radius) 0;
}
dl.key-term dt {
font-weight: 700;
font-size: 1.05rem;
color: var(--color-text);
}
dl.key-term dt + dt { margin-top: var(--space-sm); }
dl.key-term dd {
margin-top: var(--space-xs);
margin-left: 0;
color: var(--color-text-secondary);
}
/* ========== MATH EQUATIONS ========== */
figure.equation {
margin: var(--space-lg) 0;
padding: var(--space-lg);
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius);
text-align: center;
overflow-x: auto;
}
figure.equation .equation__label {
display: block;
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--color-accent-dark);
margin-bottom: var(--space-sm);
text-align: left;
}
figure.equation figcaption {
display: block;
font-size: 0.88rem;
color: var(--color-text-secondary);
margin-top: var(--space-sm);
text-align: left;
line-height: 1.5;
}
figure.equation mjx-container { color: var(--color-text) !important; font-size: 1.2em !important; }
/* ========== ACCESSIBILITY NOTE ========== */
.alt-warning {
max-width: var(--measure);
margin: var(--space-lg) auto;
background: var(--color-warn-bg);
color: var(--color-warn-fg);
border-left: 4px solid var(--color-banner);
padding: var(--space-md) var(--space-lg);
border-radius: 0 var(--radius) var(--radius) 0;
font-size: 0.95rem;
}
/* ========== PRINT ========== */
@media print {
body { font-size: 11pt; background: #fff; }
.doc-header { background: none; color: var(--color-text); padding: 1em 0; border-bottom: 2px solid #000; }
.doc-header__eyebrow, .doc-header__meta { color: var(--color-text-secondary); }
.skip-link { display: none; }
.section, .figure { page-break-inside: avoid; }
}
/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
.content { padding: var(--space-md); }
.toc { margin: var(--space-md); padding: var(--space-md); }
}
/* ========== NARRATION AUDIO ========== */
.narration__audio {
display: block;
width: 100%;
max-width: 28rem;
margin-top: var(--space-sm);
/* Don't force a fixed height — different browsers render the
native control bar at different heights, and clamping can push
the play/pause button below the 24px minimum target size. */
}
/* Screen-reader-only utility (WCAG 1.3.1, 1.4.1, 2.4.6) */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
/* Respect users who've asked the OS to minimize motion (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.001ms !important;
scroll-behavior: auto !important;
}
}
</style>