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