/* tomfejer-blog — design layer on top of Ghost Source.
   Loaded after built/screen.css (see default.hbs), so no build step is needed.
   Direction: monochrome, generous whitespace, tight Inter type, hairline borders,
   rounded image-first cards (cf. OpenAI Developers blog, Vercel blog, Core). */

/* Fonts: Geist + Geist Mono, self-hosted (SIL OFL, see assets/fonts/GEIST-LICENSE.txt) */
@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/geist-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/geist-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/geist-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 1. Tokens
/* ---------------------------------------------------------- */
:root {
    --ink: #0a0a0a;
    --paper: #fff;
    --muted: #666;
    --hairline: rgb(0 0 0 / 0.1);
    --hairline-strong: rgb(0 0 0 / 0.2);
    --surface: #fafafa;
    --radius: 14px;
    --radius-sm: 8px;

    --background-color: var(--paper);
    --color-primary-text: var(--ink);
    --color-darker-gray: var(--ink);
    --color-secondary-text: var(--muted);
    --color-border: var(--hairline);
    --color-dark-border: var(--hairline-strong);
    --color-lighter-gray: var(--surface);
    --font-sans: "Geist", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: "Geist Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --container-width: 1160px;
    --shell-width: 1320px;
    --grid-gap: 24px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #ededed;
        --paper: #0a0a0a;
        --muted: #a1a1a1;
        --hairline: rgb(255 255 255 / 0.12);
        --hairline-strong: rgb(255 255 255 / 0.28);
        --surface: #111;
        color-scheme: dark;
    }
}

html,
body {
    background-color: var(--paper);
    color: var(--ink);
}

body {
    font-family: var(--font-sans);
    /* Neutral accent: links, tags and focus states use the ink colour, not Ghost pink */
    --ghost-accent-color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--ink);
    color: var(--paper);
}

/* 2. Typography
/* ---------------------------------------------------------- */
body :is(h1, h2, h3, h4, .is-title) {
    font-weight: 600;
    letter-spacing: -0.03em;
}

body a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* 3. Navigation
/* ---------------------------------------------------------- */
body .gh-navigation {
    border-bottom: 1px solid var(--hairline);
    background-color: var(--paper);
    color: var(--ink);
}

body .gh-navigation-logo {
    font-weight: 650;
    letter-spacing: -0.03em;
}

body .gh-navigation .nav a {
    font-size: 1.35rem;
    font-weight: 450;
    color: var(--muted);
}

body .gh-navigation .nav a:hover,
body .gh-navigation .nav .nav-current a {
    color: var(--ink);
    opacity: 1;
}

/* Buttons: black pills instead of the accent colour */
body .gh-button {
    border: 1px solid var(--ink);
    border-radius: 999px;
    background-color: var(--ink);
    color: var(--paper);
    font-weight: 500;
    letter-spacing: -0.01em;
    box-shadow: none;
}

body .gh-button:hover {
    opacity: 0.82;
}

body .gh-navigation-members .gh-button:not(.gh-button-primary):not(:last-child) {
    border-color: transparent;
    background-color: transparent;
    color: var(--ink);
}

/* 4. Header (landing hero → flat, left aligned)
/* ---------------------------------------------------------- */
body .gh-header.is-classic {
    padding-block: clamp(56px, 8vw, 112px) clamp(32px, 4vw, 56px);
    background: none;
    color: var(--ink);
}

body .gh-header.is-classic::before,
body .gh-header.is-classic .gh-header-image {
    display: none;
}

body .gh-header.is-classic .gh-header-inner,
body .gh-header.is-classic.has-image .gh-header-inner {
    align-items: flex-start;
    gap: 28px;
    max-width: var(--container-width);
    color: var(--ink);
    text-align: left;
}

body .gh-header.is-classic .gh-header-title {
    max-width: 14em;
    font-size: clamp(3rem, 3vw + 1.4rem, 4.8rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.04em;
}

body .gh-header.is-classic .gh-form,
body .gh-header.is-classic.has-image .gh-form {
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    background-color: var(--paper);
    box-shadow: none;
}

body .gh-form-input {
    color: var(--ink);
}

body .gh-form .gh-button {
    background-color: var(--ink);
    color: var(--paper);
}

/* 5. Post feed → card grid
/* ---------------------------------------------------------- */
body .gh-container-title {
    margin-bottom: 20px;
    padding-bottom: 0;
    border: 0;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

body .gh-container:is(.is-list, .is-grid) .gh-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 48px 32px;
    margin: 0;
}

body .gh-container:is(.is-list, .is-grid) .gh-card::before,
body .gh-container:is(.is-list, .is-grid) .gh-card::after,
body .gh-container:is(.is-list, .is-grid) .gh-card + .gh-card::before {
    display: none;
}

body .gh-card {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
}

body .gh-container:is(.is-list, .is-grid) .gh-card-link,
body .gh-container.is-list .no-image .gh-card-link {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

/* Image: soft rounded corners, no frame; gentle zoom on hover */
body .gh-container:is(.is-list, .is-grid) .gh-card-image {
    overflow: hidden;
    width: 100%;
    max-width: none;
    margin: 0;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    background-color: var(--surface);
}

body .gh-card-image img {
    transition: transform 0.4s ease;
}

body .gh-card-link:hover .gh-card-image img {
    transform: scale(1.025);
}

/* Text sits directly on the page */
body .gh-container.is-list .gh-card:not(.no-image) .gh-card-wrapper,
body .gh-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 18px 0 0;
}

.gh-card-top {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 450;
    color: var(--muted);
}

/* Category: quiet text under the excerpt, no pill */
.gh-card-meta .gh-card-tag {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
}

.gh-card-tag + .gh-card-author::before {
    content: "·";
    margin: 0 6px;
    color: var(--muted);
}

body .gh-card-title,
body .gh-container.is-list .gh-card-title,
body .gh-container.is-list .no-image .gh-card-title {
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

body .gh-card-link:hover .gh-card-title {
    opacity: 1;
}

body .gh-card-excerpt,
body .gh-container.is-list .gh-card-excerpt {
    margin-top: 8px;
    font-size: 1.35rem;
    line-height: 1.5;
    color: var(--muted);
}

body .gh-card-meta:not(:empty),
body .gh-container .gh-card-meta:not(:empty) {
    margin-top: 16px;
    font-size: 1.2rem;
    font-weight: 450;
}

body .gh-more a {
    font-weight: 500;
}

/* 6. Articles
/* ---------------------------------------------------------- */
body .gh-article-title {
    font-size: clamp(3rem, 1.2vw + 2.6rem, 4rem);
    font-weight: 600;
    letter-spacing: -0.04em;
}

body {
    --content-font-size: 1.6rem;
}

body .gh-content {
    line-height: 1.7;
}

body .gh-content h2 {
    font-size: 2em;
}

body .gh-content a:not(.gh-button) {
    text-decoration-color: var(--hairline-strong);
}

body .gh-content a:not(.gh-button):hover {
    text-decoration-color: currentcolor;
}

body .gh-content :is(img, video, iframe),
body .kg-image-card img,
body .kg-card:not(.kg-callout-card) img {
    border-radius: var(--radius-sm);
}

body .gh-content blockquote:not([class]) {
    border-left: 2px solid var(--ink);
    padding-left: 20px;
    font-style: normal;
}

body .gh-content :not(pre) > code {
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background-color: var(--surface);
    border: 1px solid var(--hairline);
    font-size: 0.88em;
}

body .gh-content pre {
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--ink);
}

body .gh-content hr {
    border-color: var(--hairline);
}

/* Article header: quiet tag, neutral share pill */
body .gh-article-tag {
    font-size: 1.2rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

body .gh-button.gh-button-share {
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    background-color: transparent;
    color: var(--ink);
}

body .gh-button.gh-button-share:hover {
    border-color: var(--ink);
    opacity: 1;
}

/* 7. CTA + footer
/* ---------------------------------------------------------- */
body .gh-cta {
    border-top: 1px solid var(--hairline);
}

body .gh-footer {
    border-top: 1px solid var(--hairline);
    background-color: var(--paper);
    color: var(--muted);
}

body .gh-footer a {
    color: var(--muted);
}

body .gh-footer a:hover {
    color: var(--ink);
    opacity: 1;
}

/* 8. Small screens
/* ---------------------------------------------------------- */
@media (max-width: 767px) {
    body .gh-card-title,
    body .gh-container.is-list .gh-card-title {
        font-size: 1.8rem;
    }

    body .gh-card-wrapper {
        padding: 16px 0 0;
    }
}

/* 9. Subscribe form + footer
/* ---------------------------------------------------------- */
body .gh-form-input::placeholder,
body .gh-header.is-classic.has-image .gh-form-input::placeholder,
body .gh-header.is-classic.has-image button.gh-form-input,
body .gh-header.is-classic.has-image .gh-form > svg {
    color: var(--muted);
    opacity: 1;
}

body .gh-header.is-classic.has-image .gh-form-input {
    color: var(--ink);
}

body .gh-footer .gh-form {
    border: 1px solid var(--hairline-strong);
    background-color: transparent;
}

body .gh-footer-signup-header {
    font-size: 2.1rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ink);
}

body .gh-footer-signup-subhead {
    color: var(--muted);
}

body .gh-footer .gh-footer-logo {
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ink);
}

/* 10. Three-column shell: side nav | content | "on this page"
/* ---------------------------------------------------------- */
:root {
    --hover: color-mix(in srgb, var(--ink) 6%, transparent);
}

html {
    scroll-behavior: smooth;
}

.gh-content :is(h2, h3) {
    scroll-margin-top: 32px;
}

.gh-side-nav,
.gh-toc {
    display: none;
}

@media (min-width: 1100px) {
    .gh-shell {
        display: grid;
        grid-template-columns: 232px minmax(0, 1fr);
        column-gap: clamp(32px, 4vw, 64px);
        box-sizing: content-box;
        margin: 0 auto;
        padding: 0 max(4vmin, 20px);
        width: 100%;
        max-width: var(--shell-width);
    }

    /* Header lines up with the shell */
    body .gh-navigation-inner {
        max-width: var(--shell-width);
    }

    .gh-shell.has-toc {
        grid-template-columns: 232px minmax(0, 1fr) 216px;
    }

    .gh-shell-main {
        min-width: 0;
    }

    .gh-shell-main .gh-outer {
        padding-inline: 0;
    }

    /* Source centres the feed in a 16-column grid; inside the shell it should fill the column */
    body .gh-shell-main .gh-container-inner {
        display: block;
        overflow: visible;
    }

    body .gh-shell-main .gh-header.is-classic {
        padding-top: clamp(40px, 5vw, 72px);
    }

    /* Left rail */
    .gh-side-nav {
        position: sticky;
        top: 24px;
        display: block;
        align-self: start;
        overflow-y: auto;
        max-height: calc(100vh - 48px);
        padding: 40px 0 32px;
        font-size: 1.35rem;
    }

    .gh-side-heading {
        margin: 30px 0 8px;
        font-size: 1.35rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        color: var(--ink);
    }

    .gh-side-list {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .gh-side-link {
        display: block;
        margin-inline: -12px;
        padding: 7px 12px;
        border-radius: 10px;
        line-height: 1.4;
        color: var(--ink);
        text-decoration: none;
        transition: background-color 0.12s ease;
    }

    .gh-side-list .gh-side-link {
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        color: var(--muted);
    }

    .gh-side-link:hover {
        background-color: var(--hover);
        color: var(--ink);
        opacity: 1;
    }

    .gh-side-link.is-active {
        background-color: var(--hover);
        color: var(--ink);
    }

    /* Right rail: section navigator (posts only, shown by custom.js when the post has headings) */
    .gh-shell.has-toc .gh-toc {
        position: sticky;
        top: 24px;
        display: block;
        align-self: start;
        padding: 64px 0 32px;
        font-size: 1.3rem;
        line-height: 1.4;
    }

    .gh-toc ul {
        margin: 0;
        padding: 0;
        border-left: 1px solid var(--hairline);
        list-style: none;
    }

    .gh-toc a {
        display: block;
        margin-left: -1px;
        padding: 6px 0 6px 16px;
        border-left: 1px solid transparent;
        color: var(--muted);
        text-decoration: none;
        transition: color 0.12s ease, border-color 0.12s ease;
    }

    .gh-toc .is-sub a {
        padding-left: 28px;
    }

    .gh-toc a:hover {
        color: var(--ink);
        opacity: 1;
    }

    .gh-toc a.is-active {
        border-left-color: var(--ink);
        color: var(--ink);
    }
}
