/* China Pharma Desk overrides on Headline (see CPD_UPSTREAM.md) */

:root {
    --font-sans: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", Times, serif;
    --cpd-navy: #0b3d5c;
    --cpd-teal: #0f766e;
    --cpd-ink: #1a1a1a;
    --cpd-muted: #5c6570;
    --cpd-rule: #e5e7eb;
    --cpd-content-measure: 42rem;
}

/* Typography: news desk, not generic blog */
body {
    color: var(--cpd-ink);
}

.gh-head-menu .nav,
.gh-head-link,
.gh-head-btn,
.gh-card-footer,
.gh-article-meta,
.gh-article-tag,
.gh-article-topic,
.gh-topic-name,
.gh-pagehead-title {
    font-family: var(--font-sans);
}

.has-serif-body .gh-content {
    font-family: var(--gh-font-body, var(--font-serif));
    font-size: 1.125rem; /* ~18px */
    line-height: 1.62;
}

.gh-content a {
    color: var(--cpd-navy);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

.gh-content a:hover {
    color: var(--cpd-teal);
}

/* Article chrome: kicker + dek + lead */
.gh-article-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gh-article-kicker .gh-article-tag {
    margin-bottom: 0;
    color: var(--ghost-accent-color, var(--cpd-navy));
}

.gh-article-kicker-sep {
    color: var(--cpd-muted);
    font-weight: 400;
}

.gh-article-topic {
    color: var(--cpd-muted);
    text-decoration: none;
}

.gh-article-topic:hover {
    color: var(--cpd-navy);
}

.gh-article-excerpt {
    max-width: 40rem;
    margin-top: 0.75rem;
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--cpd-muted);
}

.gh-article-sidebar {
    font-family: var(--font-sans);
}

.gh-author-name {
    font-size: 0.9375rem;
    letter-spacing: 0;
}

.gh-article-meta-inner {
    font-size: 0.8125rem;
    color: var(--cpd-muted);
}

.gh-article-meta-sep {
    display: inline-block;
    width: 0.25rem;
    height: 0.25rem;
    margin: 0 0.45rem;
    vertical-align: middle;
    background: var(--cpd-muted);
    border-radius: 50%;
}

/* Answer-First lead: subtle emphasis, not a callout card */
.gh-content > p:first-of-type {
    margin-bottom: 1.75em;
    padding-left: 0.9rem;
    border-left: 3px solid var(--ghost-accent-color, var(--cpd-navy));
    font-size: 1.05em;
    font-weight: 500;
    line-height: 1.55;
}

.gh-content h2 {
    margin-top: 2.25em;
    margin-bottom: 0.65em;
    font-family: var(--gh-font-heading, var(--font-sans));
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.gh-content h3 {
    margin-top: 1.75em;
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 650;
}

/* Wide tables: Ghost source=html often drops outer wrap divs; style table + optional wrap */
.gh-content .cpd-table-wrap,
.gh-content figure.cpd-table-wrap {
    width: 100%;
    max-width: min(68rem, 100vw - 2rem);
    margin: 1.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--cpd-rule);
    border-radius: 2px;
}

.gh-content table.cpd-table,
.gh-content table {
    width: 100%;
    min-width: 36rem;
    margin: 1.75rem 0;
    border-collapse: collapse;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.4;
    border: 1px solid var(--cpd-rule);
}

/* When Ghost keeps only the bare table, enable horizontal scroll on the table box */
.gh-content > table.cpd-table,
.gh-content table.cpd-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gh-content table.cpd-table thead,
.gh-content table.cpd-table tbody {
    display: table;
    width: 100%;
    min-width: 36rem;
}

.gh-content .cpd-table-wrap table {
    margin: 0;
    border: 0;
    display: table;
    min-width: 36rem;
    overflow: visible;
}

@media (min-width: 900px) {
    .gh-canvas .gh-content .cpd-table-wrap,
    .gh-canvas .gh-content > table.cpd-table {
        width: calc(100% + 8rem);
        max-width: none;
        margin-left: -4rem;
        margin-right: -4rem;
    }
}

.gh-content .cpd-table-wrap th,
.gh-content .cpd-table-wrap td,
.gh-content table th,
.gh-content table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--cpd-rule);
    text-align: left;
    vertical-align: top;
    white-space: normal;
}

.gh-content .cpd-table-wrap th,
.gh-content table th {
    background: #f8fafc;
    font-weight: 650;
    color: var(--cpd-navy);
}

.gh-content .cpd-table-wrap tr:last-child td,
.gh-content table tr:last-child td {
    border-bottom: 0;
}

.gh-content .cpd-table-wrap th:first-child,
.gh-content .cpd-table-wrap td:first-child,
.gh-content table.cpd-table th:first-child,
.gh-content table.cpd-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 1px 0 0 var(--cpd-rule);
}

.gh-content .cpd-table-wrap th:first-child,
.gh-content table.cpd-table th:first-child {
    background: #f8fafc;
    z-index: 2;
}

/* Related desk module */
.gh-read-next .gh-pagehead-title {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cpd-muted);
}

/* Homepage skim hierarchy */
.home-template .gh-topic-grid:first-of-type .gh-topic-name {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.home-template .gh-topic-grid:first-of-type .gh-card.large .gh-card-title {
    font-size: clamp(1.75rem, 2.5vw, 2.35rem);
}

.home-template .gh-topic-grid:first-of-type .gh-card:not(.large) .gh-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--cpd-muted);
}

.home-template .gh-topic-grid:first-of-type .gh-card-footer {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--cpd-muted);
}

.home-template .gh-topic-secondary {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--cpd-rule);
    opacity: 0.92;
}

.home-template .gh-topic-secondary .gh-topic-name {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--cpd-muted);
}

.home-template .gh-topic-secondary .gh-card-footer,
.home-template .gh-topic-list .gh-card-footer {
    display: none;
}

.home-template .gh-topic-list {
    margin-top: 1.5rem;
}

.home-template .gh-topic-minimal .gh-card-title {
    font-size: 0.98rem;
    font-weight: 550;
    line-height: 1.35;
}

.home-template .gh-head-menu .nav {
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

@media (max-width: 767px) {
    .gh-article-excerpt {
        font-size: 1.1rem;
    }

    .gh-content > p:first-of-type {
        padding-left: 0.7rem;
        font-size: 1.02em;
    }

    .gh-content .cpd-table-wrap {
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
        max-width: none;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}
