/* slowcollapse: lukejudd.com, after the 2019 Vue site (gitlab.com/probabble/lukejudd, master).
   Breakpoints match its vue-mq setup: small < 666px, medium < 1250px, large above. */

@font-face {
    font-family: "Accidental";
    src: url("../fonts/accidental.ttf") format("truetype");
    font-display: swap;
}

:root {
    --ink: #030207;
    --paper: #fef9f5;
    --nav-height: 5em;
    --subnav-height: 2em;
    --gutter: 0;
    --body-font: Helvetica, Arial, sans-serif;
    --display-font: var(--body-font);
}

/* The old site asked for Accidental but its @font-face was invalid, so browsers always showed
   Helvetica. The theme setting "Typeface: Accidental" turns the intended font on for the
   title, menu and headings. */
.typeface-accidental {
    --display-font: "Accidental", Helvetica, fantasy;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0 8px;                 /* the old site kept the browser's 8px body margin */
    background-color: var(--ink);
    color: var(--paper);
    font-family: var(--body-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: white; text-decoration: none; }
a:hover { color: gray; }

/* ---------- Header: name, page links, email bar ---------- */

.site-header {
    position: fixed;
    top: 0;
    left: 8px;                     /* starts at the body margin and runs off the right edge, as before */
    right: 0;
    z-index: 101;
}

.nav {
    display: flex;
    height: var(--nav-height);
    background-color: var(--ink);
    border-bottom: 1px solid white;
    font-family: var(--display-font);
    font-weight: bold;
}

.title-link {
    margin: auto 0.5em;
    padding: 0 0.5em;
    width: min-content;            /* "LUKE" over "JUDD", as on the old wide layout */
    font-size: 32px;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--paper);
    background-color: var(--ink);
}
.title-link:hover { color: gray; }

.page-links {
    flex: 1;
    display: flex;
}

.page-link {
    flex: 1;
    display: flex;
    height: 100%;
    border-left: 0.5em solid var(--ink);
    text-align: center;
    text-transform: uppercase;
    color: var(--paper);
    background-color: var(--ink);
    transition: background-color 200ms;
}
.page-link span { margin: auto; }
.page-link:hover,
.page-link.is-current {
    color: var(--ink);
    background-color: var(--paper);
}

.subnav {
    display: flex;
    height: var(--subnav-height);
    background-color: rgba(3, 2, 7, 0.8);
    border-bottom: 2px solid white;
}
.email-link {
    margin: auto 2em auto auto;
    text-transform: uppercase;
}

.burger { display: none; }

/* ---------- Slide-in menu (small screens) ---------- */

.menu-mask {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.8);
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 201;
    width: min(300px, 85vw);
    display: flex;
    flex-direction: column;
    padding: 4em 0 3em;
    background-color: var(--ink);
    font-family: var(--display-font);
    font-weight: bold;
    font-size: 20px;
    transform: translateX(100%);
    transition: transform 0.5s;
}
.side-menu.is-open { transform: none; }
.side-menu .page-link {
    flex: 0 0 auto;
    height: auto;
    padding: 0.7em;
    border-left: 0;
    border-bottom: 0.5em solid var(--paper);
}
.side-menu .page-link:hover { border-bottom-color: var(--ink); }

/* ---------- Page body ---------- */

.site-main {
    display: flex;
    margin-top: calc(var(--nav-height) + var(--subnav-height));
}
/* Same flexbox as the old App.vue: gutters of up to 20% that shrink first, so the page column
   reaches its full 60em on ordinary laptop widths and sits centred. */
.site-main::before,
.site-main::after {
    content: "";
    flex: 0 1 var(--gutter);
}

.page {
    flex: 0 1 100%;
    min-width: 0;
    max-width: 60em;
    padding-bottom: 4em;
}

h1, h2, h3 { font-family: var(--display-font); }
.gh-content h2,
.page-title { margin-top: 2em; font-size: 2em; }
.gh-content h3 { margin-top: 1.5em; font-size: 1.5em; }
.page-title { margin-top: 1em; }

.gh-content p,
.post-card-excerpt {
    max-width: 40em;
    font-size: 20px;
    line-height: 1.4;
}

.post-meta { color: #a8a4a0; font-size: 16px; }

/* Images: as wide as the page column, captions in italics underneath. */
.gh-content figure,
.feature-image {
    margin: 1em 0 2em;
}
.gh-content img,
.feature-image img {
    display: block;
    width: 100%;
    max-width: 70em;
    height: auto;
}
.gh-content figcaption,
.feature-image figcaption {
    padding: 0 2em;
    margin-top: 0.5em;
    font-size: 16px;
    font-style: italic;
    text-align: left;
}

/* Video embeds: full column width at 16:9 (the old site used fixed 500px / 200px heights). */
.gh-content .kg-embed-card { display: block; }
.gh-content .kg-embed-card iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    background-color: black;
}
.gh-content .kg-embed-card figcaption { margin: 1em 1em 2em; }

/* Ghost's wide and full-width image cards */
.gh-content .kg-width-wide img { max-width: none; }
.gh-content .kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
}
.gh-content .kg-width-full img { max-width: none; }

/* Landing page: the GIF, centred in the page column (beats the image-card rules below). */
.landing { display: flex; justify-content: center; }
.gh-content.landing .kg-image-card { width: auto; max-width: 100%; margin: 50px auto 0; }
.landing img { width: auto; max-width: 100%; }

/* Blog list */
.post-card { margin: 2em 0 3em; }
.post-card-title { margin: 0.5em 0 0.2em; font-size: 1.6em; }
.pagination { display: flex; gap: 1em; align-items: center; font-size: 16px; }

/* ---------- Breakpoints ---------- */

@media (min-width: 666px) {
    :root { --gutter: 3em; }
}

@media (min-width: 1250px) {
    :root { --gutter: 20%; }
    .gh-content .kg-image-card { width: 100%; margin-left: -2em; }   /* shifted left, not widened */
}

@media (min-width: 666px) and (max-width: 1249px) {
    .gh-content .kg-image-card { max-width: 80%; }
}

@media (max-width: 665px) {
    .title-link { width: auto; white-space: nowrap; font-size: 26px; }
    .nav > .page-links { display: none; }
    .burger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 3em;
        height: 2em;
        margin: auto 1.5em auto auto;
        padding: 0;
        border: 0;
        background: none;
        cursor: pointer;
    }
    .burger span {
        display: block;
        height: 0.25em;
        background-color: var(--paper);
    }
    body { margin: 0; }
    .site-header { left: 0; }
    .page { padding-left: 0.75em; padding-right: 0.75em; }
    .gh-content figure { margin-left: -0.75em; margin-right: -0.75em; }
    .gh-content figcaption { padding: 0 1.5em; }
}

@media (prefers-reduced-motion: reduce) {
    .side-menu, .page-link { transition: none; }
}

/* ---------- Sections built from posts (section.hbs) ---------- */

.section-title { margin-top: 2em; font-size: 2em; }
.section-intro { max-width: 40em; font-size: 20px; line-height: 1.4; }
.works:empty { display: none; }
.work > figure:first-child { margin-top: 1em; }
.work > p { margin: 1em 0 2em; }
.back-link { margin: 2em 0 0; font-size: 16px; text-transform: uppercase; }

/* A single work (/still/<slug>/ ...): Ghost only marks exact menu matches, so mark its section by tag. */
.tag-still .page-link.nav-still,
.tag-projected .page-link.nav-projected,
.tag-moving .page-link.nav-moving,
.tag-events .page-link.nav-events {
    color: var(--ink);
    background-color: var(--paper);
}
