/* Posts and pages: compact headline, feature image joined to a white reading
   panel of the same width, table of contents on the right (desktop only). */

.back-link { display: inline-block; margin: 16px 0 8px; font-size: 14px; font-weight: 800; }
.back-link:hover { text-decoration: underline; }

.article-head { max-width: 900px; padding-top: 12px; }
.article--page .article-head { padding-top: 40px; }
.article-head .eyebrow:hover { text-decoration: underline; }
.article-title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -.01em; margin: 10px 0 12px; max-width: 850px; overflow-wrap: anywhere; }
.article-dek { font-size: 18px; line-height: 1.5; max-width: 760px; margin: 0 0 12px; color: var(--muted); }
.article-meta { margin: 0; }
.article-meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

.article-layout {
    --panel-pad: 42px;
    display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: 30px;
    margin-top: 28px; padding-bottom: 56px;
}
.article--page .article-layout { grid-template-columns: minmax(0, 1fr); max-width: 950px; }
/* No table of contents: keep the same reading width rather than an empty column. */
.article-layout:not(:has(.article-toc:not([hidden]))) { grid-template-columns: minmax(0, 910px); }

.article-image { grid-column: 1; margin: 0; background: var(--white); border-radius: var(--radius-panel) var(--radius-panel) 0 0; overflow: hidden; }
.article-image img { display: block; width: 100%; height: 300px; object-fit: cover; }
.article-image figcaption { padding: 10px var(--panel-pad) 0; font-size: 13px; color: var(--muted); }

.article-body {
    grid-column: 1; min-width: 0;
    background: var(--white);
    border: 1px solid rgba(22, 76, 80, .08); border-top: 0;
    border-radius: 0 0 var(--radius-panel) var(--radius-panel);
    box-shadow: 0 10px 26px rgba(22, 76, 80, .05);
    padding: 36px var(--panel-pad);
    font-size: 18px; line-height: 1.75;
}
.article--no-image .article-body { border-top: 1px solid rgba(22, 76, 80, .08); border-radius: var(--radius-panel); }

.article-toc {
    grid-column: 2; grid-row: 1 / span 2; align-self: start;
    position: sticky; top: 24px;
    border-top: 2px solid rgba(0, 104, 172, .2); padding-top: 20px;
    font-size: 14px;
}
.article-toc[hidden] { display: none; }
.article-toc__list { list-style: none; margin: 8px 0 0; padding: 0; }
.article-toc__list a { display: block; padding: 7px 0; line-height: 1.4; }
.article-toc__list a:hover, .article-toc__list a[aria-current] { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Content ---------- */
.gh-content > * + * { margin-top: 20px; }
.gh-content > :first-child { margin-top: 0; }
.gh-content p, .gh-content ul, .gh-content ol, .gh-content blockquote { margin-bottom: 0; }
.gh-content h2 { font-size: 27px; margin: 34px 0 0; scroll-margin-top: 24px; }
.gh-content h3 { font-size: 22px; margin: 28px 0 0; scroll-margin-top: 24px; }
.gh-content h4 { font-size: 19px; margin: 24px 0 0; }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: 10px; }
.gh-content a:not(.kg-btn):not(.kg-bookmark-container) { text-decoration: underline; text-underline-offset: 2px; }
.gh-content ul, .gh-content ol { padding-left: 24px; }
.gh-content li + li { margin-top: 6px; }
.gh-content strong { font-weight: 800; }
.gh-content blockquote:not([class]) { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--blue); font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.5; color: var(--blue); }
.gh-content blockquote.kg-blockquote-alt { text-align: center; font-family: var(--font-display); font-size: 24px; color: var(--blue); padding: 0 24px; }
.gh-content hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.gh-content img { max-width: 100%; height: auto; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center; }
.gh-content .kg-image-card img { border-radius: 14px; margin: 0 auto; }
.gh-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: #EEF4F6; padding: 2px 5px; border-radius: 5px; }
.gh-content pre { overflow-x: auto; background: #10364F; color: #E8F4F8; padding: 18px 20px; border-radius: 14px; font-size: 15px; line-height: 1.6; }
.gh-content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.gh-content table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.gh-content th, .gh-content td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.gh-content th { color: var(--blue); font-weight: 800; }

/* Wide and full cards break out of the panel's padding. */
.gh-content .kg-width-wide { margin-left: calc(var(--panel-pad) * -.5); margin-right: calc(var(--panel-pad) * -.5); }
.gh-content .kg-width-full { margin-left: calc(var(--panel-pad) * -1); margin-right: calc(var(--panel-pad) * -1); }
.gh-content .kg-width-full img { border-radius: 0; width: 100%; }
.gh-content .kg-width-full figcaption { padding: 0 var(--panel-pad); }

/* Ghost's card_assets supply the card layouts; these align them with the blog. */
.gh-content .kg-callout-card { border-radius: 14px; border-left: 4px solid #007ABB; font-size: 16px; line-height: 1.6; }
.gh-content .kg-callout-card-grey, .gh-content .kg-callout-card-blue, .gh-content .kg-callout-card-green, .gh-content .kg-callout-card-accent { background: var(--tip); color: var(--ink); }
.gh-content .kg-btn, .gh-content .kg-header-card-button { font-family: var(--font-display); font-weight: 600; border-radius: var(--radius-pill); }
.gh-content .kg-bookmark-card { margin-top: 24px; }
.gh-content .kg-bookmark-container { border-radius: 14px; color: var(--ink); }
.gh-content .kg-bookmark-title { font-family: var(--font-display); color: var(--blue); font-weight: 600; }
.gh-content .kg-toggle-card h4 { margin: 0; font-family: var(--font-display); }
.gh-content .kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.gh-content .kg-embed-card iframe { max-width: 100%; }
.gh-content .kg-gallery-image img { border-radius: 8px; }

/* ---------- Related reading ---------- */
.related { margin-top: 8px; padding: 48px 0 60px; border-top: 1px solid var(--line); }
.related .section-head { align-items: flex-end; margin-bottom: 22px; }
.related .section-head h2 { margin: 5px 0 0; font-size: 32px; }
.related__grid { gap: 24px; }
.related__grid > .card:nth-child(n + 4) { display: none; }
.related:not(:has(.card)) { display: none; }
.related .card__image { height: 175px; }
.article-template .site-footer { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); --panel-pad: 26px; }
    .article-image img { height: 230px; }
    .article-toc { display: none; }
}
@media (max-width: 700px) {
    .related .section-head { align-items: flex-start; }
    .related .section-head h2 { font-size: 28px; }
    .related .card__image { height: 190px; }
}
@media (max-width: 560px) {
    .back-link { margin: 12px 0 6px; }
    .article-head { padding-top: 8px; }
    .article-title { font-size: 28px; margin: 8px 0 10px; }
    .article-dek { font-size: 16px; line-height: 1.45; margin-bottom: 10px; }
    .article-layout { margin-top: 18px; --panel-pad: 22px; }
    .article-body { padding: 24px var(--panel-pad); font-size: 17px; }
    .gh-content h2 { font-size: 25px; }
}
@media (max-width: 480px) {
    .article-image img { height: 190px; }
}
