/* Reading surface shared by Ghost's standard and CCD article templates. */
.post-template {
    --content-width: 760px;
    --ccd-reading-ink: #172b3b;
    --ccd-reading-muted: #4e5f6b;
    --ccd-reading-link: #075e68;
    --ccd-reading-rule: #cbd5da;
}

.post-template .gh-article-header {
    padding-top: clamp(32px, 5vw, 64px);
}

.post-template .gh-article .gh-article-title,
.post-template .gh-article .ccd-issue-title {
    --gh-font-heading: Georgia, "Times New Roman", serif;
    color: var(--ccd-reading-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.2rem, 4vw, 5.2rem);
    font-weight: 400;
    line-height: 1.14;
    letter-spacing: -0.025em;
    text-wrap: pretty;
    overflow-wrap: break-word;
}

.post-template .gh-article-excerpt,
.post-template .ccd-issue-deck {
    color: var(--ccd-reading-muted);
    font-size: clamp(1.8rem, 2vw, 2.1rem);
    line-height: 1.6;
}

.post-template .gh-article-meta-content {
    color: var(--ccd-reading-muted);
    font-size: 1.4rem;
    line-height: 1.5;
}

.post-template .gh-content {
    color: var(--ccd-reading-ink);
    font-size: clamp(1.8rem, 1.5vw, 2rem);
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.post-template .gh-content > :is(h2, h3, h4),
.post-template .gh-content details :is(h2, h3, h4) {
    color: var(--ccd-reading-ink);
    line-height: 1.3;
    text-wrap: pretty;
}

.post-template .gh-content > h2 {
    margin-top: 2.6em;
    padding-top: 1em;
    border-top: 1px solid var(--ccd-reading-rule);
    font-size: clamp(2.5rem, 3vw, 3.2rem);
}

.post-template .gh-content h3 { font-size: clamp(2.1rem, 2.4vw, 2.5rem); }
.post-template .gh-content :is(h2, h3, h4, [id]) { scroll-margin-top: 100px; }
.post-template .gh-content :is(p, li) { line-height: inherit; }
.post-template .gh-content li + li { margin-top: 0.65em; }
.post-template .gh-content a {
    color: var(--ccd-reading-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
.post-template .gh-content a:hover { text-decoration-thickness: 2px; }
.post-template .gh-content img { max-width: 100%; height: auto; }
.post-template .gh-content pre { max-width: 100%; overflow-x: auto; }

/* Retain individual native disclosures and their original open/closed state. */
.post-template .gh-content details {
    min-width: 0;
    margin-block: 1em;
    border: 1px solid var(--ccd-reading-rule);
    border-radius: 3px;
    background: #fff;
    font-size: 1.7rem;
    line-height: 1.65;
}
.post-template .gh-content details > summary {
    padding: 16px 18px;
    color: var(--ccd-reading-ink);
    background: #f5f8f8;
    cursor: pointer;
    font-size: 1.7rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.post-template .gh-content details > summary::marker { color: var(--ccd-reading-link); }
.post-template .gh-content details[open] > summary { border-bottom: 1px solid var(--ccd-reading-rule); }
.post-template .gh-content details > :not(summary) { margin: 18px; }
.post-template .gh-content details > :is(ul, ol) { padding-left: 1.2em; }

.ccd-article-toc {
    width: min(760px, calc(100% - 48px));
    margin: 32px auto 0;
    border-block: 1px solid var(--ccd-reading-rule);
    color: var(--ccd-reading-ink);
    font-family: var(--font-sans, sans-serif);
    font-size: 1.5rem;
    line-height: 1.5;
}
.ccd-article-toc summary { min-height: 48px; padding: 14px 0; font-weight: 600; cursor: pointer; }
.ccd-article-toc ol { display: grid; gap: 8px; padding: 0 0 20px 22px; margin: 0; }
.ccd-article-toc a { display: inline-block; padding-block: 4px; color: var(--ccd-reading-link); text-decoration: underline; text-underline-offset: 3px; }
.ccd-table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; }
.post-template .gh-content .ccd-table-scroll table { display: table; margin: 0; font-size: 1.5rem; }
.post-template .gh-content .ccd-table-scroll :is(th, td) { min-width: 120px; padding: 12px; vertical-align: top; }

.post-template :is(a, button, input, summary, [tabindex]):focus-visible {
    outline: 3px solid #075e68;
    outline-offset: 4px;
}
.post-template .ccd-issue-hero { color: var(--ccd-reading-ink); background: #f5f8f8; border-bottom: 1px solid var(--ccd-reading-rule); }
.post-template .ccd-issue-date { color: var(--ccd-reading-link); }
.post-template .ccd-issue-hero-inner { min-height: 0; }

@media (max-width: 600px) {
    .post-template .gh-content { --gap: 20px; }
    .post-template .gh-article-title { font-size: 3.4rem; }
    .post-template .gh-meta-share { gap: 16px; flex-wrap: wrap; }
    .post-template .gh-content details > summary { padding: 14px; }
    .post-template .gh-content details > :not(summary) { margin: 14px; }
    .post-template .gh-content details details { margin-inline: 10px; }
    .ccd-article-toc { width: calc(100% - 40px); }
}

@media (prefers-reduced-motion: reduce) {
    .post-template *, .post-template *::before, .post-template *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .ccd-article-toc { display: none; }
    .ccd-table-scroll { overflow: visible; }
}
