/*
  Josh's Custom CSS Reset https://www.joshwcomeau.com/css/custom-css-reset/
  Taken on 2024-12-20, and modified since
*/

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

* {
    margin: 0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* If needed on big elements: line-height: calc(1em + 0.5rem); */
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

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

p, figure {
    text-wrap: pretty;
    margin-bottom: 1em;
}
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}
/* End */

:root {
    --bg-color: #eee;
    --content-bg-color: #fff;
    --text-color: #000;
    --text-color-muted: #555;

    --link-color: blue;
    --link-color-alt: darkblue;
    --nav-link-color: black;
    --nav-link-color-alt: #555;

    --border-radius: 1rem;
    --border-color: #bbb;
    --border-size: 2px;
    --border: var(--border-size) solid var(--border-color);

    /* https://github.com/system-fonts/modern-font-stacks?tab=readme-ov-file#humanist */
    --body-font: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif;
    --heading-font: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif;
}

html {
    scroll-padding-top: 100px; /* handle scrolling with sticky header */
}

/*noinspection CssNoGenericFontName*/
body {
    font-family: var(--body-font);
    color: var(--text-color);
}
/*noinspection CssNoGenericFontName*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
}

/* Restore margins to some elements */
ul:not(li > ul), ol:not(li > ol), table {
    margin-bottom: 1em;
}

/* Another reference: https://vanillacss.com/ -- heading styles and color management */

h1,h2,h3,h4,h5,h6 { font-weight: bold; }
h1 { font-size: 200%; }
h2 { font-size: 150%; }
h3 { font-size: 120%; }
h4,h5,h6 { font-size: 100%; }

a,a:visited { color: var(--link-color); }
a:hover,a:focus { color: var(--link-color-alt); }

table {
    border: 1px solid var(--border-color);
    border-collapse: collapse;
    text-align: left; /* FF at least defaults to center in th */

    /*caption { margin: 2rem 0; }*/
    tr { border-bottom: 1px solid var(--border-color); }
    td:not(:last-child), th:not(:last-child) { border-right: 1px solid var(--border-color); }
    /*thead { position: sticky; top: 0; }*/ /* this doesn't work well with sticky top nav ... */
    th { font-weight: bold; }
    th, td { padding: 0.5rem; }
}

/* Tailwind emulation */
.mt-4 {
    margin-top: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.m-0 {
    margin: 0 !important;
}

/* Main Layout */
body {
    background-color: var(--bg-color);
    min-height: 100vh;
}

.container {
    padding: 0.5rem;
    margin: 0 auto;
    max-width: 72rem;
}

/*noinspection CssNoGenericFontName*/
body > nav {
    position: sticky;
    top: 0;
    font-family: var(--heading-font);
    background-color: var(--content-bg-color);
    border-bottom: 1px solid #888;
    margin-bottom: 1rem;
    line-height: 1.0;

    .container {
        display: flex;
        align-items: baseline;
        gap: 1rem;
    }

    .brand {
        align-self: baseline;
        display: inline-flex;
        align-items: baseline;
        gap: 0.5rem;
        font-size: 2.25rem;
        font-weight: bold;
        margin-right: 1rem;
        img {
            height: 1em;
            vertical-align: text-bottom;
        }
        .bar-2 {
            width: 2px;
            background-color: black;
            height: 1em;
            /*vertical-align: text-bottom*/
        }
    }
    a,a:visited {
        text-decoration: none;
        color: var(--nav-link-color);
    }
    a:hover,a:focus {
        color: var(--nav-link-color-alt);
    }
    a:last-child {
        margin-right: 0;
    }
}

body > footer {
    width: 100%;
    text-align: center;
    padding: 0 1rem 1rem 1rem;
}

figure {
    text-align: center;
    font-style: italic;
    img { /* max-width and block already defined earlier */
        height: auto; /* resize based on aspect ratio */
        margin: 0 auto; /* center */
    }
}

div.highlight {
    margin: 0 3rem 1rem 3rem;
    padding: 0.5rem;
}

.postTitle {
    margin-bottom: 0;
}

.postContent {
}

.postDate {
    font-size: 75%;
    color: var(--text-color-muted);
    margin-bottom: 1rem;
}

.card {
    /*border: var(--border);*/
    background-color: var(--content-bg-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.cardSectionHeading {
    margin-bottom: 2rem;
}

.circle {
    border-radius: 50%;
}

a.continueReading, a.continueReading:visited {
    display: inline-block;
    padding: 0.5rem;
    border: var(--border);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--nav-link-color);
}

a.continueReading:hover, a.continueReading:focus {
    color: var(--nav-link-color-alt);
}

.implicit-links, h2 {
    a, a:visited {
        text-decoration: none;
        color: var(--nav-link-color);
    }
    a:hover, a:focus {
        color: var(--nav-link-color-alt);
        text-decoration: underline;
    }
}

.mediaCard {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    img { /* Update this when we go responsive and place image on top */
        width: 150px;
        max-width: 20%;
    }
    & > *:first-child {
        flex-grow: 0;
    }

    & > *:last-child {
        flex-grow: 1;
    }
    &.left { flex-direction: row; }
    &.right { flex-direction: row-reverse; }
    &.vcenter { align-items: center; }
}

ul.no-bullets {
    list-style-type: none;
    padding-left: 0;
}

img.text-icon {
    width: 0.75em;
    height: 0.75em;
    display: inline;
}

.img-bullets li img, img.icon {
    width: 1.5em;
    height: 1.5em;
    margin-top: 0.25em;
    margin-bottom: 0.25em;
    margin-right: 1rem;
}

.vertical-center {
    display: flex;
    align-items: center;
}

@media (max-height: 40rem), (max-width: 40rem) {
    body > nav {
        position: relative;
    }

    .card {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}