:root {
    --main-font-family: "MS PGothic", 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    /* --max-tab-height: 625px; */
    /* --max-main-height: 650px; */
    /* --max-grid-width: 920px; */

    --max-main-height: none;
    --max-tab-height: none;
    --max-grid-width: 940px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--box-border-color-2) var(--background-color);
    transition: background-color 0.3s, padding 0.3s, size 0.3s;

    box-sizing: border-box;
}

html {
    background-color: var(--background-color);
    color: var(--text-color);

    font-family: var(--main-font-family);
    image-rendering: pixelated;
}

html *::selection {
    color: var(--background-color);
    background-color: var(--highlight-color);
}

html >::after {
    content: "";
    background-image: url("/_img/assets/noise.png");
    opacity: 0.03;
    position: fixed;
    pointer-events: none;
    inset: 0;
    z-index: 200;
}

.container {
    position: relative;

    display: flex;
    justify-content: center;

    padding-top: 20px;
    padding-bottom: 20px;
}


.grid {
    max-width: var(--max-grid-width);

    display: grid;
    grid-template-columns: 1fr 3.4fr;
    gap: 5px 5px;
    grid-template-areas:
      "header header"
      "top main"
      "bott main"
      "footer footer";

    position: relative;
}

.nav-container {
    border: 1px dotted var(--box-border-color);
    border-radius: 3px;
}

.nav {
    padding: 5px;
    padding-top: 0px;
    background-color: var(--box-background-color);
}

.header {
    position: relative;

    grid-area: header;
    background-color: #00000000;
    background-image: var(--banner-image);
    background-size: cover;
    height: 160px;
    border: none;
    border-radius: 3px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--header-text-color);
    font-family: var(--header-font), var(--main-font-family);
    font-size: var(--header-font-size);

    text-transform: uppercase;
    font-weight: bold;

    z-index: 1;
}

.main-header {
    text-shadow: 3px 3px 5px var(--shadow-color);
    padding-bottom: 15px;
    position: relative;
}

.shoreline-theme .main-header {
    text-shadow: 3px 3px 5px #2e3330;
}


.main {
    grid-area: main;
    position: relative;
    z-index: 2;
}

.tab-page, .main-page {
    border: 1px dotted var(--box-border-color);
    border-radius: 3px;
    background-color: var(--box-background-color);

    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;

    padding: 5px;
}

.tab-page {
    max-height: var(--max-tab-height);
}

.main-page {
    max-height: var(--max-main-height);
}


.top {
    grid-area: top;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;

    position: sticky;
    top: 5px;
    height: fit-content;
}


.nav-title {
    background-color: var(--box-background-color-2);
    border: none;
    width: 100%;
    padding: 4px 10px;
    border-radius: 3px 3px 0px 0px;
    font-family: var(--main-font-family);
    color: var(--text-color);
    text-align: left;
}

.nav-items {
    display: flex;
    flex-direction: column;
}

.nav-items a:first-of-type {
    padding-top: 5px;
}

.nav-items >a {
    color: var(--text-color);
    text-decoration: none;
    padding: 3px 5px 2px 10px;
    border-left: 1px dotted var(--box-border-color);
    border-bottom: 1px dotted var(--box-border-color);
    border-radius: 2px;
    transition: color 0s;
}

.nav-items >a:hover {
    color: var(--highlight-color);
    text-decoration: underline;
}

a {
    text-decoration: none;
    color: var(--highlight-color);
    transition: color 0s, background-color 0s;
}

a:hover {
    color: var(--highlight-color-2);
    text-decoration: underline;
}

button {
    font-size: 1em;
}

.bott {
    grid-area: bott;
    display: flex;
    flex-direction: column;
}

#theme-buttons {
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: center;
    gap: 5px;
}

#theme-buttons >div {
    display: flex;
    gap: 5px;
}

#theme-buttons button {
    border: none;
    background: none;
    height: 25px;
    width: 25px;

    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-buttons img {
    height: 25px;
    width: 25px;
    image-rendering: pixelated;
}

#theme-buttons button:hover {
    cursor: pointer;
    border: 1px solid var(--highlight-color);
    border-radius: 3px;
}

.nav, #theme-buttons, #status {
    height: fit-content;
}


footer {
    grid-area: footer;
    text-align: center;
    /* padding-top: 5px; */
}


.box-simple {
    background-color: var(--box-background-color-2);
    padding: 5px;
    border-radius: 3px;
    border: 1px solid var(--box-border-color-2);
}


.box-titled {
    border: 1px dotted var(--box-border-color);
    border-radius: 3px;
    background-color: var(--box-background-color);
}

.box-titled >* {
    padding: 5px;
}

.title {
    background-color: var(--box-background-color-3);
    padding: 5px 10px;
    position: relative;
}


.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 5px;
}

#tabs {
    position: relative;
    display: flex;
    align-items: end;
    gap: 5px;
    transform: translateY(1px);
    margin-left: 10px;
    z-index: 1;
}

#tabs * {
    transition: background-color 0s, color 0s;
}

#tabs .tab-closed-button {
    border: 1px solid var(--box-border-color-2);
    border-bottom: 1px dotted var(--box-border-color);
    border-radius: 3px 3px 0px 0px;
    background-color: var(--box-background-color-2);

    font-family: var(--main-font-family);
    color: var(--box-border-color-2);

    height: 25px;
    padding: 3px 10px;
}

#tabs .tab-open-button {
    border: 1px dotted var(--box-border-color);
    border-bottom: 1px solid var(--box-background-color);
    border-radius: 3px 3px 0px 0px;
    background-color: var(--box-background-color);

    font-family: var(--main-font-family);

    color: var(--text-color);

    height: 25px;
    padding: 3px 10px;

}

#tabs button:hover {
    cursor: pointer;
}


.tab-open {
    display: flex;
    flex-direction: column;
}

.tab-closed {
    display: none;
}

.bg-gradient {
    background-image: linear-gradient(to top, var(--background-color) 0%, rgba(255, 255, 255, 0) 40%);
}


p {
    margin: 15px 0px;
}

ul {
    margin: 5px 0px;
    margin-left: -15px;
}

li {
    list-style-type: circle;
}

.box-shadow {
    box-shadow: 3px 3px 5px var(--shadow-color);
}

.shoreline-theme .box-shadow {
    box-shadow: 3px 3px 5px var(--box-border-color-2);
}

.divider {
    width: 100%;
    border-bottom: 1px dotted var(--box-border-color);
}

.leave-space {
    margin: 5px;
}

.just-padded {
    padding-left: 5px;
    padding-right: 5px;
}


.just-padded-more {
    padding: 10px;
}


.text-highlight {
    color: var(--highlight-color-2);
}

.text-highlight-2 {
    padding: 0px 3px;
    background-color: var(--highlight-color-2-soft);
    /* color: var(--highlighted-text-color); */
}



mark {

}

.sketch-highlight{
  position:relative;
}

.sketch-highlight:before{
  content:"";
  left:-0.5em;
  top:-0.1em;
  border-width:0.1em;
  border-style:solid;
  border-color:var(--marker-color);
  position:absolute;
  border-right-color:transparent;
  width:100%;
  height:1em;
  transform:rotate(2deg);
  opacity:0.7;
  border-radius:50%;
  padding:0.1em 0.25em;
  pointer-events: none;
}

.sketch-highlight:after{
  content:"";
  left:-0.5em;
  top:0.1em;
  padding:0.1em 0.25em;
  border-width:0.1em;
  border-style:solid;
  border-color:var(--marker-color);
  border-left-color:transparent;
  border-top-color:transparent;
  position:absolute;
  width:100%;
  height:1em;
  transform:rotate(-1deg);
  opacity:0.7;
  border-radius:50%;
  pointer-events: none;
}

.sketch-underline {
    position: relative;
}

.sketch-underline:before{
  content:"";
  top: 0.9em;
  left: -0.5em;
  padding: 0 0.1em;
  border-width:0.1em;
  border-style:solid;
  border-color:var(--marker-color);
  border-bottom: none;
  border-left: none;
  border-right: none;
  border-radius: 50% 10%;
  position:absolute;
  width: 100%;
  height: 0.1em;
  transform:rotate(1deg);
  opacity:0.7;
  pointer-events: none;
}

.sketch-underline:after{
  content:"";
  top: 1em;
  right: -0.2em;
  border-radius: 20% 10%;
  border-width: 0.1em;
  border-style:solid;
  border-color:var(--marker-color);
  border-right:none;
  border-bottom:none;
  border-left:none;
  position:absolute;
  width:90%;
  height:0.5em;
  transform:rotate(0deg);
  opacity:0.5;
  pointer-events: none;
}



.heading1 {
    color: var(--heading1-color);
    margin: 10px 0px;

    font-size: 2em;
    font-family: var(--secondary-font), var(--main-font-family);
}

.heading2 {
    color: var(--heading2-color);
    margin: 0px;

    font-size: 1.7em;
    font-family: var(--secondary-font), var(--main-font-family);
}

.heading3 {
    color: var(--heading3-color);
    margin: 0px;

    font-size: 1.4em;
    font-family: var(--secondary-font), var(--main-font-family);
}

.heading-underlined {
    border-bottom: 1px dotted var(--text-color);
}

.heading-highlighted {
    /* background-color: var(--heading1-background-color); */
    background-image: linear-gradient(90deg, var(--heading1-background-color) 25%, rgba(0,0,0,0) 80%);
    padding: 5px;
    margin-left: -5px;
}

.quote {
    margin: 15px 10px;
    padding: 0px 10px;
    border-left: 1px dotted var(--box-border-color);
    color: var(--box-border-color);
}

.underlined {
    border-bottom: 1px dotted var(--text-color);
}

.justified {
    text-align: justify;
}

.bolded {
    font-weight: bold;
}

.struck {
    text-decoration: line-through;
}

.italicized {
    font-style: italic;
}

.pixel-font {
    font-family: var(--secondary-font), var(--main-font-family);
}


.tooltip-hover:hover:not(img) .tooltip-hover:hover:not(:has(img)){
    border-bottom: 1px dotted var(--box-border-color);
    margin-bottom: -1px;
}

.tooltip {
    position: fixed;
    background-color: var(--box-border-color-2);
    color: var(--tooltip-text-color);

    padding: 2px 5px;
    border: 1px dotted var(--box-border-color);
    border-radius: 3px;
    box-shadow: 3px 3px 5px var(--shadow-color);

    font-size: 16px;
    font-family: var(--main-font-family);
    font-weight: 400;
    white-space: nowrap;

    display: none;
    pointer-events: none;
    z-index: 10;
}

@media only screen and (max-width: 500px) {
    .tooltip {
        display: none !important;
    }
}


.back-to-top-button {
    position: fixed;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    z-index: 20;

    background-color: var(--box-border-color-2);
    color: var(--tooltip-text-color);
    padding: 2px 5px;
    border: 1px dotted var(--box-border-color);
    border-radius: 3px;
    box-shadow: 3px 3px 5px var(--shadow-color);

    font-size: 16px;
    font-family: var(--main-font-family);
    font-weight: 400;
    white-space: nowrap;
}

.back-to-top-button:hover {
    background-color: var(--box-background-color-2);
    cursor: pointer;
}

.shoreline-theme .back-to-top-button:hover  {
    background-color: var(--box-background-color-3);
    cursor: pointer;
}

.show {
    opacity: 1;
    visibility: visible;
}


.outlink::after {
    content: "↗";
    padding: 0px 3px;
    font-size: 0.8em;
    vertical-align: top;
}



@media only screen and (max-width: 700px) {

    body {
        margin: 0px;
    }

    .container {
        padding-top: 0px;
    }

    .grid {
        display: flex;
        flex-direction: column;
        gap: 10px 10px;
    }

    .top {
        gap: 10px;
        position: relative;
    }

    .main, .main-page, .tab-page {
        max-height: none;
    }

    .just-padded {
        padding-left: 3px;
        padding-right: 3px;
    }

    .nav-container {
        border: 1px solid var(--box-border-color-2);
    }

    .nav {
        padding: 0px;
    }

    .nav:has(.nav-open) {
        padding: 5px;
        padding-top: 0px;
        transition: padding 0s;
    }

    .nav-title {
        padding: 10px;
    }

    .nav-title::before {
        content: "> ";
    }

    .nav-title:hover {
        cursor: pointer;
    }

    .nav-closed {
        visibility:hidden;
        clear: none;
        max-height: 0px;
        transition: max-height 200ms cubic-bezier(0.23, 1, 0.32, 1);
        overflow: hidden;
    }

    .nav-open {
        visibility: visible;
        position: relative;
        transition: max-height 200ms cubic-bezier(0.23, 1, 0.32, 1);
        max-height: 300px;
        overflow: hidden;
    }

    .nav-items > a {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .header {
        min-height: 240px;
        height: 240px;
        text-align: center;
        line-height: 0.8em;
        font-size: 6em;
    }

    .flex-column-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    #chatbox {
        width: 100%;
    }

    #theme-buttons {
        margin-right: 5px;
        flex-direction: row;
        justify-content: end;
        align-items: center;
    }

    #theme-buttons button, #theme-buttons img {
        height: 30px;
        width: 30px;
    }

    #tabs .tab-open-button, #tabs .tab-closed-button {
        height: min-content;
        width: fit-content;
        max-width: 30%;
        padding: 5px;
    }

    .show {
        visibility: hidden;
        opacity: 0;
    }


    html >::after {
        content: none;
    }

    footer {
        padding-top: 5px;
    }

}