/*
 * TorlyAI Editorial Header + Footer
 * Ported from torly.ai (Next.js). Matches TORLY_DESIGN_GUIDELINES.md §2 tokens,
 * §3 typography, §5 nav/footer, §7 logo.
 *
 * Scoped to the .torly-editorial wrapper so it never bleeds into legacy page
 * content on the blog. Header + footer elements are wrapped in .torly-editorial
 * in header.php / footer.php.
 */

/* ── Tokens (mirror of torlyAI app/globals.css) ─────────────────────────── */
.torly-editorial {
    /* Surface */
    --ed-bg:        #F5F1EA;
    --ed-bg-2:      #EFEAE1;
    --ed-card:      #FDFBF6;
    --ed-chip:      #E8E1D4;

    /* Ink */
    --ed-ink:       #161411;
    --ed-ink-2:     #3A342D;
    --ed-muted:     #8B8275;

    /* Lines */
    --ed-line:      #D9D1C2;
    --ed-line-2:    #E4DCCC;

    /* Accent */
    --ed-accent:    #1F7A4D;
    --ed-accent-2:  #10B981;
}

/* ── Font utility classes (match torly.ai .serif / .mono) ───────────────── */
.torly-editorial .ed-serif,
.torly-editorial .ed-serif * {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.torly-editorial .ed-italic-serif {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 400;
}
.torly-editorial .ed-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 400;
}
.torly-editorial,
.torly-editorial p,
.torly-editorial a,
.torly-editorial li {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ─────────────────────────────────────────────────────────────────────────
 * HEADER
 * Fixed nav bar, ~68px tall, bone bg with backdrop blur on scroll.
 * Logo tile + stacked Wordmark(Torly.AI, emerald ".", italic emerald "AI") + slogan.
 * ───────────────────────────────────────────────────────────────────────── */
.torly-editorial-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(245, 241, 234, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    padding-top: env(safe-area-inset-top);
    transition: border-color 200ms ease, background 200ms ease;
}
.torly-editorial-header.is-scrolled {
    border-bottom-color: var(--ed-line-2);
}
.torly-editorial-header .ed-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.torly-editorial-header .ed-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ed-ink);
}
@media (min-width: 640px) {
    .torly-editorial-header .ed-brand { gap: 12px; }
}
.torly-editorial-header .ed-logo-tile {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-block;
}
.torly-editorial-header .ed-logo-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.torly-editorial-header .ed-brand-stack {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.torly-editorial-header .ed-wordmark {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
}
.torly-editorial-header .ed-wordmark .ed-accent-dot { color: var(--ed-accent); }
.torly-editorial-header .ed-wordmark .ed-accent-ai {
    color: var(--ed-accent);
    font-style: italic;
}
.torly-editorial-header .ed-slogan {
    display: none;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ed-muted);
    margin-top: 6px;
}
@media (min-width: 640px) {
    .torly-editorial-header .ed-slogan { display: block; }
}
.torly-editorial-header .ed-nav {
    display: none;
}
@media (min-width: 1024px) {
    .torly-editorial-header .ed-nav {
        display: flex;
        align-items: center;
        gap: 32px;
    }
}
.torly-editorial-header .ed-nav a {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ed-ink-2);
    text-decoration: none;
    transition: color 160ms ease;
}
.torly-editorial-header .ed-nav a:hover { color: var(--ed-ink); }
.torly-editorial-header .ed-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.torly-editorial-header .ed-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ed-ink);
    color: var(--ed-bg);
    border: none;
    padding: 10px 16px;
    border-radius: 999px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 180ms ease;
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.3);
}
.torly-editorial-header .ed-cta:hover { background: #0c0b09; }
.torly-editorial-header .ed-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--ed-line-2);
    border-radius: 10px;
    cursor: pointer;
    color: var(--ed-ink);
}
@media (min-width: 1024px) {
    .torly-editorial-header .ed-mobile-toggle { display: none; }
}
.torly-editorial-header .ed-mobile-toggle svg { width: 18px; height: 18px; }

/* Mobile drawer — only visible when .is-open is toggled on the header */
.torly-editorial-header .ed-mobile-drawer {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--ed-bg);
    border-top: 1px solid var(--ed-line-2);
    padding: 12px 28px 24px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
}
.torly-editorial-header.is-open .ed-mobile-drawer { display: block; }
.torly-editorial-header .ed-mobile-drawer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.torly-editorial-header .ed-mobile-drawer a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--ed-line-2);
    color: var(--ed-ink);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}
.torly-editorial-header .ed-mobile-drawer a.ed-cta {
    margin-top: 16px;
    border-bottom: none;
    background: var(--ed-ink);
    color: var(--ed-bg);
    border-radius: 999px;
    padding: 14px 18px;
    text-align: center;
}

/* Offset content below fixed header */
body.torly-editorial-active { padding-top: 68px; }

/* ─────────────────────────────────────────────────────────────────────────
 * FOOTER
 * Dark ink band with 4-column grid + bottom bar.
 * Matches components/marketing/Footer.tsx on torly.ai.
 * ───────────────────────────────────────────────────────────────────────── */
.torly-editorial-footer {
    background: var(--ed-ink);
    color: var(--ed-bg);
    border-top: 1px solid rgba(245, 241, 234, 0.18);
    padding: 80px 0 32px;
}
.torly-editorial-footer .ed-footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}
.torly-editorial-footer .ed-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(245, 241, 234, 0.18);
}
@media (min-width: 768px) {
    .torly-editorial-footer .ed-footer-grid {
        grid-template-columns: 1.3fr 1fr 1fr 1fr;
        gap: 48px;
    }
}
.torly-editorial-footer .ed-footer-brand { display: flex; flex-direction: column; gap: 20px; }
.torly-editorial-footer .ed-footer-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.torly-editorial-footer .ed-footer-brand-row img { width: 36px; height: 36px; object-fit: contain; }
.torly-editorial-footer .ed-footer-brand-stack { display: flex; flex-direction: column; line-height: 1; }
.torly-editorial-footer .ed-footer-wordmark {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--ed-bg);
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
}
.torly-editorial-footer .ed-footer-wordmark .ed-accent-dot { color: var(--ed-accent); }
.torly-editorial-footer .ed-footer-wordmark .ed-accent-ai { color: var(--ed-accent); font-style: italic; }
.torly-editorial-footer .ed-footer-caption {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(245, 241, 234, 0.6);
    margin-top: 6px;
}
.torly-editorial-footer .ed-footer-tagline {
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(245, 241, 234, 0.6);
    max-width: 260px;
    margin: 0;
}
.torly-editorial-footer .ed-footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.torly-editorial-footer .ed-footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(245, 241, 234, 0.2);
    color: rgba(245, 241, 234, 0.8);
    transition: color 160ms ease, border-color 160ms ease;
}
.torly-editorial-footer .ed-footer-socials a:hover {
    color: var(--ed-bg);
    border-color: rgba(245, 241, 234, 0.55);
}
.torly-editorial-footer .ed-footer-socials svg { width: 15px; height: 15px; }
.torly-editorial-footer .ed-footer-col h4 {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(245, 241, 234, 0.6);
    margin: 0 0 16px;
    font-weight: 500;
}
.torly-editorial-footer .ed-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.torly-editorial-footer .ed-footer-col li a {
    color: rgba(245, 241, 234, 0.85);
    text-decoration: none;
    font-size: 14px;
    transition: color 160ms ease;
}
.torly-editorial-footer .ed-footer-col li a:hover { color: var(--ed-bg); }

.torly-editorial-footer .ed-footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: rgba(245, 241, 234, 0.5);
}
@media (min-width: 768px) {
    .torly-editorial-footer .ed-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.torly-editorial-footer .ed-footer-bottom p { margin: 0; }

/* ─────────────────────────────────────────────────────────────────────────
 * ARTICLE / SINGLE-POST (editorial page template)
 * Ported from TORLY_DESIGN_GUIDELINES.md §11 archetype C:
 *   - Article hero: eyebrow + H1 + lede + author byline
 *   - One-column body max-width 680px, Inter 18px, line-height 1.75
 *   - Pull-quotes in serif italic, flush-left, no quote marks
 *   - Footnotes mono, smaller, at bottom
 *   - Related strip, 3 cards
 * Scoped to .torly-editorial-post so legacy post selectors don't leak in.
 * ───────────────────────────────────────────────────────────────────────── */
.torly-editorial-post {
    background: var(--ed-bg);
    color: var(--ed-ink);
    padding: 56px 0 24px;
}
.torly-editorial-post .ed-post-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.torly-editorial-post .ed-post-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--ed-line-2);
}
.torly-editorial-post .ed-post-eyebrow {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ed-accent);
    margin: 0 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.torly-editorial-post .ed-post-eyebrow .ed-dot {
    color: var(--ed-muted);
    font-weight: 400;
}
.torly-editorial-post .ed-post-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(36px, 4.2vw, 56px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    margin: 0 0 24px;
    padding-bottom: 0.3em; /* §3 guard for italic descenders */
}
.torly-editorial-post .ed-post-title em,
.torly-editorial-post .ed-post-title .ed-italic {
    font-style: italic;
    color: var(--ed-accent);
}
.torly-editorial-post .ed-post-lede {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 19px;
    line-height: 1.55;
    color: var(--ed-ink-2);
    margin: 0 0 32px;
    max-width: 640px;
}
.torly-editorial-post .ed-post-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0 4px;
}
.torly-editorial-post .ed-post-byline img {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}
.torly-editorial-post .ed-byline-stack { display: flex; flex-direction: column; gap: 2px; }
.torly-editorial-post .ed-byline-name {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ed-ink);
}
.torly-editorial-post .ed-byline-meta {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ed-muted);
    text-transform: uppercase;
}
.torly-editorial-post .ed-byline-meta .ed-sep { margin: 0 6px; opacity: 0.5; }

/* ── Featured image ──────────────────────────────────────────────────────── */
.torly-editorial-post .ed-post-featured {
    max-width: 1040px;
    margin: 40px auto;
    padding: 0 28px;
}
.torly-editorial-post .ed-post-featured img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--ed-line-2);
    display: block;
}

/* ── Body (the_content) ──────────────────────────────────────────────────── */
.torly-editorial-post .ed-post-body {
    max-width: 680px;
    margin: 48px auto;
    padding: 0 28px;
}
.torly-editorial-post .ed-post-body .entry-content {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 18px;
    line-height: 1.75;
    color: var(--ed-ink-2);
}
.torly-editorial-post .ed-post-body .entry-content > * {
    margin: 0 0 1.4em;
}
.torly-editorial-post .ed-post-body .entry-content p { margin: 0 0 1.4em; }

.torly-editorial-post .ed-post-body .entry-content h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    margin: 2.2em 0 0.6em;
    padding-bottom: 0.2em;
}
.torly-editorial-post .ed-post-body .entry-content h3 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--ed-ink);
    margin: 1.8em 0 0.5em;
}
.torly-editorial-post .ed-post-body .entry-content h4 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--ed-ink);
    margin: 1.6em 0 0.4em;
}
.torly-editorial-post .ed-post-body .entry-content a {
    color: var(--ed-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 160ms ease;
}
.torly-editorial-post .ed-post-body .entry-content a:hover { color: #145a37; }

.torly-editorial-post .ed-post-body .entry-content strong,
.torly-editorial-post .ed-post-body .entry-content b {
    color: var(--ed-ink);
    font-weight: 600;
}

.torly-editorial-post .ed-post-body .entry-content em,
.torly-editorial-post .ed-post-body .entry-content i {
    font-style: italic;
}

.torly-editorial-post .ed-post-body .entry-content ul,
.torly-editorial-post .ed-post-body .entry-content ol {
    padding-left: 1.5em;
    margin: 0 0 1.4em;
}
.torly-editorial-post .ed-post-body .entry-content li {
    margin: 0 0 0.55em;
    line-height: 1.7;
}
.torly-editorial-post .ed-post-body .entry-content li::marker { color: var(--ed-muted); }

/* Pull-quote: serif italic, flush-left, no quote marks (§11 C) */
.torly-editorial-post .ed-post-body .entry-content blockquote {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.35;
    color: var(--ed-ink);
    border-left: 2px solid var(--ed-accent);
    padding: 0.2em 0 0.2em 1em;
    margin: 2em 0;
    background: transparent;
    letter-spacing: -0.01em;
}
.torly-editorial-post .ed-post-body .entry-content blockquote p { margin: 0; }
.torly-editorial-post .ed-post-body .entry-content blockquote cite {
    display: block;
    margin-top: 0.5em;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-style: normal;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ed-muted);
}

/* Inline code + code blocks */
.torly-editorial-post .ed-post-body .entry-content code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.92em;
    background: var(--ed-chip);
    color: var(--ed-ink);
    padding: 2px 6px;
    border-radius: 4px;
}
.torly-editorial-post .ed-post-body .entry-content pre {
    background: var(--ed-ink);
    color: var(--ed-bg);
    padding: 20px 24px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.6;
    margin: 2em 0;
}
.torly-editorial-post .ed-post-body .entry-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Images inside content */
.torly-editorial-post .ed-post-body .entry-content img,
.torly-editorial-post .ed-post-body .entry-content figure img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 2em auto;
}
.torly-editorial-post .ed-post-body .entry-content figure {
    margin: 2em 0;
}
.torly-editorial-post .ed-post-body .entry-content figcaption {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--ed-muted);
    text-align: center;
    margin-top: 10px;
    letter-spacing: 0.02em;
}

/* Tables */
.torly-editorial-post .ed-post-body .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 15px;
    border-top: 1px solid var(--ed-line);
    border-bottom: 1px solid var(--ed-line);
}
.torly-editorial-post .ed-post-body .entry-content th {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ed-muted);
    font-weight: 500;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ed-line);
}
.torly-editorial-post .ed-post-body .entry-content td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ed-line-2);
    color: var(--ed-ink-2);
    vertical-align: top;
}
.torly-editorial-post .ed-post-body .entry-content tr:last-child td { border-bottom: none; }

/* Horizontal rule */
.torly-editorial-post .ed-post-body .entry-content hr {
    border: none;
    border-top: 1px solid var(--ed-line);
    margin: 3em 0;
}

/* Footnote-style small text — authors can apply via <small> or class="ed-footnote" */
.torly-editorial-post .ed-post-body .entry-content small,
.torly-editorial-post .ed-post-body .entry-content .ed-footnote {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ed-muted);
    letter-spacing: 0.01em;
}

/* ── Share row ───────────────────────────────────────────────────────────── */
.torly-editorial-post .ed-post-share {
    max-width: 680px;
    margin: 40px auto;
    padding: 24px 28px;
    border-top: 1px solid var(--ed-line-2);
    border-bottom: 1px solid var(--ed-line-2);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.torly-editorial-post .ed-post-share-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ed-muted);
    margin: 0;
}
.torly-editorial-post .ed-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.torly-editorial-post .ed-share-buttons a,
.torly-editorial-post .ed-share-buttons button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--ed-line-2);
    border-radius: 999px;
    color: var(--ed-ink-2);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease;
}
.torly-editorial-post .ed-share-buttons a:hover,
.torly-editorial-post .ed-share-buttons button:hover {
    border-color: var(--ed-ink);
    color: var(--ed-ink);
}
.torly-editorial-post .ed-share-buttons svg { width: 14px; height: 14px; }

/* ── Related articles (3-card strip) ─────────────────────────────────────── */
.torly-editorial-post .ed-related {
    max-width: 1040px;
    margin: 64px auto 0;
    padding: 48px 28px 0;
    border-top: 1px solid var(--ed-line-2);
}
.torly-editorial-post .ed-related-header { margin-bottom: 28px; }
.torly-editorial-post .ed-related-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ed-accent);
    margin: 0 0 8px;
}
.torly-editorial-post .ed-related-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(26px, 2.8vw, 34px);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    margin: 0;
}
.torly-editorial-post .ed-related-title em { font-style: italic; color: var(--ed-accent); }
.torly-editorial-post .ed-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 768px) {
    .torly-editorial-post .ed-related-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; }
}
.torly-editorial-post .ed-related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: var(--ed-card);
    border: 1px solid var(--ed-line-2);
    border-radius: 12px;
    text-decoration: none;
    color: var(--ed-ink);
    transition: border-color 160ms ease, transform 160ms ease;
}
.torly-editorial-post .ed-related-card:hover {
    border-color: var(--ed-ink);
    transform: translateY(-2px);
}
.torly-editorial-post .ed-related-date {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ed-muted);
}
.torly-editorial-post .ed-related-card h3 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--ed-ink);
    margin: 0;
}
.torly-editorial-post .ed-related-card h3 a { color: inherit; text-decoration: none; }

/* ── Post navigation (prev / next) ───────────────────────────────────────── */
.torly-editorial-post .ed-post-nav {
    max-width: 1040px;
    margin: 56px auto 24px;
    padding: 24px 28px;
    border-top: 1px solid var(--ed-line-2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.torly-editorial-post .ed-post-nav a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--ed-ink-2);
    text-decoration: none;
    font-size: 14.5px;
    line-height: 1.4;
}
.torly-editorial-post .ed-post-nav a:hover { color: var(--ed-ink); }
.torly-editorial-post .ed-post-nav .ed-nav-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ed-muted);
}
.torly-editorial-post .ed-post-nav-next { text-align: right; }
.torly-editorial-post .ed-post-nav-next a { align-items: flex-end; }

/* ── Newsletter CTA (editorial dark band) ────────────────────────────────── */
.torly-editorial-post .ed-newsletter {
    background: var(--ed-ink);
    color: var(--ed-bg);
    border-radius: 14px;
    max-width: 1040px;
    margin: 48px auto 0;
    padding: 48px 36px;
    text-align: center;
    position: relative;
}
.torly-editorial-post .ed-newsletter .ed-newsletter-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: rgba(245, 241, 234, 0.6);
    margin: 0 0 12px;
}
.torly-editorial-post .ed-newsletter h3 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(26px, 2.8vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ed-bg);
    margin: 0 0 12px;
}
.torly-editorial-post .ed-newsletter h3 em { font-style: italic; color: var(--ed-accent-2); }
.torly-editorial-post .ed-newsletter p {
    color: rgba(245, 241, 234, 0.7);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 22px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}
.torly-editorial-post .ed-newsletter form {
    display: flex;
    gap: 8px;
    max-width: 440px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}
.torly-editorial-post .ed-newsletter input[type=email] {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    background: rgba(245, 241, 234, 0.08);
    border: 1px solid rgba(245, 241, 234, 0.25);
    border-radius: 999px;
    color: var(--ed-bg);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14.5px;
}
.torly-editorial-post .ed-newsletter input[type=email]::placeholder { color: rgba(245, 241, 234, 0.5); }
.torly-editorial-post .ed-newsletter input[type=email]:focus {
    outline: none;
    border-color: var(--ed-bg);
    background: rgba(245, 241, 234, 0.12);
}
.torly-editorial-post .ed-newsletter button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ed-bg);
    color: var(--ed-ink);
    border: none;
    padding: 12px 20px;
    border-radius: 999px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease;
}
.torly-editorial-post .ed-newsletter button:hover { background: #EAE5DC; }
.torly-editorial-post .ed-newsletter .ed-newsletter-privacy {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(245, 241, 234, 0.5);
    margin-top: 16px;
}

@media (max-width: 640px) {
    .torly-editorial-post .ed-post-hero { padding: 24px 0 20px; }
    .torly-editorial-post .ed-post-body { margin: 32px auto; }
    .torly-editorial-post .ed-post-featured { margin: 28px auto; }
    .torly-editorial-post .ed-post-nav { grid-template-columns: 1fr; }
    .torly-editorial-post .ed-newsletter { padding: 36px 22px; }
}
