/* ==========================================================================
   InstaMed — Editorial Premium layer
   Loaded on public (non-portal) pages only. The portal keeps its
   dashboard CSS untouched — these two stylesheets do not overlap because
   they sit on different surfaces.

   Aesthetic: European design publication. Paper-white, warm stone neutrals,
   softened charcoal, single muted editorial accent (brick). Display in a
   refined serif (Fraunces), body in a disciplined sans (Inter), mono kept
   for masthead-style metadata. Photography does the visible colour work;
   UI fills stay quiet.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. EDITORIAL TOKENS
   The marketing palette is its own world — separate from the portal's
   --primary / --gray-* scale. The original trust-blue is preserved here
   ONLY as --ed-cta, used on actionable elements (primary buttons, the
   masthead Sign-in link). Every other accent is editorial.
   -------------------------------------------------------------------------- */

:root {
    /* Surfaces */
    --ed-paper:        #FBF8F3;   /* page — warm paper */
    --ed-paper-deep:   #F5F0E5;   /* tonal break, image plate backing */
    --ed-stone:        #E8DFCE;   /* hairline borders, image frames */
    --ed-stone-deep:   #D6CAB1;   /* stronger rule under masthead */
    --ed-cream:        #F8F2E4;   /* margin notes, side rails */

    /* Ink — warm-tuned, not pure black */
    --ed-ink:          #1F1A14;   /* display titles */
    --ed-ink-body:     #2B251D;   /* body */
    --ed-ink-muted:    #6B5F4F;   /* metadata, captions */
    --ed-ink-quiet:    #948876;   /* sidenote, small caps */

    /* The single editorial accent — muted brick. Used sparingly. */
    --ed-accent:       #A6432E;
    --ed-accent-soft:  #C46A52;

    /* Brand CTA — the existing trust-blue, reserved for primary actions
       only. It DOES NOT colour body, headings, or decorative surfaces. */
    --ed-cta:          #1E88E5;
    --ed-cta-deep:     #1565C0;

    /* Rules — hairline dividers */
    --ed-rule:         rgba(31, 26, 20, 0.10);
    --ed-rule-soft:    rgba(31, 26, 20, 0.06);

    /* Type system */
    --ed-font-serif:  "Fraunces", "Tiempos Headline", "Iowan Old Style",
                       Georgia, "Times New Roman", serif;
    --ed-font-sans:   "Inter", system-ui, -apple-system, "Segoe UI",
                       Roboto, sans-serif;
    --ed-font-mono:   "JetBrains Mono", "SF Mono", "Roboto Mono",
                       ui-monospace, Menlo, monospace;

    /* Fluid display scale */
    --ed-fs-h1:       clamp(2.6rem, 5vw + 0.5rem, 5.4rem);
    --ed-fs-h2:       clamp(1.9rem, 2.5vw + 0.5rem, 3.0rem);
    --ed-fs-h3:       clamp(1.35rem, 1vw + 1rem, 1.65rem);
    --ed-fs-dek:      clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
    --ed-fs-body:     1.0625rem;
    --ed-fs-meta:     0.8125rem;
    --ed-fs-eyebrow:  0.7rem;

    /* Article measure */
    --ed-measure:     65ch;

    /* Spacing — generous, paper-margins */
    --ed-pad-page-y:  clamp(48px, 6vw, 96px);
    --ed-pad-page-x:  clamp(20px, 4vw, 56px);
    --ed-gap-chapter: clamp(72px, 9vw, 144px);
}

/* --------------------------------------------------------------------------
   2. BASE — only applied to non-portal pages
   The portal already has its own scoped reset (body.instamed-portal). We
   apply our base here under :not(.instamed-portal) so the portal stays
   untouched if both stylesheets ever load on the same page.
   -------------------------------------------------------------------------- */

body:not(.instamed-portal) {
    background: var(--ed-paper);
    color: var(--ed-ink-body);
    font-family: var(--ed-font-sans);
    font-size: var(--ed-fs-body);
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Neutralize the legacy .site-main grid on public pages — the editorial
   layout uses its own .ed-page container which header.php now wraps. */
body:not(.instamed-portal) .site-main {
    display: block;
    background: var(--ed-paper);
    min-height: auto;
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100%;
}

body:not(.instamed-portal) ::selection {
    background: var(--ed-accent);
    color: var(--ed-paper);
}

/* Reset old marketing scaffolding so editorial layout has clean ground.
   These are all classes from the old main.css that we're now overriding. */
body:not(.instamed-portal) .hero,
body:not(.instamed-portal) .stats,
body:not(.instamed-portal) .how-it-works,
body:not(.instamed-portal) .pricing,
body:not(.instamed-portal) .trust,
body:not(.instamed-portal) .cta {
    background: none;
    padding: 0;
}

/* --------------------------------------------------------------------------
   3. MASTHEAD (header)
   Slim publication chrome: thin rule under it, mono utility for issue
   stamp, restrained nav. No dropdowns, no decorated buttons.
   -------------------------------------------------------------------------- */

body:not(.instamed-portal) .navbar {
    background: var(--ed-paper);
    border-bottom: 1px solid var(--ed-rule);
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 40;
}

body:not(.instamed-portal) .nav-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px var(--ed-pad-page-x);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 32px;
}

body:not(.instamed-portal) .logo {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: var(--ed-ink);
}
body:not(.instamed-portal) .logo .logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--ed-ink);
    color: var(--ed-paper);
    border-radius: 3px;
    font-family: var(--ed-font-serif);
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
    align-self: center;
}
body:not(.instamed-portal) .logo .logo-word {
    font-family: var(--ed-font-serif);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--ed-ink);
}

body:not(.instamed-portal) .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
    align-items: baseline;
}
body:not(.instamed-portal) .nav-links a {
    font-size: 14px;
    font-weight: 400;
    color: var(--ed-ink-body);
    text-decoration: none;
    letter-spacing: 0.005em;
    position: relative;
    padding-bottom: 2px;
    transition: color 200ms ease;
}
body:not(.instamed-portal) .nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 240ms ease;
}
body:not(.instamed-portal) .nav-links a:hover {
    color: var(--ed-ink);
}
body:not(.instamed-portal) .nav-links a:hover::after {
    transform: scaleX(1);
}

/* Account / Sign-in link in the nav — gets a quiet utility treatment */
body:not(.instamed-portal) .nav-links .nav-cta a,
body:not(.instamed-portal) .nav-links a.nav-cta {
    color: var(--ed-cta);
    font-weight: 500;
}

body:not(.instamed-portal) .mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
@media (max-width: 760px) {
    body:not(.instamed-portal) .nav-links { display: none; }
    body:not(.instamed-portal) .mobile-toggle { display: inline-flex; flex-direction: column; gap: 4px; }
    body:not(.instamed-portal) .mobile-toggle span {
        display: block;
        width: 22px;
        height: 1.5px;
        background: var(--ed-ink);
    }
}

/* --------------------------------------------------------------------------
   4. PAGE FRAME
   A single editorial wrapper. No fluid full-bleed sections by default
   except for hero image plates which can break out via .ed-bleed.
   -------------------------------------------------------------------------- */

.ed-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--ed-pad-page-x);
}

.ed-bleed { margin-left: calc(-1 * var(--ed-pad-page-x)); margin-right: calc(-1 * var(--ed-pad-page-x)); }
@media (min-width: 1320px) {
    .ed-bleed { margin-left: calc(-1 * ((100vw - 1320px) / 2 + var(--ed-pad-page-x))); margin-right: calc(-1 * ((100vw - 1320px) / 2 + var(--ed-pad-page-x))); }
}

/* Chapter spacing */
.ed-chapter { margin-top: var(--ed-gap-chapter); }

/* --------------------------------------------------------------------------
   5. EDITORIAL HERO
   Image plate above, asymmetric split lead below (5/7). The first scene
   should read as a magazine opening, not a marketing hero.
   -------------------------------------------------------------------------- */

.ed-masthead {
    padding-top: clamp(40px, 6vw, 88px);
    padding-bottom: clamp(56px, 8vw, 120px);
}

.ed-eyebrow {
    font-family: var(--ed-font-mono);
    font-size: var(--ed-fs-eyebrow);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.ed-eyebrow::after {
    content: "";
    display: inline-block;
    width: 48px;
    height: 1px;
    background: var(--ed-stone-deep);
}

.ed-masthead h1,
.ed-display {
    font-family: var(--ed-font-serif);
    font-size: var(--ed-fs-h1);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.025em;
    color: var(--ed-ink);
    margin: 28px 0 0;
    font-feature-settings: "ss01", "ss02";
    max-width: 14ch;
}
.ed-masthead h1 em,
.ed-display em {
    font-style: italic;
    font-weight: 300;
    color: var(--ed-accent);
}

.ed-lead-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(28px, 5vw, 80px);
    align-items: end;
    margin-top: clamp(40px, 6vw, 72px);
}
@media (max-width: 860px) {
    .ed-lead-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

.ed-lead-dek {
    font-family: var(--ed-font-sans);
    font-size: var(--ed-fs-dek);
    line-height: 1.55;
    color: var(--ed-ink-body);
    max-width: 48ch;
}
.ed-lead-dek p { margin: 0 0 18px; }
.ed-lead-dek p:last-child { margin-bottom: 0; }

.ed-lead-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--ed-rule);
    font-family: var(--ed-font-mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
}
.ed-lead-meta .sep {
    display: inline-block;
    width: 6px;
    height: 1px;
    background: var(--ed-stone-deep);
}

/* --------------------------------------------------------------------------
   6. FIGURE / IMAGE PLATE
   The editorial workhorse. Used for hero plates, chapter interruptions,
   and image-text pairs. Falls back gracefully to a warm tinted plate
   when no image is set, so the layout still reads as designed.
   -------------------------------------------------------------------------- */

.ed-figure {
    position: relative;
    background: var(--ed-paper-deep);
    overflow: hidden;
    isolation: isolate;
}
.ed-figure::before {
    content: "";
    display: block;
    aspect-ratio: 16 / 10;
}
.ed-figure.is-portrait::before { aspect-ratio: 3 / 4; }
.ed-figure.is-tall::before     { aspect-ratio: 4 / 5; }
.ed-figure.is-square::before   { aspect-ratio: 1 / 1; }
.ed-figure.is-wide::before     { aspect-ratio: 21 / 9; }

.ed-figure > img,
.ed-figure > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Placeholder mode: when no image src is set, draw a warm tonal block
   with a tiny micro-typographic hint. This keeps the page editorial
   even before photography is uploaded. */
.ed-figure.is-placeholder {
    background:
        linear-gradient(135deg, var(--ed-paper-deep) 0%, var(--ed-stone) 100%);
}
.ed-figure.is-placeholder::after {
    content: attr(data-placeholder);
    position: absolute;
    bottom: 14px;
    left: 18px;
    font-family: var(--ed-font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
}

.ed-figure + .ed-caption {
    display: block;
    margin-top: 12px;
    font-family: var(--ed-font-sans);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ed-ink-muted);
    max-width: 56ch;
}
.ed-caption .ed-caption-num {
    font-family: var(--ed-font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    margin-right: 10px;
}

/* --------------------------------------------------------------------------
   7. ARTICLE LEAD
   The opening section after the hero. Drop-cap, generous measure,
   margin-quote pulled to the side.
   -------------------------------------------------------------------------- */

.ed-prose {
    max-width: var(--ed-measure);
    font-family: var(--ed-font-sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ed-ink-body);
}
.ed-prose > * + * { margin-top: 1.1em; }

.ed-prose p {
    margin: 0;
    text-wrap: pretty;
}

.ed-prose > p:first-of-type::first-letter {
    font-family: var(--ed-font-serif);
    font-weight: 400;
    float: left;
    font-size: 4.6em;
    line-height: 0.86;
    margin: 0.04em 0.1em 0 -0.05em;
    color: var(--ed-ink);
    font-feature-settings: "ss01";
}

.ed-prose h2 {
    font-family: var(--ed-font-serif);
    font-size: var(--ed-fs-h2);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.018em;
    color: var(--ed-ink);
    margin-top: 1.6em;
}
.ed-prose h3 {
    font-family: var(--ed-font-serif);
    font-size: var(--ed-fs-h3);
    font-weight: 500;
    line-height: 1.2;
    color: var(--ed-ink);
    margin-top: 1.6em;
}
.ed-prose a {
    color: var(--ed-ink);
    text-decoration: underline;
    text-decoration-color: var(--ed-stone-deep);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: text-decoration-color 200ms ease;
}
.ed-prose a:hover {
    text-decoration-color: var(--ed-accent);
}
.ed-prose strong { font-weight: 600; color: var(--ed-ink); }
.ed-prose em { font-style: italic; }

.ed-prose blockquote {
    margin: 1.8em 0;
    padding: 0 0 0 28px;
    border-left: 2px solid var(--ed-accent);
    font-family: var(--ed-font-serif);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.4;
    color: var(--ed-ink);
    max-width: 50ch;
}
.ed-prose ul,
.ed-prose ol {
    padding-left: 1.2em;
    margin: 1.1em 0;
}
.ed-prose li { margin: 0.4em 0; }

/* Article structure with margin-note rail */
.ed-article {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: clamp(40px, 5vw, 96px);
    align-items: start;
}
@media (max-width: 920px) {
    .ed-article {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

.ed-margin {
    padding-top: 8px;
    border-top: 1px solid var(--ed-rule);
}
.ed-margin-label {
    font-family: var(--ed-font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    margin-bottom: 16px;
}
.ed-margin-quote {
    font-family: var(--ed-font-serif);
    font-style: italic;
    font-size: 1.6rem;
    line-height: 1.25;
    color: var(--ed-ink);
    margin: 0;
    max-width: 22ch;
}
.ed-margin-quote-attribution {
    font-family: var(--ed-font-sans);
    font-style: normal;
    font-size: 13px;
    color: var(--ed-ink-muted);
    margin-top: 14px;
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   8. PROCESS / CHAPTER SEQUENCE
   Alternating image-text pairs. Numbered like book chapters.
   -------------------------------------------------------------------------- */

.ed-chapters {
    display: grid;
    gap: clamp(56px, 8vw, 112px);
}
.ed-chapters-head {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(28px, 5vw, 80px);
    align-items: end;
    margin-bottom: clamp(40px, 6vw, 72px);
}
@media (max-width: 860px) {
    .ed-chapters-head { grid-template-columns: 1fr; }
}

.ed-chapter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 88px);
    align-items: center;
}
.ed-chapter-row.is-reverse > .ed-figure { order: 2; }
@media (max-width: 760px) {
    .ed-chapter-row { grid-template-columns: 1fr; gap: 24px; }
    .ed-chapter-row.is-reverse > .ed-figure { order: 0; }
}

.ed-chapter-text { max-width: 38ch; }

.ed-chapter-num {
    font-family: var(--ed-font-mono);
    font-size: 13px;
    letter-spacing: 0.18em;
    color: var(--ed-ink-quiet);
    margin: 0;
}
.ed-chapter-row h3 {
    font-family: var(--ed-font-serif);
    font-size: clamp(1.6rem, 1.5vw + 1rem, 2.2rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.012em;
    color: var(--ed-ink);
    margin: 18px 0 16px;
}
.ed-chapter-row p {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ed-ink-body);
    margin: 0;
}

/* --------------------------------------------------------------------------
   9. DATA BAND (replaces stat cards)
   Numbers as typography, not as boxes. A horizontal slab with serif
   numerals and small-caps labels.
   -------------------------------------------------------------------------- */

.ed-data-band {
    border-top: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: clamp(40px, 5vw, 72px) 0;
}
@media (max-width: 760px) {
    .ed-data-band { grid-template-columns: 1fr; gap: 28px; }
}
.ed-data-cell { padding: 0 clamp(8px, 2vw, 32px); position: relative; }
.ed-data-cell + .ed-data-cell { border-left: 1px solid var(--ed-rule); }
@media (max-width: 760px) {
    .ed-data-cell + .ed-data-cell { border-left: none; border-top: 1px solid var(--ed-rule); padding-top: 28px; }
}

.ed-data-num {
    font-family: var(--ed-font-serif);
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.ed-data-num em {
    font-style: italic;
    font-weight: 300;
    color: var(--ed-accent);
}
.ed-data-label {
    font-family: var(--ed-font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    margin-top: 12px;
}
.ed-data-note {
    font-family: var(--ed-font-sans);
    font-size: 13.5px;
    color: var(--ed-ink-muted);
    margin-top: 10px;
    max-width: 28ch;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   10. SUBSCRIPTION / MEMBERSHIP
   Editorial pricing. Not a 3-card stack — a featured tier in a split
   lead plus a quiet table for the full plan grid.
   -------------------------------------------------------------------------- */

.ed-membership-lead {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(28px, 5vw, 80px);
    align-items: start;
    border-top: 1px solid var(--ed-rule);
    padding-top: clamp(40px, 6vw, 80px);
}
@media (max-width: 860px) {
    .ed-membership-lead { grid-template-columns: 1fr; gap: 24px; }
}
.ed-membership-lead h2 {
    font-family: var(--ed-font-serif);
    font-size: var(--ed-fs-h2);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.018em;
    color: var(--ed-ink);
    margin: 12px 0 0;
    max-width: 14ch;
}

.ed-plan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: clamp(40px, 5vw, 64px);
}
.ed-plan-table th,
.ed-plan-table td {
    padding: 22px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--ed-rule);
}
.ed-plan-table thead th {
    padding-top: 0;
    padding-bottom: 14px;
    font-family: var(--ed-font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    border-bottom: 1px solid var(--ed-stone-deep);
}
.ed-plan-table thead th:not(:first-child) { text-align: center; }
.ed-plan-table tbody th {
    font-family: var(--ed-font-serif);
    font-weight: 400;
    color: var(--ed-ink);
    width: 32%;
}
.ed-plan-table .ed-plan-name {
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.ed-plan-table .ed-plan-tagline {
    display: block;
    margin-top: 6px;
    font-family: var(--ed-font-sans);
    font-size: 13px;
    color: var(--ed-ink-muted);
    font-weight: 400;
}
.ed-plan-table tbody td {
    text-align: center;
    font-variant-numeric: tabular-nums lining-nums;
    font-size: 1.05rem;
    color: var(--ed-ink-body);
}
.ed-plan-table .ed-plan-price {
    font-family: var(--ed-font-serif);
    font-size: 1.4rem;
    color: var(--ed-ink);
    line-height: 1.1;
}
.ed-plan-table .ed-plan-price small {
    display: block;
    font-family: var(--ed-font-sans);
    font-size: 12px;
    color: var(--ed-ink-muted);
    margin-top: 4px;
    font-weight: 400;
}
.ed-plan-table tr.is-featured {
    background: var(--ed-cream);
}
.ed-plan-table tr.is-featured th {
    position: relative;
}
.ed-plan-table tr.is-featured th::before {
    content: "FEATURED";
    position: absolute;
    top: -10px;
    left: 16px;
    font-family: var(--ed-font-mono);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    color: var(--ed-accent);
    background: var(--ed-paper);
    padding: 0 8px;
}

/* --------------------------------------------------------------------------
   11. CLOSING CTA — a quiet editorial close, not a banner
   -------------------------------------------------------------------------- */

.ed-close {
    border-top: 1px solid var(--ed-stone-deep);
    padding: clamp(60px, 8vw, 112px) 0 clamp(60px, 8vw, 112px);
    text-align: center;
    margin-top: var(--ed-gap-chapter);
}
.ed-close-eyebrow { justify-content: center; display: inline-flex; }
.ed-close h2 {
    font-family: var(--ed-font-serif);
    font-size: clamp(2.2rem, 3vw + 0.8rem, 3.4rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    margin: 24px auto 0;
    max-width: 18ch;
}
.ed-close p {
    font-size: var(--ed-fs-dek);
    color: var(--ed-ink-muted);
    margin: 24px auto 0;
    max-width: 52ch;
    line-height: 1.55;
}
.ed-close .ed-cta-row {
    margin-top: 36px;
    display: inline-flex;
    align-items: center;
    gap: 18px;
}

/* --------------------------------------------------------------------------
   12. BUTTONS / LINKS
   Two action levels only: primary (filled CTA in trust blue, used very
   sparingly) and quiet (link-style with arrow). No three-button rows.
   -------------------------------------------------------------------------- */

.ed-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px 12px;
    font-family: var(--ed-font-sans);
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-decoration: none;
    color: var(--ed-paper);
    background: var(--ed-cta);
    border: 1px solid var(--ed-cta);
    border-radius: 2px;
    transition: background 180ms ease, transform 180ms ease;
}
.ed-btn:hover {
    background: var(--ed-cta-deep);
    color: var(--ed-paper);
    border-color: var(--ed-cta-deep);
}
.ed-btn svg { width: 14px; height: 14px; }

.ed-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ed-font-sans);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ed-ink);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--ed-ink);
    transition: color 200ms ease, border-color 200ms ease;
}
.ed-link svg { width: 14px; height: 14px; transition: transform 200ms ease; }
.ed-link:hover {
    color: var(--ed-accent);
    border-color: var(--ed-accent);
}
.ed-link:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   13. SINGLE POST (article view)
   The editorial style on its native ground.
   -------------------------------------------------------------------------- */

body:not(.instamed-portal) .single-post {
    padding: 0;
}
body:not(.instamed-portal) .single-post .container,
body:not(.instamed-portal) .single-post .container-narrow {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--ed-pad-page-x);
}
body:not(.instamed-portal) .post-header {
    padding-top: clamp(40px, 6vw, 88px);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ed-rule);
    margin-bottom: clamp(32px, 4vw, 56px);
}
body:not(.instamed-portal) .post-header .post-meta {
    font-family: var(--ed-font-mono);
    font-size: 11.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    display: flex;
    gap: 18px;
    margin-bottom: 24px;
}
body:not(.instamed-portal) .post-title {
    font-family: var(--ed-font-serif);
    font-size: var(--ed-fs-h1);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--ed-ink);
    margin: 0;
    max-width: 18ch;
}
body:not(.instamed-portal) .post-thumbnail {
    margin: clamp(24px, 4vw, 56px) 0;
}
body:not(.instamed-portal) .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}
body:not(.instamed-portal) .post-body {
    max-width: var(--ed-measure);
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--ed-ink-body);
}
body:not(.instamed-portal) .post-body > * + * { margin-top: 1.2em; }
body:not(.instamed-portal) .post-body h2,
body:not(.instamed-portal) .post-body h3 {
    font-family: var(--ed-font-serif);
    font-weight: 400;
    color: var(--ed-ink);
    line-height: 1.1;
    margin-top: 1.8em;
}
body:not(.instamed-portal) .post-body h2 { font-size: var(--ed-fs-h2); letter-spacing: -0.018em; }
body:not(.instamed-portal) .post-body h3 { font-size: var(--ed-fs-h3); }

body:not(.instamed-portal) .post-body > p:first-of-type::first-letter {
    font-family: var(--ed-font-serif);
    font-weight: 400;
    float: left;
    font-size: 4.6em;
    line-height: 0.86;
    margin: 0.04em 0.1em 0 -0.05em;
    color: var(--ed-ink);
}

/* --------------------------------------------------------------------------
   14. FOOTER — publication colophon
   -------------------------------------------------------------------------- */

body:not(.instamed-portal) .footer {
    margin-top: var(--ed-gap-chapter);
    border-top: 1px solid var(--ed-stone-deep);
    background: var(--ed-paper);
    padding: clamp(48px, 6vw, 88px) 0 32px;
    color: var(--ed-ink-body);
}
body:not(.instamed-portal) .footer-grid {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--ed-pad-page-x);
    display: grid;
    grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr));
    gap: clamp(24px, 4vw, 56px);
    align-items: start;
}
@media (max-width: 760px) {
    body:not(.instamed-portal) .footer-grid { grid-template-columns: 1fr 1fr; }
}

body:not(.instamed-portal) .footer-brand h3 {
    font-family: var(--ed-font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--ed-ink);
    margin: 0 0 8px;
    letter-spacing: -0.005em;
}
body:not(.instamed-portal) .footer-brand p {
    font-size: 14.5px;
    color: var(--ed-ink-muted);
    max-width: 38ch;
    margin: 0;
    line-height: 1.55;
}
body:not(.instamed-portal) .footer-section h4,
body:not(.instamed-portal) .footer-section .widget-title {
    font-family: var(--ed-font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
    margin: 0 0 16px;
}
body:not(.instamed-portal) .footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
body:not(.instamed-portal) .footer-section li { margin: 8px 0; }
body:not(.instamed-portal) .footer-section a {
    font-size: 14px;
    color: var(--ed-ink-body);
    text-decoration: none;
    transition: color 200ms ease;
}
body:not(.instamed-portal) .footer-section a:hover { color: var(--ed-accent); }

/* Trust ribbon — small caps row, no emoji */
body:not(.instamed-portal) .footer-trust {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
body:not(.instamed-portal) .footer-trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ed-font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
}
body:not(.instamed-portal) .footer-trust svg {
    width: 12px;
    height: 12px;
    color: var(--ed-ink-muted);
}

/* Colophon — publication-style imprint at the very bottom */
body:not(.instamed-portal) .ed-colophon {
    max-width: 1320px;
    margin: clamp(48px, 5vw, 72px) auto 0;
    padding: 24px var(--ed-pad-page-x) 0;
    border-top: 1px solid var(--ed-rule);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    font-family: var(--ed-font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-ink-quiet);
}

/* --------------------------------------------------------------------------
   15. ENTRY MOTION — near-silent
   Motion intensity 2 (per the skill). Hero fade-up on first paint,
   one IntersectionObserver fade-in for sections marked .ed-reveal.
   No scroll choreography, no parallax, no decorative loops.
   -------------------------------------------------------------------------- */

.ed-reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ed-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .ed-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .ed-link svg { transition: none !important; }
    body:not(.instamed-portal) .nav-links a::after { transition: none !important; }
}
