/* ==========================================================================
   Regeneration theme
   One stylesheet for both sites. Colors come from:
   - Ghost's Brand accent color  -> --ghost-accent-color (this site)
   - Theme setting "companion_color" -> --companion (the other site)
   ========================================================================== */

:root {
    --paper: #FBFAF5;
    --paper-2: #F3F1E7;
    --white: #FFFFFF;
    --ink: #15171A;
    --ink-2: #3D4046;
    --ink-3: #5C5F64;
    --rule: #DCDACB;
    --rule-strong: #B9B6A3;
    --sage: #D7DBA2;
    --sage-tint: #EEF0DA;
    --accent: var(--ghost-accent-color, #731A2C);

    --font-heading: var(--gh-font-heading, "Fraunces", Georgia, "Times New Roman", serif);
    --font-body: var(--gh-font-body, "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif);

    --radius: 10px;
    --radius-lg: 20px;
    --container: 1200px;
    --gutter: clamp(20px, 4vw, 32px);
    --section-pad: clamp(56px, 8vw, 88px);
}

/* --- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.15; margin: 0; }

p { margin: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-narrow { max-width: 760px; }

.skip-link {
    position: absolute; left: 12px; top: -100px; z-index: 100;
    background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Shared bits --------------------------------------------------------- */

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.8rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}

.section { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-title { font-size: clamp(2rem, 3.4vw, 2.8rem); margin-bottom: 16px; }
.section-lead { color: var(--ink-2); max-width: 640px; margin-bottom: 44px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.section-head .section-title { margin-bottom: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 28px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    font: inherit; font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--ink); color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--accent); color: var(--white); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: var(--paper); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-companion { background: var(--companion); color: var(--white); }
.btn-companion:hover { background: var(--ink); color: var(--white); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.text-link { font-weight: 700; }

/* The vine pattern. Only shows when the "Show vines" setting is on. */
.has-vines .vines {
    background-color: var(--paper);
    background-image: var(--vine-tile);
    background-size: 720px 480px;
    background-repeat: repeat;
}

/* --- Header -------------------------------------------------------------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); position: relative; z-index: 20; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 78px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-top { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; }
.brand-bottom { font-size: 0.8rem; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.brand-logo { display: block; max-height: 56px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.site-nav .nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.05rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav .nav a:hover, .site-nav .nav-current a { border-bottom-color: var(--accent); }

.companion-pill {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 1.5px solid var(--companion);
    border-radius: 999px;
    color: var(--companion);
    background: color-mix(in srgb, var(--companion) 10%, var(--paper));
    font-weight: 600; text-decoration: none;
}
.companion-pill:hover { background: var(--companion); color: var(--white); }

.menu-toggle {
    display: none;
    align-items: center; gap: 10px;
    min-height: 44px; padding: 0 14px;
    border: 1.5px solid var(--ink); border-radius: var(--radius);
    background: transparent; color: var(--ink);
    font: inherit; font-weight: 600; cursor: pointer;
}
.menu-toggle-bars { display: inline-flex; flex-direction: column; gap: 4px; }
.menu-toggle-bars span { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
    .menu-toggle { display: inline-flex; }
    .site-nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--paper); border-bottom: 1px solid var(--rule);
        padding: 8px var(--gutter) 20px;
        box-shadow: 0 12px 24px rgba(21, 23, 26, .08);
    }
    .site-nav.is-open { display: flex; }
    .site-nav .nav { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav .nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); }
    .site-nav .nav a:hover, .site-nav .nav-current a { border-bottom-color: var(--rule); color: var(--accent); }
    .site-nav-extras { padding-top: 16px; }
}

/* --- Footer -------------------------------------------------------------- */

.site-footer { background: var(--ink); color: #E9E7DD; font-size: 1rem; }
.site-footer a { color: #E9E7DD; }
.site-footer a:hover { color: var(--white); }
.site-footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 32px; }
.footer-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.4rem; color: var(--white); margin-bottom: 8px; }
.footer-muted { color: #C9C7BC; }
.footer-heading { font-weight: 700; color: var(--white); margin-bottom: 10px; }
.site-footer .nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer-bottom { border-top: 1px solid #34373C; padding-top: 20px; padding-bottom: 32px; font-size: .875rem; color: #A9A79D; }

/* --- Hero ---------------------------------------------------------------- */

.hero { border-bottom: 1px solid var(--rule); }
.hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: clamp(48px, 7vw, 72px); padding-bottom: clamp(48px, 7vw, 72px); }
.hero-copy { flex: 1 1 440px; min-width: 0; }
.has-vines .hero-copy { background: rgba(251, 250, 245, .88); padding: 8px 0; box-shadow: 0 0 0 16px rgba(251, 250, 245, .88); border-radius: 4px; }
.hero-title { font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: 1.08; margin-bottom: 20px; }
.hero-subhead { font-size: 1.25rem; color: var(--ink-2); max-width: 560px; margin-bottom: 32px; }
.hero-media { flex: 1 1 380px; min-width: 0; max-width: 480px; margin: 0; }
.hero-media img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 24px; border: 1.5px solid var(--ink); }
.hero-media.has-caption img { aspect-ratio: 4 / 5; object-position: center top; border-radius: 24px 24px 0 0; border-bottom: 0; }
.hero-caption { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 0 0 24px 24px; padding: 16px 22px; font-family: var(--font-heading); font-weight: 600; font-size: 1.2rem; }

/* --- Book feature -------------------------------------------------------- */

.book-feature { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.book-feature + .book-feature { margin-top: 64px; padding-top: 64px; border-top: 1px solid var(--rule); }
.book-cover { flex: 0 1 320px; min-width: 0; }
.book-cover img { display: block; width: 100%; border-radius: 12px; box-shadow: 0 15px 35px rgba(21, 23, 26, .15), 0 5px 15px rgba(21, 23, 26, .07); }
.book-cover-empty { aspect-ratio: 3 / 4; border: 2px dashed var(--rule-strong); border-radius: 12px; background: var(--paper-2); }
.book-body { flex: 1 1 440px; min-width: 0; }
.book-title { font-size: clamp(1.7rem, 2.6vw, 2.1rem); margin-bottom: 8px; }
.book-title a { color: inherit; text-decoration: none; }
.book-meta { font-weight: 600; color: var(--ink-2); margin-bottom: 20px; }
.book-body .btn-row { margin-top: 28px; }

/* --- Cards (blog, services, talks) --------------------------------------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 28px; }

.post-card {
    display: flex; flex-direction: column;
    background: var(--paper); border: 1px solid var(--rule); border-radius: 16px;
    overflow: hidden; color: var(--ink); text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.section-alt .post-card { background: var(--paper); }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(21, 23, 26, .06); }
.post-card-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--rule); }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 26px 28px 24px; flex: 1; }
.post-card-tag { font-size: .8rem; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.post-card-title { font-size: 1.5rem; line-height: 1.25; }
.post-card-excerpt { color: var(--ink-2); font-size: 1.05rem; }
.post-card-date { margin-top: auto; padding-top: 12px; font-size: .95rem; color: var(--ink-3); }

.service-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 28px; border: 1px solid var(--rule); border-radius: 16px; background: var(--white);
    color: var(--ink); text-decoration: none;
}
.service-card:hover { border-color: var(--accent); }
.service-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; color: var(--accent); }
.service-card h3 { font-size: 1.4rem; margin-top: 6px; }
.service-card p { color: var(--ink-2); font-size: 1.05rem; }

/* --- Companion panel (link to the other site) ---------------------------- */

.companion-panel { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.companion-panel-inner { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.companion-panel-image { flex: 0 1 300px; min-width: 0; width: 300px; aspect-ratio: 1 / 1; object-fit: cover; object-position: center top; border-radius: var(--radius-lg); border: 1.5px solid var(--ink); }
.companion-panel-card { flex: 1 1 420px; min-width: 0; background: rgba(251, 250, 245, .94); border-radius: 16px; padding: 28px 32px; }
.companion-panel .eyebrow { color: var(--companion); }
.companion-panel h2 { font-size: 1.9rem; line-height: 1.2; margin-bottom: 12px; }
.companion-panel p { color: var(--ink-2); margin-bottom: 20px; }
.companion-panel .eyebrow { margin-bottom: 8px; }

/* --- Speaking ------------------------------------------------------------ */

.speaking-inner { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.speaking-copy { flex: 1 1 460px; min-width: 0; }
.speaking-copy p { color: var(--ink-2); margin-bottom: 28px; }
.talk-list { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; list-style: none; margin: 0; padding: 0; }
.talk-card { display: block; padding: 22px 24px; border: 1px solid var(--rule); border-radius: 14px; background: var(--white); color: var(--ink); text-decoration: none; }
.talk-card:hover { border-color: var(--accent); }
.talk-label { font-size: .9rem; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.talk-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.3rem; }

/* --- Newsletter ---------------------------------------------------------- */

.newsletter-inner { max-width: 760px; margin: 0 auto; padding: 80px var(--gutter); text-align: center; }
.newsletter-card { background: rgba(251, 250, 245, .94); border: 1.5px solid var(--ink); border-radius: var(--radius-lg); padding: 44px clamp(20px, 4vw, 32px); }
.newsletter-card h2 { font-size: 2rem; margin-bottom: 10px; }
.newsletter-card > p { color: var(--ink-2); margin-bottom: 24px; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.newsletter-form input {
    flex: 1 1 260px; min-height: 52px; padding: 0 18px;
    border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--white);
    font: inherit; color: var(--ink);
}
.newsletter-form .message-success, .newsletter-form .message-error { display: none; flex-basis: 100%; font-weight: 600; }
.newsletter-form.success .message-success { display: block; color: #3F4C24; }
.newsletter-form.error .message-error { display: block; color: #8A1C1C; }
.newsletter-form.loading button { opacity: .7; }

/* --- CTA band ------------------------------------------------------------ */

.cta-band { background: var(--accent); color: var(--white); }
.cta-band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 56px; padding-bottom: 56px; }
.cta-band h2 { font-size: 1.9rem; margin-bottom: 4px; }
.cta-band p { opacity: .92; }

/* --- Page content from the Ghost editor ---------------------------------- */

.page-header { padding-top: clamp(48px, 7vw, 72px); padding-bottom: 32px; }
.page-title { font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.1; }
.page-excerpt { font-size: 1.25rem; color: var(--ink-2); margin-top: 16px; max-width: 680px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 20px; color: var(--ink-3); font-size: 1rem; }
.post-meta a { color: inherit; }
.feature-image { margin: 0 auto 48px; max-width: 1000px; padding: 0 var(--gutter); }
.feature-image img { display: block; width: 100%; border-radius: 16px; }
.feature-image figcaption { text-align: center; font-size: .95rem; color: var(--ink-3); margin-top: 10px; }

.gh-content { font-size: 1.15rem; line-height: 1.75; }
.gh-content > * + * { margin-top: 1.4em; }
.gh-content > h2 { font-size: 2rem; margin-top: 2.2em; }
.gh-content > h3 { font-size: 1.5rem; margin-top: 1.8em; }
.gh-content > h2 + *, .gh-content > h3 + * { margin-top: .7em; }
.gh-content blockquote { margin-left: 0; margin-right: 0; padding-left: 24px; border-left: 3px solid var(--accent); font-family: var(--font-heading); font-size: 1.3rem; font-style: italic; }
.gh-content blockquote.kg-blockquote-alt { border-left: 0; padding: 0; text-align: center; font-size: 1.6rem; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li + li { margin-top: .4em; }
.gh-content hr { border: 0; border-top: 1px solid var(--rule); margin: 3em 0; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content img { border-radius: 8px; }
.gh-content figcaption { text-align: center; font-size: .95rem; color: var(--ink-3); margin-top: 10px; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.gh-content th, .gh-content td { border-bottom: 1px solid var(--rule); padding: 10px 12px; text-align: left; }
.gh-content .kg-toggle-card { background: var(--white); }
.gh-content .kg-callout-card { border-radius: 14px; }

/* Ghost wide and full-width cards (required by Ghost) */
.kg-width-wide { position: relative; width: min(1000px, calc(100vw - 2 * var(--gutter))); left: 50%; transform: translateX(-50%); }
.kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.kg-width-full img { border-radius: 0; width: 100%; }
.kg-image { display: block; margin: 0 auto; }

.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }
.post-tags a { padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; font-size: .95rem; color: var(--ink-2); text-decoration: none; }
.post-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* Homepage block rendered from the page with slug "home" or "faq" */
.home-content .gh-content, .faq-content .gh-content { max-width: 880px; }

/* --- Book page template -------------------------------------------------- */

.book-page { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; padding-top: clamp(48px, 7vw, 72px); padding-bottom: var(--section-pad); }
.book-page .book-cover { flex: 0 1 380px; }
.book-page .book-body { flex: 1 1 460px; }
.book-page .page-title { margin-bottom: 8px; }

/* --- Archive pages (blog, tag, author) ----------------------------------- */

.archive-header { padding-top: clamp(48px, 7vw, 72px); padding-bottom: 40px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 56px; font-weight: 700; }
.pagination a { padding: 10px 20px; border: 1.5px solid var(--accent); border-radius: var(--radius); text-decoration: none; }
.pagination a:hover { background: var(--accent); color: var(--white); }
.page-number { color: var(--ink-2); }

.error-page { text-align: center; padding-top: 96px; padding-bottom: 120px; }
.error-code { font-family: var(--font-heading); font-size: 6rem; color: var(--accent); line-height: 1; }

/* --- Phones -------------------------------------------------------------- */

@media (max-width: 600px) {
    body { font-size: 1.0625rem; }
    .hero-inner { gap: 36px; }
    .btn { width: 100%; }
    .btn-row .btn { flex: 1 1 100%; }
    .companion-panel-image { width: 100%; flex-basis: 100%; }
    .book-feature, .book-page, .speaking-inner { gap: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
