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