/* ------------------------------------------------------------------
   gramkoski.com

   No framework, no build step. Edit this file directly.

   Two typefaces, on purpose:
     --mono  index page and site chrome (nav, footer, metadata)
     --sans  blog post prose, matching the old Bootstrap Reboot look
   ------------------------------------------------------------------ */

:root {
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --grey: #6c757d;
}

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

body {
    margin: 0 auto;
    max-width: 74ch;
    padding: 3rem 1.25rem 6rem;
    background: #fff;
    color: #000;
    font: 0.875rem/1.7 var(--mono);
    /* long URLs must not push the page sideways on narrow screens */
    overflow-wrap: break-word;
}

a {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

sup {
    line-height: 0;
}

/* ---- masthead ---------------------------------------------------- */

.masthead {
    margin-bottom: 1.5rem;
}

.masthead h1 {
    font-size: 0.875rem;
    font-weight: bold;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    margin: 0;
}

.masthead h1 a {
    text-decoration: none;
}

.tagline {
    margin: 0.35rem 0 1.25rem;
    color: #555;
}

.masthead nav a {
    margin-right: 0.5rem;
}

hr.rule {
    border: 0;
    border-top: 1px solid #000;
    margin: 0;
}

/* ---- index sections ---------------------------------------------- */

h2 {
    font-size: 0.875rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 2.75rem 0 0.35rem;
}

.entry {
    margin-top: 2rem;
}

.entry h3 {
    font-size: 0.875rem;
    font-weight: bold;
    margin: 0;
}

.entry .meta {
    margin: 0 0 0.55rem;
    color: #767676;
}

.entry p {
    margin: 0 0 0.5rem;
}

.link::before {
    content: "-> ";
    color: #767676;
}

/* ---- figures ----------------------------------------------------- */

figure {
    margin: 0.9rem 0 0;
}

figure img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    border: 1px solid #000;
}

figure canvas {
    display: block;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    height: auto;
    border: 1px solid #000;
}

figcaption {
    margin-top: 0.4rem;
    color: #767676;
}

/* ---- simple text pages (about) ----------------------------------- */
/* These stay monospace like the index; only blog posts switch to sans. */

.page p {
    margin: 0 0 1.1rem;
}

/* ---- blog posts -------------------------------------------------- */

.post {
    font-family: var(--sans);
}

.post-title {
    font-family: var(--sans);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-transform: none;
    margin: 0 0 0.3rem;
}

.post-meta {
    font-family: var(--sans);
    font-size: 1rem;
    color: var(--grey);
    margin: 0 0 1.75rem;
}

.post p {
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 1.1rem;
}

.post figure {
    margin: 1.5rem 0;
}

.post figure img,
.post figure canvas {
    max-width: 420px;
}

/* Navigation stays monospace even inside a post. */
.post .link,
.post .back {
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.7;
}

.back {
    margin: 2.5rem 0 0;
}

/* Safety net: an oversized equation scrolls in place rather than
   widening the whole page. Display math is also hand-wrapped so this
   should rarely trigger. */
mjx-container[display="true"] {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 0.25rem 0;
}

/* ---- footer ------------------------------------------------------ */

footer {
    margin-top: 4rem;
    border-top: 1px solid #000;
    padding-top: 0.6rem;
    color: #767676;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

footer a {
    margin-left: 1.5ch;
}
