perl: wrap code blocks on mobile screens
[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(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 .X:hover > span                            {background: #FFF} /* whitespace marker */
571 .Greek:hover, .Armenian:hover              {background: #FA8}
572 .Cyrillic:hover                            {background: #FB7}
573 .Latin:hover                               {background: #EE4}
574 .Hebrew:hover, .Aramaic:hover              {background: #FFA}
575 .Arabic:hover                              {background: #CFD}
576 .African:hover                             {background: #BDB}
577 .Syllabic:hover, .Hangul:hover             {background: #CE6}
578 .Katakana:hover                            {background: #BF7}
579 .Hiragana:hover                            {background: #AF8}
580 .Bopomofo:hover                            {background: #8FA}
581 .Brahmic:hover                             {background: #F77}
582 .Khmer:hover                               {background: #F87}
583 .Han:hover                                 {background: #5EB}
584 .Alpha:hover                               {background: #5C5}
585 .Nd:hover, .Nl:hover, .No:hover            {background: #F99} /* number */
586 .Sc:hover                                  {background: #F8C} /* currency */
587 .Sm:hover                                  {background: #F8F} /* math */
588 .So:hover                                  {background: #A8F} /* symbol */
589 .Pd:hover, .Po:hover, .Pc:hover            {background: #8AF} /* punctuation */
590 .Ps:hover, .Pe:hover, .Pi:hover, .Pf:hover {background: #8DF} /* quote */
591 .Lm:hover, .Sk:hover                       {background: #BFF} /* spacing modifier */
592 .Mn:hover                                  {background: #CDE} /* modifier */
593 .Zs:hover                                  {background: #CED} /* space */
594 .Cc:hover, .Cf:hover                       {background: #DDD} /* control */
595 .Co:hover                                  {background: #A77} /* private */
596 .Xr:hover                                  {background: #FFF} /* reserved */
597 .Xi:hover                                  {background: #DDD} /* invalid */
598 .l0:hover                                  {background: #888}
599 .l1:hover                                  {background: #F88}
600 .l2:hover                                  {background: #FC8}
601 .l3:hover                                  {background: #FF8}
602 .l4:hover                                  {background: #CF8}
603 .l5:hover                                  {background: #8F8}
604 .u-l4:hover    {outline: 1px solid #080}
605 .u-l5:hover    {outline: 1px solid #8F0}
606 .u-l2:hover    {outline: 1px solid #800}
607 .u-l1:hover    {outline: 1px solid #F00}
608
609 /* key type colorization */
610
611 .c-sa,
612 .g1 {background: #BFE} /* cyan: info */
613 .c-na,
614 .g2 {background: #BFB} /* green: motion */
615 .g3 {background: #DFA} /* greenish: jump (g2+) */
616 .c-af,
617 .g4 {background: #FFA} /* yellow: command */
618 .c-eu,
619 .g5 {background: #FDA} /* orangish: open (g6-) */
620 .g6 {background: #FCA} /* orange: insert */
621 .c-as,
622 .g7 {background: #FCC} /* red: mode */
623 .c-an,
624 .g8 {background: #ECE} /* purple: visual (g7+) */
625 .c-oc,
626 .g9 {background: #CCF} /* blue: prefix */
627
628 .c-sa:hover,
629 .g1 a:hover, .g1[onclick]:hover {background: #5ED}
630 .c-na:hover,
631 .g2 a:hover, .g2[onclick]:hover {background: #7E7}
632 .g3 a:hover, .g3[onclick]:hover {background: #CE6}
633 .c-af:hover,
634 .g4 a:hover, .g4[onclick]:hover {background: #EE4}
635 .c-eu:hover,
636 .g5 a:hover, .g5[onclick]:hover {background: #FA6}
637 .g6 a:hover, .g6[onclick]:hover {background: #F97}
638 .c-as:hover,
639 .g7 a:hover, .g7[onclick]:hover {background: #F88}
640 .c-an:hover,
641 .g8 a:hover, .g8[onclick]:hover {background: #D9D}
642 .c-oc:hover,
643 .g9 a:hover, .g9[onclick]:hover {background: #99F}
644
645 .no {
646         background: #EEE; /* unassigned */
647 }
648 .keys td.ni {
649         border: 0;
650         padding: 1px; /* same size as borderlessless keys */
651         background: none;
652 }
653
654 dl.legend dt.more,
655 .keys td.more {
656         outline: 3px solid #0006;
657         outline-offset: -3px; /* inside */
658 }
659 dl.legend dt.new,
660 .keys td.new {
661         border-style: dashed;
662 }
663 .ext,
664 dl.legend dt.ext,
665 .keys td.ext {
666         opacity: .6;
667 }
668
669 /* l/r help columns */
670
671 .help {
672         display: table;
673         width: 100%;
674 }
675 .help > * {
676         display: table-cell;
677         width: 20%;
678         vertical-align: top;
679 }
680
681 .left dl.legend {
682         margin-left: 6.4em; /* a bit over 6.2em to allow for borders+padding (border-sizing would work too) */
683 }
684 .left dl.legend dt {
685         margin-left: -6.4em; /* msie<=6 multiply this by two for some reason */
686         float: left;
687         clear: left;
688 }
689 .left dl.legend dd {
690         float: left; /* align next to dt (except msie<=7 does just the opposite) */
691 }
692 .right dl.legend {
693         margin-right: 6.4em;
694 }
695 .right dl.legend dt {
696         margin-right: -6.4em;
697         float: right;
698         clear: right;
699 }
700 .right dl.legend dd {
701         float: right;
702 }
703 .right {
704         text-align: right;
705 }
706
707 /* help/legend */
708
709 dl.legend dt {
710         margin: 0 0 1px; /* distinct keys */
711         height: auto; /* not key-height */
712         padding: 2px 0;
713 }
714 dl.legend dd {
715         margin: 3px 0.4em 0; /* align text (add dt border+padding height) */
716         padding: 0;
717 }
718
719 dl.legend-options dt {
720         background: #CCC;
721 }
722
723 ul.legend-set {
724         clear: right;
725         padding-top: 1ex;
726 }
727 ul.legend-set li {
728         margin: 6px 0; /* similar to dl legends */
729 }
730
731 .legend {
732         margin-top: 1em;
733 }
734 .legend table {
735         width: 100%;
736 }
737 .legend td {
738         padding: 0 0.2em;
739 }
740
741 /* images */
742
743 figure {
744         margin: 0;
745         position: relative;
746 }
747 figure img {
748         vertical-align: bottom;
749         width: 100%;
750 }
751
752 @media (min-width: 60em) {
753         figcaption {
754                 padding: 0 1em;
755                 color: #000;
756                 background: rgba(255, 255, 255, .66);
757                 position: absolute;
758                 right: 0;
759                 bottom: 0;
760                 max-width: 100%;
761                 box-sizing: border-box;
762         }
763         .gallery li.parent:hover > figure > figcaption,
764         .gallery figure:hover > figcaption {
765                 /* highlight title of current and parents */
766                 font-size: 175%;
767                 right: 50%;
768                 bottom: 50%;
769                 transform: translate(50%, 50%);
770                 margin-left: -60%; /* keep width */
771         }
772 }
773
774 /* image gallery */
775
776 .gallery {
777         display: grid;
778         grid: auto-flow dense / repeat(auto-fit, minmax(200px, 1fr));
779         grid-gap: 1px;
780 }
781 .gallery li, .gallery ul {
782         display: contents;
783 }
784 .gallery figure {
785         overflow: hidden;
786         box-sizing: border-box;
787         hyphens: auto;
788         max-width: 900px;
789 }
790 .gallery figcaption > small {
791         display: inline-block;
792 }
793
794 @media (min-width: 403px) and (min-height: 266px) {
795         /* able to fit 2 cells of 200x133 */
796         .gallery li.large > figure {
797                 grid-row: span 2;
798                 grid-column: span 2;
799         }
800 }
801 @media (min-width: 603px) and (min-height: 400px) {
802         /* fit 3 cells of 200x133 */
803         .gallery > li:first-child > figure,
804         .gallery li.huge > figure {
805                 grid-row: span 3;
806                 grid-column: span 3;
807         }
808 }
809
810 .gallery figure, .gallery figcaption {
811         transition: all .5s ease-in;
812 }
813 .gallery figure:hover ~ ul figcaption {
814         /* mark all children */
815         color: #FFF;
816         background: rgba(0, 0, 0, .5);
817 }
818
819 .gallery figure[data-sup]:after {
820         position: absolute;
821         right: 0;
822         content: attr(data-sup);
823         color: #FFF;
824         background: #0006;
825         border-radius: 1em;
826         padding: .1ex .4em;
827         margin: .4em;
828 }
829 .gallery .expand > figure[data-sup]:after {
830         content: '+' attr(data-sup);
831         background: #0008;
832         font-size: 150%;
833         border: 2px solid #FFF8;
834 }
835
836 /* specialised galleries */
837
838 body#word {
839         margin: 8px 1px;
840 }
841
842 table.gallery {
843         grid-auto-flow: row;
844         grid-template-columns: repeat(auto-fit, minmax(2em, max-content)); /* 1fr */
845 }
846 table.gallery tbody,
847 table.gallery tr {
848         display: contents;
849 }
850 table.gallery tr > :first-child {
851         grid-column: 1;
852         -grid-row: span 6;
853         margin: auto; /* vertical-align: middle */
854 }
855 table.gallery tr > :nth-child(2) {
856         grid-column: 2; /* in case 1st is missing */
857 }
858 table.gallery td {
859         border: 0; /* does not collapse */
860         outline: 1px solid #888; /* over grid-gap */
861 }
862
863 /* page-specific */
864
865 #browser td > a {
866         text-decoration: none;
867 }
868 #browser td > a:active,
869 #browser td > a:hover {
870         text-decoration: underline;
871 }
872 #browser tr .aside {
873         font-size: 80%;
874         overflow: hidden;
875         height: 0;
876         -webkit-transition: all 1s ease-in;
877         -o-transition: all 1s ease-in;
878         -moz-transition: all 1s ease-in;
879         transition: height 1s ease-in;
880 }
881 #browser tr .aside p {
882         margin: 1ex 0;
883 }
884 #browser tr.target .aside,
885 #browser tr:target .aside {
886         height: auto;
887 }
888 #browser td.X {
889         white-space: nowrap; /* some browsers break on dashes */
890 }
891
892 #browser tr:target > td:first-of-type,
893 #browser tr.focus > td:first-of-type {
894         background: inherit;
895 }
896 #browser tr.focus > td {
897         border-bottom-color: #000;
898 }
899
900 form.aside {
901         position: absolute;
902         top: 3ex;
903         right: 1em;
904 }
905
906 .family-name {
907         font-variant: small-caps;
908 }
909
910 #index nav {
911         columns: 3;
912         -moz-columns: 3;
913         -webkit-columns: 3;
914 }
915 nav > .section {
916         break-inside: avoid;
917         -webkit-column-break-inside: avoid; /* webkit */
918         page-break-inside: avoid; /* moz */
919         overflow: hidden; /* webkit workaround */
920 }
921 #index nav a {
922         display: inline-block;
923         margin-top: 1em;
924 }
925
926 .units tbody tr:hover:not(.race) {
927         background: #EEE;
928 }
929 .unit-gas {
930         color: #040;
931 }
932 .unit-min, .unit-min a:not(:hover) {
933         color: #004;
934 }
935 .unit-supply {
936         color: #080;
937 }
938 .unit-o {color: #C08} /* organic */
939 .unit-u {color: #44C} /* mechanic */
940 .unit-p {color: #0A8} /* psionic */
941 .unit-composed {
942         color: #C88;
943 }
944 .unit-air {
945         color: #08C;
946 }
947 .unit-x {color: #888}
948 .unit-s {color: #890}
949 .unit-m {color: #C70}
950 .unit-l {color: #D22}
951 .unit-h {color: #804}
952 .magic-opt:before,
953 .magic-opt:after {
954         color: #000;
955 }
956 .hurtrel, .units .hurtrel {
957         color: #778;
958 }
959 tbody .unit-shield {
960         color: #64A;
961 }
962 .unit-pdd {
963         color: #A8C;
964 }
965 .unit-splash {
966         color: #4A0;
967 }
968 .hurt-a {
969         color: #036;
970 }
971 .hurt-g {
972         color: #063;
973 }
974 .unit-massive {
975         color: #D88;
976 }
977 .unit-detect::before {
978         color: #0A8;
979 }
980 .unit-jump {
981         color: #8A4;
982 }
983 body .magic-perma {
984                 text-decoration-color: #8C0;
985            -moz-text-decoration-color: #8C0;
986         -webkit-text-decoration-color: #8C0;
987 }
988
989 /* printing hints */
990
991 @page {
992         size: landscape;
993         margin: 0;
994 }
995
996 @media print {
997         ul.legend-set {display: none} /* current options only relevant on dynamic media */
998 }
999
1000 /* terse optimisation */
1001
1002 @media (min-height: 112ex) and (min-width: 90em) {
1003         .keys td {
1004                 padding: 1ex 0 1ex .1em;
1005                 width: 7em;
1006         }
1007 }
1008
1009 @media (max-width: 79em) {
1010         .keys td {
1011                 position: relative; /* hides overflow */
1012                 width: 4.5em;
1013                 min-width: 6.5vw;
1014                 min-width: calc(7.7vw - 8px);
1015         }
1016         .keys td b,
1017         .keys .meta td b,
1018         .keys .ctrl td b,
1019         .keys .lead td b { /* leading chars always fit */
1020                 position: absolute; /* background */
1021                 right: 0; /* least overlap in corner */
1022                 font-size: 250%;
1023                 line-height: 2.5ex;
1024                 opacity: .5;
1025                 color: #FFF;
1026         }
1027
1028         .row2 {margin-left: 5.3em} /* 7em / Δtd(6em : 4.5em) */
1029         .row3 {margin-left: 6em}   /* 8em / Δtd */
1030         .row4 {margin-left: 7.5em} /* 10em / Δtd */
1031
1032         /* letter scripts columns to rows */
1033         .legend .glyphs:first-child td {
1034                 display: table-row;
1035                 vertical-align: baseline;
1036         }
1037         .legend .glyphs td > table {
1038                 width: auto;
1039                 display: inline;
1040                 margin-left: 1ex;
1041         }
1042         .legend .glyphs:first-child td td {
1043                 margin: 2px;
1044                 display: inline-block;
1045                 width: auto;
1046         }
1047
1048         @media (max-width: 61em) {
1049                 .keys td {
1050                         width: 3em;
1051                         height: 6.75ex; /* 3 lines */
1052                         font-size: 80%;
1053                 }
1054                 .keys td b,
1055                 .keys .meta td b,
1056                 .keys .ctrl td b,
1057                 .keys .lead td b {
1058                         line-height: 4ex;
1059                 }
1060
1061                 .row2 {margin-left: 3.5em} /* 7em / Δtd(6em : 3em) */
1062                 .row3 {margin-left: 4em}   /* 8em / Δtd */
1063                 .row4 {margin-left: 5em}   /* 10em / Δtd */
1064         }
1065
1066         @media (max-width: 42em) {
1067                 /* flatten right legend column on mobile */
1068                 .help > * {
1069                         display: table-row;
1070                         width: auto;
1071                 }
1072                 ul.legend-set {
1073                         clear: left;
1074                 }
1075                 .right dl.legend {
1076                         margin-right: 0;
1077                         margin-left: 6.4em;
1078                 }
1079                 .right dl.legend dt {
1080                         margin-right: 0;
1081                         margin-left: -6.4em;
1082                         float: left;
1083                         clear: left;
1084                 }
1085                 .right dl.legend dd {
1086                         float: left;
1087                 }
1088         }
1089 }
1090
1091 /*
1092 @media screen and (orientation: portrait) and (max-width: 62em) {
1093         body table.keys,
1094         #rows {
1095                 margin-top: 1ex;
1096                 transform: rotate(90deg);
1097                 transform-origin: top left;
1098                 margin-left: 40em;
1099                 margin-bottom: 30em;
1100                 font-size: 80%;
1101         }
1102 }
1103 */