.lang-ja {
    font-family: "Kaisei Tokumin", serif; /* might need !important */
    font-weight: 400;
    font-style: normal;
}

pre {
  white-space: pre-line;
}

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-size: cover;
}

body {
    margin: 0;
    min-height: 100vh;
}

#navbar {
    display: flex;
    align-items: center;
    padding: 8px 10px;
}
.navbar-item {
    margin: 10px;
}

.navbar-item > a, .navbar-item > a:visited {
    text-decoration: none;
}

a:not(.navbar-item > a, #navbar-title):hover {
    text-decoration: none;
}

.navbar-item > a:hover {
    text-decoration: underline;
}

#navbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

#content-container {
    flex: auto;
    padding: 30px 30px 50px 20px;
}

#navbar, #content-container, #footer {
    min-width: 200px;
    width: 80vw;
    max-width: 1250px;
    margin: 10px auto 10px auto;
}

#footer {
    padding-bottom: 20px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: end;
}

#footer-links {
    padding-top: 20px;
    display: flex;
    justify-content: end;
}

#footer-text {
    font-size: 0.85rem;
    font-style: italic;
}

.md-img img {
    height: 100%;
}

img {
    max-width: 90%;
    margin: 0 auto;
    border: none;
}
img:not([src]){
    visibility: hidden;
}

:is(p, blockquote, ul, ol) + :is(h1, h2) {
    padding-top: 50px;
}
:is(p, blockquote, ul, ol) + :is(h3, h4) {
    padding-top: 30px;
}
:is(p, blockquote, ul, ol) + :is(h5, h6) {
    padding-top: 20px;
}

.vertical {
    -webkit-writing-mode: vertical-rl;
    -moz-writing-mode: vertical-rl;
    -ms-writing-mode: vertical-rl;
    writing-mode: vertical-rl;
}

#cursor {
    animation: flash linear 1.2s infinite;
    -webkit-animation: flash linear 1.2s infinite;
}

@-webkit-keyframes flash {
    0% { opacity: 1; }
    50% { opacity: .1; }
    100% { opacity: 1; }
}
@keyframes flash {
    0% { opacity: 1; }
    50% { opacity: .1; }
    100% { opacity: 1; }
}

#background {
    background-position: center center;
    background-size: cover;
    top: 0px;
    left: 0px;
    height: 100vh;
    width: 100vw;
    pointer-events: none;
    position: fixed;
    z-index: -2;
    mask: linear-gradient(#000000, transparent);
    filter: "blur(2px)";
    webkitFilter: "blur(2px)";
}
#background-overlay {
    position: fixed;
    top: 0px;
    left: 0px;
    height: 100vh;
    width: 100vw;
    background-size: cover;
    pointer-events: none;
    z-index: -1;
}

#primary-layer {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 98vh;
    border-width: 12px !important; /* TODO - figure out how to remove this !Important */
    border: solid;
    z-index: 1;
}

table {
    display: table;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    border-spacing: 0;

    /* This border-width changes for small screens */
    border-width: 0px;
    border-style: solid;
}


th, td {
    padding: 6px;
}

thead {
    border-bottom-width: 2px;
    border-bottom-style: solid;
}

thead, tbody {
    width: 100%;
    margin: 0 auto;
}

@media screen and (max-width: 600px) {
    #footer {
       flex-direction: column;
    }
    table {
        display: block;
        border-width: 1px;
    }
}

iframe[src*='youtube.com/embed'] {
    display: block;
    width: 80%;
    max-width: 720px;
    height: auto;
    aspect-ratio: 16/ 9;
    margin: 0 auto;
}

#scroll-top-btn {
    z-index: 3;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100vw;
    box-shadow: 0px 10px 10px 10px;
    cursor: pointer;
}
#scroll-top-btn p {
    padding: 12px 6px 10px 6px;
    margin: 0px;
    text-align: center;
    font-size: 1.15rem;
}
/* This ensures that scrolling via hyperlinks to headers works well */
[id] {
  scroll-margin-top: 80px;
}

.footnotes {
    margin-top: 100px;
}



/* details */
details {
  position: relative;
  border: none; /* no full border */

  padding: 0.5em 1em;
  margin-bottom: 1em;
  margin-top: 1em;
}

details[open] {
    width: 100%;
}

/* details border */
details::before, details::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: height 300ms ease, width 300ms ease, opacity 300ms ease;
}
details::before {
  border-top: 3px solid;
  border-left: 3px solid;
  top: 0;
  left: 0;
}
details::after {
  bottom: 0;
  right: 0;
  border-bottom: 3px solid;
  border-right: 3px solid;
}
details:hover::before, details:hover::after {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}
details[open]::before, details[open]::after {
  width: 30px;
  height: 30px;
  opacity: 1.0;
}
details[open]:hover::before, details[open]:hover::after {
  opacity: 0.8;
}


/* details summary */

details > summary {
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
}

details > summary::before {
  content: "✚";
  font-size: 1rem;
  display: inline;
}
details[open] > summary::before {
  content: "✖";
}

summary {
  font-weight: bold;
  cursor: pointer;
}

hr {
  margin-top: 30px;
  margin-bottom: 30px;
}
