/*
 * g60printer.css
 * Google60-style line printer for PDP-11 console output
 * Adapted from Google60 by Norbert Landsteiner (mass:werk)
 */

/* Font face declaration for the LP1 font */
@font-face {
    font-family: 'lp1_regular';
    src: url('../assets/fonts/lp1/lp1-regular-webfont.eot');
    src: url('../assets/fonts/lp1/lp1-regular-webfont.eot#iefix') format('embedded-opentype'),
        url('../assets/fonts/lp1/lp1-regular-webfont.woff') format('woff'),
        url('../assets/fonts/lp1/lp1-regular-webfont.ttf') format('truetype'),
        url('../assets/fonts/lp1/lp1-regular-webfont.svg#lp1_regular') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* Printer container – replaces the old console textarea */
#g60printer {
    position: relative;
    width: 940px;
    height: 470px;
    background-color: #2a2a2a;
    overflow: hidden;
    border: 1px solid #444;
    margin: 8px 0;
}

#g60printer div#printer {
    position: absolute;
    top: 0;
    left: 0;
    width: 940px;
    height: 464px;
    background-color: #6f323d;
    background-image: url('../assets/images/printer_bg.gif');
    background-repeat: repeat;
}

#g60printer #printheadarea {
    display: block;
    position: absolute;
    top: 388px;
    left: 67px;
    width: 807px;
    max-width: 807px;
    height: 30px;
    max-height: 30px;
    padding: 0;
    margin: 0;
    z-index: 3;
    overflow: hidden;
}

#g60printer #printhead {
    display: block;
    position: absolute;
    top: 0;
    left: 16px;
    padding: 0;
    margin: 0;
}

#g60printer div#printer_frontpannel {
    position: absolute;
    top: 395px;
    left: 67px;
    width: 807px;
    height: 69px;
    background-image: url('../assets/images/printerskin.png');
    background-repeat: repeat-x;
    background-position: 0 -465px;
    z-index: 2;
}

#g60printer div#printer_left {
    position: absolute;
    top: 0;
    left: 0;
    width: 67px;
    height: 464px;
    background-image: url('../assets/images/printerskin.png');
    background-repeat: no-repeat;
}

#g60printer div#printer_right {
    position: absolute;
    top: 0;
    left: 874px;
    width: 66px;
    height: 464px;
    background-image: url('../assets/images/printerskin.png');
    background-repeat: no-repeat;
    background-position: -67px 0;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {

    #g60printer div#printer_frontpannel,
    #g60printer div#printer_left,
    #g60printer div#printer_right {
        background-image: url('../assets/images/printerskin_webkit.png');
    }
}

#g60printer div#paper {
    position: absolute;
    top: 0;
    left: 67px;
    width: 839px;
    height: 400px;
    max-height: 400px;
    vertical-align: top;
    text-align: left;
    padding: 0;
    margin: 0;
    z-index: 1;
}

#g60printer div#paper.paperNoScroll {
    overflow: hidden;
}

#g60printer div#paper.paperScroll {
    overflow-y: auto;
    overflow-x: hidden;
}

#g60printer div#paper_topspacer {
    position: relative;
    height: 345px;
    width: 1px;
    margin: 0;
    padding: 0;
}

#g60printer div#paper_topspacer.paperScroll {
    height: 16px;
}

#g60printer table#paper_area {
    margin: 0;
    padding: 0;
    border: 0 none;
    border-collapse: collapse;
    border-spacing: 0;
}

#g60printer table#paper_area td {
    vertical-align: top;
    margin: 0;
    white-space: nowrap;
}

#g60printer td#papermargin_left,
#g60printer td#papermargin_right {
    background-image: url('../assets/images/paper-margin.png');
    background-repeat: repeat-y;
    width: 33px;
    min-width: 33px;
}

#g60printer td#papermargin_left {
    background-position: -3px 0;
}

#g60printer td#papermargin_right {
    background-position: 0 0;
}

#g60printer td#paper_top {
    background-image: url('../assets/images/paper-edge.png');
    background-repeat: repeat-x;
    background-position: 0 0;
    height: 5px;
}

#g60printer tr#paper_bottom {
    background-image: url('../assets/images/paper-edge.png');
    background-repeat: repeat-x;
    background-position: 0 -5px;
    height: 5px;
    display: none;
}

#g60printer td#paper_printarea {
    width: 705px;
    color: #36363c;
    font-size: 13px;
    text-align: left;
    font-family: lp1_regular, "Trebuchet MS", sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
    background-color: white;
    padding: 57px 18px 1px 18px;
    white-space: nowrap;
    background-image: url('../assets/images/paper.png');
    background-repeat: repeat;
    -webkit-text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    -moz-text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    -o-text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    -webkit-font-smoothing: subpixel-antialiased;
}

#g60printer td#paper_printarea span {
    display: inline-block;
    vertical-align: top;
    white-space: pre;
    width: 7px;
    max-width: 7px;
    height: 16px;
    max-height: 16px;
    text-align: center;
}

/* Right-margin overstrike: characters printed after the carriage reached
   the last column pile up on top of each other, forming an unreadable
   dark blob (authentic Model 33 ASR behaviour). */
#g60printer td#paper_printarea span.overstrike {
    background-color: #3a3a3a;
    color: #8a8a8a;
    text-shadow: none;
}

/* Bold / underline emphasis produced by nroff/man overstrike (same glyph
   re-printed → bold; letter printed over an underscore → underline). */
#g60printer td#paper_printarea span.bold {
    font-weight: bold;
}

#g60printer td#paper_printarea span.underline {
    text-decoration: underline;
}

#g60printer td#paper_printarea span.drop {
    margin-top: 1px;
    height: 15px;
    max-height: 15px;
    overflow: hidden;
    text-shadow: 0 -1px 1px rgba(115, 115, 121, 0.7), 0 -1px 2px rgba(115, 115, 121, 0.4);
}

#g60printer td#paper_printarea span.shift {
    margin-top: -1px;
    text-shadow: 0 1px 1px rgba(115, 115, 121, 0.7), 0 1px 2px rgba(115, 115, 121, 0.4);
}

#g60printer td#paper_printarea span.nonAscii {
    font-size: 12px !important;
    line-height: 18px !important;
}

#g60printer td#paper_printarea p {
    margin: 0;
    padding: 0;
    max-height: 16px;
    vertical-align: top;
    white-space: nowrap;
    overflow: visible;
}

/* Form-feed page separator: 2.11BSD lpd sends FF between print jobs and the
   printer ejects to the top of the next page. The fold/perforation marker is
   a dashed seam across the full printable width. The Model 33 ASR console teletype
   disables the marker (smooth paper roll) and only advances the paper. */
#g60printer td#paper_printarea p.pageBreak,
#lp11_printer td#lp11g60paper_printarea p.pageBreak {
    margin: 0;
    padding: 0;
    max-height: 16px;
    border-bottom: 1px dashed #8a8a8a;
}

#g60printer div#printer_topoverlay,
#g60printer div#paper_topshadow {
    position: absolute;
    top: 0;
    left: 67px;
    width: 807px;
    height: 20px;
    padding: 0;
    margin: 0;
    background-image: url('../assets/images/paper-topoverlay.png');
    background-repeat: repeat-x;
}

#g60printer div#printer_topoverlay {
    z-index: 1;
}

#g60printer div#paper_topshadow {
    background-position: 0 -21px;
    z-index: 10;
}

/* ==================================================================
   Model 33 ASR console teletype — smooth plain paper (no tractor feed).
   A real Model 33 ASR was fed by friction with a smooth roll of paper, NOT
   the striped fanfold with sprocket holes used by line printers. The
   striped texture (paper.png) and the tractor-hole margins
   (paper-margin.png) are shared with the LP11 line printer, so here
   they are overridden with CSS gradients scoped ONLY to the teletype
   container #g60printer. The LP11 page (#lp11_printer) keeps the
   authentic fanfold look untouched.
   ================================================================== */
#g60printer td#paper_printarea {
    background: linear-gradient(to bottom, #f6f1e5 0%, #ede6d5 100%) repeat;
}

#g60printer td#papermargin_left,
#g60printer td#papermargin_right {
    /* The `background` shorthand resets image + repeat + position + color
       in one declaration, so no trace of paper-margin.png (sprocket holes)
       can survive here. The LP11 page rules below still use that image. */
    background: linear-gradient(to bottom, #f6f1e5 0%, #ede6d5 100%) repeat-y;
}

/* ==================================================================
   Google60-style punch keyboard for PDP-11 terminal input
   Placed below the line printer in the terminal page.
   Sprite-based 3D keys (keys.png + keyfaces.png) matching the
   original Google60 keypunch keyboard.
   ================================================================== */

#punchkeypane {
    position: relative;
    width: 940px;
    height: 240px;
    background-color: #3a1018;
    background-image: url('../assets/images/keyboardbg.jpg');
    background-repeat: repeat-x;
    margin: 0;
    padding: 0;
    border: 1px solid #444;
    border-top: none;
}

#punchkeyboard {
    position: absolute;
    top: 14px;
    left: 180px;
}

/* ---- Sprite-based keys (Google60 style) ---- */

#punchkeyboard .key {
    position: absolute;
    width: 38px;
    height: 38px;
    cursor: default;
}

/* Key 3D background sprite (keys.png) */
#punchkeyboard .key .keybg {
    position: absolute;
    width: 45px;
    height: 58px;
    left: -4px;
    top: -12px;
    background-image: url('../assets/images/keys.png');
    background-repeat: no-repeat;
    background-position: 0 0;
}

/* Key face character sprite (keyfaces.png) */
#punchkeyboard .key .keyface {
    position: absolute;
    top: 0;
    left: 0;
    width: 37px;
    height: 35px;
    z-index: 2;
    background-image: url('../assets/images/keyfaces.png');
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Pressed state: shift keybg sprite down, keyface shifts down */
#punchkeyboard .key:active .keybg,
#punchkeyboard .key.key_down .keybg {
    background-position: 0 -59px !important;
}

#punchkeyboard .key:active .keyface,
#punchkeyboard .key.key_down .keyface {
    top: 4px;
}

/* Ctrl label pressed state: shift down 4px to follow the 3D body */
#punchkeyboard .key:active .keylabel_ctrl,
#punchkeyboard .key.key_down .keylabel_ctrl {
    top: 8px;
}

/* ---- Ctrl key (text label over sprite body) ---- */
#punchkeyboard .key .keylabel_ctrl {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 30px;
    height: 30px;
    font-size: 9px;
    font-weight: bold;
    font-family: arial, helvetica, sans-serif;
    color: #e0d8c8;
    line-height: 30px;
    text-align: center;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
}

/* ---- Space bar (sprite-based) ---- */

#punchkeyboard .key_blank {
    position: absolute;
    width: 187px;
    height: 35px;
    cursor: pointer;
}

#punchkeyboard .key_blank .key_blank_bg {
    position: absolute;
    width: 195px;
    height: 58px;
    left: -4px;
    top: -12px;
    background-image: url('../assets/images/keys.png');
    background-repeat: no-repeat;
    background-position: -46px 0;
    pointer-events: none;
}

#punchkeyboard .key_blank:active .key_blank_bg,
#punchkeyboard .key_blank_down .key_blank_bg {
    background-position: -46px -59px !important;
}

/* ==================================================================
   LP11 printer page — the same Google60 rendering as the console
   teletype, but WITHOUT a keyboard and WIDER: a real LP11 prints
   132 columns, so the whole machine is scaled up (1160px) to fit a
   full 132-character line on the paper. The G60Printer instance is
   created with idPrefix "lp11g60", so every generated id is scoped
   under the #lp11_printer container and never collides with the
   console printer. The console teletype (#g60printer) stays 940px.
   ================================================================== */
#lp11_printer {
    position: relative;
    width: 1160px;
    height: 470px;
    background-color: #2a2a2a;
    overflow: hidden;
    border: 1px solid #444;
    margin: 8px 0;
}

#lp11_printer div#lp11g60printer {
    position: absolute;
    top: 0;
    left: 0;
    width: 1160px;
    height: 464px;
    background-color: #6f323d;
    background-image: url('../assets/images/printer_bg.gif');
    background-repeat: repeat;
}

#lp11_printer #lp11g60printheadarea {
    display: block;
    position: absolute;
    top: 388px;
    left: 67px;
    width: 994px;
    max-width: 994px;
    height: 30px;
    max-height: 30px;
    padding: 0;
    margin: 0;
    z-index: 3;
    overflow: hidden;
}

#lp11_printer #lp11g60printhead {
    display: block;
    position: absolute;
    top: 0;
    left: 16px;
    padding: 0;
    margin: 0;
}

#lp11_printer div#lp11g60printer_frontpannel {
    position: absolute;
    top: 395px;
    left: 67px;
    /* Full machine body width (1160 - 67 left skin - 66 right skin = 1027),
       so the panel seam meets the right skin exactly, matching the console
       teletype (#printer_frontpannel) where width == body width. */
    width: 1027px;
    height: 69px;
    background-image: url('../assets/images/printerskin.png');
    background-repeat: repeat-x;
    background-position: 0 -465px;
    z-index: 2;
}

#lp11_printer div#lp11g60printer_left {
    position: absolute;
    top: 0;
    left: 0;
    width: 67px;
    height: 464px;
    background-image: url('../assets/images/printerskin.png');
    background-repeat: no-repeat;
}

#lp11_printer div#lp11g60printer_right {
    position: absolute;
    top: 0;
    left: 1094px;
    width: 66px;
    height: 464px;
    background-image: url('../assets/images/printerskin.png');
    background-repeat: no-repeat;
    background-position: -67px 0;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {

    #lp11_printer div#lp11g60printer_frontpannel,
    #lp11_printer div#lp11g60printer_left,
    #lp11_printer div#lp11g60printer_right {
        background-image: url('../assets/images/printerskin_webkit.png');
    }
}

#lp11_printer div#lp11g60paper {
    position: absolute;
    top: 0;
    left: 67px;
    width: 1026px;
    height: 400px;
    max-height: 400px;
    vertical-align: top;
    text-align: left;
    padding: 0;
    margin: 0;
    z-index: 1;
}

#lp11_printer div#lp11g60paper.paperNoScroll {
    overflow: hidden;
}

#lp11_printer div#lp11g60paper.paperScroll {
    overflow-y: auto;
    overflow-x: hidden;
}

#lp11_printer div#lp11g60paper_topspacer {
    position: relative;
    height: 345px;
    width: 1px;
    margin: 0;
    padding: 0;
}

#lp11_printer div#lp11g60paper_topspacer.paperScroll {
    height: 16px;
}

#lp11_printer table#lp11g60paper_area {
    margin: 0;
    padding: 0;
    border: 0 none;
    border-collapse: collapse;
    border-spacing: 0;
}

#lp11_printer table#lp11g60paper_area td {
    vertical-align: top;
    margin: 0;
    white-space: nowrap;
}

#lp11_printer td#lp11g60papermargin_left,
#lp11_printer td#lp11g60papermargin_right {
    background-image: url('../assets/images/paper-margin.png');
    background-repeat: repeat-y;
    width: 33px;
    min-width: 33px;
}

#lp11_printer td#lp11g60papermargin_left {
    background-position: -3px 0;
}

#lp11_printer td#lp11g60papermargin_right {
    background-position: 0 0;
}

#lp11_printer td#lp11g60paper_top {
    background-image: url('../assets/images/paper-edge.png');
    background-repeat: repeat-x;
    background-position: 0 0;
    height: 5px;
}

#lp11_printer tr#lp11g60paper_bottom {
    background-image: url('../assets/images/paper-edge.png');
    background-repeat: repeat-x;
    background-position: 0 -5px;
    height: 5px;
    display: none;
}

#lp11_printer td#lp11g60paper_printarea {
    width: 960px;
    color: #36363c;
    font-size: 13px;
    text-align: left;
    font-family: lp1_regular, "Trebuchet MS", sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 16px;
    background-color: white;
    padding: 57px 18px 1px 18px;
    white-space: nowrap;
    background-image: url('../assets/images/paper.png');
    background-repeat: repeat;
    -webkit-text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    -moz-text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    -o-text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    text-shadow: 0 0 1px rgba(115, 115, 121, 0.6), 0 0 2px rgba(115, 115, 121, 0.3);
    -webkit-font-smoothing: subpixel-antialiased;
}

#lp11_printer td#lp11g60paper_printarea span {
    display: inline-block;
    vertical-align: top;
    white-space: pre;
    width: 7px;
    max-width: 7px;
    height: 16px;
    max-height: 16px;
    text-align: center;
}

#lp11_printer td#lp11g60paper_printarea span.overstrike {
    background-color: #3a3a3a;
    color: #8a8a8a;
    text-shadow: none;
}

/* Bold / underline emphasis produced by nroff/man overstrike (same glyph
   re-printed → bold; letter printed over an underscore → underline). */
#lp11_printer td#lp11g60paper_printarea span.bold {
    font-weight: bold;
}

#lp11_printer td#lp11g60paper_printarea span.underline {
    text-decoration: underline;
}

#lp11_printer td#lp11g60paper_printarea span.drop {
    margin-top: 1px;
    height: 15px;
    max-height: 15px;
    overflow: hidden;
    text-shadow: 0 -1px 1px rgba(115, 115, 121, 0.7), 0 -1px 2px rgba(115, 115, 121, 0.4);
}

#lp11_printer td#lp11g60paper_printarea span.shift {
    margin-top: -1px;
    text-shadow: 0 1px 1px rgba(115, 115, 121, 0.7), 0 1px 2px rgba(115, 115, 121, 0.4);
}

#lp11_printer td#lp11g60paper_printarea span.nonAscii {
    font-size: 12px !important;
    line-height: 18px !important;
}

#lp11_printer td#lp11g60paper_printarea p {
    margin: 0;
    padding: 0;
    max-height: 16px;
    vertical-align: top;
    white-space: nowrap;
    overflow: visible;
}

#lp11_printer div#lp11g60printer_topoverlay,
#lp11_printer div#lp11g60paper_topshadow {
    position: absolute;
    top: 0;
    left: 67px;
    width: 994px;
    height: 20px;
    padding: 0;
    margin: 0;
    background-image: url('../assets/images/paper-topoverlay.png');
    background-repeat: repeat-x;
}

#lp11_printer div#lp11g60printer_topoverlay {
    z-index: 1;
}

#lp11_printer div#lp11g60paper_topshadow {
    background-position: 0 -21px;
    z-index: 10;
}