digraphs: dark backgrounds for scripts and character types
[sheet.git] / style / _base.scss
1 /* general */
2
3 body {
4         background: #FFF;
5         color: #000;
6         font-size: 90%;
7         text-align: center;
8 }
9 a, a:visited {
10         color: #000;
11         text-decoration: underline;
12 }
13 a:active, a:hover {
14         color: #00F;
15         text-decoration: none;
16 }
17
18 /* common sections */
19
20 h1, h2 {
21         font-size: 200%;
22         margin: 0;
23 }
24 h2, caption {
25         font-size: 110%;
26         font-weight: bold;
27 }
28 caption {
29         margin: 1ex;
30 }
31 caption aside {
32         position: absolute;
33         margin-left: 1ex;
34         font-weight: normal;
35         display: inline;
36         font-size: 91%; /* 100% */
37         margin-top: .3ex; /* align with 110% baseline */
38 }
39
40 hr {
41         clear: both;
42         visibility: hidden;
43         height: 2ex;
44         margin: 0;
45 }
46
47 .section ul {
48         margin-bottom: 1ex;
49 }
50 .section h2 {
51         margin: 0 1ex;
52         clear: both;
53 }
54 .section table {
55         float: left;
56         position: relative; /* prevents buggy hovering in table if caption present in gecko */
57         margin: 1ex 1ex 2ex;
58 }
59 .section .section {
60         float: left;
61 }
62 #charset .section table {
63         margin: -0.5ex 0 1ex; /* headers provide sufficient spacing already */
64 }
65
66 p {
67         margin: 1ex 0 1em;
68 }
69 p.aside {
70         font-size: 80%;
71 }
72 p.footer {
73         margin: 1em 0 0;
74         clear: both;
75 }
76 .help + .footer {
77         margin: 0;
78 }
79
80 .error {
81         background: #F00;
82         background: rgba(255, 0, 0, .8);
83         color: #FFF;
84         border: 2px solid #000;
85         border-width: 2px 0;
86         padding: 1em;
87         margin: 2ex auto;
88         clear: both;
89 }
90 .error > * {
91         margin-bottom: 1ex;
92 }
93 .error > *:last-child {
94         margin-bottom: 0;
95 }
96
97 ul {
98         margin: 0;
99         padding: 0;
100         list-style: none;
101 }
102
103 pre {
104         text-align: left;
105         margin: 2ex auto;
106         white-space: pre-wrap;
107         overflow-wrap: break-word;
108 }
109 body > pre {
110         width: 78ch;
111         tab-size: 4;
112         -moz-tab-size: 4;
113         padding: 0 1em;
114         border-width: 0 1px;
115         border-style: solid;
116         white-space: pre;
117         font-size: 1.9vmin; /* cover full width at most */
118 }
119 code {
120         white-space: nowrap;
121 }
122
123 h1 small,
124 h2 small {
125         position: absolute; /* side note; do not influence alignment */
126         margin-left: 1em;
127         font-weight: normal;
128         font-size: 50%; /* 1rem */
129         padding-top: 1.75ex; /* align baseline with container */
130 }
131 h2 small {
132         font-size: 90.9%;
133         padding-top: .17ex;
134 }
135
136 .section dl {
137         display: grid;
138         grid: auto-flow / 1fr 1fr;
139         clear: both;
140 }
141 .section dl > dt {
142         grid-column: 1;
143         text-align: right;
144 }
145 dt code {
146         white-space: normal;
147 }
148 dl > dd {
149         grid-column: 2;
150         text-align: left;
151         padding-left: 1em;
152         margin: 0 0 .5ex;
153 }
154 @media (max-width: 42em) {
155         .section dl {
156                 grid: auto-flow / minmax(8em, 1fr) minmax(10em, 3fr);
157         }
158         dl > dd {
159                 margin-bottom: 1ex; /* distinguish rows more as dts can wrap */
160         }
161         dd small {
162                 display: inline-block;
163         }
164         dd code {
165                 white-space: normal;
166         }
167 }
168
169 /* "keyboard" (list of keys) */
170
171 .row0 {margin-top: -5ex} /* top (esc) row fits besides header */
172 .row2 {margin-left: 7em} /* row offsets relative to ~6em key width */
173 .row3 {margin-left: 8em}
174 .row4 {margin-left: 10em} /* should actually align to next key on row1 */
175         /* ...however rows>=1 are shifted a bit, to make space */
176
177 table.keys tr {
178         clear: both; /* start new row (screen row) */
179         display: block;
180 }
181 table.keys tbody {
182         /* start new row block (keyboard row) */
183         clear: both;
184         padding-top: 1ex;
185         display: block;
186 }
187
188 table.keys th,
189 h3      {display: none} /* semantic details (non-css/js) */
190 .keys .mode {display: none} /* initially hidden (only show interactively (js)) */
191
192 table.keys {
193         display: block;
194         border-spacing: 0;
195         border-collapse: collapse;
196         white-space: nowrap;
197         text-align: left;
198 }
199
200 /* individual keys */
201
202 dl.legend dt,
203 .keys td {
204         display: inline-block;
205         white-space: normal;
206         width: 6.2em;
207         line-height: 2.25ex; /* a little terser (seems to be gecko's default anyway) */
208         height: 4.5ex; /* 2 lines */
209         overflow: hidden;
210         margin: 0 2px -1px;
211         padding: 0;
212         text-align: center;
213         border: 1px solid #000;
214         border-radius: 4px;
215         -moz-border-radius: 4px;
216         text-transform-variation: text;
217 }
218 .keys td b {
219         float: left;
220         font-size: 200%;
221         line-height: 2.5ex; /* inherits otherwise */
222         padding-left: 2px;
223 }
224 .keys .row0 td { /* omni-present esc */
225         width: 8.5em;
226 }
227
228 /* fine tuning of special occurrences */
229
230 .keys td b[title] { /* mnemonic hover */
231         cursor: help;
232 }
233 .keys td[onclick]:hover { /* link */
234         cursor: pointer;
235 }
236 .keys td a { /* key link */
237         color: inherit;
238         text-decoration: none;
239         display: block;
240         height: 100%;
241 }
242
243 .keys .meta td b,
244 .keys .ctrl td b,
245 .keys .lead td b { /* char with ctrl or leading key */
246         font-size: 100%; /* space is too limited for 2+ double-sized chars */
247         line-height: 5ex; /* keep double height though */
248 }
249 .keys .meta td b small,
250 .keys .ctrl td b small { /* meta key indicator */
251         font-size: 70%;
252         font-weight: normal; /* nice and subtle */
253 }
254
255 /* enlarged keys */
256
257 .keys.big td {
258         width: 1em;
259         min-width: auto;
260         height: 2.25ex;
261         font-size: 200%;
262         font-size: calc(7vmin - 4px); /* fit 12 keys to page */
263         overflow: visible;
264         position: relative;
265         padding: 0;
266         margin: 0 .2vw -1px;
267 }
268
269 /* override row alignments */
270 .keys.big tbody {
271         font-size: calc(1.4vmin); /* enlarged td conversion */
272 }
273 .keys.big .row2 {margin-left: 7em}
274 .keys.big .row3 {margin-left: 8em}
275 .keys.big .row4 {margin-left: 10em}
276 .keys.big .row0 {
277         display: none; /* headerless */
278 }
279
280 .keys.big td b {
281         position: absolute; /* overlay */
282         z-index: 1;
283         top: -1.2ex; /* halfway over shift */
284         left: 0;
285         right: 0;
286         font-size: 50%;
287         opacity: .5;
288         color: #FFF;
289         line-height: 2.25ex;
290 }
291 .keys.big.cmp td b,
292 .keys.big .ctrl td b,
293 .keys.big .meta td b,
294 .keys.big .shift td b {
295         display: none;
296 }
297
298 /* tables */
299
300 table {
301         border-collapse: collapse;
302 }
303 th, td {
304         border-color: #778;
305         border: 1px solid #888;
306         background: #DDD;
307 }
308 thead th, td {
309         text-align: center;
310 }
311
312 td.joind {
313         border-bottom: none;
314 }
315 td.joinu {
316         /* first cell determines border width for entire row */
317         border-top-color: transparent;
318 }
319 td.joinr {
320         border-right: none;
321 }
322 td.joinl {
323         border-left: none;
324 }
325
326 thead {
327         position: sticky;
328         top: 0;
329         background: #DDD8;
330 }
331
332 /* character table */
333
334 .glyphs thead th, .glyphs td {
335         width: 1.6em; /* regular interval */
336 }
337 .glyphs tbody td {
338         font-size: 112%;
339 }
340 .glyphs.big tbody td {
341         font-size: 200%;
342 }
343 .glyphs .glyphs {
344         margin: 0.5ex 0; /* nested in legend */
345 }
346 .glyphs .glyphs td {
347         font-size: 100%;
348 }
349
350 .cover td {
351         min-width: 2.5ex; /* square cells */
352 }
353
354 /* table headers */
355
356 th,
357 tfoot td,
358 thead td {
359         border-width: 0;
360         background: transparent;
361 }
362 .glyphs thead td {
363         width: auto; /* no glyph cells in header */
364 }
365 .glyphs caption {
366         margin-left: 2.2em; /* 1ex + offset head column (1.6em + 0.4em) / 110% */
367                 /* adjusted insignificant -.2em to fit wide contents on /charset/mac */
368 }
369 th {
370         padding: 0 0.2em;
371 }
372 .diinfo th {
373         font-size: 50%; /* mostly insignificant here */
374         font-weight: normal;
375 }
376 .diinfo tbody th {
377         text-align: right; /* variable width so keep near cells */
378         padding: 0 0.5em;
379 }
380 .cat {
381         font-size: 70%;
382         text-transform: uppercase;
383 }
384 tfoot .cat th {
385         border-top: 1px solid #888;
386 }
387
388 /* colour map */
389
390 table.color td {
391         border: 1px solid #555;
392         font-weight: normal;
393         padding: 0 8px;
394 }
395 table.color td samp {
396         margin: 0 -8px 0 8px;
397         font-family: inherit;
398         float: right;
399 }
400 table.color td samp ~ samp {
401 }
402 table.color td samp small {
403         font: 100% monospace;
404         padding: 0 .5ex;
405 }
406
407 /* digraphs map */
408
409 table.dimap {
410         table-layout: fixed; /* prevent resizing, notably in msie6 */
411 }
412 .dimap thead th, .dimap td {
413         /* below-maximum size (but still average enough to be regular) so we can fit more */
414         width: 1.2em; /* msie only looks at the first row */
415         min-width: 1em; /* prevents gecko from restricting to page width */
416 }
417 .dimap th {
418         text-align: center; /* row headers are also glyph-sized */
419 }
420
421 .mapped tbody, .mapped colgroup,
422 .dimap tbody, .dimap colgroup {
423         border: 2px double #888; /* major character group grid */
424 }
425 .mapped tbody,
426 .dimap tbody {
427         border-width: 2px 0; /* horizontal group dividers */
428 }
429 .mapped colgroup,
430 .dimap colgroup {
431         border-width: 0 2px; /* vertical divides */
432 }
433
434 /* digraph selection */
435
436 .diinfo {
437         -moz-column-width: 24em;
438         -webkit-column-width: 24em;
439         column-width: 24em;
440 }
441 .diinfo > div {
442         overflow: hidden;
443         column-break-inside: avoid;
444         -webkit-column-break-inside: avoid;
445         position: relative; z-index: 1; /* webkit bug */
446 }
447
448 /* glyph cell overlay (digraph labels) */
449
450 .glyphs.dilabel td {
451         padding: 0;
452         padding-bottom: 1.1ex; /* reserve space for label */
453         vertical-align: bottom;
454 }
455 .glyphs.dilabel small {
456         font-size: 50%;
457         display: block;
458         margin-top: 0.2ex;
459         margin-bottom: -2.2ex; /* take cell padding */
460 }
461 .glyphs.dilabel small.digraph {
462         background: #000;
463         color: #FFF;
464         opacity: 0.3;
465 }
466 .glyphs.dilabel small.value {
467         background: #600;
468         color: #FFF;
469         opacity: 0.3;
470 }
471
472 /* character properties */
473
474 .X  {background: #FFF} /* unidentified */
475 .Mc, .Me, .Zl, .Zp      {background: #F00} /* unstyled */
476 .X > span               {background: #898; background: rgba(0, 0, 0, .25)} /* invisible contents */
477
478 /* letter scripts */
479 .Armenian,
480 .Greek    {background: #FFE8CF}
481 .Cyrillic {background: #FFDDA8}
482 .Latin    {background: #FFB}
483 .Aramaic,
484 .Hebrew   {background: #FFD}
485 .Arabic   {background: #EFE}
486 .African  {background: #DED}
487 .Brahmic  {background: #FBB} /* same as number */
488 .Khmer    {background: #FBA}
489 .Hangul,
490 .Syllabic {background: #DEA}
491 .Katakana {background: #DFA}
492 .Hiragana {background: #DFC}
493 .Bopomofo {background: #BFC}
494 .Han      {background: #CFD}
495 .Alpha    {background: #ADA} /* other scripts */
496
497 /* other categories */
498 .Nd, .Nl, .No         {background: #FDD} /* number */
499 .Sc                   {background: #FCD} /* currency */
500 .Sm                   {background: #ECE} /* math */
501 .So                   {background: #DCF} /* symbol */
502 .Pd, .Po, .Pc         {background: #CDF} /* punctuation */
503 .Ps, .Pe, .Pi, .Pf    {background: #BEF} /* quote */
504 .Lm, .Sk              {background: #CEE} /* spacing modifier */
505 .Mn                   {background: #ACC} /* modifier */
506 .Cc, .Cf {color: #666; background: #BBB} /* control */
507 .Zs                   {background: #ACB} /* space */
508 .Co, .Xi.Co           {background: #DCC} /* private */
509 .Xi, .Cs              {background: #CCC} /* invalid */
510 .Xd                   {color: #844} /* deprecated */
511 .Xr                   {color: #888} /* reserved (digraph reverse or proposal) */
512 .dimap .Xr            {background: #EEE} /* reversed digraph */
513 .ccmap .Xr {opacity:.4}
514
515 /* support levels */
516 .l1 {background: #FDD} /* no, unsupported, other */
517 .l2 {background: #FED} /* partial, restricted, unofficial */
518         /* default u-prop, u-bmp */
519 .l3 {background: #FFD} /* almost, imperfect, common */
520         /* default u-di, u-lat1 */
521 .l4 {background: #EFD} /* yes, supported, ubiquitous, native */
522         /* default u-ascii */
523 .l5 {background: #DFD} /* complete, perfect */
524 .l0 {background: #EEE} /* unknown, omitted */
525 .ex {     color: #888; color: rgba(0, 0, 0, .5)} /* experimental, disfavoured */
526 .u-invalid {background: #BBB} /* invalid, impossible */
527
528 /* foreground representation */
529 #digraphs .u-l4 {color: #080} /* partial */
530 #digraphs .u-l5 {color: #4C0} /* experimental */
531 #digraphs .u-l2 {color: #A44; color: rgba(128, 0, 0, .6)} /* unofficial */
532 #digraphs .u-l1 {color: #D00; color: rgba(255, 0, 0, .8)} /* missing */
533
534 /* support percentage (browser cells) */
535 .p0         {opacity: .6}
536 .p0.p       {opacity: 1}
537 .p::after   {content: '!'; color: #F00}
538 .p4::after  {color: #C00}
539 .p3::after  {color: #A00}
540 .p2::after  {color: #800}
541 .p1::after,
542 .p0::after  {color: #000}
543 .p09::after {opacity: .9}
544 .p08::after {opacity: .8}
545 .p07::after {opacity: .7}
546 .p06::after {opacity: .6}
547 .p05::after {opacity: .5}
548 .p04::after {opacity: .4}
549 .p03::after {opacity: .3}
550 .p02::after {opacity: .2}
551 .p01::after {opacity: .1}
552 .p00::after {display: none}
553
554 /* code syntax */
555 .sy-comment    { color: #888 }
556 .sy-constant   { color: #008 }
557 .sy-identifier { color: #804 }
558 .sy-statement  { }
559 .sy-preProc    { }
560 .sy-type,
561 .sy-special    { color: #408 }
562 .sy-error      { font-weight: bold; background-color: #F00; color: #FFF }
563 .sy-todo       { background-color: #FF0 }
564
565 /* boolean alternate */
566 .glyphs b      { font-weight: normal; color: #800 }
567
568 /* hover effects */
569 .X:hover {cursor: help}
570 body { // precedence in dark
571 .X:hover > span                            {background: #FFF} /* whitespace marker */
572 .Greek:hover, .Armenian:hover              {background: #FA8}
573 .Cyrillic:hover                            {background: #FB7}
574 .Latin:hover                               {background: #EE4}
575 .Hebrew:hover, .Aramaic:hover              {background: #FFA}
576 .Arabic:hover                              {background: #CFD}
577 .African:hover                             {background: #BDB}
578 .Syllabic:hover, .Hangul:hover             {background: #CE6}
579 .Katakana:hover                            {background: #BF7}
580 .Hiragana:hover                            {background: #AF8}
581 .Bopomofo:hover                            {background: #8FA}
582 .Brahmic:hover                             {background: #F77}
583 .Khmer:hover                               {background: #F87}
584 .Han:hover                                 {background: #5EB}
585 .Alpha:hover                               {background: #5C5}
586 .Nd:hover, .Nl:hover, .No:hover            {background: #F99} /* number */
587 .Sc:hover                                  {background: #F8C} /* currency */
588 .Sm:hover                                  {background: #F8F} /* math */
589 .So:hover                                  {background: #A8F} /* symbol */
590 .Pd:hover, .Po:hover, .Pc:hover            {background: #8AF} /* punctuation */
591 .Ps:hover, .Pe:hover, .Pi:hover, .Pf:hover {background: #8DF} /* quote */
592 .Lm:hover, .Sk:hover                       {background: #BFF} /* spacing modifier */
593 .Mn:hover                                  {background: #CDE} /* modifier */
594 .Zs:hover                                  {background: #CED} /* space */
595 .Cc:hover, .Cf:hover                       {background: #DDD} /* control */
596 .Co:hover                                  {background: #A77} /* private */
597 .Xr:hover                                  {background: #FFF} /* reserved */
598 .Xi:hover                                  {background: #DDD} /* invalid */
599 .l0:hover                                  {background: #888}
600 .l1:hover                                  {background: #F88}
601 .l2:hover                                  {background: #FC8}
602 .l3:hover                                  {background: #FF8}
603 .l4:hover                                  {background: #CF8}
604 .l5:hover                                  {background: #8F8}
605 }
606 .u-l4:hover    {outline: 1px solid #080}
607 .u-l5:hover    {outline: 1px solid #8F0}
608 .u-l2:hover    {outline: 1px solid #800}
609 .u-l1:hover    {outline: 1px solid #F00}
610
611 /* key type colorization */
612
613 .c-sa,
614 .g1 {background: #BFE} /* cyan: info */
615 .c-na,
616 .g2 {background: #BFB} /* green: motion */
617 .g3 {background: #DFA} /* greenish: jump (g2+) */
618 .c-af,
619 .g4 {background: #FFA} /* yellow: command */
620 .c-eu,
621 .g5 {background: #FDA} /* orangish: open (g6-) */
622 .g6 {background: #FCA} /* orange: insert */
623 .c-as,
624 .g7 {background: #FCC} /* red: mode */
625 .c-an,
626 .g8 {background: #ECE} /* purple: visual (g7+) */
627 .c-oc,
628 .g9 {background: #CCF} /* blue: prefix */
629
630 .c-sa:hover,
631 .g1 a:hover, .g1[onclick]:hover {background: #5ED}
632 .c-na:hover,
633 .g2 a:hover, .g2[onclick]:hover {background: #7E7}
634 .g3 a:hover, .g3[onclick]:hover {background: #CE6}
635 .c-af:hover,
636 .g4 a:hover, .g4[onclick]:hover {background: #EE4}
637 .c-eu:hover,
638 .g5 a:hover, .g5[onclick]:hover {background: #FA6}
639 .g6 a:hover, .g6[onclick]:hover {background: #F97}
640 .c-as:hover,
641 .g7 a:hover, .g7[onclick]:hover {background: #F88}
642 .c-an:hover,
643 .g8 a:hover, .g8[onclick]:hover {background: #D9D}
644 .c-oc:hover,
645 .g9 a:hover, .g9[onclick]:hover {background: #99F}
646
647 .no {
648         background: #EEE; /* unassigned */
649 }
650 .keys td.ni {
651         border: 0;
652         padding: 1px; /* same size as borderlessless keys */
653         background: none;
654 }
655
656 dl.legend dt.more,
657 .keys td.more {
658         outline: 3px solid #0006;
659         outline-offset: -3px; /* inside */
660 }
661 dl.legend dt.new,
662 .keys td.new {
663         border-style: dashed;
664 }
665 .ext,
666 dl.legend dt.ext,
667 .keys td.ext {
668         opacity: .6;
669 }
670
671 /* l/r help columns */
672
673 .help {
674         display: table;
675         width: 100%;
676 }
677 .help > * {
678         display: table-cell;
679         width: 20%;
680         vertical-align: top;
681 }
682
683 .left dl.legend {
684         margin-left: 6.4em; /* a bit over 6.2em to allow for borders+padding (border-sizing would work too) */
685 }
686 .left dl.legend dt {
687         margin-left: -6.4em; /* msie<=6 multiply this by two for some reason */
688         float: left;
689         clear: left;
690 }
691 .left dl.legend dd {
692         float: left; /* align next to dt (except msie<=7 does just the opposite) */
693 }
694 .right dl.legend {
695         margin-right: 6.4em;
696 }
697 .right dl.legend dt {
698         margin-right: -6.4em;
699         float: right;
700         clear: right;
701 }
702 .right dl.legend dd {
703         float: right;
704 }
705 .right {
706         text-align: right;
707 }
708
709 /* help/legend */
710
711 dl.legend dt {
712         margin: 0 0 1px; /* distinct keys */
713         height: auto; /* not key-height */
714         padding: 2px 0;
715 }
716 dl.legend dd {
717         margin: 3px 0.4em 0; /* align text (add dt border+padding height) */
718         padding: 0;
719 }
720
721 dl.legend-options dt {
722         background: #CCC;
723 }
724
725 ul.legend-set {
726         clear: right;
727         padding-top: 1ex;
728 }
729 ul.legend-set li {
730         margin: 6px 0; /* similar to dl legends */
731 }
732
733 .legend {
734         margin-top: 1em;
735 }
736 .legend table {
737         width: 100%;
738 }
739 .legend td {
740         padding: 0 0.2em;
741 }
742
743 /* images */
744
745 figure {
746         margin: 0;
747         position: relative;
748 }
749 figure img {
750         vertical-align: bottom;
751         width: 100%;
752 }
753
754 @media (min-width: 60em) {
755         figcaption {
756                 padding: 0 1em;
757                 color: #000;
758                 background: rgba(255, 255, 255, .66);
759                 position: absolute;
760                 right: 0;
761                 bottom: 0;
762                 max-width: 100%;
763                 box-sizing: border-box;
764         }
765         .gallery li.parent:hover > figure > figcaption,
766         .gallery figure:hover > figcaption {
767                 /* highlight title of current and parents */
768                 font-size: 175%;
769                 right: 50%;
770                 bottom: 50%;
771                 transform: translate(50%, 50%);
772                 margin-left: -60%; /* keep width */
773         }
774 }
775
776 /* image gallery */
777
778 .gallery {
779         display: grid;
780         grid: auto-flow dense / repeat(auto-fit, minmax(200px, 1fr));
781         grid-gap: 1px;
782 }
783 .gallery li, .gallery ul {
784         display: contents;
785 }
786 .gallery figure {
787         overflow: hidden;
788         box-sizing: border-box;
789         hyphens: auto;
790         max-width: 900px;
791 }
792 .gallery figcaption > small {
793         display: inline-block;
794 }
795
796 @media (min-width: 403px) and (min-height: 266px) {
797         /* able to fit 2 cells of 200x133 */
798         .gallery li.large > figure {
799                 grid-row: span 2;
800                 grid-column: span 2;
801         }
802 }
803 @media (min-width: 603px) and (min-height: 400px) {
804         /* fit 3 cells of 200x133 */
805         .gallery > li:first-child > figure,
806         .gallery li.huge > figure {
807                 grid-row: span 3;
808                 grid-column: span 3;
809         }
810 }
811
812 .gallery figure, .gallery figcaption {
813         transition: all .5s ease-in;
814 }
815 .gallery figure:hover ~ ul figcaption {
816         /* mark all children */
817         color: #FFF;
818         background: rgba(0, 0, 0, .5);
819 }
820
821 .gallery figure[data-sup]:after {
822         position: absolute;
823         right: 0;
824         content: attr(data-sup);
825         color: #FFF;
826         background: #0006;
827         border-radius: 1em;
828         padding: .1ex .4em;
829         margin: .4em;
830 }
831 .gallery .expand > figure[data-sup]:after {
832         content: '+' attr(data-sup);
833         background: #0008;
834         font-size: 150%;
835         border: 2px solid #FFF8;
836 }
837
838 /* specialised galleries */
839
840 body#word {
841         margin: 8px 1px;
842 }
843
844 table.gallery {
845         grid-auto-flow: row;
846         grid-template-columns: repeat(auto-fit, minmax(2em, max-content)); /* 1fr */
847 }
848 table.gallery tbody,
849 table.gallery tr {
850         display: contents;
851 }
852 table.gallery tr > :first-child {
853         grid-column: 1;
854         -grid-row: span 6;
855         margin: auto; /* vertical-align: middle */
856 }
857 table.gallery tr > :nth-child(2) {
858         grid-column: 2; /* in case 1st is missing */
859 }
860 table.gallery td {
861         border: 0; /* does not collapse */
862         outline: 1px solid #888; /* over grid-gap */
863 }
864
865 /* page-specific */
866
867 #browser td > a {
868         text-decoration: none;
869 }
870 #browser td > a:active,
871 #browser td > a:hover {
872         text-decoration: underline;
873 }
874 #browser tr .aside {
875         font-size: 80%;
876         overflow: hidden;
877         height: 0;
878         -webkit-transition: all 1s ease-in;
879         -o-transition: all 1s ease-in;
880         -moz-transition: all 1s ease-in;
881         transition: height 1s ease-in;
882 }
883 #browser tr .aside p {
884         margin: 1ex 0;
885 }
886 #browser tr.target .aside,
887 #browser tr:target .aside {
888         height: auto;
889 }
890 #browser td.X {
891         white-space: nowrap; /* some browsers break on dashes */
892 }
893
894 #browser tr:target > td:first-of-type,
895 #browser tr.focus > td:first-of-type {
896         background: inherit;
897 }
898 #browser tr.focus > td {
899         border-bottom-color: #000;
900 }
901
902 form.aside {
903         position: absolute;
904         top: 3ex;
905         right: 1em;
906 }
907
908 .family-name {
909         font-variant: small-caps;
910 }
911
912 #index nav {
913         columns: 3;
914         -moz-columns: 3;
915         -webkit-columns: 3;
916 }
917 nav > .section {
918         break-inside: avoid;
919         -webkit-column-break-inside: avoid; /* webkit */
920         page-break-inside: avoid; /* moz */
921         overflow: hidden; /* webkit workaround */
922 }
923 #index nav a {
924         display: inline-block;
925         margin-top: 1em;
926 }
927
928 .units tbody tr:hover:not(.race) {
929         background: #EEE;
930 }
931 .unit-gas {
932         color: #040;
933 }
934 .unit-min, .unit-min a:not(:hover) {
935         color: #004;
936 }
937 .unit-supply {
938         color: #080;
939 }
940 .unit-o {color: #C08} /* organic */
941 .unit-u {color: #44C} /* mechanic */
942 .unit-p {color: #0A8} /* psionic */
943 .unit-composed {
944         color: #C88;
945 }
946 .unit-air {
947         color: #08C;
948 }
949 .unit-x {color: #888}
950 .unit-s {color: #890}
951 .unit-m {color: #C70}
952 .unit-l {color: #D22}
953 .unit-h {color: #804}
954 .magic-opt:before,
955 .magic-opt:after {
956         color: #000;
957 }
958 .hurtrel, .units .hurtrel {
959         color: #778;
960 }
961 tbody .unit-shield {
962         color: #64A;
963 }
964 .unit-pdd {
965         color: #A8C;
966 }
967 .unit-splash {
968         color: #4A0;
969 }
970 .hurt-a {
971         color: #036;
972 }
973 .hurt-g {
974         color: #063;
975 }
976 .unit-massive {
977         color: #D88;
978 }
979 .unit-detect::before {
980         color: #0A8;
981 }
982 .unit-jump {
983         color: #8A4;
984 }
985 body .magic-perma {
986                 text-decoration-color: #8C0;
987            -moz-text-decoration-color: #8C0;
988         -webkit-text-decoration-color: #8C0;
989 }
990
991 /* printing hints */
992
993 @page {
994         size: landscape;
995         margin: 0;
996 }
997
998 @media print {
999         ul.legend-set {display: none} /* current options only relevant on dynamic media */
1000 }
1001
1002 /* terse optimisation */
1003
1004 @media (min-height: 112ex) and (min-width: 90em) {
1005         .keys td {
1006                 padding: 1ex 0 1ex .1em;
1007                 width: 7em;
1008         }
1009 }
1010
1011 @media (max-width: 79em) {
1012         .keys td {
1013                 position: relative; /* hides overflow */
1014                 width: 4.5em;
1015                 min-width: 6.5vw;
1016                 min-width: calc(7.7vw - 8px);
1017         }
1018         .keys td b,
1019         .keys .meta td b,
1020         .keys .ctrl td b,
1021         .keys .lead td b { /* leading chars always fit */
1022                 position: absolute; /* background */
1023                 right: 0; /* least overlap in corner */
1024                 font-size: 250%;
1025                 line-height: 2.5ex;
1026                 opacity: .5;
1027                 color: #FFF;
1028         }
1029
1030         .row2 {margin-left: 5.3em} /* 7em / Δtd(6em : 4.5em) */
1031         .row3 {margin-left: 6em}   /* 8em / Δtd */
1032         .row4 {margin-left: 7.5em} /* 10em / Δtd */
1033
1034         /* letter scripts columns to rows */
1035         .legend .glyphs:first-child td {
1036                 display: table-row;
1037                 vertical-align: baseline;
1038         }
1039         .legend .glyphs td > table {
1040                 width: auto;
1041                 display: inline;
1042                 margin-left: 1ex;
1043         }
1044         .legend .glyphs:first-child td td {
1045                 margin: 2px;
1046                 display: inline-block;
1047                 width: auto;
1048         }
1049
1050         @media (max-width: 61em) {
1051                 .keys td {
1052                         width: 3em;
1053                         height: 6.75ex; /* 3 lines */
1054                         font-size: 80%;
1055                 }
1056                 .keys td b,
1057                 .keys .meta td b,
1058                 .keys .ctrl td b,
1059                 .keys .lead td b {
1060                         line-height: 4ex;
1061                 }
1062
1063                 .row2 {margin-left: 3.5em} /* 7em / Δtd(6em : 3em) */
1064                 .row3 {margin-left: 4em}   /* 8em / Δtd */
1065                 .row4 {margin-left: 5em}   /* 10em / Δtd */
1066         }
1067
1068         @media (max-width: 42em) {
1069                 /* flatten right legend column on mobile */
1070                 .help > * {
1071                         display: table-row;
1072                         width: auto;
1073                 }
1074                 ul.legend-set {
1075                         clear: left;
1076                 }
1077                 .right dl.legend {
1078                         margin-right: 0;
1079                         margin-left: 6.4em;
1080                 }
1081                 .right dl.legend dt {
1082                         margin-right: 0;
1083                         margin-left: -6.4em;
1084                         float: left;
1085                         clear: left;
1086                 }
1087                 .right dl.legend dd {
1088                         float: left;
1089                 }
1090         }
1091 }
1092
1093 /*
1094 @media screen and (orientation: portrait) and (max-width: 62em) {
1095         body table.keys,
1096         #rows {
1097                 margin-top: 1ex;
1098                 transform: rotate(90deg);
1099                 transform-origin: top left;
1100                 margin-left: 40em;
1101                 margin-bottom: 30em;
1102                 font-size: 80%;
1103         }
1104 }
1105 */