/* https://github.com/ireade/holy-grail-css-grid/ */
/* Reset */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font: inherit;
	font-size: 100%;
	vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}



/* Custom Styles */


html {
	font-size: 62.5%;
}

body {
	font-size: 1.5rem;
	line-height: 1.6;
	font-family: 'Arial';
}

p {
	display: block;
	margin-bottom: 15px;
}

.hg-header {
	background-color: var(--bg);
}

.hg-footer {
	background-color: var(--bg);
	color: var(--fg);
	font-size: 1.2rem;
	display: flex;
	justify-content: center;
	align-items: center;
}

.hg-left,
.hg-right {
	background-color: var(--bg);
	text-align: center;
}

.hg-header,
.hg-left,
.hg-right,
.hg-main {
	padding: 5px;
}
/* **************************
	Holy Grail Layout with CSS Grid
************************** */

/* Define grid areas */
.hg-header { grid-area: header; }
.hg-footer { grid-area: footer; }
.hg-main { grid-area: main; }
.hg-left { grid-area: navigation; }
.hg-right { grid-area: ads; }


.hg {
	display: grid;
	grid-template-areas: "header header header"
	                     "navigation main ads"
	                     "footer footer footer";

	grid-template-columns: 150px 1fr 10px;

	grid-template-rows: 100px
						1fr
						30px;

	min-height: 100vh;
}



@media screen and (max-width: 600px) {
	.hg {
		grid-template-areas: "header"
		                     "navigation"
		                     "main"
		                     "ads"
		                     "footer";

		grid-template-columns: 100%;
		grid-template-rows: 100px
							200px
							1fr
							1px
							30px;
	}
}

h1{
    font-size: 24px;
    display: block;
}

h2{
    font-size: 20px;
    display: block;
}

h3{
    font-size: 16px;
    display: block;
}

.hg-left menu{
    top: 0;
    position: sticky;
}

.mirror{
    display: flex;
    width: 100%;
    height: 100%;
}

.mirror .raw {
    width: 50%;
    height: 100%;
    white-space: pre;
    word-wrap: nowrap;
    font-family: monospace;
    font-size: 14px;
    min-height: 400px;
    line-height: 16px;
    border: 1px solid #888;
}



.mirror div.svgbob {
    width: 50%;
    margin-left: 10px;
    margin-top: 40px;
}

.mirror div.svgbob div{
    overflow: auto;
    width: 100%;
    height: 100%
}

.btn {
    background-color: var(--hl);
    color: var(--hl-alt);
    padding: 14px 25px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border-radius: 5px;
    margin-top: 10px;
    width: 100%;
    cursor: pointer;
}

:root {
    --bg: #fff;
    --fg: #000;
    --accent-bg: #eee;
    --hl: #ada402;
    --hl-alt: #fff;
}

.coal{
    --bg: #141617;
    --fg: #98a3ad;
    --accent-bg: #b7b7b7;
    --hl: #b7b7b7;
    --hl-alt: #000;
}

.minimal{
    --bg: #fff;
    --fg: #000;
    --accent-bg: #eee;
    --hl: #ada402;
    --hl-alt: #fff;
}

body{
    font-family: monospace;
    font-size: 14px;
    color: var(--fg);
    background-color: var(--bg);
}

/* override the svg backdrop with the theme bg */
svg.bob rect.backdrop,
svg.bob .bg_fill{
    fill: var(--bg) !important;
}

svg.bob .fg_fill{
    fill: var(--fg) !important;
}

svg.bob .fg_stroke{
    stroke: var(--fg) !important;
}


.line {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    line-height: 16px;
    min-height: 16px;
}

.cell {
    width: 8px;
    height: 16px;
    flex: none;
}

/*
.tool-content .cell{
    border-right: 1px solid green;
}

.tool-content .line{
    border-bottom: 1px solid blue;
}
*/

.charwidth2{
    width: 16px!important;
    display: inline-block;
}


.focused {
    background-color: #333;
    animation: blinker 800ms linear infinite;
    opacity: 1;
}


@keyframes blinker {
  50% {
    opacity: 0;
  }
}

#input,
#buffer{
    top:0px;
    position:sticky;
    position: -webkit-sticky;
    white-space: pre;
    word-wrap: normal;
    font-family: monospace;
    font-size: 14px;
    line-height: 16px;
    width:0px;
    height:0px;
    resize: none;
}

p.debug {
    display:none;
}

.mn-editor{
    cursor: crosshair;
    position: relative;
    line-height: 16px;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* use for covering the cell lines, in order to get offset_x and offset_y accurate to the mn-editor
 * needs to be infront of all the overlays
 * */
.cells-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1111;
}

.hidden {
    display: none;
}

/* overlay for tool when user starts dragging mouse */
.tool-overlay{
    background-color: #88f;
    border: 2px solid blue;
    opacity: 0.2;
    position: absolute;
}

.tool-content{
    opacity: 0.8;
    position: absolute;
}

.tool-content.debug{
    background-color: red;
}

.tool-content .debug .cell{
    border: 1px solid blue;
}

.tool-content-cells{
    position: relative;
}

.tool-content.eraser{
    opacity: 0.5;
    border: 2px solid #88f;
    background-color: #fff;
}

.content-editable{
    min-height: 400px;
}

.content-editable .inner-html-container{
    white-space: pre;
}

.loader {
    border: 16px solid var(--accent-bg);
    border-top: 16px solid var(--hl);
    border-bottom: 16px solid var(--hl);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    position: absolute;
    left: 50%;
    top: 30%;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tool{
    display: flex;
    border-bottom: 1px solid #888;
    position: sticky;
    top: 0;
    background-color: var(--accent-bg);
    z-index: 2222;
}

.tool button{
    height: 40px;
    outline: none;
    background-color: transparent;
    border: 0;
    padding: 5px;
    outline: none;
}

.tool button.active{
    background-color: #eee;
}

