/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

html {
  line-height: 1.15; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
  margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */

main {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

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

/* Grouping content
   ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

a {
  background-color: transparent;
}

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted; /* 2 */
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

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

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

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

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */

img {
  border-style: none;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */

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

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

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

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

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

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

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

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */

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

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

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

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */

details {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Misc
   ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */

template {
  display: none;
}

/**
 * Add the correct display in IE 10.
 */

[hidden] {
  display: none;
}

/* Root styles that are used everywhere */

:root {
    --darker-color: rgba(0, 0, 0, 0.3);
    --dark-color: #2d2524;
    --light-color: #fef9ed;
    --key-color: #f3c400;
    --light-key-color: #009688;

    /* TODO refactor the above into better variable names so it can be themed */

    --sidebar-background-color: #2d2524;
    --sidebar-background-color-muted: #795548;
    --sidebar-color: #fef9ed;
    --sidebar-anchor-color: #f3c400;
    --sidebar-anchor-color-muted: rgba(243, 196, 0, 0.3);
    --sidebar-line-color: #fef9ed;

    --article-background-color: #f8f8ea; /* #fef9ed */
    --article-color: #171717;
    --article-anchor-color: #009688;

    --jumbo-nav-background-color: #001d21;
    --jumbo-nav-text-color: white;
    --jumbo-nav-accent-color: rgb(205 203 255);
    --jumbo-nav-anchor-color: rgb(205 203 255);
    --jumbo-nav-anchor-hover-color: #ff353f;

    /* Markdown Alert Colours */
    --color-note: #0969da;
    --color-tip: #1a7f37;
    --color-warning: #9a6700;
    --color-severe: #bc4c00;
    --color-caution: #d1242f;
    --color-important: #8250df;
}

/* Colours from https://wingolog.org/ */

body.theme__pink {
    --sidebar-background-color: #ecc;
    --sidebar-color: #33a;
    --sidebar-anchor-color: #6c1732;

    --jumbo-nav-background-color: #93445f;
    --jumbo-nav-anchor-color: #310425;
    --jumbo-nav-anchor-hover-color: #ffc107;
}

/* Colours from Win3.1 Hot Dog Stand Theme */

body.theme__hot-dog {
    /* TODO */
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    overflow: hidden;
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0;

    font-size: 16px;
    text-rendering: optimizeLegibility;
    transition: background-color 300ms, color 200ms;

    background: var(--article-background-color);
    color: var(--article-color);
}

.nav__off{
    text-decoration: none;
}

.nav__on {
    font-weight: bold;
}

/* <figure> can be used to wrap images, code blocks, quotes, etc. Anything that is referenced in
   the main flow of a document, but that can be moved to another part of the document or to an
   appendix without affecting the main flow.
   @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure */

figure {
    width: 100%;
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
    margin-bottom: .9rem;
}

figure img {
    max-width: 100%;
    height: auto;
}

figure picture {
    display: flex;
    justify-content: center;
}

figure picture + figcaption,
figure img + figcaption {
    font-size: .85rem;
    margin-top: .25rem;
}

figure blockquote + figcaption {
    margin-inline-start: 4.5em;
    margin-inline-end: 2.5em;
}

figure.conversation {
    background-color: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
    max-width: 83%;
    padding: 0.5rem 1.5rem;

    p {
        border-radius: 1.15rem;
        line-height: 1.25;
        max-width: 75%;
        padding: 0.5rem .875rem;
        position: relative;
        word-wrap: break-word;
        font-family: sans-serif;
        font-size: 1rem;
    }
    p::before,
    p::after {
        bottom: -0.1rem;
        content: "";
        height: 1rem;
        position: absolute;
    }

    p.from-me {
        align-self: flex-end;
        background-color: #248bf5;
        color: #fff;
    }

    p.from-me::before {
        border-bottom-left-radius: 0.8rem 0.7rem;
        border-right: 1rem solid #248bf5;
        right: -0.35rem;
        transform: translate(0, -0.1rem);
    }

    p.from-me::after {
        background-color: #fff;
        border-bottom-left-radius: 0.5rem;
        right: -40px;
        transform: translate(-30px, -2px);
        width: 10px;
    }

    p[class^="from-"] {
        margin: 0.5rem 0;
        width: -moz-fit-content;
        width: fit-content;
    }

    p[class^="from-"].no-tail {
        margin-bottom: 0;
    }

    p.from-me ~ p.from-me,
    p.from-them ~ p.from-them {
        margin: 0.25rem 0 0;
    }

    p.from-me ~ p.from-me:not(:last-child),
    p.from-them ~ p.from-them:not(:last-child){
        margin: 0.25rem 0 0;
    }

    p.from-me ~ p.from-me:last-child,
    p.from-them ~ p.from-them:last-child{
        margin-bottom: 0.5rem;
    }

    p.from-them {
        align-items: flex-start;
        background-color: #e5e5ea;
        color: #000;
    }

    p.from-them:before {
        border-bottom-right-radius: 0.8rem 0.7rem;
        border-left: 1rem solid #e5e5ea;
        left: -0.35rem;
        transform: translate(0, -0.1rem);
    }

    p.from-them::after {
        background-color: #fff;
        border-bottom-right-radius: 0.5rem;
        left: 20px;
        transform: translate(-30px, -2px);
        width: 10px;
    }

    .no-tail::before {
        display: none;
    }

    p.from-me + p.from-them{
        margin-top: 1rem !important;
    }
}

blockquote {
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 2.5em;
    margin-inline-end: 2.5em;

    border-left: 10px solid #3F51B5;
    padding-left: 1.5em;
}

article blockquote p {
    font-size: 1.875rem;
    font-style: italic;
    width: 100%;
}

blockquote p:first-child {
    margin-top: 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 1rem;
    line-height: 1.4em;
}

table tbody th {
    margin-right: 1rem
}

table tfoot {
    border-top: 4px double;
}

th, td {
    text-align: left
}

.ascii-art{
    white-space: pre;
    font-family: monospace;
    font-size: 12px;
    line-height: 12px;
    letter-spacing: unset;
    transform: unset;
    overflow-y: hidden;
}

/*
 * In the DOM the content flow is as such:
 * <main>
 *   <header/>
 *   <div class="side-bar">
 *     <aside/>
 *     <footer/>
 *   </div>
 *   <article/>
 * </main>
 *
 * Main is a CSS Grid made up of two columns and two rows.
 *
 * On desktop view (screen width > 900px) the website presents two columns, the <header/>
 * sits in the top left with the <div> containing the sidebar and footer taking the bottom left.
 * The remaining <article/> therefore takes the top right grid placement but has a row span of
 * two so that it fills the page height.
 *
 * On mobile view (screen width <= 900px) the website presents as one column.
 */

main {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 50vw 50vw;
    grid-template-rows: auto 1fr;
    transition: 300ms;
    max-height: 100vh;
}

main.sidebar__closed {
    grid-template-columns: 5vw 95vw;
}

/* Main Page Header and sidebar share the same prose formatting */

main > header,
main.full-width #content,
.side-bar {
    font-size: 0.8rem;
    line-height: 1.54;
    letter-spacing: -0.02em;

    padding: 1.5rem;
    background: var(--sidebar-background-color);
    color: var(--sidebar-color);
    font-family: monospace;
}

/* Main Page Header doesn't need padding, its applied to it's children. */

main > header {
    padding: 0;
    grid-row: 1;
}

.side-bar {
    overflow-y: auto;
    box-sizing: border-box;

    grid-row: 2;
    display: flex;
    flex-direction: column;
    padding-top: 0;

    scrollbar-color: var(--article-background-color) var(--sidebar-background-color);
    scrollbar-width: thin;
}

#content {
    scrollbar-color: var(--sidebar-background-color) var(--article-background-color);
    scrollbar-width: thin;
}

.side-bar a,
.side-bar h1 {
    color: var(--sidebar-anchor-color);
}

.side-bar aside {
    flex-grow: 1;
}

.side-bar footer {
    margin-top: 1rem;
}

.side-bar footer p {
    margin-bottom: 0;
}

main.two-columns #content {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: scroll;
    max-height: 100vh;

    grid-row: span 2;
    max-width: 100vw;
}

/*
 * FULL WIDTH LAYOUT
 *
 * These pages do not have a sidebar and #content shares the same colour scheme as
 * the navigation does.
 */

main.full-width {
    grid-template-columns: 100vw;
}

main.full-width #content {
    padding-top: 0;
    padding-bottom: 0;
}

main.full-width #content p {
    max-width: 1000px;
}

main.full-width #content a {
    color: var(--sidebar-anchor-color);
}

.kanban__column {
    margin-right: 8px;
    width: 350px;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    border-radius: 6px;
    border: 1px solid var(--sidebar-line-color);
}

.kanban__column header{
    display: flex;
    align-items: center;
    -moz-column-gap: 8px;
         column-gap: 8px;
    padding: 8px 16px 4px;
}

.kanban__column header h2 {
    margin: 0;
    font-size: 1.2em;
}

.kanban__column header span {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    border-radius: 20px;
    background-color: var(--sidebar-anchor-color-muted);
    color: var(--sidebar-anchor-color);
}

/* On screens too small for two columns to look nice, lets make it look nice. */

@media only screen and (max-width: 900px) {
    body {
        overflow: auto;
    }

    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        overflow: auto;
    }

    .side-bar{
        overflow-y: visible;
        max-height: initial;
        grid-row: 3;
    }

    #content{
        overflow-y: visible;
        max-height: initial;
        flex-grow: 1;
        grid-row: 2;
    }
}

/* Article typography plus some styles used in the left column */

article {
    width: 92%;
    max-width: 1000px;
}

article > header {
    text-align: center;
}

article > header a {
    text-transform: uppercase;
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
}

/* https://www.smashingmagazine.com/2022/01/modern-fluid-typography-css-clamp/ */

article > header h1 {
    margin-bottom: 0;
    font-size: clamp(2.6rem, 6vw, 5rem);
    font-weight: lighter;
}

article > header h2 {
    font-size: clamp(0.85rem, 3vw, 1.9rem);
    font-weight: lighter;
}

article > * {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-content: flex-start;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 2rem;
    margin-top: 1.5em;
}

article > section > h2,
article > section > h3,
article > section > h4,
article > section > h5,
article > section > h6 {
    margin: 2.5rem 0;
}

article > section > h2:first-child,
article > section > h3:first-child,
article > section > h4:first-child,
article > section > h5:first-child,
article > section > h6:first-child {
    margin-top: 1rem;
}

article hr {
    border: none;
    width: 50px;
    height: 1px;
    border-top: 4px double;
}

article a {
    color: var(--light-key-color);
    line-break: anywhere;
}

article a.note {
    font-size: small;
    text-transform: uppercase;
    font-family: monospace;
    background: #0d24a4; /* TODO: add variable for styling */
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--article-background-color);
}

article a.note:hover {
    background: var(--light-key-color);
}

article p,
article ul,
article ol {
    font-family: serif;
    font-size: 1.2rem;
    line-height: 1.4em;
    width: 83%;
    margin: 1rem 0;
}

article .markdown-alert {
    width: 83%;
    margin: 1rem 0;

    p {
        width: 100%;
    }
}

article footer p,
article footer ul,
article footer ol {
    width: auto;
}

article :not(pre) > code {
    font-size: 0.9rem;
    background: var(--sidebar-background-color);
    border-width: 1px;
    padding: 0.125rem 0.2rem;
    border-radius: .125rem;
    color: var(--sidebar-anchor-color);
}

article a > code {
    --sidebar-anchor-color: #f8f8ea;
    --sidebar-background-color: #009688;
    padding-bottom: 0;
    padding-top: 1px;
}

span.new-thought {
    font-variant: small-caps;
    font-size: 1.4em;
}

article pre{
    /*width: calc(83% + 80px);*/
    width: 100%;
}

article pre:not([class*="language-"]) {
    background: var(--sidebar-background-color);
    color: var(--sidebar-anchor-color);
    padding: 1rem;
    overflow: auto;
    border-radius: 0.3em;
    scrollbar-color: var(--sidebar-anchor-color) var(--sidebar-background-color-muted);
    scrollbar-width: thin;
}

article footer section {
    width: 83%;
}

article footer section h3 {
    font-size: 0.9rem;
    border-bottom: 1px solid var(--dark-color);
    text-transform: uppercase;
    padding-bottom: 0.5rem;
}

.links-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footnotes-list {
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

.footnotes-list,
.footnotes-list p {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.footnotes-list__annotations {
    list-style: none;
    padding: 0;
}

.related-notes {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    -moz-column-gap: 1rem;
         column-gap: 1rem;
}

.related-notes a {
    color: var(--dark-color);
    text-decoration: none;
}

.related-notes a:hover {
    text-decoration: underline;
}

.related-notes img {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    -o-object-fit: cover;
       object-fit: cover;
}

.related-notes small {
    font-size: 0.6rem;
    text-transform: uppercase;
}

.related-notes h4 {
    font-size: 0.9rem;
    font-weight: normal;
    margin: 0.4rem 0;
}

.related-notes__next-previous {
    grid-template-columns: 1fr 1fr;
}

.related-notes__next-previous img {
    aspect-ratio: auto;
    max-height: 120px;
    width: 100%;
}

.related-notes__next-previous a:nth-child(2) {
    text-align: right;
}

article aside p {
    margin: 0;
}

.post-list__topics ol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.post-list header {
    display: flex;
    flex-direction: column;
}

ul.alphabet {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.post-list header.post-list__inline-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.post-list header:not(.post-list__inline-header) h3{
    margin-bottom: 0;
}

.post-list header:not(.post-list__inline-header) p {
    margin-top: 0.5rem;
}

.post-list footer {
    margin-top: 1rem;
}

.post-list ol {
    list-style: none;
    padding: 0;
}

.post-list__alphabetised > li {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    margin-bottom: 1rem;
}

.post-list__alphabetised > li > ul {
    padding: 0;
    list-style-position: inside;
}

.post-list__alphabetised > li > ul li {
    margin-bottom: 0.3rem;
}

.post-list__chronological li {
    display: flex;
    margin-bottom: 1rem;
    flex-direction: column;
}

.post-list__todo ul > li,
.post-list__chronological-thin li {
    margin-bottom: 0.3rem;
}

.post-list__chronological hr {
    display: none;
}

.post-list__todo ul {
    padding-left: 0;
}

.project-list header {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
}

.project-list header h3 {
    margin-bottom: 0;
}

.project-list header p {
    margin-top:0.5rem;
}

.project-list ul li {
    margin: .5rem 0;
}

/*
 * Library / Anti Library
 */

.book-list {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.book {
    display: block;
    text-decoration: none;
}

.book .cover{
    display: block;
    background: #CCC;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 1 / 1.5;
}

.book .cover img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    transition: all 150ms;
}

.book .cover.cover__placeholder,
.book-list > h3{
    background: transparent;
    border: 1px solid;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
}

.book-list > h3 {
    aspect-ratio: 1 / 1.5;
    border: 4px white double;
    margin: 0;
}

.book h3 {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.book p {
    font-size: 0.75rem;
    margin: 0.5rem 0;
}

/*
 * Listened To
 */

.album-list {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
}

/* five in a row by default
    TODO: change for different viewports
 */

.album{
    width: calc(100% / 5);
    aspect-ratio: 1;
    padding: 0.5rem;
}

/* one plus the number per row */

.album:first-child,
.album:nth-child(6){
    padding-left: 0;
}

.album:nth-child(5) {
    padding-right: 0;
}

.album .inner{
    display: block;
    background: #CCC;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.album .inner img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    transition: all 150ms;
}

.album .inner:hover img {
    width: 110%;
    height: 110%;
    margin-left: -5%;
    margin-top: -5%;
}

.album.album__detail .inner{
    background: transparent;
    border: 1px solid #CCC;
    padding:1rem;
}

.items-list ul {
    width: 100%;
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
    margin-bottom: .9rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    list-style: none;
    gap: 1rem;
}

.items-list img {
    max-width: 100%;
    -o-object-fit: cover;
       object-fit: cover;
}

.items-list p {
    margin-top: 0;
}

/* Do not display the bar decoration on smaller screen sizes as it causes the
   content to wrap and look terrible. */

@media only screen and (min-width: 500px) {
    .post-list__chronological hr {
        flex-grow: 1;
        margin: 0;
        display: block;
        border: 0;
        border-bottom: 3px double;
    }

    .post-list__chronological li {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }

    .post-list footer {
        text-align: right;
    }
}

#main-nav.jumbo-nav__open {
    --sidebar-color: var(--jumbo-nav-text-color);
    --sidebar-anchor-color: var(--jumbo-nav-anchor-color);
    --sidebar-background-color: var(--jumbo-nav-background-color);

    scrollbar-color: var(--sidebar-anchor-color) var(--sidebar-background-color);
    scrollbar-width: thin;
}

/* In two column layouts; when the jumbo nav is open, its container should be
   scrollable in case the viewport is too short to display the whole menu. */

main.two-columns #main-nav.jumbo-nav__open {
    height: 100vh;
    position: relative;
}

.jumbo-nav__open #jumbo-toggle{
    font-weight: bold;
}

.main-nav {
    position: relative;
    z-index: 2;
    color: var(--sidebar-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
}

.main-nav a {
    color: var(--sidebar-anchor-color);
}

.main-nav > div {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.main-nav input {
    border: none;
    border-bottom: 1px solid var(--sidebar-anchor-color);
    background: transparent;
    color: var(--sidebar-anchor-color);
    margin-bottom: 1px;
}

.main-nav input::-moz-placeholder {
    color: var(--sidebar-anchor-color);
}

.main-nav input::placeholder {
    color: var(--sidebar-anchor-color);
}

.main-nav nav > * {
    margin: 0 0.2rem
}

.main-nav nav > *:first-child {
    margin-left: 0;
}

.main-nav nav > *:last-child {
    margin-right: 0;
}

a.skip-content {
    left: -9999px;
    position: absolute;
    top: 0;
}

a.skip-content:focus {
    left: auto;
    position: relative;
}

/* Skip content link doesn't make sense on mobile view */

@media only screen and (min-width: 900px) {
    a.skip-content {
        visibility: hidden;
    }
}

@media only screen and (min-width: 500px) {
    .main-nav {
        flex-direction: row;
    }
}

#jumbo-nav {
    display: none;
    width: 100%;
}

.jumbo-nav__open #jumbo-nav{
    display: block;
    padding-bottom: var(--spacing);
}

#jumbo-nav nav {
    display: grid;
    -moz-column-gap: 1rem;
         column-gap: 1rem;
    row-gap: var(--spacing);
    grid-template-columns: repeat(2, 1fr);

    color: var(--jumbo-nav-text-color);
    font-size: .9rem;

    padding: 0 var(--gutter);
    width: 100%;
}

#jumbo-nav dl:not(.community) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

#jumbo-nav dl:not(.community) dt {
    border-bottom: 1px solid;
    margin-bottom: 0.5rem;
    height: 20px;
}

#jumbo-nav dl.community {
    margin-top: 0.5rem;
}

#jumbo-nav dl.community dd:first-of-type{
    margin-bottom: 1rem;
}

#jumbo-nav dl.community dd:nth-of-type(2) a {
    text-decoration: none;
    display: inline-block;
    height: 31px;
    width: 88px;
}

#jumbo-nav dl.community:last-child dd:first-of-type {
    margin-bottom: 0;
}

#jumbo-nav dl.community dd:nth-of-type(2) a:hover{
    box-shadow: 0 0 10rem var(--jumbo-nav-anchor-color);
}

#jumbo-nav dt {
    text-transform: uppercase;
    font-size: 80%;
}

#jumbo-nav dt,
#jumbo-nav .footer {
    grid-column: span 2;
}

#jumbo-nav .footer {
    margin-top: .5rem;
}

#jumbo-nav dd {
    margin: 0;
}

#jumbo-nav dd a {
    text-decoration: none;
    color: var(--jumbo-nav-text-color);
}

#jumbo-nav dd span:first-child {
    color: var(--jumbo-nav-anchor-color);
    margin-right: 0.3rem;
    font-size: smaller;
}

#jumbo-nav dd span:nth-child(2) {
    border-bottom: 1px solid var(--jumbo-nav-anchor-color);
}

#jumbo-nav dd a:hover span:first-child {
    color: var(--jumbo-nav-anchor-hover-color);
}

#jumbo-nav dd a:hover span:nth-child(2) {
    border-bottom-color: var(--jumbo-nav-anchor-hover-color);
}

#jumbo-nav div {
    grid-column-end: span 2;
    border-top: 1px solid;
}

#jumbo-nav div a {
    color: var(--jumbo-nav-anchor-color);
    text-decoration: underline;
}

@media (max-width: 425px) {
    #jumbo-nav nav {
        display: flex;
        flex-direction: column;
    }
}

ul.button-board {
    list-style: none;
    margin: 0;
    padding: 0;
}

.button-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(81px, 1fr));
    width: 100%;
    -moz-column-gap: 0.5rem;
         column-gap: 0.5rem;
}

.button-board > * {
    width: auto;
    margin: 0;
    padding: 0;
}

.markdown-alert {
    width: 83%;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: .25em solid #888;

    p {
        font-size: 1em;
        font-family: sans-serif;
    }

    >:first-child {
        margin-top: 0;
    }
    >:last-child {
        margin-bottom: 0;
    }

    .markdown-alert-title {
        display: flex;
        font-weight: 500;
        align-items: center;
        font-size: 1.17em;
        line-height: 1;

        .octicon {
            margin-right: 0.5rem;
            display: inline-block;
            overflow: visible !important;
            vertical-align: text-bottom;
            fill: currentColor;
        }
    }

    &.markdown-alert-note {
        border-left-color: var(--color-note);
        .markdown-alert-title {
            color: var(--color-note);
        }
    }

    &.markdown-alert-important {
        border-left-color: var(--color-important);
        .markdown-alert-title {
            color: var(--color-important);
        }
    }

    &.markdown-alert-warning {
        border-left-color: var(--color-warning);
        .markdown-alert-title {
            color: var(--color-warning);
        }
    }

    &.markdown-alert-tip {
        border-left-color: var(--color-tip);
        .markdown-alert-title {
            color: var(--color-tip);
        }
    }

    &.markdown-alert-caution {
        border-left-color: var(--color-caution);
        .markdown-alert-title {
            color: var(--color-caution);
        }
    }
}

/* With thanks to the user Shaz @ Stack Overflow
 * @see https://stackoverflow.com/a/5379820/1225977 */

a[href]:not(:where(
  /* exclude hash only links */
  [href^="#"],
  /* exclude relative but not double slash only links */
  [href^="/"]:not([href^="//"]),
  /* domains to exclude */
  [href*="//photogabble.co.uk"],
  /* subdomains to exclude */
  [href*="//www.photogabble.co.uk"]
)):not(.no-ext):after {
  content: "↗️";
  margin-left: 0.25rem;
  vertical-align: super;
  font-size: 0.5rem;
}
