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