/* ==========================================================================
   RadOncToday — editorial theme
   ========================================================================== */

:root {
    --cream:       #F5F0E8;
    --cream-card:  #FDFBF6;
    --navy:        #1A2A4C;
    --navy-mid:    #2E4057;
    --terra:       #E05E23;
    --terra-dark:  #BE4D1A;
    --terra-pale:  #F7E4D8;
    --muted:       #6B7280;
    --muted-soft:  #8A8F99;
    --border:      #E2DBCE;
    --ink:         #2A3441;

    --font-serif: 'Fraunces', Georgia, serif;
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --maxw: 720px;
    --maxw-wide: 1080px;
}

* { box-sizing: border-box; }

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--cream);
    font-family: var(--font-sans);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main { flex: 1 0 auto; }

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(245, 240, 232, 0.92);
}

.site-header-inner {
    max-width: var(--maxw-wide);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo img { max-height: 52px; width: auto; }
.site-logo-text {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--navy);
    letter-spacing: -0.01em;
}

.site-nav { display: flex; align-items: center; }
.site-nav ul {
    display: flex;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav a {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
    border-bottom: 1px solid var(--border);
}
/* Masthead strip below the nav bar */
.site-masthead {
    border-top: 1px solid var(--border);
    padding: 0.55rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.site-masthead-eyebrow {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--terra);
}
.site-masthead-audience {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-soft);
}

.hero-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 3rem;
    text-align: center;
}
.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 300;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin: 0 0 1rem;
}
.hero-accent {
    color: var(--terra);
    font-style: italic;
}
.hero-sub {
    font-size: 1rem;
    color: var(--muted);
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.55;
}

.hero-signup {
    display: flex;
    gap: 0.5rem;
    max-width: 440px;
    margin: 0 auto;
}
.hero-signup-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background: var(--cream-card);
    color: var(--ink);
}
.hero-signup-input:focus {
    outline: none;
    border-color: var(--terra);
}
.hero-signup-btn {
    padding: 0.7rem 1.4rem;
    background: var(--terra);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}
.hero-signup-btn:hover { background: var(--terra-dark); }
.hero-signup-embed {
    max-width: 440px;
    margin: 0 auto;
    min-height: 58px;
}

.hero-signup-note {
    font-size: 0.75rem;
    color: var(--muted-soft);
    margin: 0.85rem 0 0;
}

/* Signup form state messages — Ghost adds .success/.error to the form */
.signup-success, .signup-error { display: none; }
.hero-signup.success ~ .hero-signup-note .signup-default,
.hero-signup.error ~ .hero-signup-note .signup-default { display: none; }
.hero-signup.success ~ .hero-signup-note .signup-success { display: inline; color: #2D6A32; }
.hero-signup.error ~ .hero-signup-note .signup-error { display: inline; color: var(--terra); }
.hero-signup.loading .hero-signup-btn { opacity: 0.6; pointer-events: none; }

/* ---------- Feed ---------- */
.feed-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.feed-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-soft);
    margin-bottom: 1.25rem;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------- Post card ---------- */
.post-card {
    background: var(--cream-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.post-card:hover {
    border-color: var(--terra);
    transform: translateY(-1px);
}
.post-card-link {
    display: block;
    padding: 1.4rem 1.5rem;
}
.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--navy);
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}
.post-card:hover .post-card-title { color: var(--terra); }
.post-card-excerpt {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 0.9rem;
}
.post-card-meta {
    font-size: 0.75rem;
    color: var(--muted-soft);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.post-card-dot { opacity: 0.5; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: 3px;
    background: #ECE7DD;
    color: var(--muted);
    line-height: 1.3;
}

/* Badge variants — matched by tag slug.
   Importance scale stays COLORED (worth-attention / high-relevance / practice-changing).
   Other descriptors use a neutral grey OUTLINE so they don't compete with the scale.
   Outline via inset box-shadow keeps badge size identical to filled badges. */
.badge--worth-attention      { background: #FEF3CD; color: #7A5C00; }
.badge--high-relevance       { background: var(--terra); color: #fff; }
.badge--practice-changing    { background: var(--navy); color: #fff; }

.badge--technical-relevance,
.badge--trial,
.badge--review,
.badge--preliminary,
.badge--conference-signal {
    background: transparent;
    color: var(--muted);
    box-shadow: inset 0 0 0 1px var(--border);
}

/* ---------- Article ---------- */
.article-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
}
.article-header { margin-bottom: 2rem; }
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}
.article-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin: 0 0 1rem;
}
.article-excerpt {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--muted);
    margin: 0 0 1.25rem;
}
.article-meta {
    font-size: 0.8rem;
    color: var(--muted-soft);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.article-dot { opacity: 0.5; }

.article-image {
    margin: 0 0 2.5rem;
    border-radius: 8px;
    overflow: hidden;
}
.article-image figcaption {
    font-size: 0.78rem;
    color: var(--muted-soft);
    text-align: center;
    padding-top: 0.6rem;
}

/* ---------- Article content (gh-content) ---------- */
.gh-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ink);
}
.gh-content > * { margin-top: 0; margin-bottom: 1.4rem; }
.gh-content h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--navy);
    line-height: 1.25;
    margin-top: 2.6rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}
.gh-content h3 {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--terra);
    margin-top: 2.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.gh-content p { margin: 0 0 1.4rem; }
.gh-content a {
    color: var(--terra);
    text-decoration: underline;
    text-decoration-color: var(--terra-pale);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s ease;
}
.gh-content a:hover { text-decoration-color: var(--terra); }
.gh-content strong { font-weight: 600; color: var(--navy); }
.gh-content ul, .gh-content ol { padding-left: 1.3rem; margin: 0 0 1.4rem; }
.gh-content li { margin-bottom: 0.6rem; padding-left: 0.3rem; }
.gh-content ul { list-style: none; padding-left: 0.2rem; }
.gh-content ul li {
    position: relative;
    padding-left: 1.4rem;
}
.gh-content ul li::before {
    content: "";
    position: absolute;
    left: 0.1rem;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--terra);
}
.gh-content blockquote {
    border-left: 3px solid var(--terra);
    padding-left: 1.2rem;
    margin: 0 0 1.4rem;
    font-style: italic;
    color: var(--muted);
}
.gh-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}
/* Source line — the muted paragraph right after the final divider */
.gh-content hr + p {
    font-size: 0.82rem;
    color: var(--muted-soft);
    font-style: italic;
    line-height: 1.55;
}
.gh-content hr + p a { font-style: normal; }
.gh-content figure { margin: 0 0 1.6rem; }
.gh-content figure img { border-radius: 6px; }

/* Koenig editor image widths (required by Ghost) */
.gh-content .kg-width-wide {
    width: 100vw;
    max-width: 85vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.gh-content .kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.gh-content .kg-width-full img {
    border-radius: 0;
}
.gh-content .kg-image {
    margin-left: auto;
    margin-right: auto;
}
.gh-content figcaption {
    font-size: 0.78rem;
    color: var(--muted-soft);
    text-align: center;
    padding-top: 0.5rem;
}
.gh-content code {
    background: #ECE7DD;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Callout / clinical takeaway box — use a Ghost "callout" card */
.gh-content .kg-callout-card {
    background: var(--terra-pale);
    border: none;
    border-left: 3px solid var(--terra);
    border-radius: 6px;
    padding: 1.3rem 1.5rem;
    margin: 0 0 1.6rem;
}
.gh-content .kg-callout-card .kg-callout-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--navy);
}
.gh-content .kg-callout-card-grey,
.gh-content .kg-callout-card-white {
    background: var(--cream);
}

/* ---------- Article footer ---------- */
.article-footer {
    max-width: var(--maxw);
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.article-share a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--terra);
}

/* ---------- Post CTA ---------- */
.post-cta {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
.post-cta-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-align: center;
}
.post-cta-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--navy);
    margin: 0 0 0.5rem;
}
.post-cta-text {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
}

/* ---------- Archive header ---------- */
.archive-header-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 3rem 1.5rem 1rem;
}
.archive-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 300;
    color: var(--navy);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}
.archive-desc {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.pagination a {
    color: var(--terra);
    font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
    flex-shrink: 0;
    background: var(--navy);
    color: rgba(255,255,255,0.6);
    margin-top: 3rem;
}
.site-footer-inner {
    max-width: var(--maxw-wide);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}
.site-footer-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: #fff;
    display: block;
}
.site-footer-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    display: block;
    margin-top: 0.3rem;
}
.site-footer-nav ul {
    display: flex;
    gap: 1.3rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}
.site-footer-nav a {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    transition: color 0.15s ease;
}
.site-footer-nav a:hover { color: #fff; }
.site-footer-copy {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    html { font-size: 16px; }
    .site-header-inner { padding: 0.7rem 1rem; gap: 1rem; }
    .site-nav ul { gap: 1rem; }
    .site-masthead { padding: 0.4rem 1rem 0.5rem; }
    .site-masthead-audience { display: none; }
    .hero-inner { padding: 2.5rem 1.25rem 2rem; }
    .hero-signup { flex-direction: column; }
    .hero-signup-btn { padding: 0.8rem; }
    .feed-inner { padding: 2rem 1rem 3rem; }
    .post-card-link { padding: 1.2rem 1.2rem; }
    .article-inner { padding: 2rem 1.25rem 1.5rem; }
}
