/*Adapted from MVP.css v1.12 - https://github.com/andybrewer/mvp */

:root {
    --active-brightness: 0.85;
    --border-radius: 13px;
    --box-shadow: 2px 2px 10px;
    --color-accent: #118bee15;
    --color-darkblue: #043898;
    --color-bg: #fbf5cc;
    --color-bg-secondary: #485cf5;
    --color-link: #000000;
    --color-secondary: #485cf5;
    --color-secondary-accent: #e90d0d0b;
    --color-shadow: #acb4e7;
    --color-table: #118bee;
    --color-text: #000;
    --color-text-secondary: #7b7a7a;
    --color-bg-whiteish: #f0f8ff;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, "Ubuntu", Cantarell, "Helvetica Neue", sans-serif;
    --hover-brightness: 1.3;
    --justify-important: center;
    --justify-normal: left;
    --line-height: 1.3;
    --width-card: 285px;
    --width-card-medium: 460px;
    --width-card-wide: 800px;
    --width-content: 1080px;
    

}

@media (prefers-color-scheme: dark) {
    :root {
        --color-accent: #0097fc5e;
        --color-darkblue: #f3febd;
        --color-bg: #313131;
        --color-bg-secondary: #555;
        --color-link: #fcf199;
            --color-secondary:#fcd80e;
        --color-secondary-accent: #e20de94f;
        --color-shadow: #bbbbbb20;
        --color-table: #0097fc;
        --color-text: #f7f7f7;
        --color-text-secondary: #aaa;
        --color-bg-whiteish: #0e1e2e;
    }
}

/* Layout */
article aside {
    background: var(--color-secondary-accent);
    border-left: 4px solid var(--color-secondary);
    padding: 0.01rem 0.1rem;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    line-height: var(--line-height);
    overflow-x: hidden;
    padding: 0.5em;
    scroll-behavior: smooth;
    margin: 0.5em;
}

footer,
header,
main {
    margin: 0.1px auto;
    max-width: var(--width-content);
    padding-top: 1.1rem;
}

footer {
    text-align: center;
    font-size: x-small;
    opacity: 0.7;
    position:relative;
    width: 100%;
    bottom: 10px;
    }

footer p {
    margin: 0.1em;
}

hr {
    background-color: var(--color-bg-secondary);
    border: none;
    height: 1px;
    width: 90%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

section {
    display: flex;
    flex-wrap: wrap;
    justify-content: var(--justify-important);
}

section img,
article img {
    max-width: 100%;
}

section pre {
    overflow: auto;
}

section aside {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    margin: 0.8rem;
    padding: 1.3rem;
    width: var(--width-card);
}

section aside:hover {
    box-shadow: var(--box-shadow) var(--color-bg-secondary);
}

[hidden] {
    display: none;
}

/* Headers */
article header,
div header,
main header {
    padding-top: 1px;
}

header {
    text-align: var(--justify-important);
}

header a b,
header a em,
header a i,
header a strong {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

header nav img {
    margin: 0.5rem 0;
}

section header {
    padding-top: 1px;
    width: 100%;
}

/* Nav */
nav {
    align-items: center;
    display: flex;
    font-weight: bold;
    justify-content: space-between;
    margin-bottom: 0.2rem;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline-block;
    margin: 0 0.5rem;
    position: relative;
    text-align: left;
}

/* Max's nav dropdown*/
.dropdown {
    float: left;
    overflow: hidden;
}

/* Dropdown button */
.dropdown .dropbtn {
    font-size: 16px;
    border: none;
    outline: none;
    color: var(--color-bg-whiteish);
    padding: 14px 16px;
    background-color: inherit;
    font-family: inherit;
    /* Important for vertical align on mobile phones */
    margin: 0;
    /* Important for vertical align on mobile phones */
}

/* Add a red background color to navbar links on hover */
.navbar a:hover,
.dropdown:hover .dropbtn {
    background-color: red;
}

/* Dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color:var(--color-bg-whiteish);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Links inside the dropdown */
.dropdown-content a {
    float: none;
    color: var(--color-text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

/* Add a grey background color to dropdown links on hover */
.dropdown-content a:hover {
    background-color: var(--color-bg)
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}
/*END MB DROPDOWN*/


/* Nav Dropdown */
nav ul li:hover ul {
    display: block;
}

nav ul li ul {
    background: var(--color-bg);
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    display: none;
    height: auto;
    left: -2px;
    padding: .5rem 1rem;
    position: absolute;
    top: 1.7rem;
    white-space: nowrap;
    width: auto;
    z-index: 1;
}

nav ul li ul::before {
    /* fill gap above to make mousing over them easier */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.5rem;
    height: 0.5rem;
}

nav ul li ul li,
nav ul li ul li a {
    display: block;
}

/* Typography */
code,
samp {
    background-color: var(--color-accent);
    border-radius: var(--border-radius);
    color: var(--color-text);
    display: inline-block;
    margin: 0 0.1rem;
    padding: 0 0.5rem;
}

details {
    margin: 1.3rem 0;
}

details summary {
    font-weight: bold;
    cursor: pointer;
    /*
        border-radius: var(--border-radius);
            display: inline-block;
            font-size: medium;
            font-weight: bold;
            line-height: var(--line-height);
            margin: 0.5rem 0;
            padding: 1rem 2rem;
            background-color: var(--color-link);
                border: 2px solid var(--color-link);
                color: var(--color-bg);
                */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: var(--line-height);
    margin-bottom: 2%;
}

mark {
    padding: 0.1rem;
}

ol li,
ul li {
    padding: 0.2rem 0;
    padding-inline-start: 1ch;
}

p {
    margin: 0.75rem 0;
    text-align: inherit;
    padding: 0;
    margin-right: auto;
    margin-left: auto;
}

pre {
    margin: 1rem 0;
    max-width: var(--width-card-wide);
    padding: 1rem 0;
}

pre code,
pre samp {
    display: block;
    max-width: var(--width-card-wide);
    padding: 0.5rem 2rem;
    white-space: pre-wrap;
}

/*A special class to minimise the width of text*/
.readable {
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 5%;
    padding-right: 5%;
}

*.monitor:-webkit-scrollbar-thumb {
    background-color: var(--color-darkblue);
    border-radius: 20px;
    border: 3px solid transparent;
}

/*A subclass for rendering code in a cool Matrix style 😎 */
.code {
    background-color: darkslategrey; 
    color: greenyellow; 
    font-size: 16px;
    font-family: monospace;
    border-radius: 0;
    border-style:groove;
    border-color: white;
    border-width: 4px;
    max-width: 500px;
    height: 30vh;
}

.code::-webkit-input-placeholder {
    color: white;
}

small {
    color: var(--color-text-secondary);
}

sup {
    background-color: var(--color-secondary);
    border-radius: var(--border-radius);
    color: var(--color-bg);
    font-size: xx-small;
    font-weight: bold;
    margin: 0.2rem;
    padding: 0.2rem 0.3rem;
    position: relative;
    top: -2px;
}

/* Links */
a {
    color: var(--color-link);
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
    overflow-wrap: break-word;
}

a:active {
    filter: brightness(var(--active-brightness));
    text-decoration: underline;
}

a:hover {
    filter: brightness(var(--hover-brightness));
    text-decoration: underline;
}

a b,
a em,
a i,
a strong,
button,
input[type="submit"] {
    border-radius: var(--border-radius);
    display: inline-block;
    font-size: medium;
    font-weight: bold;
    line-height: var(--line-height);
    margin: 0.5rem 0;
    padding: 1rem 2rem;
}

button,
input[type="submit"] {
    font-family: var(--font-family);
}

button:active,
input[type="submit"]:active {
    filter: brightness(var(--active-brightness));
}

button:hover,
input[type="submit"]:hover {
    cursor: pointer;
    filter: brightness(var(--hover-brightness));
}

a b,
a strong,
button,
input[type="submit"] {
    background-color: var(--color-link);
    border: 2px solid var(--color-link);
    color: var(--color-bg);
}

a em,
a i {
    border: 2px solid var(--color-link);
    border-radius: var(--border-radius);
    color: var(--color-link);
    display: inline-block;
    padding: 1rem 1rem;
}

article aside a {
    color: var(--color-secondary);
}

/* Images */
figure {
    margin: 0;
    padding: 0;
}

figure img {
    max-width: 100%;
}

figure figcaption {
    color: var(--color-text-secondary);
}

/* Forms */
button:disabled,
input:disabled {
    background: var(--color-bg-secondary);
    border-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

button[disabled]:hover,
input[type="submit"][disabled]:hover {
    filter: none;
}

form {
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    display: block;
    max-width: var(--width-card-wide);
    min-width: var(--width-card);
    padding: 1.5rem;
    text-align: var(--justify-normal);
    background-color: var(--color-bg-whiteish);
        font-family: var(--font-family);

    
}


/*This was tricky: hidden forms/text were still taking up space on the page because of pre-inserted linebreaks. This tweaked version forces it to be a single pixel in height/width, and puts the overflow into a scrolling box... effectively making it invisible. */
.show {
    visibility: visible;
}

.hidden {
    display: none !important;
    height: 1px;
    width: 1px;
    font-size: 0px;
    overflow:hidden;
    margin: 0px;
    padding: 0px;
    background: none;
    background-color: none;
    background-image: none;
}

.loader
{
    margin: auto;
        border: 5px solid lightblue;
        border-radius: 50%;
        border-top: 5px solid var(--color-bg-secondary);
        width: 30px;
        height: 30px;
        animation: spinner 1s linear infinite;
        margin-bottom: 10px;
        z-index:2;
        background-color: transparent;
        pointer-events: none;
}
.loader.show {
    visibility: show;
}

.loader.hidden {
    visibility: hidden;
    width: 1px;
    height: 1px;
}

@keyframes spinner {


    0% {
        transform: rotate(0deg);
    }


    100% {
        transform: rotate(360deg);
    }


}

form header {
    margin: 1rem 0;
    padding: 1rem 0;
}

input,
label,
select,
textarea {
    display: block;
    font-size: inherit;
    max-width: var(--width-card-wide);
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

input[type="checkbox"],
input[type="radio"] {
    display: inline-block;
}

input[type="checkbox"]+label,
input[type="radio"]+label {
    display: inline-block;
    font-weight: normal;
    position: relative;
    top: 1px;
}

input[type="range"] {
    padding: 0.4rem 0;
}

input,
select,
textarea {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
}

input[type="text"],
textarea {
    width: calc(100% - 1.6rem);
    resize: vertical;
    overflow-x:visible;
}

input[readonly],
textarea[readonly] {
    background-color: var(--color-bg-secondary);
}

label {
    font-weight: bold;
    margin-bottom: 0.2rem;
}

/* Popups */
dialog {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    z-index: 999;
}

/* Tables */
table {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    border-spacing: 0;
    display:flex;
    max-width: 100%;
    overflow-x: auto;
    padding: 0;
    white-space: nowrap;
}

table td,
table th,
table tr {
    padding: 0.4rem 0.8rem;
    text-align: var(--justify-important);
}

table thead {
    background-color: var(--color-table);
    border-collapse: collapse;
    border-radius: var(--border-radius);
    color: var(--color-bg);
    margin: 0;
    padding: 0;
}

table th {
    background-color: #485cf5;
    color: white;
    font-style: italic;
}

table thead th:first-child {
    border-top-left-radius: var(--border-radius);
}

table thead th:last-child {
    border-top-right-radius: var(--border-radius);
}

table thead th:first-child,
table tr td:first-child {
    text-align: var(--justify-normal);
}

table tr:nth-child(even) {
    background-color: var(--color-accent);
}

iframe {
        margin-left: auto;
        margin-right: auto;
        border: 1px solid var(--color-bg-secondary);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow) var(--color-shadow);
        display: block;
        width: 90%;
        height: 70vh;
        max-width: var(--width-card-wide);
        min-width: var(--width-card);
        padding: 1rem;
        text-align: var(--justify-normal);
        background-color: whitesmoke;
    }

/* Quotes */
blockquote {
    display: block;
    font-size: large;
    line-height: var(--line-height);
    margin: 1rem auto;
    max-width: var(--width-card-medium);
    padding: 11rem 1rem;
    text-align: var(--justify-important);
}

blockquote footer {
    color: var(--color-text-secondary);
    display: block;
    font-size: small;
    line-height: var(--line-height);
    padding: 1.5rem 0;
}

/*Call it as <a class="tooltipdata" data-tooltip="what you want to popup">WORD</a>*/

.tooltip {
    position: relative;
    white-space: pre-line;
    cursor: context-menu;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    z-index: 1;
}

.tooltipdata {
    white-space: pre-line;
    cursor: context-menu;
    pointer-events: all;
    top: 100%;
        left: 0;
        right: 0;
        margin-left: auto;
        margin-right: auto;
}

.tooltipdata:hover::after {
    content: attr(data-tooltip);
    position:absolute;
    display:flex;
    top: 100%;
        margin-right: auto;
    font-size: medium;
    font-style: italic;
    font-weight: 250;
    min-width: 200px;
    text-align: center;
    border-radius: var(--border-radius);
    border: 2px var(--color-secondary) solid;
    padding: 8px;
    color: black;
    background-color: var(--color-shadow);
    z-index: 1;
    white-space: pre-line;
}


/* The toastAlert - position it at the bottom and in the middle of the screen */
#toastAlert {
    visibility: hidden;
    border-radius: var(--border-radius);
    /* Hidden by default. Visible on click */
    min-width: 20vw;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px;
    position: fixed;
    /* Sit on top of the screen */
    z-index: 1;
    left: 33vw;
    right: 33vw;
    bottom: 32px;
    font-family: var(--font-family);
}



/* Show the toastAlert when clicking on a button (class added with JavaScript) */
#toastAlert.show {
    visibility: visible;
    /* Show the toastAlert */
    /* Add animation: Take 0.5 seconds to fade in and out the toastAlert.
  However, delay the fade out process for 2.5 seconds */
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

/* Animations to fade the toastAlert in and out */
@-webkit-keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@-webkit-keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

@keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

/* Blog Stylesheet*/

  blog div {
      padding-left: 5%;
      padding-right: 5%;
      font-family: var(--font-family);
      line-height: 160%;
      font-size: 110%;
      min-height: 69vh;
      color:var(--color-text);
      background-color: var(--color-bg-whiteish);
  }


  blog a {
      color: var(--color-secondary);

      display: inline-block;
      font-weight: bold;
      text-decoration: none;
      word-wrap: normal;
     overflow-wrap: break-word;
  }

  blog h1 {
      margin-bottom: 1%;
  }

  blog  {
    text-align: center;
  }

  blog h2 {
      margin-top: 5%;
      margin-bottom: 1%;

  }

  blog h3 {
      font-style: italic;
      color: var(--color-text-secondary);
      font-size: 100%;
      font-weight: 350;
  }

  blog h4 {
    margin: 0;
        padding: 0 1em;
        color: var(--color-text-secondary);
        font-size: 80%;
        font-style: italic;
        font-weight: 300;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        max-width: 80%;
  }

  blog img {
      border-radius: var(--border-radius);
      max-width: 100%;
      max-height: 40vh;
      margin-left: auto;
      margin-right: auto;
      display: block;
  }

  blog blockquote {
      margin: 0;
      padding: 2px 3em;
      color: var(--color-text);
      border-left: 0.4em solid var(--color-accent);
    font-style: normal;
    font-display:inherit;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
    max-width: 80%;
    font-size: 85%;
    background-color: var(--color-accent);
  }

  blog code,
  samp {
      background-color:#333333;
      border-radius: 4px;
      color: var(--color-bg);
      display: inline-block;
      margin: 0.1rem;
      font-size: 17px;
  }

  blog form {
      border: transparent;
      border-width: 0px;
      margin-left: auto;
      margin-right: auto;
      padding-left: 1%;
      padding-right: 1%;
  }

  blog form small {
      font-style: italic;
      font-family: monospace;
      align-content: center;
      margin-left: auto;
      margin-right: auto;
      text-align: center;
      color: var(--color-text-secondary);
      display: block;
  }

  blog button {
    margin-right: auto;
    margin-left: auto;
    align-self: center;
    text-align: center;
    display: flex;
    
  }

  blog hr {
    width: 50%;
    height: 2px;
    margin-left: auto;
    margin-right: auto;
    padding: 0px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  blog ul li::marker {
    content: "ᐷ";
    padding-inline-start: 1ch;
    color: var(--color-bg-secondary);
}

blog iframe {
    border: transparent;
    border-width: 0px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0%;
    padding-right: 0%;
    width: 100%;
    height: 600px;
    
}

.row {
    display: flex;
}

.column {
    flex: 50%;
}

@media screen and (max-width: 600px) {
    .column {
        width: 100%;
    }
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}


/* This section is used for the hiding of long content. First, the Fadeout block.

Make sure you give it the onclick function 'showArticle(this)' */

fadeout {
    margin-top: -50px;
    height: 90px;
    background-image: linear-gradient(to bottom,rgba(245, 245, 245, 0.0),var(--color-bg-whiteish),var(--color-bg-whiteish));
    text-align: center;
    cursor: pointer;
    padding-top: 9%;
    display: block;
    position: relative;
    max-width: var(--width-card-wide);
    min-width: (var(--width-card));
    padding: 1%;
    margin-left: auto;
    margin-right: auto;
    line-height: 100px;
}

fadeout small {
    font-size: 120%;
    text-align: center;
    font-family: var(--font-family);
    color: var(--color-text);
}

.collapsed > * {
    max-height: 600px;
    overflow-y:hidden;
}

/* This experimental class will change the font and layout to be more readable for dyslexic readers - based on guidance from the BDA (https: //www.bdadyslexia.org.uk/advice/employers/creating-a-dyslexia-friendly-workplace/dyslexia-friendly-style-guide) */

.dyslexic
{
    font-family: 'Comic Sans', sans-serif;
    font-size: 120%;
    letter-spacing: 0.06em;
    word-spacing: 1.2em;
    line-height: 108%;
    font-style: normal;
    background-color: rgb(215, 245, 255);
    margin-bottom: 10px;

}

.dyslexic h1, h2, h3, h4 {
    font-size: 150%;
    font-style: normal;
}

.dyslexic p {
    margin-bottom: 2.6em;
}

.dyslexic i, em {
    font-style: normal;
    font-weight: 650;
}

