/* Article, page and error layouts, and long-form essay typography */

.article { padding: 0 20px; }

.article-header {
    max-width: var(--column-text);
    margin: 0 auto;
    padding: 44px 0 34px;
    text-align: center;
}
.article-tag { margin-bottom: 16px; }
.article-title {
    font-size: clamp(30px, 6vw, 44px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}
.article-excerpt { margin: 14px auto 0; max-width: 56ch; font-size: 17px; color: var(--text-soft); }
.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--text-soft);
}
.article-meta a { text-decoration: none; }
.article-meta a:hover { text-decoration: underline; text-decoration-color: var(--hl); }

.article-feature {
    max-width: var(--column-wide);
    margin: 0 auto 40px;
    padding: 12px;
    border-radius: 24px;
}
.article-feature img { width: 100%; border-radius: 14px; }
.article-feature figcaption,
.gh-content figcaption {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: var(--text-soft);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: var(--column-text);
    margin: 40px auto 0;
}
.article-after { max-width: var(--column); margin: 0 auto; }
/* Comments get a light frosted card: Ghost's comments use the site accent both
   as button colour and as link text, which only reads well on a light surface */
.article-comments {
    margin-top: 40px;
    padding: 26px 24px 18px;
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--ink);
}

/* Long-form content */
.gh-content {
    max-width: var(--column-text);
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    overflow-wrap: break-word;
}
.gh-content > * + * { margin-top: 1.25em; }
.gh-content > :first-child { margin-top: 0; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content p, .gh-content ul, .gh-content ol { margin-bottom: 0; }

.gh-content h2 { font-size: 32px; margin-top: 1.8em; }
.gh-content h3 { font-size: 25px; margin-top: 1.6em; }
.gh-content h4 { font-size: 20px; margin-top: 1.5em; }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: 0.6em; }

.gh-content a {
    text-decoration: underline;
    text-decoration-color: var(--hl);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.gh-content a:hover { color: var(--hl); }

.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li + li { margin-top: 0.4em; }
.gh-content li::marker { color: var(--hl); }

.gh-content hr {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 2.5em 0;
}

.gh-content blockquote:not([class]) {
    margin-left: 0;
    margin-right: 0;
    padding: 18px 22px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-fill);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 22px;
    line-height: 1.45;
}
.gh-content blockquote p { margin: 0; }
.gh-content blockquote.kg-blockquote-alt {
    margin: 1.8em 0;
    padding: 0 1em;
    border: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 26px;
    line-height: 1.4;
    color: #fff;
}

.gh-content code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.85em;
}
.gh-content pre {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}
.gh-content pre code { padding: 0; background: none; font-size: inherit; }

.gh-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 15px;
}
.gh-content th, .gh-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
    white-space: nowrap;
}
.gh-content th { font-weight: 600; background: var(--glass-fill); }

/* Citations and the Sources box (see assets/js/main.js) */
.gh-content a.cite {
    display: inline-block;
    min-width: 1.6em;
    padding: 3px 5px;
    margin: 0 1px;
    border-radius: var(--radius-pill);
    background: var(--hl);
    color: var(--ink);
    font: 600 10px/1 var(--font-body);
    text-align: center;
    text-decoration: none;
    vertical-align: super;
}
.gh-content a.cite:hover { color: var(--ink); filter: brightness(1.12); }
.gh-content a.cite { position: relative; }
.gh-content a.cite::after { content: ""; position: absolute; inset: -8px -4px; }

.gh-content .sources {
    margin-top: 2.5em;
    padding: 18px 22px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
}
.gh-content .sources > :is(h1, h2, h3, h4, h5, h6) { margin: 0 0 8px; font-size: 22px; }
.gh-content .sources ol, .gh-content .sources ul { margin: 0; color: rgba(255, 255, 255, 0.88); }
.gh-content .sources li:target { color: #fff; text-shadow: 0 0 12px var(--hl); }
.gh-content .sources li { scroll-margin-top: 30vh; }

/* Members-only content gate (rendered by Ghost's {{content}}) */
.gh-post-upgrade-cta {
    margin-top: 2em;
    padding: 28px 24px;
    border-radius: var(--radius-card);
    text-align: center;
    background: var(--glass-fill-strong) !important;
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
}
.gh-post-upgrade-cta-content { background: none !important; }
.gh-post-upgrade-cta h2 { font-size: 26px; color: #fff; }
.gh-post-upgrade-cta p { color: var(--text-soft); }
.gh-post-upgrade-cta a.gh-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    background: #fff !important;
    color: var(--ink) !important;
    text-decoration: none;
    font-weight: 500;
}
.gh-post-upgrade-cta a:not(.gh-btn) { color: #fff !important; text-decoration-color: var(--hl); }

/* Error pages */
.error-page {
    max-width: var(--column);
    margin: 0 auto;
    padding: 12vh 20px;
    text-align: center;
}
.error-code {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(80px, 20vw, 140px);
    line-height: 1;
}
.error-message { margin: 10px 0 0; font-size: 26px; }
.error-hint { color: var(--text-soft); }
.error-page .btn { margin-top: 20px; }

@media (max-width: 520px) {
    .gh-content { font-size: 17px; }
    .gh-content h2 { font-size: 27px; }
    .gh-content h3 { font-size: 22px; }
    .gh-content blockquote:not([class]) { font-size: 19px; }
    .article-feature { padding: 6px; border-radius: 16px; margin-bottom: 28px; }
    .article-feature img { border-radius: 11px; }
}

/* Post templates: Wide (default) and Narrow.
   On phones both columns are wider than the screen, so the text fills the width either
   way; the title sizes scale with the screen and only differ from tablet size up. */

/* Wide: roomy 760px text, bigger title, images spread out */
.article--wide .article-header { max-width: 860px; }
.article--wide .article-title { font-size: clamp(30px, 6.5vw, 54px); }
.article--wide .article-feature { max-width: 1100px; }
.article--wide .gh-content,
.article--wide .article-tags { max-width: 760px; }

/* Narrow: intimate 580px essay column, quieter headings, every image kept in the column */
.article--narrow .article-header { max-width: 580px; }
.article--narrow .article-title { font-size: clamp(28px, 5.5vw, 38px); }
.article--narrow .article-feature { max-width: calc(580px + 24px); }
.article--narrow .gh-content,
.article--narrow .article-tags { max-width: 580px; }
.article--narrow .gh-content h2 { font-size: 27px; }
.article--narrow .gh-content h3 { font-size: 22px; }
.article--narrow .gh-content blockquote:not([class]) { font-size: 20px; }
.article--narrow .gh-content :is(.kg-width-wide, .kg-width-full) {
    width: 100%;
    left: auto;
    transform: none;
}
.article--narrow .gh-content .kg-width-full img { border-radius: 14px; }

@media (max-width: 520px) {
    .article--narrow .gh-content h2 { font-size: 25px; }
    .article--narrow .gh-content h3 { font-size: 21px; }
}
