main
css 322 lines 7.28 KB
Raw
1 /* Article visual modules — generated covers, signal/noise, topic & repo trend.
2 Issue #328. Locally generated visuals only (no third-party/hotlinked assets).
3 Consistent with the Editorial Trend Report tokens + #327 mobile density. */
4
5 /* ---------- Generated cover / fallback ---------- */
6 .article-cover {
7 margin-top: var(--space-4);
8 }
9
10 .article-cover__panel {
11 position: relative;
12 display: flex;
13 flex-direction: column;
14 gap: var(--space-2);
15 /* Fixed aspect ratio reserves space up front -> no layout shift (CLS). */
16 aspect-ratio: 16 / 7;
17 min-height: calc(var(--space-12) + var(--space-3));
18 padding: var(--space-4);
19 overflow: hidden;
20 border: var(--size-border-thin) solid var(--color-border);
21 border-radius: var(--radius-md);
22 background: var(--color-surface);
23 }
24
25 .article-cover__panel--fallback {
26 aspect-ratio: auto;
27 min-height: 0;
28 gap: var(--space-1);
29 }
30
31 .article-cover__meta {
32 position: relative;
33 display: flex;
34 flex-direction: column;
35 gap: var(--space-1);
36 }
37
38 .article-cover__kicker {
39 margin: 0;
40 color: var(--color-text-muted);
41 font-size: var(--text-xs);
42 font-weight: 700;
43 letter-spacing: var(--tracking-nav);
44 text-transform: uppercase;
45 }
46
47 .article-cover__brand {
48 margin: 0;
49 color: var(--color-text);
50 font-size: var(--text-2xl);
51 font-weight: 800;
52 line-height: var(--leading-tight);
53 letter-spacing: var(--tracking-tight);
54 }
55
56 /* ---------- Topic prominence bar chart (#560) ----------
57 Every bar IS a topic: one bar per topic, in editorial-prominence order, each
58 labelled with its name and rank number. Replaces the former decorative motif
59 that visually mismatched the topic list. */
60 .article-cover__topics {
61 display: flex;
62 align-items: flex-end;
63 gap: var(--space-1);
64 flex: 1 1 auto;
65 min-height: 0;
66 margin: 0;
67 padding: 0;
68 list-style: none;
69 counter-reset: none;
70 }
71
72 /* Topic = a labelled bar. Plain, non-interactive caption metadata: no link,
73 no button/pill affordance, never looks clickable (operator ask, #328). */
74 .article-cover__topic {
75 display: flex;
76 flex: 1 1 0;
77 min-width: 0;
78 flex-direction: column;
79 align-items: center;
80 justify-content: flex-end;
81 height: 100%;
82 gap: var(--space-1);
83 }
84
85 /* The bar itself — height encodes rank (set inline via --bar-h); tonal shading
86 from --bar-i gives distinct, theme-aware tonalities (not one flat shade). */
87 .article-cover__bar {
88 width: 100%;
89 height: var(--bar-h, 100%);
90 min-height: var(--space-3);
91 border-radius: var(--radius-sm) var(--radius-sm) 0 0;
92 background: color-mix(
93 in srgb,
94 var(--color-accent) calc(82% - var(--bar-i, 0) * 6%),
95 var(--color-surface)
96 );
97 }
98
99 /* Rank number sits just above its bar, against the panel surface, so contrast
100 is independent of each bar's tonal fill (review: low-contrast on light bars). */
101 .article-cover__bar-num {
102 margin-bottom: 2px;
103 font-size: var(--text-xs);
104 font-weight: 700;
105 line-height: 1;
106 color: var(--color-text);
107 }
108
109 .article-cover__topic-label {
110 width: 100%;
111 font-size: var(--text-xs);
112 font-weight: 600;
113 line-height: var(--leading-tight);
114 text-align: center;
115 color: var(--color-text-muted);
116 overflow: hidden;
117 text-overflow: ellipsis;
118 white-space: nowrap;
119 }
120
121 .article-cover__legend {
122 margin: 0;
123 color: var(--color-text-muted);
124 font-size: var(--text-xs);
125 line-height: var(--leading-normal);
126 }
127
128 .article-cover__fallback-note {
129 margin: 0;
130 color: var(--color-text-muted);
131 font-size: var(--text-base);
132 line-height: var(--leading-relaxed);
133 }
134
135 .article-cover--image {
136 margin-block: var(--space-4) 0;
137 }
138
139 .article-cover__img {
140 display: block;
141 width: 100%;
142 height: auto;
143 border-radius: var(--radius-md);
144 }
145
146 .article-cover__attribution {
147 margin-top: var(--space-1);
148 color: var(--color-text-muted);
149 font-size: var(--text-xs);
150 }
151
152 /* ---------- Signal & Noise summary ---------- */
153 .signal-noise {
154 margin-top: var(--space-4);
155 padding: var(--space-4);
156 border: var(--size-border-thin) solid var(--color-border);
157 border-radius: var(--radius-md);
158 background: var(--color-surface);
159 }
160
161 .signal-noise__heading {
162 margin: 0 0 var(--space-3);
163 font-size: var(--text-xl);
164 line-height: var(--leading-tight);
165 }
166
167 .signal-noise__cols {
168 display: grid;
169 gap: var(--space-3);
170 grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--space-15) + var(--space-3))), 1fr));
171 }
172
173 .signal-noise__label {
174 display: flex;
175 align-items: center;
176 gap: var(--space-2);
177 margin: 0 0 var(--space-2);
178 font-size: var(--text-sm);
179 font-weight: 700;
180 text-transform: uppercase;
181 letter-spacing: var(--tracking-nav);
182 }
183
184 .signal-noise__dot {
185 width: var(--space-2);
186 height: var(--space-2);
187 border-radius: var(--radius-full);
188 background: var(--color-text-muted);
189 }
190
191 .signal-noise__col--signal .signal-noise__dot {
192 background: var(--color-success);
193 }
194
195 .signal-noise__col--noise .signal-noise__dot {
196 background: var(--color-danger);
197 }
198
199 .signal-noise__list {
200 margin: 0;
201 padding-left: var(--space-4);
202 color: var(--color-text);
203 line-height: var(--leading-relaxed);
204 }
205
206 .signal-noise__list li + li {
207 margin-top: var(--space-1);
208 }
209
210 .signal-noise__caveat,
211 .signal-noise__source {
212 margin: var(--space-3) 0 0;
213 color: var(--color-text-muted);
214 font-size: var(--text-sm);
215 line-height: var(--leading-normal);
216 }
217
218 /* ---------- Topic / star visualization ---------- */
219 .topic-stars {
220 margin-top: var(--space-4);
221 }
222
223 .topic-stars__heading {
224 margin: 0 0 var(--space-2);
225 font-size: var(--text-lg);
226 line-height: var(--leading-tight);
227 }
228
229 .topic-stars__cloud {
230 display: flex;
231 flex-wrap: wrap;
232 gap: var(--space-2);
233 margin: 0;
234 padding: 0;
235 list-style: none;
236 }
237
238 /* Topic names are caption metadata, not controls: plain muted labels with a
239 subtle separator. No background/border/padding-pill/hover -> never look clickable. */
240 .topic-stars__chip {
241 font-size: var(--text-sm);
242 font-weight: 600;
243 color: var(--color-text-muted);
244 }
245
246 .topic-stars__chip:not(:last-child)::after {
247 content: "·";
248 margin-inline-start: var(--space-3);
249 color: var(--color-border);
250 }
251
252 .topic-stars__figures {
253 margin: var(--space-2) 0 0;
254 color: var(--color-text-muted);
255 font-size: var(--text-sm);
256 }
257
258 .topic-stars__figures strong {
259 color: var(--color-text);
260 }
261
262 /* ---------- Repo trend chart ---------- */
263 .repo-trend {
264 margin: var(--space-4) 0;
265 }
266
267 .repo-trend__heading {
268 margin: 0 0 var(--space-2);
269 font-size: var(--text-base);
270 line-height: var(--leading-tight);
271 }
272
273 .repo-trend__chart {
274 display: block;
275 width: 100%;
276 height: calc(var(--space-11) + var(--space-2));
277 color: var(--color-accent);
278 }
279
280 .repo-trend__chart rect {
281 fill: currentColor;
282 opacity: 0.85;
283 }
284
285 .repo-trend__caption {
286 margin-top: var(--space-1);
287 color: var(--color-text-muted);
288 font-size: var(--text-xs);
289 }
290
291 /* ---------- Responsive (matches #327 mobile density) ---------- */
292 @media (max-width: 768px) {
293 .article-cover {
294 margin-top: var(--space-3);
295 }
296
297 .article-cover__panel {
298 aspect-ratio: 16 / 9;
299 padding: var(--space-3);
300 }
301
302 .article-cover__brand {
303 font-size: var(--text-xl);
304 }
305
306 .signal-noise {
307 margin-top: var(--space-3);
308 padding: var(--space-3);
309 }
310
311 /* Stack signal/noise columns to avoid cramped two-up at narrow widths. */
312 .signal-noise__cols {
313 grid-template-columns: 1fr;
314 gap: var(--space-3);
315 }
316
317 .topic-stars {
318 margin-top: var(--space-3);
319 }
320 }
321
322 /* No motion is used in the cover; nothing to reduce here. */