@import url("../fonts/fonts.css");

body {
    font-family: "ShureTechMonoNerdFontMono-Regular", monospace;
    background: var(--bg);
    color: var(--txt);
    max-width: 100% !important;
    /* margin: 2rem 0; */
    padding: 1rem 1rem 1rem 1rem;
    line-height: 1.6;
    font-size: 1rem;
    text-align: left;
    box-sizing: border-box;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--sec);
    text-decoration: underline;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.back-link:hover,
.back-link:focus {
    color: var(--acc);
    outline: none;
    background-color: transparent;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "DepartureMono", monospace;
    font-weight: normal;
    margin: 2.5rem 0 1rem 0;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
    margin-top: 0;
    /* margin-bottom: 2rem; */
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.85rem;
}

h2::before,
h3::before,
h4::before {
    content: "#";
    color: var(--acc);
    opacity: 0.5;
    margin-right: 0.5ch;
}

/* Std elements */
p {
    margin: 0 0 1.25rem 0;
    /* white-space: pre-line; */
    white-space: normal;
}

/* Links */
a {
    color: var(--acc);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color 0.15s;
}

a:hover {
    color: var(--txt);
    background-color: var(--acc);
}

/* Lists */
ul li::marker {
    content: "+ ";
    color: var(--acc);
}

/* When the list is a palette */
.palette-list {
    list-style: none;
    padding-left: 0;
}

.palette-list li code {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    margin: 0.1rem 0;
    padding: 0.5rem 1rem;
    border: 1px double var(--bg);
    border-radius: 2px;
    background-color: var(--color);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Blockquote */
blockquote {
    display: inline-block;
    max-width: 100%;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    box-shadow: 4px 4px 0px var(--ter);
    color: var(--txt);
}

blockquote p {
    margin: 0;
}

hr {
    border: none;
    border-top: 1px dashed var(--ter);
    margin: 3rem 0;
}

/*
pre {
    border: 2px solid var(--acc);
    padding: 1rem;
    font-family: "ShureTechMonoNerdFontMono-Regular", monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}
*/

/* Inline code */
/*
code {
    background: none;
    border-radius: 2px;
    font-size: 0.9rem;
    color: var(--acc);
}

pre > code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    border-radius: 0;
}
*/

pre {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--sec);
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: none;
    font-family: "ShureTechMonoNerdFontMono-Regular", monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
    overflow-x: auto;
}

pre::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.88)),
        url("../assets/imgs/mde7w1.png");

    background-size: cover;
    background-position: center;
}

pre > code {
    position: relative;
    z-index: 2;
    color: #fff;
    text-shadow:
        /* Inner */
        0 0 2px #fff,
        0 0 5px #fff,
        0 0 8px #fff,
        /* Outer */ 0 0 12px var(--acc),
        0 0 20px var(--acc),
        0 0 25px var(--acc),
        0 0 35px var(--acc);

    background: none;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
}

code {
    background-color: var(--ter);
    color: var(--sec);
    padding: 0.2em 0.4em;
    border-radius: 2px;
    font-size: 0.9rem;
}

/* Command */

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    overflow-x: auto;
    display: block;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

table::-webkit-scrollbar {
    display: none;
}

th,
td {
    border: 2px solid var(--sec);
    padding: 0.6rem 1rem;
    text-align: center;
    white-space: nowrap;
}

th {
    background: var(--acc);
    color: var(--txt);
    font-family: "DepartureMono", monospace;
}

/* Images, GIFs, etc */
img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0 1.5rem 0;
    display: inline-block;
    border: 2px solid var(--sec);
    box-sizing: border-box;
}

.no-border {
    border: none;
}

.no-border-no-margin {
    border: none;
    margin: 0 0 0 0;
}

/* No border sometimes looks better */
/*
img,
video {
    max-width: 100%;
    height: auto;
    margin: 1rem 0 1.5rem 0;
    display: inline-block;
}
*/

/* Also, adaptive size might come in handy */
/*
img,
video {
    display: block;
    width: 80%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    /* Or retro */
/* aspect-ratio: 4 / 3; */
/*
    object-fit: cover;
    margin: 1.5rem 0;
    */
/* border: 1px solid var(--sec); */
/*
}
*/

/* + buttons && links && badges 2 */
button {
    font-family: "ShureTechMonoNerdFontMono-Regular", monospace;
    color: var(--bg);
    border: none;
    outline: 1px dotted var(--bg);
    outline-offset: -4px;
    cursor: pointer;
    background: hsl(0deg 0% 75%);
    box-shadow:
        inset -1px -1px #292929,
        inset 1px 1px #fff,
        inset -2px -2px rgb(158, 158, 158),
        inset 2px 2px #ffffff;
    font-size: 0.69em;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 5px 30px;
}

button:active {
    box-shadow:
        inset -1px -1px #fff,
        inset 1px 1px #292929,
        inset -2px -2px #ffffff,
        inset 2px 2px rgb(158, 158, 158);
}

.view-more {
    color: var(--sec);
}

.view-more:hover,
.view-more:focus-visible {
    background-color: var(--acc);
    color: var(--bg);
}

.back-to-top {
    color: var(--sec);
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.back-to-top:hover {
    background-color: transparent;
    color: var(--acc);
    outline: none;
    opacity: 1;
}

/* Details & Summary */
details {
    margin-bottom: 1rem;
}

details > summary {
    padding: 0.69rem 1rem;
    cursor: pointer;
    font-family: "DepartureMono", monospace;
    color: var(--txt);
    outline: none;
}

details > summary::marker {
    color: var(--acc);
}

/* Fieldset & Legend */
fieldset {
    border: 1px dotted var(--ter);
    padding: 1.2rem 1.8rem;
    margin: 1.5rem 0;
    max-width: 420px;
}

legend {
    font-family: "DepartureMono", monospace;
    font-weight: normal;
    padding: 0 0.5rem;
    color: var(--sec);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Meter */
meter {
    width: 100%;
    height: 1rem;
}

meter::-webkit-meter-bar {
    background: var(--ter);
    border: none;
    border-radius: 0;
}

meter::-webkit-meter-optimum-value,
meter::-webkit-meter-suboptimum-value,
meter::-webkit-meter-even-less-good-value {
    background: var(--acc);
}

meter::-moz-meter-bar {
    background: var(--acc);
}

/* Larger screens */
@media (min-width: 540px) {
    h1 {
        font-size: 2.25rem;
    }
    h2 {
        font-size: 1.75rem;
    }
    h3 {
        font-size: 1.35rem;
    }
    pre {
        max-width: 680px;
    }
    table {
        max-width: 469px;
        display: table;
    }
    button {
        font-size: 0.9em;
    }
}

@media (min-width: 860px) {
    body {
        padding: 2rem 2rem 2rem 2rem;
    }
    table {
        display: table;
    }
}
