/* VARIABLES */
:root {
    /* colors */
    --primary: #028C00;
    --primaryAlpha: #028C0033;
    --primaryAlphaHover: #028C0066;
    --primary1: #03BF00;
    --primary2: #03A600;
    --primary3: var(--primary);
    --primary4: #027300;
    --primary5: #015900;
    --primary6: #015900;
    --grey: rgba(0,0,0,.4);
    --greyAlpha: rgba(0,0,0,.2);
    --blue: #3486c7;
    --blueDark: #293c85;
    --red: #b71e1e;

    /* dimens */
    --radius: 5px;
    --distance: 5px;
    --border: 3px;

    /* media */
    --breakpoint-tablet: 768px;
    --breakpoint-mobile: 480px;
}
@media only screen and (max-width: 768px) {
    :root {
        /* dimens */
        --radius: 3px;
        --border: 1px;
    }
}

/* TEMPLATES */
* {
    margin: 0;
    padding: 0;
    font-family: 'Kurale', serif;
    font-size: 100%;
    transition: all .5s ease-in-out;
    user-select: none;
    scrollbar-width: thin;
    outline: none;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
		background: rgba(0,0,0,.15);
    border-radius: 0; 
}
::selection {
    background-color: var(--primary);
    color: white;
}
.builder {
    cursor: pointer;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    height: calc(100% - 10px);
    margin: var(--distance);
}
.builder > div {
    display: flex;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-style: solid;
    border-width: var(--border);
    line-height: 100%;
    padding: 10px;
}
.builder > div:not(:first-child) {
    border-left-width: 0;
}
.builder > div:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}
.builder > div:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}
.builder > div > span {
    display: block;
    background-color: transparent !important;
}

.icon {
    box-sizing: border-box;
    border: var(--primary) solid var(--border);
    background-color: var(--primaryAlpha);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 200%;
}
@media only screen and (max-width: 768px) {
    .icon {
        font-size: 100%;
    }
}
.icon:hover {
    background-color: var(--primaryAlphaHover);
}
.disable {
    cursor: default !important;
    background-color: var(--greyAlpha);
    color: var(--grey);
    border-color: var(--grey);
}
.icon.disable:hover {
    background-color: var(--greyAlpha);
}

.notSure {
    background-image: linear-gradient(45deg, rgba(255,255,255,.5) 25%, rgba(0,0,0,.2) 25%, rgba(0,0,0,.2) 50%, rgba(255,255,255,.5) 50%, rgba(255,255,255,.5) 75%, rgba(0,0,0,.2) 75%, rgba(0,0,0,.2) 100%);
    background-size: 20px 20px;
}

/* BODY */
body {
    overflow: hidden;
}
@media only screen and (max-width: 868px) {
    body {
        font-size: 80%;
    }
}
#container {
    display: grid;
    height: 100vh;
    grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
    grid-template-rows: auto minmax(0,1fr) auto 60px;
    grid-template-areas:
    "header header"
    "content map"
    "timeline timeline"
    "footer footer";
}
@media only screen and (max-width: 768px) {
    #container {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 300px 200px 50px;
        grid-template-areas:
        "header"
        "content"
        "map"
        "timeline"
        "footer";
    }
}
#container > header {
    grid-area: header;

    margin: 20px 20px 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px;
    grid-template-rows: 50px 0 50px 50px 50px;
    grid-template-areas:
    "overview search"
    "middle search"
    "books search"
    "books info"
    "books info";
}
@media only screen and (max-width: 768px) {
    #container > header {
        grid-template-columns: 1fr 40px;
        grid-template-rows: 40px 40px;
        grid-template-areas:
        "overview search"
        "overview info";
    }
}

#container > header > .overview {
    grid-area: overview;

    color: white;
    z-index: 1;
}
#container > header > .overview div {
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
}

#container > header > .overview.big {
    height: 200px;
}
@media only screen and (max-width: 768px) {
    #container > header > .overview.big {
        height: 80px;
    }
}
#container > header > .overview.big > .builder > div:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}
#container > header > .overview.big > .builder > div:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

#container > header > .overview #dropdown {
    position: relative;
    z-index: 2;
    border-radius: var(--radius);
    background-color: var(--primaryAlpha);
    color: var(--primary);
    border: var(--primary) solid var(--border);
}
#container > header > .overview #dropdown i {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translate(-100%, -50%);
}

#container > header > .middle {
    height: 0;
    width: 0;
    border-bottom: 10px solid var(--primary1);
    transform: translate(5px, -50%);
}

#container > header > .books {
    grid-area: books;

    color: white;
    height: 100%;
}

#container > header > .books div {
    overflow: hidden;
    flex: 1;

    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

#container > header > .books span {
    transform: rotate(-90deg);
    white-space: nowrap;
}

#container > header > .infoButton {
    grid-area: info;

    cursor: pointer;
    border-radius: var(--radius);
    margin: var(--distance);
}

#container > header > .search {
    grid-area: search;

    margin: var(--distance);
}
#container > header .searchBg {
    cursor: pointer;
    border-radius: var(--radius);
    background-color: white;
    height: 90px;
}
@media only screen and (max-width: 768px) {
    #container > header .searchBg {
        height: 30px;
    }
}
#container > header .searchHolder {
    border-radius: var(--radius);
    height: 100%;
}
#container > header .searchHolder input {
    background: none;
    border: none;
    color: black;
    margin: 0 20px 0 20px;
    user-select: auto;
    display: none;
}
#container > header .searchOpen {
    cursor: default;
    position: absolute;
    display: inline-block;
    right: 25px;
    z-index: 10;
    text-align: left;
}
#container > header .searchOpen .searchHolder {
    padding-left: 25px;
}
#container > header .searchOpen input {
    display: block;
    width: 40vw;
}
@media only screen and (max-width: 768px) {
    #container > header .searchOpen {
        left: 25px;
    }
    #container > header .searchOpen input {
        width: 100%;
    }
}
#container > header .searchBg .searchResults {
    display: none;
    padding-top: 10px;
    font-size: 150%;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}
#container > header .searchBg .searchResults ul {
    background-color: white;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    list-style: none;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}
@media only screen and (max-width: 768px) {
    #container > header .searchBg .searchResults ul {
        max-height: calc(100vh - 80px);
    }
}
#container > header .searchBg .searchResults li {
    cursor: pointer;
    padding: 10px 20px;
    transition: background-color 0s;
}
#container > header .searchBg .searchResults li.active {
    background-color: rgba(0,0,0,.05);
}
#container > header .searchBg .searchResults li:hover {
    background-color: rgba(0,0,0,.05);
}
#container > header .searchOpen .searchResults {
    display: block;
}
#searchOverlay {
    display: none;
    z-index: 9;
    background-color: rgba(255,255,255,.8);
}

#container > #content {
    grid-area: content;

    margin: 0 0 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0,1fr);
}
@media only screen and (max-width: 768px) {
    #container > #content {
        margin: 0 20px 0 20px;
    }
}

#container > #content > .chapters {
    color: white;
    height: 100%;
}
#container > #content > .chapters > .builder {
    cursor: default;

    min-height: 50px;
    overflow-x: auto;
}
#container > #content > .chapters > .builder span {
    font-weight: bold;
    margin-right: 10px;
}

#container > #content > .infos {
    display: flex;
    align-items: center;
    justify-content: center;
}
#container > #content > .infos > div {
    max-height: 100%;
}

.infos .title {
    margin-bottom: 50px;
}
@media only screen and (max-width: 768px) {
    .infos .title {
        margin-bottom: 20px;
    }
}

.infos .title > .maintitle {
    display: inline-block;
    font-size: 400%;
}

.infos .title > .subtitle {
    margin-left: 10px;
    font-size: 200%;
    color: var(--grey);
}

.infos > div {
    overflow-y: auto;
}
.infos .infolist {
    margin-bottom: 20px;
}

.infos .infolistHolder {
    font-size: 150%;
    display: grid;
    grid-template-columns: 50px 1fr;
    grid-template-rows: auto auto auto auto auto;
}

.infos .infolistHolder .info {
    display: flex;
    align-items: left;
    justify-content: left;
    margin-left: 20px;
}

.infos .infolistHolder > div:not(:last-child):not(:nth-last-child(2)) {
    margin-bottom: 15px;
}

.infos .infolistHolder i {
    font-size: 200%;
    color: var(--grey);
}

#container > #map {
    grid-area: map;

    position: relative;
    margin: var(--distance) 0 0 var(--distance);
    overflow: hidden;
}
@media only screen and (max-width: 768px) {
    #container > #map {
        margin: 30px 0 0 0;
    }
}

#container > #map > #mapHolder {
    height: 100%;
    background-image: url("img/map.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#container > #map > .pointer {
    position: absolute;
    font-size: 300%;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    transition: all 1s ease-in-out;
}

#container > #map > .pointerAuthor {
    color: var(--red);
}

#container > #map > .pointerReceiver {
    color: var(--blue);
}

#container > #map > .nameBg {
    background-color: rgba(255,255,255,.5);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

#container > #map .name {
    font-size: 200%;
    position: relative;
    padding: 10px 20px;
}

#container > #map .nameAuthor {
    color: var(--red);
    float: left;
}

#container > #map .nameReceiver {
    color: var(--blueDark);
    float: right;
}

#container > #timeline {
    grid-area: timeline;

    position: relative;
    overflow: hidden;
}

#container > #timeline .timelineHolder {
    position: relative;
    width: auto;
    height: 100%;
    overflow: hidden;
}

#container > #timeline figure {
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
}

#container > #timeline img {
    width: calc(100% + 2px);
    margin-bottom: -6px;
}
@media only screen and (max-width: 768px) {
    #container > #timeline {
        overflow-x: auto;
    }
    #container > #timeline img {
        width: auto;
        height: 200px;
    }
}

#container > #timeline #timelineUnder {
    position: relative;
}

#container > #timeline #timelineOver {
    position: absolute;
    top: 0;
    left: 0;
}

#container > #timeline #timelineCurrent {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--primaryAlpha);
}

#container > #timeline .timeTextBg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

#container > #timeline .timeText {
    background-color: rgba(255,255,255,.5);
    padding: 10px 20px;
    font-size: 150%;
    position: relative;
}

#container > #timeline .timeStart {
    color: var(--red);
    float: left;
}

#container > #timeline .timeEnd {
    color: var(--blueDark);
    float: right;
    text-align: right;
}

#container > footer {
    grid-area: footer;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
#container > footer a {
    color: white;
}
.arrow {
    cursor: pointer;
    position: fixed;
    height: 150px;
    width: 70px;
    top: 50%;
    transform: translate(0, -50%);
}
@media only screen and (max-width: 768px) {
    .arrow {
        height: 60px;
        width: 30px;
    }
}
.arrowBackward {
    left: 0;
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}
.arrowForward {
    right: 0;
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: white;
    overflow: hidden;
}

#dropdownOverlay {
    z-index: 50;
    display: none;
}

#dropdownOverlay > .dropdownBooks {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#dropdownOverlay > .dropdownBooks > div {
    height: 100%;
    display: inline-block;
    overflow-y: auto;
    overflow-x: hidden;
}
#dropdownOverlay > .dropdownBooks ul {
    font-size: 200%;
    list-style: none;
}
#dropdownOverlay > .dropdownBooks li {
    cursor: pointer;
}
#dropdownOverlay > .dropdownBooks li:not(:last-child) {
    margin-bottom: 20px;
}

#dropdownOverlay > .close {
    position: fixed;
    cursor: pointer;
    display: none;
    top: 5px;
    right: 20px;
    font-size: 300%;
    color: var(--primary6);
}

#loaderHolder {
    z-index: 100;
}
.loaderCenter {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3vw;
    transform: scale(1.1);
}
.loaderText span {
    width: 100%;
    display: inline-block;
}
.loaderText span:nth-child(1) {
    text-align: left;
}
.loaderText span:nth-child(3) {
    text-align: center;
    font-size: 200%;
    text-transform: uppercase;
}
.loaderText span:nth-child(5) {
    text-align: right;
}
.loaderImg {
    text-align: center;
    margin-top: 10vh;
    color: var(--primary);
}