:root {
    color-scheme: light dark;

    --background-color: #f7f7f7;

    --active-text-color: #FF7F02;
    --text-color: #5e5e5e;
    --secondary-text-color: #9e9e9e;
    --thirdary-text-color: #444;

    --font-size: 16px;
    --line-height: 26px;

    --border-style: 1px solid #E8E8E8;
    --header-height: 80px;
    --panel-width: 300px;
    --panel-padding: 16px;
    --icon-size: 20px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--background-color: #2e2e2e;

		--text-color: #a7a7a7;
		--secondary-text-color: #888;
        --thirdary-text-color: #ccc;

		--border-style: 1px solid #444;
	}
}

@font-face {
    font-family: 'heading';
    src: url('./fonts/Muli-Black.ttf') format('truetype');
    font-display: fallback;
}

@font-face {
    font-family: 'body';
    src: url('./fonts/Montserrat-Regular.ttf') format('truetype');
    font-display: fallback;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
}

html {
    font-size: var(--font-size);
    line-height: var(--line-height);
}

body {
    font-family: "body", "Arial", sans-serif;
    margin: 0px;
    color: var(--secondary-text-color);
    background-color: var(--background-color);
}

a {
    text-decoration: none;
}

h1 {
    font-family: "heading", "Arial", sans-serif;
    font-size: calc(var(--font-size) + 10px);
    line-height: 24px;
    font-weight: 500;
}

h2 {
    font-family: "heading", "Arial", sans-serif;
    padding: 0;
    margin: 16px 0;
    font-size: calc(var(--font-size) + 14px);
    font-weight: 500;
    line-height: var(--line-height);    
}

h1 a {
    color: var(--active-text-color);
}

#header {
    display: flex;
    height: var(--header-height);
    border-bottom: var(--border-style);
    align-items: center;
}

#header h1 {
    padding-left: var(--panel-padding);
    flex: 1;
}

#panel {
    position: fixed;
    z-index: 100;
    left: 0px;
    width: var(--panel-width);
    height: 100%;
    overflow: auto;
    border-right: var(--border-style);
    display: flex;
    flex-direction: column;
}

#expandButton {
    width: 32px;
    height: 32px;
    position: absolute;
    right: 16px;
    top: 12px;
    display: none;
    cursor: pointer;
    background-color: var(--active-text-color);
    background-size: var(--icon-size);
    -webkit-mask-image: url(./ic_menu_black_24dp.svg);
    -webkit-mask-position: 50% 50%;
    -webkit-mask-repeat: no-repeat;
    mask-image: url(./ic_menu_black_24dp.svg);
    mask-position: 50% 50%;
    mask-repeat: no-repeat;  
}

#panel #content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0px var(--panel-padding) var(--panel-padding) var(--panel-padding);
}

#panel #content .link {
    color: var(--text-color);
    display: block;
}

#panel #content .link:hover {
    text-decoration: underline;
    color: var(--thirdary-text-color);
}

#panel #content .selected {
    color: var(--active-text-color) !important;
}

#viewer {
    position: absolute;
    border: 0px;
    padding-left: var(--panel-width);
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

#button {
    position: fixed;
    bottom: 16px;
    right: 16px;
    padding: 12px;
    border-radius: 50%;
    margin-bottom: 0px;
    background-color: #fff;
    opacity: 0.9;
    z-index: 999;
    color: #fff;

    box-shadow: 0 0 4px rgba(0, 0, 0, .15);
}

#button:hover {
    cursor: pointer;
    opacity: 1;
}

#button img {
    display: block;
    width: var(--icon-size);
}

/* mobile */

@media all and (max-width: 640px) {
    :root {
        --header-height: 56px;
        --icon-size: 24px;
    }

    h1{
        font-size: 20px;
    }

    #expandButton {
        display: block;
    }

    #panel {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        right: 0;
        z-index: 1000;
        overflow: hidden;
        border: none;
        height: var(--header-height);
        transition: 0s 0.2s height;
    }

    #panel.open {
        height: 100%;
        transition: 0s 0s height;
    }

    #panelScrim {
		pointer-events: none;
		background-color: rgba(0, 0, 0, 0);
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		transition: .2s background-color;
	}

    #panel.open #panelScrim {
		pointer-events: auto;
		background-color: rgba(0, 0, 0, 0.4);
	}

    #content {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        background: var(--background-color);
        box-shadow: 0 0 8px rgba(0,0,0,.1);
        width: calc(100vw - 60px);
        max-width: 360px;
        transition: .25s transform;
        font-size: 17px;
        margin-right: -380px;
		line-height: 2rem;
    }

    #panel.open #content {
        transform: translate3d(-380px, 0 ,0);
    }

    #viewer {
        left: 0;
        top: var(--header-height);
        width: 100%;
        height: calc(100% - var(--header-height));
        padding-left: 0;
    }
}