html, body {
    margin: 0;
    padding: 0;
}

body > main {
    padding: 0 3rem;

    font-family: "Playfair Display", serif;
    font-size: 125%;
    line-height: 1.6;
    margin-inline: auto;
    padding-inline: 1rem;
}

#page-header-link {
    text-decoration: none;
    color: inherit;
}

#page-header {
    position: relative;
    overflow: hidden;

    text-align: center;
    color: white;
    margin-bottom: 5rem;
    padding: 2rem 1rem;
    isolation: isolate;

    font-family: "Montserrat", sans-serif;
}

#page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    background: url("../images/header-bg.jpg") no-repeat center center / cover;
    filter: saturate(1.3) brightness(.6);
}

#page-header > h1 {
    font-size: 3em;
    font-weight: 600;
    margin: 0 0 .5rem 0;
    padding: 0;
}

#page-header > h2 {
    font-size: 1.5em;
    font-weight: normal;
    margin: 0;
    padding: 0;
}

.main-page-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 3rem 0;
    padding: 0;
    text-align: center;
}

#page-footer {
    margin: 3rem 0 0 0;
    padding: 2rem;

    font-family: "Montserrat", sans-serif;
    font-size: 0.85rem;
    color: slategray;

    text-align: center;
}

#page-footer > ul {
    list-style: none;
    padding: 0;
    margin: 0;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

#page-footer > ul > li {
    white-space: nowrap;
}

#page-footer > ul a {
    color: inherit;
    text-decoration: none;
}

#page-footer > ul a:hover {
    text-decoration: underline;
}

#page-footer .footer-icon {
    max-width: 1em;
    max-height: 1em;
    vertical-align: middle;
}

h1 .header-anchor, h2 .header-anchor, h3 .header-anchor, h4 .header-anchor {
    margin-left: .75em;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 85%;
    color: rgb(191, 191, 191);
    text-decoration: none;
    opacity: 0;
    transition: opacity .1s;
}
h1:hover .header-anchor, h2:hover .header-anchor, h3:hover .header-anchor, h4:hover .header-anchor {
    opacity: 1;
}

@media (max-width: 900px) {
    .header-anchor {
        display: none;
    }
}

nav {
    font-family: "Montserrat", sans-serif;
}

nav.nav-links {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 3rem;
}

nav.nav-links a {
    font-size: .85rem;
    color: #36454F;
    text-decoration: none;
}

nav.nav-links a:hover {
    text-decoration: underline;
}

blockquote {
    position: relative;
    padding-left: 5rem;
    margin-left: 0;
    margin-right: 0;
}

blockquote::before {
    position: absolute;
    left: 0rem;
    top: 3rem;
    z-index: -1;

    content: "“";
    font-size: 10rem;
    line-height: 0;
    color: rgb(191, 191, 191);
}

.code-highlight {
    max-height: 400px;
    padding: 1rem;
    border-radius: .5rem;
    overflow-x: auto;
    overflow-y: auto;
}

table.data-structure {
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    border-collapse: collapse;
    margin: 1rem 0;
}

table.data-structure td {
    border: 1px solid #ddd;
    padding: 0.25rem 0.5rem;
}

.draft-notice {
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    width: 100%;

    color: black;
    background-color: rgba(56, 255, 255, 0.8);
    padding: 1rem;

    font-family: "Montserrat", sans-serif;
    font-size: 1rem;
}

.note-box {
    position: relative;
    margin: 0 0 2rem 0;
    padding: 1rem 1.5rem;
    border-radius: .5rem;
    background-color: rgba(54, 69, 79, 0.06);

    font-size: 0.85rem;
    line-height: 1.5;
    color: #36454F;
}

.note-box::before {
    display: block;
    content: "Note";
    margin-bottom: .25rem;

    font-family: "Montserrat", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.note-box p:first-child {
    margin-top: 0;
}

.note-box p:last-child {
    margin-bottom: 0;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.gallery > * {
    flex: 0 1 15rem;
}_

.gallery a {
    color: inherit;
    text-decoration: none;
}
.gallery a:hover {
    text-decoration: underline;
}

.gallery figure {
    margin: 0;
}

.gallery img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.gallery figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: slategrey;
    margin-top: 0.3rem;
}

figure.standalone-image {
    text-align: center;
}

figure.standalone-image img {
    max-width: 100%;
}

figure.standalone-image figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: slategrey;
    margin-top: 0.3rem;
}

figure.sidebar-image {
    --img-w: clamp(14rem, 42vw, 25rem);

    float: right;
    margin: 0 0 1rem 1rem;
    width: var(--img-w);
    margin-right: calc(-0.5 * min(var(--img-w), var(--sidebar-room)));
}

figure.sidebar-image img {
    width: 100%;
}

figure.sidebar-image figcaption {
    font-size: 0.875rem;
    color: slategrey;
    margin-top: 0.3rem;
}

@media (max-width: 900px) {
    figure.sidebar-image {
        float: none;
        width: min(100%, 32rem);
        margin: 1.25rem auto;
    }
}
