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