.md-typeset h1{
    margin-bottom: 0.2em;
}

.md-source-file {
    border-bottom: 0.1rem solid var(--md-default-fg-color--lightest);
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
}

.md-content h2:not(:first-child):not(h1+h2):not(.md-source-file+h2)
{
    border-top: 0.1rem solid var(--md-default-fg-color--lightest);
    border-radius: 0;
    padding-top: 0.5em;
    margin-top: 0;
}

.md-content h2:is(.md-source-file+h2)
{
    margin-top: 0.5em;
}

table {
    max-height: 50vh;
}

table thead {
    z-index: 2;
    position: sticky;
    top: 0;
    background: var(--md-default-bg-color);
}

td {
    white-space: nowrap;
}

html
{
    scroll-behavior: smooth !important;
}

/* Non-essential elements */

img,
video,
iframe,
.md-nav,
.md-search-result__item,
.md-search-result__more,
table,
footer,
.arithmatex,
.mermaid,
.jp-Cell
{
    content-visibility: auto !important;
    contain-intrinsic-size: 1px 500px !important;
}

.jp-Cell-outputWrapper
{
    max-height: 50vh;
    max-height: 50svh;
}


.arithmatex, .katex
{
    font-display: swap !important;
}

.arithmatex
{
    will-change: opacity;
    opacity: 0;
    transition: opacity 0.2s ease-out; /* delay = 0.5s */
}

.loaded
{
    opacity: 1;
}

@media (orientation: landscape)
{
    header > *,
    footer > *,
    .md-sidebar > * {
        will-change: opacity;
        transition: opacity 0.1s;
    }
    
    /* .md-nav.md-nav--primary li:not(li:has(.md-nav__link--active)):not(.md-nav.md-nav--primary:hover li) a, */
    /* .md-nav.md-nav--primary li:not(li:has(.md-nav__link--active)):not(.md-nav.md-nav--primary:hover li) label, */
    header:not(:hover) > *,
    footer:not(:hover) > *,
    .md-sidebar:not(:hover) > * {
        opacity: 0.2;
    }
}

img,
video,
iframe
{   
    max-width: 100%;
    height: auto;
    max-height: 75vh;
    
    display: block;
    margin: auto;
}

.md-typeset iframe
{
    width: 100%;
    height: 75vh;
    border: none;
}

.md-footer-meta, .md-footer__direction
{
    display: none;
}

.md-footer__link
{
    padding: 0;
}

.md-ellipsis
{
    max-width: 15ex;
}

.md-grid
{
    max-width: initial;
}

.md-nav__link--active,
li:has(.md-nav__link--active) label
{
    font-weight: bold;
}

/* latin */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/roboto_latin_400.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/roboto_latin_700.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/roboto_mono_latin_400.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* CUSTOM CSS FOR SWAL ALERT */
svg {
    width: 20px;
    height: 20px;
    margin-right: 7px;
}

.copy-link, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    color: #777;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 2px;
    text-transform: capitalize;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.copy-link:hover, .button:hover {
    border-color: #cdd;
}

.copy-link {
    padding-left: 30px;
    padding-right: 30px;
}

.targets {
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr 1fr;
    grid-gap: 20px;
    margin-bottom: 20px;
}

.link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    background-color: #eee;
}

.pen-url {
    margin-right: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
