
/*
 *  Some useful numbers...
 *
 *  When font-size is 1em/12pt/16px/100%:
 *  1px = 0.0625em (when PPI is 96)
 *  1in = 6em
 *  1pt = 0.0833333em (1/12em)
 *
 */

/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */

/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html,
button,
input,
select,
textarea {
    color: #222;
}

@media print {
    html,
    button,
    input,
    select,
    textarea {
        color: #000;
    }
}

html {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 12pt;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight: h5bp.com/i
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

body {
  color: white;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between images, videos, audio and canvas and the bottom of
 * their containers: h5bp.com/i/440
 */

audio,
canvas,
img,
video {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;da
    padding: 0;
}

@media screen and (min-width: 900px) {
    body {
        background: url('../img/web-background-dark.jpg');
        background-attachment: fixed;
    }
    body.dark {
        background-image: url('../img/web-background-dark.jpg');
    }
}

p,
pre {
    margin: .5em 0 1em; /* bring top of paragraphs closer to headers */
}

em {
    font-style: normal;
    text-decoration: underline;
}

h1 {
    font-size: 2em;
    margin: 0.67em 0 0;
}

h2 {
    font-size: 1.5em;
    margin: 0;
}

h3 {
    font-size: 1.17em;
    margin: 1em 0 0;
}

h4 {
    font-size: 1em;
    margin: 1.33em 0 0;
}

h5 {
    font-size: 0.83em;
    margin: 1.67em 0 0;
}

h6 {
    font-size: 0.67em;
    margin: 2.33em 0 0;
}

h2, h3, h4 {
    text-decoration: underline;
}

li ul {
    margin: 0;
}

table {
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid white;
}

@media print {
    table, th, td {
        border-color: white;
    }
}

td, th {
    padding: .3em .6em .2em;
}

.new-block-formatting-context {
    /* Starts a new block formatting context which will prevent text from wrapping tightly around
        an image, etc.
        http://colinaarts.com/articles/the-magic-of-overflow-hidden/
      */
    overflow: hidden;
}

.dark .no-border, .no-border, .no-border tr, .no-border tr th, .no-border tr td {
    border: none;
}

table.centered {
    margin-left: auto;
    margin-right: auto;
}

p.centered,
h5.centered, h4.centered, h3.centered, h2.centered, h1.centered,
tr.centered {
    text-align: center;
}

.centered-img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.diagram {
    width: 5em;
    float: right;
    margin-left: .5em;
    margin-bottom: .5em;
    background-color: #FFF;
}

[dir='rtl'] .diagram {
    float: left;
    margin-left: 0;
    margin-right: .5em;
}

@media screen and (min-width: 900px), print {
    .diagram {
        width: 9em;
        margin-left: 1em;
        margin-bottom: 1em;
    }

    [dir='rtl'] .diagram {
        margin-left: 0;
        margin-right: 1em;
    }
}

.diagram-label {
    text-align: center;
}

@media screen and (min-width: 900px) {
    .page {
        margin: 1em auto;
        padding: 0;
        border: 1px solid #222; /* Safely using px because exists outside layout of page content */
        box-shadow: #222 0.0em 0em 0.6em;
        clear: both;
        background-color: #232323;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100%;
        width: 8.5in; /* = 8.5in at 12pt (1em) */
        min-height: 11in; /* = 11in at 12pt (1em) */
    }
    .dark .page {
        background-color: #232323;
    }
    .developer-mode .page {
        background-color: #f66;
    }
    .dark.developer-mode .page {
        background-color: #700;
    }
}

@media print {
    .page {
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        max-width: none;
        min-height: initial;
        background-color: #FFF;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100%;
        width: 8.5in; /* = 8.5in at 12pt (1em) */
        height: 11in; /* = 11in at 12pt (1em) */
        page-break-before: always;
    }
}

.page-bg-01 {
    background-image: url("../img/page-bg-noise-01-dark.png");
}

.page-bg-02 {
    background-image: url("../img/page-bg-noise-02-dark.png");
}

.page-bg-03 {
    background-image: url("../img/page-bg-noise-03-dark.png");
}

.page-bg-04 {
    background-image: url("../img/page-bg-noise-04-dark.png");
}

.page-bg-05 {
    background-image: url("../img/page-bg-noise-05-dark.png");
}

.page-bg-06 {
    background-image: url("../img/page-bg-noise-06-dark.png");
}

.page-bg-07 {
    background-image: url("../img/page-bg-noise-07-dark.png");
}

.dark .page-bg-01 {
    background-image: url("../img/page-bg-noise-01-dark.png");
}

.dark .page-bg-02 {
    background-image: url("../img/page-bg-noise-02-dark.png");
}

.dark .page-bg-03 {
    background-image: url("../img/page-bg-noise-03-dark.png");
}

.dark .page-bg-04 {
    background-image: url("../img/page-bg-noise-04-dark.png");
}

.dark .page-bg-05 {
    background-image: url("../img/page-bg-noise-05-dark.png");
}

.dark .page-bg-06 {
    background-image: url("../img/page-bg-noise-06-dark.png");
}

.dark .page-bg-07 {
    background-image: url("../img/page-bg-noise-07-dark.png");
}

.dark {
    color: #ddd;
    background-color: #222;
}

.dark table, .dark th, .dark td {
    border: 1px solid #ccc;
}

.page-content {
    margin: 0 .25in;
    padding-top: 2em;
}

@media print {
    .page-first {
        page-break-before: auto;
    }
}

@media screen and (min-width: 900px), print {
    .page-content {
        margin: 0 .75in;
        padding-top: 4.5em;
        min-height: 9.5in; /* Leaving 3em at the bottom for footer (0.75in) */
    }
}

@media screen and (min-width: 900px) {
    body.multipage .section {
        display: flex;
        flex-wrap: wrap;
    }
}

.page-header {
    display: block;
    position: relative;
    height: 0;
    top: .25in; /* = 0.25in at 12pt (1em) */
    margin: 0 .5in; /* = ~0.5in at 12pt (1em) */
}

@media screen and (max-width: 900px) {
    .page .page-header {
        display: none;
    }

    .section {
        margin-bottom: 3em;
    }
}

.page-header-section-title {
    float: right;
}

[dir='rtl'] .page-header-section-title {
    float: left;
}

.page-header-doc-title {
    float: left;
}

[dir='rtl'] .page-header-doc-title {
    float: right;
}

.page-footer {
    text-align: center;
}

.relative-footer {
    display: none;
}

@media screen and (min-width: 900px) {
    .relative-footer {
        margin-top: .25in; /* = 0.25in */
        height: .5in; /* = 0.5in */
        display: block;
    }
}

.absolute-footer {
    display: none;
}

.appendix-reference {
    font-style: italic;
}

/* ==========================================================================
   Section-specific
   ========================================================================== */

.instructions {
    font-family: 'Cabin', sans-serif;
    line-height: normal;
}

    .instructions h2, .instructions h3, .instructions h4 {
        text-decoration: none;
    }

    .instructions em {
        font-style: italic;
        text-decoration: none;
    }

.dark .repeaters-table, .repeaters-table {
    width: 98%;
    border: none;
    margin-left: auto;
    margin-right: auto;
}

.dark .repeaters-spacer, .repeaters-spacer {
    border: none;
}

.dark .whos-on-first-step1-table, .whos-on-first-step1-table, .whos-on-first-step1-table td {
    margin-left: auto;
    margin-right: auto;
    border: none;
}

    .whos-on-first-step1-table th, .whos-on-first-step1-table td {
        font-size: 0.9em;
        width: 6.5em;
        padding: 0.45em 0.45em .7em .7em;
    }

        .whos-on-first-step1-table :is(th,td) table {
            width: 95%;
            margin-left: auto;
            margin-right: auto;
        }
        .dark .whos-on-first-step1-table :is(th,td) table td img,
        .dark .whos-on-first-step1-table :is(th,td) table.eye-table td.button {
            filter: invert(90%);
        }

.whos-on-first-look-at-display {
    background-color: black;
    color: white;
}
.dark .whos-on-first-look-at-display {
    background-color: #BBB;
    color: #000;
}

.whos-on-first-step1-table td table td {
    font-size: 1em;
    height: 1.5em;
    width: 50%;
    padding: 0;
    text-align: center;
    border: 1px solid black;
}
.dark .whos-on-first-step1-table td table :is(td, th) { border-color: #DDD; }

.whos-on-first-step1-table td table th {
    font-size: 1em;
    height: 1.5em;
    padding: 0.1em 0.1em;
    text-align: center;
    border: 1px solid black;
}

.whos-on-first-step1-table th {
    border: 1px solid black;
}

.whos-on-first-step2-table {
    width: 105%;
}

    .whos-on-first-step2-table th {
        padding-left: .2em;
        padding-right: .2em;
        padding-top: .15em;
        padding-bottom: .15em;
    }

    .whos-on-first-step2-table td {
        font-size: .78em;
    }

.keypad-table {
    margin-left: auto;
    margin-right: auto;
    font-family: Arial, sans-serif;
    font-size: 2.2em;
    border-style: none;
    text-align: center;
}

.keypad-table-column {
    background-color: #FFF; /*For ensuring photocopy noise doesn't affect symbols*/
    padding: .1em;
}

.keypad-table-spacer {
    border-style: none;
}

.dark .keypad-table-spacer, .dark .keypad-table {
    border-style: none;
}

.keypad-symbol-image {
    height: 1.9em;
}

#morseCodeChart {
    float: left;
    margin-right: 1em;
    height: 32em;
    width: 24.8270625em; /* Hardcode for IE */
    border: 1px solid #021a40;
    background-color: #ffffff;
}

[dir='rtl'] #morseCodeChart {
    float: right;
    margin-right: 0;
    margin-left: 1em;
}

.morse-code table th {
    font-size: 1.2em;
    font-weight: bold;
    width: 5.5em;
}

.morse-code table td {
    text-align: center;
}

.morse-signal-table {
    float: left;
    margin-right: 1em;
    height: 32em;
    width: 24.8270625em;
    border: 1px solid #021a40;
    background-color: #ffffff;
}

.dark .morse-signal-table {
    background-color: #222;
}

.morse-signal-table td, .morse-signal-table th {
    border: none;
}

.morse-interpret th, .morse-interpret td {
    padding: 0.4em 0.3em;
}

.morse-interpret p {
    margin: 0 1em;
    font-size: 0.8em;
}

#morseSignalImg {
    width: 100%;
}

.memory-rules p {
    margin-top: .3em;
    font-size: 0.95em;
}

.flavour-text, .comment {
    font-style: italic;
    font-size: 75%;
    margin-top: .5em;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Image replacement
 */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
    /* IE 6/7 fallback */
    *text-indent: -9999px;
}

    .ir:before {
        content: "";
        display: block;
        width: 0;
        height: 150%;
    }

/*
 * Hide from both screenreaders and browsers: h5bp.com/u
 */

.hidden {
    display: none !important;
    visibility: hidden;
}

/*
 * Hide from both screenreaders and browsers, but only for non-print
 */
.hide-screen {
    display: none;
    visibility: hidden;
}

@media print {
    .hide-screen {
        display: initial;
        visibility: initial;
    }
}

/*
 * Hide from both screenreaders and browsers, but only for print
 */
@media print {
    .hide-print {
        display: none;
        visibility: hidden;
    }
}

/*
 * Hide only visually, but have it available for screenreaders: h5bp.com/v
 */

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

    /*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard: h5bp.com/p
 */

    .visuallyhidden.focusable:active,
    .visuallyhidden.focusable:focus {
        clip: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        position: static;
        width: auto;
    }

/*
 * Hide visually and from screenreaders, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}

/* ==========================================================================
   Print styles.
   Inlined to avoid required HTTP connection: h5bp.com/r
   ========================================================================== */

@media print {
    /* Removed all this stuff because we'll be aiming to make everything deliberate for print */
    /* * { */
        /*background: transparent !important;
        color: #000 !important;*/ /* Black prints faster: h5bp.com/s */
        /*box-shadow: none !important;
        text-shadow: none !important;*/
    /* } */

    a,
    a:visited {
        text-decoration: underline;
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links for images, or javascript/internal links
     */

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* Rule seed */
.page-header-section-title.ruleseed-seeded {
    color: #800;
    background: rgba(255, 0, 0, .1);
    border: 2px solid #f00;
    padding: .3em .7em;
}

.dark .page-header-section-title.ruleseed-seeded {
    color: #f44;

}
.ruleseed-header {
    display: none;
}

@media screen and (max-width: 900px) {
    .ruleseed-active .ruleseed-header {
        display: block;
        background: rgba(255, 0, 0, .1);
        padding: .3em 0;
        font-weight: bold;
        font-size: 14pt;
        text-align: center;
    }
}



/** NOTIFICATION AND OPTIONS MENU **/

#notification {
    position: fixed;
    top: 0;
    left: 0;
    padding: 6px;
    color: black;
    border-bottom: 1px solid black;
    border-right: 1px solid black;
    border-bottom-right-radius: 5px;
    box-shadow: rgba(0,0,0,.5) 0 0 10px;
    font-family: sans-serif;
}

#optionsMenu {
    position: fixed;
    transition: transform 300ms ease-out;
    left: 0;
    top: 50px;
    transform: translateX(-120%);
    background: #f7f7f7;
    border: 1px solid black;
    border-left: none;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    box-shadow: rgba(0,0,0,.5) 0 0 10px;
    font-family: sans-serif;
    padding: 10px 15px 15px 20px;
}

    .dark #optionsMenu {
        background: #212121;
    }

    #optionsMenu.open {
        transform: none;
    }

    #optionsMenu h2 {
        text-decoration: none;
    }

    #optionsMenu blockquote {
        margin: 0 0 0 25px;
    }

    #optionsMenu kbd {
        font: inherit;
        text-decoration: underline;
    }

@media screen and (max-width: 900px), print {
    #pageTypeOption {
        display: none;
    }
}

.dark a {
    color: #F44121;
}

.dark ::selection {
    background: #2E58CC;
    color: white;
}

.dark .invertible {
    filter: contrast(75%) invert(100%);
}

/* Hidden table cells */
.dark .borderless, .borderless {
    border: none;
}
.dark td.corner, .dark th.corner, td.corner, th.corner {
    border: none;
}
.dark td.empty, .dark th.empty, td.empty, th.empty {
    border: none;
}

.developer-mode-warning {
    color: #f66;
    background-color: #400;
}
.dark .developer-mode-warning {
    color: #400;
    background-color: #f66;
}
div.developer-mode-warning {
    position: fixed;
    top: 0;
    width: 100%;
    text-align: center;
    transition: 0.2s;
}
div.developer-mode-warning:hover {
    background-color: #0000;
    color: #0000;
    user-select: none;
}
div.developer-mode-warning p {
    font-weight: bold;
    margin-top: 0.2em;
    margin-bottom: 0.4em;
}

p.caption {
    margin: 0;
    text-align: center;
    font-weight: bold;
}

/* stacks up in the center with no spacing by default */
.hstack {
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.vstack {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* elements stack up on the left (top for a vstack) */
.hstack.left, .vstack.top { justify-content: start; }
/* stack up on the right (or bottom for a vstack) */
.hstack.right, .vstack.bottom { justify-content: end; }
/* fill available space by putting space between elements */
:is(.hstack, .vstack).full { justify-content: space-between; }
/* fill available space by putting space between elements and around them */
:is(.hstack, .vstack).even { justify-content: space-evenly; }
/* elements can wrap if space is too small */
:is(.hstack, .vstack).wrap { flex-wrap: wrap; }
/* align the centers of each element in the stack */
:is(.hstack, .vstack).alignc { align-items: center; }
/* align the top edges of each element (or left edges for a vstack) */
.hstack.top, .vstack.left { align-items: flex-start; }
/* align the bottom edges of each element (or right edges for a vstack) */
.hstack.bottom, .vstack.right { align-items: flex-end; }
/* put extra space between elements */
:is(.hstack, .vstack).gap { gap: 5px; }
:is(.hstack, .vstack).gap1 { gap: 10px; }
:is(.hstack, .vstack).gap2 { gap: 20px; }
:is(.hstack, .vstack).gap3 { gap: 30px; }

/* colored strip on the left edge of a manual page, e.g. Morsematics */
.page.strip {
    position: relative;
    --strip-color: #FF0000;
}
.page.strip::before {
    content: '';
    position: absolute;
    width: .85cm;
    inset: 0 auto 0 0;
    opacity: 0.3;
    background-color: var(--strip-color);
    -webkit-print-color-adjust: exact;
}
@media print {
    .page.strip::before {
        display: none;
    }
}
@media screen and (max-width: 900px) {
    .page.strip::before {
		width: .3cm;
    }
}
