/* =============================================================================
   FloreData — Single article (.ai page 4 "Blog single")
   Floral hero → tags → reading body (+ Dirty-Cream code cards) → related → CTA.
   Reuses global chrome, eyebrow primitives, .fd-btn--cream/--filled, .fd-carousel.
   ============================================================================= */

:root {
    --fd-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
        "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
    --fd-read: 900px;            /* article reading column — widened from 820 (Sandro 2026-06-28: was too narrow) */
}

/* The post pages sit on the page background; hero supplies its own. */
.fd-page-blog-single {
    background: var(--wp--preset--color--background);
}
/* hero bleeds behind the floating nav (was global 92px → header sat on a white band) */
body.fd-page-blog-single #fd-main { padding-top: 0; }

/* -----------------------------------------------------------------------------
   A. Hero banner — shorter, title-led variant of the landing hero
   -------------------------------------------------------------------------- */
.fd-post-hero {
    position: relative;
    text-align: center;
    padding: clamp(150px, 11vw, 232px) 24px clamp(72px, 7vw, 110px);   /* straight full-bleed banner (Sandro 2026-06-28) */
    overflow: hidden;
    isolation: isolate;
}
.fd-post-hero__bg {
    position: absolute;
    inset: -40px 0 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -2;
}
.fd-post-hero__overlay {
    position: absolute;
    inset: 0;
    /* Grape Soda wash, darkened at the centre so the title + excerpt clear AA on the
       pale floral (flat 0.55 wash failed AA on the lighter petals). No mix-blend. */
    background: radial-gradient(120% 92% at 50% 42%,
        rgba(40, 40, 57, 0.42), rgba(169, 149, 252, 0.55) 68%);
    z-index: -1;
}
/* concave ellipse bottom removed → straight full-bleed banner (Sandro 2026-06-28) */
.fd-post-hero__inner {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    text-shadow: 0 1px 18px rgba(40, 40, 57, 0.38);   /* legibility floor on the floral */
}
.fd-post-hero__title {
    font-weight: 700;
    font-size: clamp(2.4rem, 1rem + 4.6vw, 5.3rem);
    line-height: 1.04;
    letter-spacing: -0.01em;
    color: var(--wp--preset--color--background);
    margin: 0;
}
.fd-post-hero__title em { font-weight: 700; font-style: italic; }
.fd-post-hero__excerpt {
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.05rem, 0.85rem + 0.7vw, 1.6rem);
    line-height: 1.35;
    color: var(--wp--preset--color--background);
    margin: 22px auto 0;
    max-width: 40ch;
}

/* A. meta pills + B. tag pills — dark Jazz Club pill family */
.fd-post-meta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}
.fd-post-meta__pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--wp--preset--color--surface-dark);
    color: #f3f2f7;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(0.85rem, 0.8rem + 0.2vw, 1rem);
    padding: 8px 18px;
    border-radius: 999px;
}
.fd-post-meta__pill img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: -6px;
}

/* B. Category tags — overlap the concave curve */
.fd-post-tags {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: clamp(-34px, -3vw, -22px) auto 0;   /* straddle the straight hero edge (ellipse removed) */
    padding: 0 24px;
    list-style: none;
    position: relative;
    z-index: 2;
}
.fd-tag {
    display: inline-block;
    background: var(--wp--preset--color--surface-dark);
    border-radius: 999px;
}
.fd-tag a {
    display: inline-block;
    padding: 9px 22px;
    color: #ffffff;                              /* white on the navy pill (Sandro 2026-06-28: lavender was unreadable on the dark hero) */
    font-weight: 700;
    font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.95rem);
    text-decoration: none;
    transition: color 0.15s ease;
}
.fd-tag a:hover { color: var(--wp--preset--color--punchy); }

/* -----------------------------------------------------------------------------
   C–E. Article body
   -------------------------------------------------------------------------- */
.fd-post-body {
    max-width: var(--fd-read);
    margin: clamp(44px, 5vw, 72px) auto 0;
    padding: 0 24px;
}
.fd-post-body > * { margin-top: 1.4em; margin-bottom: 0; }
.fd-post-body > *:first-child { margin-top: 0; }

/* lede = the opening paragraph (authored as a "Lede" style later). Gated to
   first-CHILD so a post that opens with a heading/image/list doesn't hand lede
   styling to a random mid-article paragraph. */
.fd-post-body > p:first-child {
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.7rem);
    line-height: 1.5;
    color: var(--wp--preset--color--text);
}
.fd-post-body p {
    font-weight: 500;
    font-size: clamp(1.06rem, 1rem + 0.35vw, 1.32rem);
    line-height: 1.65;
    color: #161616;
}
.fd-post-body h2 {
    font-weight: 300;
    font-style: normal;
    font-size: clamp(2rem, 1.3rem + 2.6vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: var(--wp--preset--color--text);
    margin-top: 1.6em;
}
.fd-post-body h3 {
    font-weight: 600;
    font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
    line-height: 1.2;
    color: var(--wp--preset--color--text);
    margin-top: 1.5em;
}
.fd-post-body h4 {
    font-weight: 700;
    font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
    color: var(--wp--preset--color--text);
    margin-top: 1.4em;
}
.fd-post-body a:not(.fd-btn--cream):not(.fd-btn--filled) {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.fd-post-body ul,
.fd-post-body ol { padding-left: 1.4em; }
.fd-post-body li {
    font-weight: 500;
    font-size: clamp(1.06rem, 1rem + 0.35vw, 1.28rem);
    line-height: 1.66;
    color: #161616;
    margin: 0.5em 0;
}
.fd-post-body li::marker { color: var(--wp--preset--color--primary); }
.fd-post-body blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 28px;
    border-left: 3px solid var(--wp--preset--color--primary-soft);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--wp--preset--color--text);
}
.fd-post-body figure { margin: 1.8em 0; }
.fd-post-body img { border-radius: 14px; height: auto; max-width: 100%; }
.fd-post-body :not(.fd-codecard) > :not(pre) > code,
.fd-post-body p > code,
.fd-post-body li > code {
    font-family: var(--fd-mono);
    font-size: 0.88em;
    background: var(--wp--preset--color--dirty-cream);
    border: 1px solid #e6e3da;
    border-radius: 6px;
    padding: 0.12em 0.4em;
    color: #2c2c3a;
    overflow-wrap: anywhere;   /* long identifiers wrap instead of overflowing the phone column (audit 2026-06-29) */
    word-break: break-word;
}
/* Inline code INSIDE headings — smaller chip that sits within the thin display type,
   not a stray baseline-floating monospace fragment. */
.fd-post-body h2 code,
.fd-post-body h3 code,
.fd-post-body h4 code {
    font-family: var(--fd-mono);
    font-size: 0.72em;
    font-weight: 600;
    vertical-align: 0.04em;
    background: var(--wp--preset--color--dirty-cream);
    border: 1px solid #e6e3da;
    border-radius: 6px;
    padding: 0.08em 0.32em;
    color: #2c2c3a;
    letter-spacing: 0;
}
/* Neutralise stray bold/strong applied to a heading in the editor — keep the thin display rhythm. */
.fd-post-body h2 strong, .fd-post-body h2 b,
.fd-post-body h3 strong, .fd-post-body h3 b { font-weight: inherit; }
/* Geetha: remove dividers + bold fonts from the article body (cleaner reading). */
.fd-post-body hr,
.fd-post-body .wp-block-separator { display: none; }
.fd-post-body p strong, .fd-post-body p b,
.fd-post-body li strong, .fd-post-body li b,
.fd-post-body td strong, .fd-post-body td b { font-weight: inherit; }
/* Fallback: any raw <pre> the render_block filter didn't convert still gets the cream
   card look, never the parent theme's dark <pre>. (Phiki output inside .fd-codecard is .phiki → excluded.) */
.fd-post-body > pre:not(.phiki),
.fd-post-body .wp-block-preformatted:not(.phiki) {
    background: var(--wp--preset--color--dirty-cream);
    color: #24292e;
    border: 1px solid #e6e3da;
    border-radius: 16px;
    padding: 18px 20px;
    overflow-x: auto;
    font-family: var(--fd-mono);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   D. Dirty-Cream code card (core/code → fd_code_card via code-highlight.php)
   -------------------------------------------------------------------------- */
.fd-codecard {
    background: var(--wp--preset--color--dirty-cream);
    border: 1px solid #e6e3da;
    border-radius: 16px;
    margin: 2em 0;
    overflow: hidden;
}
.fd-codecard__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 10px 20px;
    border-bottom: 1px solid rgba(40, 40, 57, 0.08);
}
.fd-codecard__lang {
    font-family: var(--fd-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wp--preset--color--growth);
}
.fd-codecard__copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(40, 40, 57, 0.18);
    border-radius: 8px;
    padding: 5px 11px;
    font-family: var(--wp--preset--font-family--satoshi);
    font-size: 0.74rem;
    font-weight: 600;
    color: #3a3a4a;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.fd-codecard__copy:hover {
    background: var(--wp--preset--color--surface-dark);
    border-color: var(--wp--preset--color--surface-dark);
    color: #fff;
}
.fd-codecard__copy-icon { stroke: currentColor; fill: none; stroke-width: 1.7; }
.fd-codecard__copy.is-copied {
    background: var(--wp--preset--color--growth);
    border-color: var(--wp--preset--color--growth);
    color: #fff;
}
.fd-codecard__body {
    overflow-x: auto;
    padding: 18px 20px;
}
.fd-codecard__body pre.phiki {
    background: transparent !important;
    margin: 0;
    padding: 0;
    font-family: var(--fd-mono);
    font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.95rem);
    line-height: 1.62;
    tab-size: 2;
    white-space: pre;
    width: max-content;        /* as wide as the longest line → the body scrolls, never clips */
    min-width: 100%;
}
.fd-codecard__body pre.phiki code { font-family: inherit; white-space: inherit; }
.fd-codecard__body .line { display: block; min-height: 1.62em; }
.fd-codecard__body .fd-code__plain { white-space: pre; color: #24292e; }

/* visible thin scrollbar → signals the code scrolls horizontally (not a silent clip) */
.fd-codecard__body { scrollbar-width: thin; scrollbar-color: var(--wp--preset--color--primary-soft) transparent; }
.fd-codecard__body::-webkit-scrollbar { height: 7px; }
.fd-codecard__body::-webkit-scrollbar-thumb { background: var(--wp--preset--color--primary-soft); border-radius: 4px; }

/* Responsive tables — the .fd-table-scroll wrapper (added in the_content) scrolls;
   the table keeps a readable min-width instead of crushing its cells on mobile. */
.fd-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--wp--preset--color--primary-soft) transparent;
}
.fd-table-scroll table { min-width: 560px; }
.fd-table-scroll::-webkit-scrollbar { height: 7px; }
.fd-table-scroll::-webkit-scrollbar-thumb { background: var(--wp--preset--color--primary-soft); border-radius: 4px; }

/* F. hairline */
.fd-post-rule {
    border: 0;
    height: 1px;
    background: var(--wp--preset--color--line);
    max-width: var(--fd-read);
    margin: clamp(48px, 6vw, 80px) auto 0;
}

/* -----------------------------------------------------------------------------
   G. Related posts — "Explore More Articles"
   -------------------------------------------------------------------------- */
.fd-related {
    text-align: center;
    padding: clamp(48px, 6vw, 88px) 0 clamp(40px, 5vw, 72px);
}
.fd-eyebrow--blog {
    background: var(--wp--preset--color--bloom);
    color: var(--wp--preset--color--primary);
}
.fd-eyebrow--blog .fd-eyebrow__badge {
    display: inline-flex;
    color: var(--wp--preset--color--primary);
}
.fd-eyebrow--blog .fd-eyebrow__badge svg { width: 16px; height: 16px; }
.fd-related__heading {
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 1.1rem + 3.4vw, 4.4rem);
    line-height: 1.05;
    color: var(--wp--preset--color--text);
    margin: 20px auto clamp(36px, 4vw, 56px);
}
.fd-related .fd-carousel { position: relative; padding: 0 clamp(24px, 6vw, 96px); }
/* right-edge fade hints the 4th card overflows (the track is scrollable) */
.fd-related .fd-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 8px;
    width: clamp(24px, 6vw, 96px);
    background: linear-gradient(90deg, transparent, var(--wp--preset--color--background));
    pointer-events: none;
}
.fd-related .fd-carousel__track {
    display: flex;
    gap: 24px;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.fd-related .fd-carousel__track::-webkit-scrollbar { display: none; }
.fd-related .fd-carousel__track:focus-visible {   /* keyboard-scrollable (tabindex=0) */
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 4px;
    border-radius: 10px;
}
.fd-related-card {
    position: relative;
    flex: 0 0 auto;
    width: clamp(240px, 24vw, 300px);
    aspect-ratio: 4 / 5;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
    padding: 24px;
    text-decoration: none;
    scroll-snap-align: start;
    isolation: isolate;
}
.fd-related-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform 0.4s ease;
}
.fd-related-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(40, 40, 57, 0.05) 28%, rgba(40, 40, 57, 0.78));
    z-index: -1;
}
.fd-related-card--3::after { background: linear-gradient(180deg, rgba(40, 40, 57, 0.35) 10%, rgba(40, 40, 57, 0.86)); }
.fd-related-card:hover .fd-related-card__img { transform: scale(1.05); }
.fd-related-card__title {
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.45rem);
    line-height: 1.18;
    color: var(--wp--preset--color--background);
}
.fd-related-card__by {
    font-weight: 700;
    font-style: italic;
    font-size: 0.92rem;
    color: var(--wp--preset--color--background);
    opacity: 0.88;
    margin-top: 10px;
}

/* -----------------------------------------------------------------------------
   H. CTA pair
   -------------------------------------------------------------------------- */
.fd-post-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 auto clamp(72px, 9vw, 120px);
    padding: 0 24px;
}

@media (max-width: 600px) {
    .fd-post-meta { gap: 8px; }
    .fd-post-body { padding: 0 20px; }
    .fd-codecard__body { padding: 14px 16px; }
    .fd-codecard__body pre.phiki { font-size: 0.78rem; }   /* fit more code per line → less horizontal scrolling */
    .fd-table-scroll table { min-width: 520px; }

    /* end CTA pair → equal width + centered */
    .fd-post-cta { flex-direction: column; align-items: center; gap: 12px; margin-bottom: clamp(48px, 8vw, 72px); }
    .fd-post-cta a { width: 100%; max-width: 300px; box-sizing: border-box; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .fd-related-card__img,
    .fd-codecard__copy { transition: none; }
    .fd-related-card:hover .fd-related-card__img { transform: none; }
}

/* Author byline → links to the writer's /team/ profile (white on the dark hero pill). */
.fd-post-meta__author { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.fd-post-meta__author:hover { opacity: 0.85; }

/* -----------------------------------------------------------------------------
   Breadcrumbs — base style is global (site-chrome.css). Blog single narrows the
   trail to the reading column + tightens the gap into the article body.
   -------------------------------------------------------------------------- */
.fd-page-blog-single .fd-breadcrumbs { max-width: var(--fd-read); margin-top: clamp(40px, 4.5vw, 64px); }
.fd-breadcrumbs + .fd-post-body { margin-top: clamp(18px, 2vw, 26px); }

/* -----------------------------------------------------------------------------
   Table of contents (Backlog #9) — auto box after the lede in long articles.
   -------------------------------------------------------------------------- */
.fd-toc {
    margin: 0.4em 0 2.6em;
    padding: 20px 24px;
    background: var(--wp--preset--color--sage);
    border-radius: 12px;
}
.fd-toc__title {
    margin: 0 0 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid rgba(40, 40, 57, 0.12);   /* formalise the label as a header, not a floating caption */
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--primary);
}
.fd-toc__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
/* ToC is a <details>: collapsed by default on EVERY viewport (Francesca 2026-07-02 —
   the ~20-link index was huge). Served open in the HTML for crawlers/no-JS; the
   inline script in fd_render_toc() closes it on load, the summary toggles it. */
.fd-toc__title { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fd-toc__title::-webkit-details-marker { display: none; }
details.fd-toc:not([open]) > .fd-toc__title { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.fd-toc__title::after {
    content: ""; width: 9px; height: 9px; flex: none; margin-bottom: 3px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform 0.2s ease;
}
details.fd-toc[open] > .fd-toc__title::after { transform: rotate(-135deg); margin-bottom: -3px; }
@media (hover: hover) { .fd-toc__title:hover { color: var(--wp--preset--color--grape, #4c4cc8); } }
/* Beat .fd-post-body a:not(...) (0-3-1) — the ToC is wayfinding chrome, not prose:
   quiet --text by default, purple only on hover, NO underline. */
/* 3 classes (0,3,1) + later in source → beats .fd-post-body a:not():not() (0,3,1). */
.fd-post-body .fd-toc .fd-toc__list a {
    display: block;
    padding: 3px 0;
    color: var(--wp--preset--color--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    transition: color 0.15s ease;
}
.fd-post-body .fd-toc .fd-toc__list a:hover { color: var(--wp--preset--color--primary); text-decoration: none; }
.fd-toc__list a:focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 3px; border-radius: 3px; }
.fd-toc__sub { padding-left: 16px; margin-left: 2px; border-left: 1px solid rgba(40, 40, 57, 0.12); }   /* rail groups H3 children */
.fd-post-body .fd-toc .fd-toc__sub a { font-weight: 500; font-size: 0.88rem; color: var(--wp--preset--color--text); }   /* was --text-muted = 4.36:1 on sage (AA fail) — size+weight+rail carry the H3 hierarchy */
.fd-post-body .fd-toc .fd-toc__sub a:hover { color: var(--wp--preset--color--primary); }

/* anchor jumps clear the fixed header */
.fd-post-body h2, .fd-post-body h3 { scroll-margin-top: 104px; }

@media (prefers-reduced-motion: reduce) {
    .fd-toc__list a, .fd-breadcrumbs a { transition: none; }
}
