:root {
    --txt-color: #000;

    --bg-color: #fff;
    --bg-color-alt: #f5f5f5;
    --bg-color-alt-hover: #e1e4e8;

    --shadow-color: #959da5;

    --link-color-hover: salmon;
    --focus-border-color: rebeccapurple;
}

/* @media (prefers-color-scheme: dark) {
    :root {
      --bg-color: #2a2a3a;
      --txt-color: #fff;
    }
  } */

*,
::before,
::after {
    box-sizing: border-box;
}

html:focus-within {
    scroll-behavior: smooth;
}

body {
    max-width: 70ch;
    padding: 1rem;
    margin: auto;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
    tab-size: 2;
    word-break: break-word;
    overflow-wrap: break-word;
    background: var(--bg-color);
    color: var(--txt-color);
    font-family: sans-serif;
}

/* Text Selection */
::selection {
    background-color: var(--focus-border-color);
    color: white;
}

/* Links */
a:hover {
    color: var(--link-color-hover);
    text-decoration: none;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

/* Code Pre Keyboard */
pre,
code,
samp,
tt,
var {
    background: var(--bg-color-alt);
}

pre {
    overflow: auto;
    border: 1px solid;
    padding: 1rem;
}

code {
    word-break: break-all;
    padding: 0 1px;
}

kbd {
    vertical-align: middle;
    /* background-color: #eee; */
    background: var(--bg-color-alt);
    border-radius: 3px;
    border: 1px solid #b4b4b4;
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.2),
        0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
    font-weight: 700;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Images Videos SVG iFrames */
img,
video,
svg {
    height: auto;
    max-width: 100%;
    border: 1px solid;
}

embed,
iframe,
object {
    max-width: 100%;
}

/* Tables */
table {
    border-collapse: collapse;
    border-radius: 1rem;
    width: 100%;
    table-layout: fixed;
}

table tr {
    border: 1px solid;
}

table th,
table td {
    text-align: center;
    padding: 0.625rem;
}

table th {
    font-size: 0.85em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@media screen and (max-width: 600px) {
    table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table tr {
        border-bottom: 2px solid;
        display: block;
        margin-bottom: 0.625rem;
    }

    table td {
        border-bottom: 1px solid;
        display: block;
        text-align: right;
    }

    table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
    }

    table td:last-child {
        border-bottom: 0;
    }
}

/* Buttons Selects Inputs Textareas */
button,
input,
select,
textarea {
    padding: 0.25rem 0.5rem;
    max-width: 100%;
    border: 1px solid;
    border-radius: 0.25rem;
    background: var(--bg-color-alt);
    color: var(--txt-color);
}

button,
select {
    text-transform: none;
}

button {
    margin-block-end: 2px;
    border: 1px solid;
    box-shadow: inset 0px -1px 0px var(--shadow-color);
}

button:hover {
    cursor: pointer;
    background: var(--bg-color-alt-hover);
}

button[disabled] {
    border: 1px dashed;
}

select,
[type="date"],
[type="datetime-local"],
[type="datetime"],
[type="email"],
[type="month"],
[type="number"],
[type="password"],
[type="search"],
[type="tel"],
[type="text"],
[type="time"],
[type="url"],
[type="week"] {
    width: 100%;
}

[type="image"],
[type="checkbox"],
[type="radio"] {
    cursor: pointer;
}

[type="color"] {
    min-height: 2.125rem;
}

textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid;
}

textarea:not([rows]) {
    height: 8rem;
}

/* Summary Details */
details {
    display: block;
    background: var(--bg-color);
    border: 1px solid;
    border-radius: 0.25rem;
}

details>*:not(ul, ol) {
    padding-inline-start: 1rem;
}

details[open]>summary {
    border-bottom: 1px solid;
}

summary {
    display: list-item;
    cursor: pointer;
    font-weight: bold;
    padding-block: 0.25rem;
}

summary:focus {
    box-shadow: none;
}

/* Definition List */
dt {
    font-weight: bold;
    font-style: oblique;
}

dd {
    margin-bottom: 1rem;
}

/* Scroll to top button */
#goToTopBtn {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;

    background-color: var(--bg-color-alt);
    padding: 10px 15px;
    cursor: pointer;
    transition:
        background-color 0.3s,
        transform 0.2s ease;
}

#goToTopBtn:hover {
    background-color: var(--bg-color-alt-hover);
}

#goToTopBtn:hover:active {
    transform: translateY(1px);
    box-shadow: inset 0px 1px 0px var(--shadow-color);
}

/* Block quotes */
blockquote {
    position: relative;
    text-align: justify;
    font-style: italic;
}

blockquote:before {
    position: absolute;
    content: open-quote;
    font-size: 3em;
    margin-left: -0.6em;
    margin-top: -0.4em;
    font-style: normal;
}

blockquote:after {
    position: absolute;
    content: close-quote;
    font-size: 3em;
    bottom: 0;
    right: 0;
    margin-right: -0.6em;
    margin-bottom: -0.8em;
    font-style: normal;
}

/* Loose Elements */
fieldset {
    border-radius: 0.25rem;
}

label {
    cursor: pointer;
    display: block;
    margin-bottom: 0.25rem;
}

hr {
    height: 0;
    border: 0;
    border-bottom: 1px solid;
}

/* Focus */
button:focus,
[type="button"]:focus,
[type="color"]:focus,
[type="reset"]:focus,
[type="submit"]:focus,
button:not([type]):focus,
input:not([type]):focus,
[type="date"]:focus,
[type="datetime-local"]:focus,
[type="email"]:focus,
[type="hidden"]:focus,
[type="image"]:focus,
[type="month"]:focus,
[type="number"]:focus,
[type="password"]:focus,
[type="search"]:focus,
[type="tel"]:focus,
[type="text"]:focus,
[type="time"]:focus,
[type="url"]:focus,
[type="week"]:focus,
textarea:focus,
select:focus,
summary:focus {
    outline: none;
    /*   border: 1px solid var(--focus-border-color); */
    border-color: var(--focus-border-color);
    box-shadow: 0 0 0.2rem 0.01rem var(--focus-border-color);
}