/* Notes

 Property order:
 - all sides: x;
 - vertical | horizontal: x, y;
 - top | horizontal | bottom: x, y, z;
 - top | right | bottom | left: w, x, y, z;

 ToC:
 - Document
 - Sections
 - Grouping content
 - Text-level semantics
 - Embdedded content
 - Forms
 - Interactive
 - Misc
 - Tables
 */

/* Variables
   ========================================================================== */
:root {
    --color-bg: #f7f5f2;
    --color-fg: #3d3d3d;
    --color-accent: #d8a7b1;
    --color-grey: #808080;

    --border-width: 2px;
    --padding-width: 0.8em;

    --color-tbl-1: #f4e7e7;
    --color-tbl-2: #e6e0f8;

    --color-hover: #d0beb4;
}

/* Dark theme
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #282828;
        --color-fg: #f0e4d7;

        --color-tbl-1: #4a3d3c;
        --color-tbl-2: #3c3836;

        --color-accent: #b8a989;

        --color-hover: #6d5d54;
    }
    /* Increase color contrast of links. */
    a {
        color: rgba(0, 221, 255, 1);
    }
    a:visited {
        color: rgba(230, 117, 253, 1);
    }
}

/* Document
   ========================================================================== */
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;

    background-color: var(--color-bg);
    color: var(--color-fg);
    scroll-behavior: smooth;
}

/* Sections
   ========================================================================== */
body {
    margin: 0 auto;
    max-width: 48rem;
    padding: 0 var(--padding-width);

    font-family: "Roboto", ui-sans-serif, sans-serif;
}

main {
    display: block;
}

article {
    /* background-color: var(--color-tbl-1);*/
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    padding: var(--padding-width);
    margin: 1rem 0;
}

h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    overflow-wrap: break-word;
}

/* Grouping content
   ========================================================================== */
hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible;

    border-style: dashed;
}

pre {
    /* color: rgb(49, 49, 55); */
    font-family: monospace, monospace;
    font-size: 1em;

    overflow-x: auto;
    background-color: var(--color-grey);
    padding: var(--padding-width);
}

/* Text-level semantics
   ========================================================================== */
a {
    background-color: transparent;
}

abbr[title] {
    border-bottom: none;
    text-decoration: underline;
    text-decoration: underline dotted;
}

b,
strong {
    font-weight: bolder;
}

.post-tag {
    background-color: var(--color-tbl-2);
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    padding: 0.2em 0.5em;
    font-size: 0.85em;
    margin-right: 0.3em;
    display: inline-block;
}

code,
kbd,
samp {
    font-family: monospace, monospace;
    font-size: 1em;
}

mark {
    background-color: var(--color-accent);
}

small {
    font-size: 80%;
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/* Embedded content
   ========================================================================== */
img {
    border-style: none;

    max-width: 100%;
}

/* Forms
   ========================================================================== */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button,
input {
    overflow: visible;
}

button,
select {
    text-transform: none;
}

[type="button"],
[type="reset"],
[type="submit"],
button {
    -webkit-appearance: button;
}

[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner,
button::-moz-focus-inner {
    border-style: none;
    padding: 0;
}
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring,
button:-moz-focusring {
    outline: 1px dotted ButtonText;
}

fieldset {
    padding: 0.35em 0.75em 0.625em;
}

legend {
    box-sizing: border-box;
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal;
}

progress {
    vertical-align: baseline;
}

textarea {
    overflow: auto;
}

[type="checkbox"],
[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}
[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

/* Interactive
   ========================================================================== */
details {
    display: block;

    cursor: pointer;
}

summary {
    display: list-item;
}

/* Misc
   ========================================================================== */
template {
    display: none;
}

[hidden] {
    display: none;
}

/* Tables
   ========================================================================== */
table {
    border-collapse: collapse;
    letter-spacing: 1px;

    display: block;
    overflow-x: auto;
}

caption {
    padding: var(--padding-width);
}

td,
th {
    border: 1px solid var(--color-accent);
    padding: 10px 20px;
}

td {
    text-align: center;
}
tr:nth-child(even) td {
    /* background-color: rgb(250,250,250); */
    background-color: var(--color-tbl-1);
}
tr:nth-child(odd) td {
    /* background-color: rgb(245,245,245); */
    background-color: var(--color-tbl-2);
}

/* Custom
   ========================================================================== */

/* Navbar */

nav {
    margin: 1rem auto 0;
    background-color: var(--color-bg);
}

nav ul {
    list-style: none;
    padding: 0;
    line-height: 1.5; /* optional */
    margin: 0;
}

nav summary {
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px 4px 0 0;
    background-color: var(--color-tbl-2);
    margin-bottom: 0.5rem; /*optional*/
    position: relative;
    list-style: none;
}

nav ul ul {
    padding-left: 1rem;
    margin-top: 0.5rem; /* optional */
    background-color: var(--color-tbl-1);
    border-left: 2px solid var(--color-accent);
    border-radius: 4px;
    padding: 0.5rem;
}

/* List items */
nav li {
    padding: 0.5rem 0;
}

/* Hover effect for links */
nav a {
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    display: block;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

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

nav a,
nav a:hover,
nav a:visited,
nav a:active {
    color: var(--color-fg);
}

nav > details > ul {
    border: 1px solid;
    border-top: 0px;
    border-radius: 0 0 4px 4px;
    padding: 0px var(--padding-width);
}

nav > details > summary {
    text-align: center;
    background-color: var(--color-bg);
    border: 1px solid;
    margin-bottom: 0px;
}

nav > details > summary::after {
    content: "\002630"; /* ☰ burger menu icon */
}

nav > details[open] > summary::after {
    content: "\002715"; /* ✕ closing icon */
}

/* Indicating child menus */
nav summary::after {
    content: "\25BC"; /* ▼ Downward arrow symbol */
    font-size: 0.8em;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Change arrow direction when open */
details[open] > summary::after {
    content: "\25B2"; /* ▲ Upward arrow symbol */
    font-size: 0.8em;
}
/* End navbar */

blockquote {
    border-left: var(--border-width) solid;
    padding: 0 var(--padding-width);
}

a {
    /* text-decoration-thickness: var(--border-width); */
}
a:hover {
    text-decoration: none;
}

footer {
    margin: 2rem 0;
    border-top: var(--border-width) dashed;
}
