:root {
    --viewport-padding-x: 1rem;
    --viewport-padding-y: 1rem;
}
@media (min-width: 768px) {
    :root {
        --viewport-padding-x: 2rem;
    }
}

footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.post-description-line {
    display: block;
    font-style: italic;
    opacity: 0.5;
    text-color: gray;
}

blockquote {
    background-color: #f7e6d4;
    padding: 5px;
    border-left: 4px solid #f3dabe;
}

a {
    color: #c43c37;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

a[href^="https://jmcph4.dev"] {
    color: black;
    font-weight: bold;
    text-decoration: none;

    &:hover {
        background-color: darkorange;
    }
    &:before {
        content: "{";
    }
    &:after {
        content: "}";
    }
}

html {
    background: linen;
}

header {
    display: flex;
    gap: var(--viewport-padding-x);
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.navbar-list {
    display: flex;
    gap: calc(var(--viewport-padding-x) / 2);
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.site-name,
.navbar-item {
    flex-shrink: 0;
}
.navbar-button {
    color: orange;
    border: 1px solid orange;
    padding: calc(var(--viewport-padding-y) / 4) calc(var(--viewport-padding-x) / 4);
    text-decoration: none;

    &:hover {
        color: white;
        background-color: orange;
    }
}

.block-list-item {
    width: 100%;

    &:hover {
        background-color: darkorange;
    }
}

pre {
    overflow-x: auto;
    white-space: pre;
    padding: 0.5rem;
}

.post-wrapper p,
.post-wrapper li,
.post-wrapper tr,
.post-wrapper td {
    font-family: "charter";
    line-height: 1.2;
}

.page-wrapper p,
.page-wrapper li,
.page-wrapper tr,
.page-wrapper td {
    font-family: "charter";
    line-height: 1.2;
}

img {
    object-fit: contain;
    max-width: 80%;
    display: inline-block;
}

table {
    border: 1px solid;
    border-collapse: collapse;
}

th {
    border: 1px solid;
    padding-bottom: 5px;
    padding-left: 10px;
}

td {
    border-left: 1px solid;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 5px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "equity-caps";
    text-transform: uppercase;
}

h2 {
    border-bottom: 1px solid;
}

.post-wrapper > p:first-of-type:first-letter {
    initial-letter: 3;
    color: red;
}

.footnote-definition p {
    display: inline;
}

.invisible {
    opacity: 0;
}

/********************************** LIST PADDING ******************************/


.post-wrapper li, .page-wrapper li {
    padding-top: 0.1em;
    padding-bottom: 0.1em;
}

.post-wrapper ol, .post-wrapper ul {
    padding-top: 1em;
    padding-bottom: 1em;
}

/************************************* FIGURES ********************************/

figure {
    display: inline-block;
    border: 1px solid;

    /* this centres figures within posts and pages */
    margin-left: auto;
    margin-right: auto;
}

figcaption {
    width: 100%;
    border-top: 1px solid;
}

figure img {
    object-fit: contain;
    display: inline-block;
    width: 80%;
}

/* hack to preserve aesthetic of front page images */
.front-img {
    width: 200px;
}

/************************************** LAYOUT ********************************/

body {
    margin: 0;
}
hr {
    margin: 0 var(--viewport-padding-x);
}

header,
.page-wrapper,
.post-wrapper,
footer {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding: var(--viewport-padding-y) var(--viewport-padding-x);
    overflow-wrap: break-word;
}

@media (max-width: 500px) {
    .desktop-only {
        display: none;
        visibility: hidden;
    }
}

/************************************** FONT FACES ****************************/

@font-face {
    font-family: charter;
    font-style: normal;
    font-weight: normal;
    font-stretch: normal;
    src: url("assets/fonts/charter_regular.woff2") format("woff2");
}

@font-face {
    font-family: charter;
    font-style: italic;
    font-weight: normal;
    font-stretch: normal;
    src: url("assets/fonts/charter_italic.woff2") format("woff2");
}

@font-face {
    font-family: charter;
    font-style: normal;
    font-weight: bold;
    font-stretch: normal;
    src: url("assets/fonts/charter_bold.woff2") format("woff2");
}

@font-face {
    font-family: charter;
    font-style: italic;
    font-weight: bold;
    font-stretch: normal;
    src: url("assets/fonts/charter_bold_italic.woff2") format("woff2");
}
