/* ==================================================================
 * BFO Journal v0.29 — article toolbox (desktop v5 / mobile v2 anatomy)
 * Loaded after bfo-journal.css. Only adds to it; legacy posts unchanged
 * except: mobile images edge-to-edge, takeaway rows numbered on phones.
 * ================================================================== */

.bfo-post .cite, .bfo-post span.cite{ font-size:.84em; color:var(--bfo-amber-ink); white-space:nowrap; }
.bfo-post span.cite a{ color:var(--bfo-amber-ink); font-weight:600; text-decoration:none; }
.bfo-post span.cite a:hover, .bfo-post span.cite a:focus-visible{ text-decoration:underline; text-underline-offset:2px; }
.bfo-post details.bfo-post-refs li{ scroll-margin-top:120px; }
.bfo-post details.bfo-post-refs li.bfo-ref-hit{ background:#FCEFD6; border-radius:4px; transition:background .6s ease; }

/* ---------- Mobile: editorial images edge-to-edge by default ----------
 * Opt out per image: Block > Styles > "Inset on phones" (is-style-inset).
 * CTA thumbnails/media handle themselves below. */
@media (max-width:767px){
  .bfo-post figure.wp-block-image:not(.is-style-inset):not(.bfo-convcta__thumb):not(.bfo-navcta__media){
    margin-left:calc(-1 * var(--bfo-gutter)); margin-right:calc(-1 * var(--bfo-gutter));
    width:auto; max-width:none;
  }
  .bfo-post figure.wp-block-image:not(.is-style-inset):not(.bfo-convcta__thumb):not(.bfo-navcta__media) img,
  .bfo-post figure.wp-block-image:not(.is-style-inset):not(.bfo-post-figure):not(.bfo-convcta__thumb):not(.bfo-navcta__media) img{
    width:100%; max-width:100%; max-height:none; border-radius:0;
  }
  .bfo-post figure.wp-block-image:not(.is-style-inset) figcaption{ margin-left:var(--bfo-gutter); margin-right:var(--bfo-gutter); }
}
/* Unfilled image placeholders never show on the live page */
.bfo-post figure.wp-block-image.bfo-img-empty{ display:none; }

/* ---------- Pull quote: Mist break (new pattern; bare legacy quote untouched) ---------- */
.bfo-post .bfo-post-breakquote{
  background:var(--bfo-mist); border-top:1px solid #E1E9ED; border-bottom:1px solid #E1E9ED;
  margin:44px calc(-1 * var(--bfo-gutter)) 0; padding:25px var(--bfo-gutter) 24px; text-align:center;
}
.bfo-post > .bfo-post-breakquote + *{ margin-top:30px; }
.bfo-post .bfo-post-breakquote > *{ margin:0; }
.bfo-post .bfo-post-breakquote p.bfo-post-pullquote{
  margin:0 auto; padding:0; max-width:none; text-align:center;
  font:800 24px/1.16 var(--bfo-display) !important; letter-spacing:-.025em; color:var(--bfo-navy);
}
.bfo-post .bfo-post-breakquote p.bfo-post-pullquote::before{ display:none; }
.bfo-post p.bfo-post-pullquote__credit{
  margin-top:9px !important; text-align:center; color:#7A8798;
  font:600 9.5px/15px var(--bfo-body) !important; letter-spacing:.09em; text-transform:uppercase;
}
@media (min-width:768px){
  .bfo-post .bfo-post-breakquote{ margin:62px 0 0; padding:30px 34px 29px; }
  .bfo-post > .bfo-post-breakquote + *{ margin-top:38px; }
  .bfo-post .bfo-post-breakquote p.bfo-post-pullquote{ font-size:30px !important; line-height:1.15; max-width:690px; }
  .bfo-post p.bfo-post-pullquote__credit{ margin-top:11px !important; font-size:10px !important; line-height:16px !important; }
}

/* ---------- Framework rows ---------- */
.bfo-post .bfo-post-framework{ margin-top:26px; border-top:1px solid var(--bfo-line); }
.bfo-post .bfo-post-framework > *{ margin:0; }
.bfo-post .bfo-post-framework__row{ padding:22px 0; border-bottom:1px solid var(--bfo-line); }
.bfo-post .bfo-post-framework__row > *, .bfo-post .bfo-post-framework__kicker > *, .bfo-post .bfo-post-framework__copy > *{ margin:0; }
.bfo-post p.bfo-post-framework__num{
  color:var(--bfo-amber-ink); font:700 10px/15px var(--bfo-label) !important; letter-spacing:.13em; text-transform:uppercase;
}
.bfo-post .bfo-post-framework__kicker h3.wp-block-heading{ margin:5px 0 11px; font-size:23px; line-height:1.05; font-weight:900; color:var(--bfo-navy); }
.bfo-post .bfo-post-framework__copy p{ font-size:15.5px; line-height:23px; }
.bfo-post .bfo-post-framework__copy p + p{ margin-top:10px; }
.bfo-post .bfo-post-framework__copy strong{ color:var(--bfo-navy); font-weight:600; }
@media (min-width:768px){
  .bfo-post .bfo-post-framework{ margin-top:30px; }
  .bfo-post .bfo-post-framework__row{ display:grid; grid-template-columns:150px minmax(0,1fr); gap:32px; padding:26px 0; }
  .bfo-post .bfo-post-framework__kicker h3.wp-block-heading{ margin:6px 0 0; font-size:22px; }
}

/* ---------- Points Worth Remembering (list version) ----------
 * Desktop: amber-dot bullets. Phones: numbered editorial rows.
 * Legacy three-row version (.bfo-post-takeaway) also numbers on phones. */
.bfo-post .bfo-post-takeaways ol.bfo-post-points__list{ list-style:none; margin:0; padding:0; counter-reset:bfo-pt; display:grid; gap:9px; }
.bfo-post .bfo-post-takeaways ol.bfo-post-points__list li{
  counter-increment:bfo-pt; position:relative; margin:0; padding-left:19px;
  color:var(--bfo-slate); font-size:15.5px; line-height:23px;
}
.bfo-post .bfo-post-takeaways ol.bfo-post-points__list li::before{
  content:""; position:absolute; left:0; top:9px; width:6px; height:6px; border-radius:50%; background:var(--bfo-amber);
}
.bfo-post .bfo-post-points h3.wp-block-heading{ margin:0 0 16px; }
@media (min-width:768px){
  .bfo-post .bfo-post-points h3.wp-block-heading{ font-size:30px; margin-bottom:18px; }
}
@media (max-width:767px){
  .bfo-post .bfo-post-takeaways ol.bfo-post-points__list{ gap:0; }
  .bfo-post .bfo-post-takeaways ol.bfo-post-points__list li{
    display:block; position:relative; padding:14px 0 14px 41px; border-top:1px solid #E6EBEE; font-size:15px; line-height:22px;
  }
  .bfo-post .bfo-post-takeaways ol.bfo-post-points__list li:first-child{ border-top:0; padding-top:0; }
  .bfo-post .bfo-post-takeaways ol.bfo-post-points__list li::before{
    content:counter(bfo-pt, decimal-leading-zero); position:absolute; left:0; top:14px; width:auto; height:auto; border-radius:0; background:none;
    font:900 13px/22px var(--bfo-display); color:var(--bfo-amber-ink);
  }
  .bfo-post .bfo-post-takeaways ol.bfo-post-points__list li:first-child::before{ top:0; }
  /* legacy rows: tick → number */
  .bfo-post .bfo-post-takeaways{ counter-reset:bfo-ptl; }
  .bfo-post .bfo-post-takeaway{ counter-increment:bfo-ptl; }
  .bfo-post .bfo-post-takeaway::before{
    content:counter(bfo-ptl, decimal-leading-zero); background:none; width:auto; height:auto; border-radius:0; display:block;
    color:var(--bfo-amber-ink); font:900 13px/1.4 var(--bfo-display);
  }
}

/* ---------- TAKE HOME MESSAGE ---------- */
.bfo-post .bfo-post-takehome{ text-align:center; padding:36px 0 3px; max-width:650px; margin-left:auto; margin-right:auto; }
.bfo-post .bfo-post-takehome > *{ margin:0; }
.bfo-post .bfo-post-takehome p.bfo-eyebrow{ justify-content:center; }
.bfo-post .bfo-post-takehome p.bfo-eyebrow::before{ display:none; }
.bfo-post p.bfo-post-takehome__text{
  margin-top:8px !important; color:var(--bfo-navy); font:900 25px/1.15 var(--bfo-display) !important; letter-spacing:-.02em; text-wrap:balance;
}
@media (min-width:768px){
  .bfo-post .bfo-post-takehome{ padding-top:46px; }
  .bfo-post p.bfo-post-takehome__text{ margin-top:10px !important; font-size:29px !important; line-height:1.16 !important; }
}

/* ---------- Navigation CTAs (Related guide / Continue reading) ---------- */
.bfo-post .bfo-navcta{
  background:var(--bfo-mist); border-top:1px solid #E1E9ED; border-bottom:1px solid #E1E9ED;
  margin:40px calc(-1 * var(--bfo-gutter)) 0; padding:23px var(--bfo-gutter) 25px;
}
.bfo-post > .bfo-navcta + *{ margin-top:30px; }
.bfo-post .bfo-navcta > *, .bfo-post .bfo-navcta__copy > *{ margin:0; }
.bfo-post .bfo-navcta h3.wp-block-heading{ margin:7px 0 8px; font-size:23px; line-height:1.12; color:var(--bfo-navy); }
.bfo-post .bfo-navcta__copy p:not(.bfo-eyebrow){ font-size:15px; line-height:22px; color:var(--bfo-slate); }
.bfo-post .bfo-navcta p.bfo-eyebrow{ color:var(--bfo-amber-ink); }
.bfo-post .bfo-navcta p.bfo-eyebrow::before{ background:var(--bfo-amber-ink); width:28px; }
.bfo-post p.bfo-navcta__link{ margin-top:13px !important; }
.bfo-post p.bfo-navcta__link a{
  display:inline-flex; align-items:center; gap:7px; padding:11px 0 6px; border-bottom:2px solid var(--bfo-amber);
  color:var(--bfo-navy); text-decoration:none; white-space:nowrap;
  font:900 12px/1 var(--bfo-display); text-transform:uppercase; letter-spacing:.04em;
}
.bfo-post p.bfo-navcta__link a:hover{ border-bottom-color:var(--bfo-navy); }
.bfo-post .bfo-navcta .wp-block-buttons{ margin-top:16px; }
.bfo-post .bfo-navcta figure.bfo-navcta__media{ margin:20px 0 0; width:auto; max-width:none; }
.bfo-post .bfo-navcta figure.bfo-navcta__media img{ display:block; width:100% !important; max-width:none; height:auto !important; max-height:none; aspect-ratio:4/3 !important; object-fit:cover !important; border-radius:0; }
@media (max-width:767px){
  .bfo-post .bfo-navcta .wp-block-buttons, .bfo-post .bfo-navcta .wp-block-button, .bfo-post .bfo-navcta .wp-block-button__link{ width:100%; box-sizing:border-box; text-align:center; }
  .bfo-post .bfo-navcta figure.bfo-navcta__media{ margin-left:calc(-1 * var(--bfo-gutter)); margin-right:calc(-1 * var(--bfo-gutter)); }
}
@media (min-width:768px){
  .bfo-post .bfo-navcta{ margin:54px 0 0; padding:27px 28px; }
  .bfo-post > .bfo-navcta + *{ margin-top:40px; }
  .bfo-post .bfo-navcta h3.wp-block-heading{ font-size:24px; }
  .bfo-post .bfo-navcta--guide{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:32px; align-items:center; }
  .bfo-post .bfo-navcta--guide p.bfo-navcta__link{ margin-top:0 !important; }
  .bfo-post .bfo-navcta__copy p:not(.bfo-eyebrow){ max-width:53ch; }
  /* Continue reading: editorial ruled band, image right */
  .bfo-post .bfo-navcta--feature{ padding:31px 28px; margin-top:54px; }
  .bfo-post .bfo-navcta--feature:has(figure.bfo-navcta__media){ display:grid; grid-template-columns:minmax(0,1fr) 210px; gap:38px; align-items:center; }
  .bfo-post .bfo-navcta--feature h3.wp-block-heading{ font-size:28px; line-height:1.08; margin:8px 0 11px; }
  .bfo-post .bfo-navcta--feature .bfo-navcta__copy p:not(.bfo-eyebrow){ font-size:15.5px; line-height:23px; max-width:47ch; }
  .bfo-post .bfo-navcta--feature figure.bfo-navcta__media{ margin:0; }
  .bfo-post .bfo-navcta--feature figure.bfo-navcta__media img{ aspect-ratio:4/5 !important; }
}

/* ---------- Conversion CTAs — compact, article-sized (v0.29.3) ----------
 * All article CTAs sit on the Mist band (v0.29.4).
 * --quiz     : button right on desktop.
 * --resource : same, optional thumbnail left.
 * --bulletin : Mist band with the working email form.
 * Phones: all three are full-width Mist breaks.
 * Also restyles posts imported with the older navy markup (.bfo-nextstep.bfo-convcta). */
.bfo-post .bfo-convcta{
  background:var(--bfo-mist); border-top:1px solid #E1E9ED; border-bottom:1px solid #E1E9ED; border-radius:0;
  margin:40px calc(-1 * var(--bfo-gutter)) 0; padding:24px var(--bfo-gutter) 26px;
  display:block;
}
.bfo-post > .bfo-convcta + *{ margin-top:30px; }
.bfo-post .bfo-convcta > *, .bfo-post .bfo-convcta__copy > *, .bfo-post .bfo-convcta .bfo-nextstep__copy > *{ margin:0; }
.bfo-post .bfo-convcta p.bfo-eyebrow{ color:var(--bfo-amber-ink) !important; margin-bottom:0 !important; }
.bfo-post .bfo-convcta p.bfo-eyebrow::before{ background:var(--bfo-amber-ink) !important; width:28px; }
.bfo-post .bfo-convcta h3.wp-block-heading{ margin:7px 0 8px; color:var(--bfo-navy); font-size:23px; line-height:1.12; }
.bfo-post .bfo-convcta p:not(.bfo-eyebrow):not(.bfo-signup__msg){ color:var(--bfo-slate); font-size:15px; line-height:22px; max-width:none; }
.bfo-post .bfo-convcta .wp-block-buttons{ margin-top:16px; }
.bfo-post .bfo-convcta .wp-block-button__link{ white-space:nowrap; }
@media (max-width:767px){
  .bfo-post .bfo-convcta .wp-block-buttons, .bfo-post .bfo-convcta .wp-block-button, .bfo-post .bfo-convcta .wp-block-button__link{ width:100%; box-sizing:border-box; text-align:center; }
}
.bfo-convcta figure.bfo-convcta__thumb{ margin:0 0 16px; max-width:120px; }
.bfo-convcta figure.bfo-convcta__thumb img{ display:block; width:100% !important; max-width:none; height:auto !important; max-height:none; aspect-ratio:3/4 !important; object-fit:cover !important; border-radius:8px; border:1px solid var(--bfo-line); }

/* Bulletin form (shell becomes a working form at render — inc/forms.php) */
.bfo-post .bfo-convcta .bfo-signup{ display:flex; flex-direction:column; gap:10px; margin:18px 0 0; max-width:540px; }
.bfo-post .bfo-convcta .bfo-signup input[type="email"]{
  width:100%; height:50px; padding:0 16px; box-sizing:border-box; border:1px solid rgba(3,59,90,.18);
  border-radius:var(--bfo-btn-radius, 16px); background:#fff; font:15px var(--bfo-body); color:var(--bfo-navy);
}
.bfo-post .bfo-convcta .bfo-signup button{
  height:50px; border:0; border-radius:var(--bfo-btn-radius, 16px); padding:0 20px; background:var(--bfo-amber); color:var(--bfo-navy);
  font:900 12.5px/1 var(--bfo-display); letter-spacing:.03em; text-transform:uppercase; white-space:nowrap;
}
.bfo-post .bfo-convcta .bfo-signup__msg{ color:var(--bfo-navy); font-size:14px !important; }

@media (min-width:768px){
  .bfo-post .bfo-convcta{ margin:54px 0 0; padding:27px 28px 28px; }
  .bfo-post > .bfo-convcta + *{ margin-top:40px; }
  .bfo-post .bfo-convcta h3.wp-block-heading{ font-size:25px; }
  .bfo-post .bfo-convcta--quiz, .bfo-post .bfo-convcta--resource{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:32px; align-items:center; }
  .bfo-post .bfo-convcta--quiz .wp-block-buttons, .bfo-post .bfo-convcta--resource .wp-block-buttons{ margin-top:0; }
  .bfo-post .bfo-convcta__copy p:not(.bfo-eyebrow), .bfo-post .bfo-convcta .bfo-nextstep__copy p:not(.bfo-eyebrow){ max-width:50ch; }
  .bfo-post .bfo-convcta--resource:has(figure.bfo-convcta__thumb){ grid-template-columns:96px minmax(0,1fr) auto; gap:28px; }
  .bfo-convcta figure.bfo-convcta__thumb{ margin:0; max-width:none; }
  /* Bulletin: quiet Mist band, form under the copy */
  .bfo-post .bfo-convcta--bulletin{ background:var(--bfo-mist); border-color:#E1E9ED; padding:27px 28px 28px; }
  .bfo-post .bfo-convcta .bfo-signup{ flex-direction:row; }
  .bfo-post .bfo-convcta .bfo-signup input[type="email"]{ flex:1; min-width:0; }
}

/* ---------- Article headings use the full reading column (v0.29.3) ---------- */
@media (min-width:768px){
  .bfo-post h2.wp-block-heading,
  .bfo-post h3.wp-block-heading,
  .bfo-post .bfo-post-conclusion h2.wp-block-heading,
  .bfo-post .bfo-post-utilities h2.wp-block-heading,
  .bfo-post .bfo-post-editorial__copy h2.wp-block-heading{ max-width:none; }
}

/* ---------- Older-format references: folded into an accordion (v0.29.3) ----------
 * The theme wraps .bfo-references-list in <details>; its "References" H2 becomes a small label. */
.bfo-post h2.wp-block-heading:has(+ details.bfo-post-refs--legacy){
  display:flex; align-items:center; gap:12px; margin:40px 0 0; max-width:none;
  font:700 11px/1.2 var(--bfo-label) !important; letter-spacing:.16em; text-transform:uppercase; color:var(--bfo-navy);
}
.bfo-post h2.wp-block-heading:has(+ details.bfo-post-refs--legacy)::before{ content:""; flex:none; width:44px; height:2px; border-radius:99px; background:var(--bfo-amber); }
.bfo-post details.bfo-post-refs--legacy{ margin-top:14px; border-top:1px solid var(--bfo-line); }
.bfo-post details.bfo-post-refs--legacy ol{ margin:0 0 18px; padding-left:20px; display:grid; gap:9px; color:var(--bfo-muted); font-size:12.5px; line-height:1.55; }
.bfo-post details.bfo-post-refs--legacy ol li{ margin:0; }

/* ---------- Desktop "On this page": progress + current section (subtle) ---------- */
.bfo-toc__progress{ height:3px; margin:12px 0 2px; background:#EEF1F3; border-radius:999px; overflow:hidden; }
.bfo-toc__progress span{ display:block; height:100%; width:0; background:var(--bfo-amber); transition:width .12s linear; }
.bfo-toc--live .bfo-toc__links a{ position:relative; transition:color .18s ease, padding-left .18s ease; }
.bfo-toc--live .bfo-toc__links a:first-child{ color:var(--bfo-muted); font-weight:500; }
.bfo-toc--live .bfo-toc__links a.is-current{ color:var(--bfo-navy); font-weight:700; padding-left:10px; }
.bfo-toc--live .bfo-toc__links a.is-current::before{ content:""; position:absolute; left:0; top:calc(10px + .72em - 2px); width:4px; height:4px; border-radius:50%; background:var(--bfo-amber); }
@media (min-width:1025px){
  .bfo-jread .bfo-jread__side{ max-height:calc(100vh - 140px); overflow:auto; scrollbar-width:none; }
  .bfo-jread .bfo-jread__side::-webkit-scrollbar{ display:none; }
}
@media (prefers-reduced-motion:reduce){
  .bfo-toc__progress span, .bfo-toc--live .bfo-toc__links a{ transition:none; }
}

/* ---------- In Brief with plain points (importer 1.1) — amber bullets, no rules ---------- */
.bfo-post .bfo-post-brief ul.bfo-post-brief__points{ list-style:none; margin:12px 0 0; padding:0; display:grid; gap:10px; }
.bfo-post .bfo-post-brief ul.bfo-post-brief__points li{ position:relative; margin:0; padding:0 0 0 17px; border:0; color:var(--bfo-slate); font-size:14px; line-height:21px; }
.bfo-post .bfo-post-brief ul.bfo-post-brief__points li::before{ content:""; position:absolute; left:0; top:8px; width:6px; height:6px; border-radius:50%; background:var(--bfo-amber); }
@media (min-width:768px){ .bfo-post .bfo-post-brief ul.bfo-post-brief__points li{ font-size:15px; line-height:23px; } .bfo-post .bfo-post-brief ul.bfo-post-brief__points li::before{ top:9px; } }

/* ---------- Resource download — email gate (v0.29.8) ----------
 * Mist band like the Bulletin CTA; optional thumbnail left on desktop.
 * Form → Download button swap handled by assets/js/bfo-gate.js. */
.bfo-gate-form .bfo-signup__hp{ position:absolute !important; left:-9999px !important; width:1px; height:1px; overflow:hidden; }
.bfo-gate-form.is-busy button{ opacity:.7; cursor:wait; }
.bfo-post .bfo-convcta--gated .bfo-gate__unlocked[hidden], .bfo-post .bfo-convcta--gated [hidden]{ display:none !important; }
.bfo-post .bfo-convcta--gated .bfo-gate__btn{ margin-top:14px; }
.bfo-post .bfo-convcta--gated p.bfo-gate__note{ margin-top:12px !important; font-size:13px !important; line-height:19px !important; color:var(--bfo-slate); opacity:.85; max-width:540px !important; }
.bfo-post .bfo-convcta--gated .bfo-gate__warn{ margin-top:14px !important; padding:10px 12px; background:#fff3cd; color:#664d03 !important; font-size:13px !important; border-radius:8px; }
@media (max-width:767px){
  .bfo-post .bfo-convcta--gated .bfo-gate__btn, .bfo-post .bfo-convcta--gated .bfo-gate__btn .wp-block-button, .bfo-post .bfo-convcta--gated .bfo-gate__btn .wp-block-button__link{ width:100%; box-sizing:border-box; text-align:center; }
}
@media (min-width:768px){
  .bfo-post .bfo-convcta--gated:has(figure.bfo-convcta__thumb img[src]){ display:grid; grid-template-columns:96px minmax(0,1fr); gap:28px; align-items:start; }
  .bfo-post .bfo-convcta--gated .bfo-convcta__copy p:not(.bfo-eyebrow):not(.bfo-signup__msg){ max-width:58ch; }
}
.bfo-convcta figure.bfo-convcta__thumb:not(:has(img[src])){ display:none; }
