/* The Survivor's Guide layer, loaded after Source's built/screen.css.
   Same palette and type as clinic.survivors-guide.com (site/public/assets/site.css): oat paper,
   white cards, pine ink, one coral accent. The signature is the clinic's date card: pine panels
   with big coral numerals and highlights. Source sets html to 62.5%, so 1rem = 10px here. */

:root {
    --paper: #f2efe9; --card: #ffffff; --ink: #1c2622; --muted: #56625c;
    --teal: #24463d; --accent: #cf4329; --accent-ink: #a8361f; --on-accent: #ffffff;
    --pine: #1f3a33; --pine-deep: #172d27; --pine-line: #345148; --on-pine: #f2efe9; --on-pine-muted: #b9c6bf;
    --accent-light: #ff7a5c;
    --line: #ddd7cc; --tint: #e7ece6;
    --shadow: 0 1px 2px rgba(28, 38, 34, .06), 0 14px 34px -20px rgba(28, 38, 34, .28);
    --f-display: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

    /* Source's own variables, pointed at ours */
    --background-color: var(--paper);
    --color-darker-gray: var(--ink);
    --color-primary-text: var(--ink);
    --color-secondary-text: var(--muted);
    --color-border: var(--line);
    --color-lighter-gray: var(--tint);
    --font-sans: var(--f-body);
    --font-serif: var(--f-display);
    --font-serif-alt: var(--f-display);
    --gh-font-heading: var(--f-display);
    --gh-font-body: var(--f-body);
    --ghost-accent-color: var(--accent);
    --container-width: 1180px;
    --content-font-size: 1.9rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #121a17; --card: #1a2420; --ink: #ecefea; --muted: #a9b5ae;
        --teal: #8fc4b1; --accent: #ff7a5c; --accent-ink: #ff9c80; --on-accent: #1a0f0b;
        /* Pine stays lighter than the dark paper so the panels still read as panels */
        --pine: #1d342e; --pine-deep: #15261f; --pine-line: #2f4a42; --on-pine: #ecefea; --on-pine-muted: #a9b5ae;
        --line: #2c3a34; --tint: #1f2b26;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -20px rgba(0, 0, 0, .7);
        color-scheme: dark;
    }
}

/* ---------- Base ---------- */
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); }
.is-title, h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.01em; text-wrap: balance; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent-light); color: #1a0f0b; }

.gh-button {
    background: var(--accent); color: var(--on-accent); border-radius: 999px;
    font-family: var(--f-body); font-weight: 700;
    transition: transform .16s cubic-bezier(0.23, 1, 0.32, 1), background-color .16s;
}
.gh-button:hover { background: var(--accent-ink); opacity: 1; }
.gh-button:active { transform: scale(.97); }

/* ---------- Navigation: a pine bar ---------- */
.gh-navigation { background: var(--pine); color: var(--on-pine); height: 84px; }
.gh-navigation a, .gh-navigation .gh-icon-button { color: var(--on-pine); }
.gh-navigation-logo { font-family: var(--f-display); font-size: 2.3rem; font-weight: 400; letter-spacing: -0.01em; }
.gh-navigation-menu .nav a { opacity: .86; }
.gh-navigation-menu .nav a:hover, .gh-navigation-members a:not(.gh-button):hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--accent-light); }
.gh-navigation .gh-button { background: var(--accent); color: var(--on-accent); }
.gh-navigation-actions { background: transparent; }
@media (max-width: 767px) {
    .gh-navigation.is-open, .gh-navigation.is-open .gh-navigation-inner { background: var(--pine); }
    .gh-navigation .gh-navigation-actions { background: var(--pine); }
}

/* ---------- Homepage hero: the pine panel with the clinic card ---------- */
.gh-header.is-classic {
    background: var(--pine); color: var(--on-pine);
    padding-block: clamp(48px, 7vw, 104px);
    position: relative; overflow: hidden;
}
/* A quiet sunburst in the corner, like the clinic's printed-poster feel */
.gh-header.is-classic::after {
    content: ""; position: absolute; inset: auto -180px -260px auto; width: 620px; height: 620px; border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgb(255 122 92 / .07) 0 6deg, transparent 6deg 18deg);
    pointer-events: none;
}
.gh-header.is-classic .gh-header-inner { max-width: var(--container-width); text-align: left; align-items: stretch; position: relative; z-index: 1; }
.sg-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.sg-eyebrow, .sg-clinic-label {
    font-size: 1.3rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-light); margin: 0;
}
.gh-header.is-classic .gh-header-title {
    font-size: clamp(3.4rem, 4.6vw, 5.8rem); line-height: 1.06; letter-spacing: -0.015em; color: var(--on-pine); margin-top: 16px;
}
.sg-hero-sub { font-size: clamp(1.8rem, 1.6vw, 2.1rem); color: var(--on-pine-muted); max-width: 46ch; margin-top: 20px; text-wrap: pretty; }
.sg-hero .gh-form { margin-top: 32px; background: var(--card); border-radius: 999px; max-width: 520px; }
.sg-hero .gh-form-input, .gh-footer .gh-form-input { color: var(--ink); }
.sg-hero .gh-form-input::placeholder, .gh-footer .gh-form-input::placeholder { color: var(--muted); opacity: 1; }
.sg-hero-note { margin-top: 12px; font-size: 1.4rem; color: var(--on-pine-muted); }
.gh-header.is-classic:not(.has-image) + .gh-featured,
.gh-header.is-classic:not(.has-image) + .gh-container { margin-top: clamp(48px, 6vw, 80px); }

/* ---------- The clinic card (the "5") ---------- */
.sg-clinic-card {
    display: grid; grid-template-columns: minmax(130px, .62fr) minmax(0, 1.38fr);
    background: var(--card); color: var(--ink); border-radius: 22px; overflow: hidden;
    box-shadow: 0 30px 60px -30px rgb(0 0 0 / .55); text-decoration: none;
    transition: transform .25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow .25s;
}
.sg-clinic-card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 36px 70px -30px rgb(0 0 0 / .6); }
.sg-stub {
    background: var(--pine-deep); color: var(--on-pine);
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 28px 16px; border-right: 2px dashed var(--pine-line);
}
.sg-stub-dow, .sg-stub-mon { font-size: 1.25rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.sg-stub-day { font-family: var(--f-display); font-size: clamp(7rem, 9vw, 10.5rem); line-height: 1; color: var(--accent-light); margin: 4px 0 10px; }
.sg-clinic-body { display: grid; gap: 10px; align-content: center; padding: clamp(22px, 2.6vw, 34px); }
.sg-clinic-card .sg-clinic-label { color: var(--accent-ink); }
.sg-clinic-title { font-family: var(--f-display); font-size: clamp(2.1rem, 1.9vw, 2.6rem); line-height: 1.15; }
.sg-clinic-text { font-size: 1.6rem; line-height: 1.5; color: var(--muted); }
.sg-clinic-cta { font-weight: 700; font-size: 1.6rem; color: var(--accent-ink); margin-top: 4px; }
.sg-clinic-card:hover .sg-clinic-cta { text-decoration: underline; text-underline-offset: 4px; }

/* Under each post: the same card on a full-width pine band */
.sg-panel { background: var(--pine); padding-block: clamp(48px, 7vw, 88px); margin-top: clamp(56px, 8vw, 96px); }
.sg-panel-inner { max-width: 820px; }
.sg-panel + .gh-container { margin-top: clamp(56px, 8vw, 96px); }

/* ---------- Post feed ---------- */
.gh-container-title {
    font-family: var(--f-body); font-size: 1.3rem; font-weight: 700; letter-spacing: .16em; color: var(--accent-ink);
    border-bottom: 2px solid var(--ink);
}
.gh-container.is-grid .gh-card, .gh-container.is-list .gh-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.gh-container.is-grid .gh-card-link { padding-bottom: 22px; }
.gh-container.is-grid .gh-card-wrapper { padding-inline: 22px; }
.gh-container.is-grid .gh-card-image { margin-bottom: 0; border-radius: 0; }
.gh-container.is-grid .gh-card-wrapper:first-child, .gh-container.is-grid .no-image .gh-card-wrapper { padding-top: 22px; }
.gh-container.is-list .gh-card-link { padding: 22px; }
.gh-card-tag, .gh-article-tag { color: var(--accent-ink); font-weight: 700; letter-spacing: .12em; }
.gh-card-title { font-family: var(--f-display); font-weight: 400; font-size: calc(2.2rem * var(--factor, 1)); line-height: 1.2; }
.gh-card-excerpt { color: var(--muted); }
.gh-card-meta { color: var(--muted); }
.gh-card-link:hover .gh-card-title { color: var(--accent-ink); opacity: 1; }
.gh-card-link:hover { opacity: 1; }

/* Featured posts sit on a pine strip */
.gh-featured { background: var(--pine); color: var(--on-pine); border-radius: 22px; padding: 28px; }
.gh-featured .gh-featured-title { color: var(--accent-light); border-color: var(--pine-line); }
.gh-featured .gh-card-title { color: var(--on-pine); }

/* ---------- Article ---------- */
.gh-article-header { margin-top: clamp(40px, 6vw, 80px); }
.gh-article-title { font-size: clamp(3.6rem, 4.4vw, 5.6rem); line-height: 1.08; letter-spacing: -0.015em; }
.gh-article-excerpt { color: var(--muted); font-size: clamp(1.9rem, 1.6vw, 2.2rem); line-height: 1.45; }
.gh-article-author-name, .gh-article-meta-content { color: var(--muted); }
.gh-content { line-height: 1.7; }
.gh-content > h2 { font-size: clamp(2.6rem, 2.4vw, 3.2rem); margin-top: 1.7em; }
.gh-content > h3 { font-size: 2.3rem; margin-top: 1.5em; }
.gh-content a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gh-content a:hover { text-decoration-thickness: 2px; }
.gh-content strong { font-weight: 700; }
.gh-content hr {
    border: 0; height: 18px; width: 100%; background: none; position: relative; overflow: visible;
}
.gh-content hr::after {
    content: "\2726"; position: absolute; inset: 0; text-align: center; color: var(--accent); font-size: 1.8rem; line-height: 18px;
}

/* Blockquotes become pine panels with a big coral quote mark */
.gh-content blockquote:not([class]),
.gh-content blockquote.kg-blockquote-alt {
    position: relative; background: var(--pine); color: var(--on-pine);
    border: 0; border-radius: 18px; padding: 28px 30px 28px 76px;
    font-family: var(--f-display); font-style: normal; font-size: clamp(2rem, 1.8vw, 2.3rem); line-height: 1.4; text-align: left;
}
.gh-content blockquote:not([class])::before,
.gh-content blockquote.kg-blockquote-alt::before {
    content: "\201C"; position: absolute; left: 22px; top: 6px;
    font-family: var(--f-display); font-size: 7.2rem; line-height: 1; color: var(--accent-light);
}
.gh-content blockquote a { color: var(--accent-light); }

/* Callout cards: pine with the coral emoji slot */
.gh-content .kg-callout-card { border-radius: 18px; }
.gh-content .kg-callout-card-accent, .gh-content .kg-callout-card-green, .gh-content .kg-callout-card-grey {
    background: var(--pine); color: var(--on-pine);
}
.gh-content .kg-callout-card-accent a, .gh-content .kg-callout-card-green a { color: var(--accent-light); }
.gh-content .kg-button-card a.kg-btn, .gh-content .kg-button-card a.kg-btn-accent { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-weight: 700; }
.gh-content .kg-bookmark-card a.kg-bookmark-container { background: var(--card); border-color: var(--line); border-radius: 14px; }

/* Code: tinted, never black slabs */
.gh-content :not(pre) > code { background: var(--tint); color: var(--ink); border-radius: 5px; padding: .1em .35em; font-size: .9em; }
.gh-content pre { background: var(--pine-deep); color: var(--on-pine); border-radius: 14px; }

.gh-content table:not(.gist table) { font-family: var(--f-body); }
.gh-content figcaption { color: var(--muted); }

/* ---------- Footer: pine, with the signup up top ---------- */
.gh-footer { background: var(--pine); color: var(--on-pine); margin-top: 0; padding-block: clamp(56px, 8vw, 96px) 32px; }
.gh-main + .gh-footer, .gh-container + .gh-footer, .gh-article + .gh-footer { margin-top: clamp(64px, 8vw, 120px); }
.gh-footer .gh-footer-signup { margin-bottom: clamp(56px, 7vw, 88px); }
.gh-footer-signup-header { color: var(--on-pine); font-size: clamp(3rem, 3.4vw, 4.2rem); }
.gh-footer-signup-subhead { color: var(--on-pine-muted); max-width: 52ch; }
.gh-footer .gh-form { background: var(--card); border-radius: 999px; }
.gh-footer .gh-form-input { color: var(--ink); }
.gh-footer-bar { border-top: 1px solid var(--pine-line); color: var(--on-pine-muted); }
.gh-footer-logo { font-family: var(--f-display); color: var(--on-pine); font-weight: 400; }
.gh-footer a { color: var(--on-pine); }
.gh-footer-copyright a { color: var(--on-pine-muted); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .sg-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .sg-clinic-card { grid-template-columns: minmax(0, 1fr); }
    .sg-stub { flex-direction: row; gap: 14px; justify-content: flex-start; padding: 16px 20px; border-right: 0; border-bottom: 2px dashed var(--pine-line); }
    .sg-stub-day { font-size: 5.2rem; margin: 0; }
    .gh-content blockquote:not([class]), .gh-content blockquote.kg-blockquote-alt { padding: 56px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .sg-clinic-card, .gh-button { transition: none; }
    .sg-clinic-card:hover { transform: none; }
}
