/*
  Trade Finance BD editorial template (v20261110-1)
  Self-hosted, CSP-safe (style-src 'self'); no CDN, no CSS imports, no remote fonts.
  Scoped to body.tfbd-editorial so it cannot restyle the portal SPA.
  It maps the editorial palette onto the existing --site-* tokens from
  site-theme.css, so light/dark mode and the shared header keep working.
*/
@font-face{font-family:"TFBD Sans";src:url("/assets/fonts/NotoSans-latin-var.woff2") format("woff2");font-weight:400 800;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2194,U+2212,U+2215,U+2713,U+FEFF,U+FFFD}
@font-face{font-family:"TFBD Bengali";src:url("/assets/fonts/NotoSansBengali-var.woff2") format("woff2");font-weight:100 900;font-style:normal;font-display:swap;unicode-range:U+0951-0952,U+0964-0965,U+0980-09FF,U+1CD0-1CF7,U+200C-200D,U+25CC,U+A8F1}

:root{
  /* Editorial palette (only ed-* components read these) */
  --ed-navy:#0b1b3d;--ed-navy-2:#0a192f;--ed-accent:#0050b3;--ed-accent-2:#0066cc;--ed-accent-bg:#eaf2ff;
  --ed-canvas:#f9fafb;--ed-surface:#fff;--ed-ink:#1f2937;--ed-ink-2:#2d3748;--ed-muted:#4b5563;--ed-line:#e5e7eb;
  --ed-radius:12px;--ed-radius-sm:8px;--ed-shadow:0 1px 2px rgb(16 24 40 / 5%),0 4px 16px rgb(16 24 40 / 6%);
  --ed-measure:72ch;--ed-gap:clamp(20px,3vw,40px);--ed-font:"TFBD Sans","TFBD Bengali",Inter,"Segoe UI",system-ui,-apple-system,sans-serif;
}
body.tfbd-editorial,html[data-theme] body.tfbd-editorial{
  /* Bridge to the shared site tokens (site-theme.css reads these with !important) */
  --site-bg:var(--ed-canvas);--site-surface:var(--ed-surface);--site-text:var(--ed-ink);--site-muted:var(--ed-muted);
  --site-line:var(--ed-line);--site-accent:var(--ed-accent);--site-accent-bg:var(--ed-accent-bg);--portal-font:var(--ed-font);
  margin:0;background:var(--ed-canvas);color:var(--ed-ink);font-family:var(--ed-font);font-size:17px;line-height:1.75;
  -webkit-text-size-adjust:100%;text-rendering:optimizeLegibility
}
html[data-theme=dark]{
  --ed-navy:#e8f0ff;--ed-navy-2:#dbe7fb;--ed-accent:#9cc7ff;--ed-accent-2:#b5d5ff;--ed-accent-bg:#1c3354;
  --ed-canvas:#0e1726;--ed-surface:#152338;--ed-ink:#e5e9f0;--ed-ink-2:#d4dae3;--ed-muted:#b3bfcf;--ed-line:#2f4561;
  --ed-shadow:0 1px 2px rgb(0 0 0 / 30%)
}
.tfbd-editorial *,.tfbd-editorial *::before,.tfbd-editorial *::after{box-sizing:border-box}
.tfbd-editorial a{color:var(--ed-accent);text-underline-offset:3px;text-decoration-thickness:1px}
.tfbd-editorial a:hover{text-decoration-thickness:2px}
.tfbd-editorial :focus-visible{outline:3px solid var(--ed-accent-2);outline-offset:3px;border-radius:4px}
.tfbd-editorial .ed-skip{position:absolute;left:-9999px;top:8px;background:var(--ed-surface);padding:8px 12px;z-index:60}
.tfbd-editorial .ed-skip:focus{left:8px}

/* Shared enhancements, also used by generated banker guides */
[data-ed-article] h2[id],[data-ed-article] h3[id]{position:relative;scroll-margin-top:24px}

/* Reading progress: fixed 2px bar, transform-only updates (no layout, no CLS) */
.ed-progress{position:fixed;inset:0 0 auto 0;height:2px;z-index:50;background:transparent;pointer-events:none}
.ed-progress span{display:block;height:100%;background:var(--ed-accent-2);transform:scaleX(0);transform-origin:0 50%;will-change:transform}

/* Site masthead */
.ed-masthead{background:var(--ed-surface);border-bottom:1px solid var(--ed-line)}
.ed-masthead-inner{max-width:1200px;margin:auto;padding:14px var(--ed-gap);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 24px;min-height:60px}
.ed-brand{font-weight:800;letter-spacing:-.01em;color:var(--ed-navy)!important;text-decoration:none}
.ed-masthead nav{display:flex;flex-wrap:wrap;gap:4px 20px;font-size:.95rem}
.ed-masthead nav a{color:var(--ed-ink-2);text-decoration:none;min-height:44px;display:inline-flex;align-items:center}
.ed-masthead nav a:hover{color:var(--ed-accent)}

/* 12-column editorial grid */
.ed-shell{max-width:1200px;margin:auto;padding:0 var(--ed-gap) 56px;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:var(--ed-gap)}
.ed-context{grid-column:1/-1;padding:28px 0 20px;border-bottom:1px solid var(--ed-line);margin-bottom:28px}
.ed-main{grid-column:1/span 8;min-width:0}
.ed-sidebar{grid-column:9/span 4;min-width:0}
.ed-sidebar-inner{position:sticky;top:20px;display:grid;gap:16px;max-height:calc(100vh - 40px);overflow:auto;padding-bottom:4px;overscroll-behavior:contain}

/* Context zone */
.ed-crumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;font-size:.875rem;color:var(--ed-muted)}
.ed-crumbs li{margin:0}
.ed-crumbs li+li::before{content:"\203A";margin-right:6px;color:var(--ed-muted)}
.ed-crumbs a{color:var(--ed-muted)}
.ed-badge{display:inline-block;margin:18px 0 10px;padding:4px 10px;border-radius:999px;background:var(--ed-accent-bg);color:var(--ed-accent);font-size:.75rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;line-height:1.5}
.tfbd-editorial h1,.tfbd-editorial h2,.tfbd-editorial h3,.tfbd-editorial h4{color:var(--ed-navy);letter-spacing:-.02em;font-weight:800;line-height:1.2}
.tfbd-editorial h1{font-size:clamp(1.875rem,1.15rem + 2.9vw,3rem);line-height:1.12;margin:0 0 14px;max-width:24ch}
.ed-deck{font-size:clamp(1.0625rem,1rem + .35vw,1.25rem);line-height:1.6;color:var(--ed-muted);max-width:var(--ed-measure);margin:0 0 20px}
.ed-byline{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;font-size:.9rem;color:var(--ed-muted)}
.ed-byline strong{color:var(--ed-ink)}
.ed-byline .ed-dot::before{content:"\00B7";margin-right:18px}
.ed-share{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;align-items:center}
.ed-btn{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:8px 14px;border:1px solid var(--ed-line);border-radius:999px;background:var(--ed-surface);color:var(--ed-ink)!important;font:600 .875rem/1.2 var(--ed-font);text-decoration:none;cursor:pointer}
.ed-btn:hover{border-color:var(--ed-accent);color:var(--ed-accent)!important}
.ed-btn[data-state=copied]{border-color:#1a7f37;color:#1a7f37!important}
.ed-btn[hidden]{display:none}
.ed-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ed-toc-toggle{display:none}

/* Article body */
.ed-prose{max-width:var(--ed-measure);font-size:1.0625rem;line-height:1.75;color:var(--ed-ink)}
.ed-prose>*{margin-top:0;margin-bottom:1.1em}
.ed-prose h2{font-size:clamp(1.375rem,1.2rem + .7vw,1.75rem);margin:2.2em 0 .6em;scroll-margin-top:24px;position:relative}
.ed-prose h3{font-size:1.1875rem;margin:1.6em 0 .4em;scroll-margin-top:24px;position:relative}
.ed-prose h4{font-size:1.0625rem;margin:1.4em 0 .4em}
.ed-prose p a,.ed-prose li a{overflow-wrap:anywhere}
.ed-prose ol,.ed-prose ul{padding-left:1.4em}
.ed-prose li{margin:.5em 0}
.ed-prose strong{color:var(--ed-ink-2)}
.ed-anchor{position:absolute;left:-1.1em;top:0;padding-right:.2em;color:var(--ed-muted)!important;text-decoration:none;opacity:0;font-weight:600}
[data-ed-article] h2:hover .ed-anchor,[data-ed-article] h3:hover .ed-anchor,.ed-anchor:focus{opacity:1}
.ed-source{font-size:.9rem;color:var(--ed-muted)}

/* Executive takeaways */
.ed-takeaways{max-width:var(--ed-measure);margin:0 0 32px;padding:20px 24px;background:var(--ed-surface);border:2px solid var(--ed-navy);border-left-width:6px;border-radius:var(--ed-radius-sm)}
.ed-takeaways h2{font-size:.8125rem!important;letter-spacing:.1em!important;text-transform:uppercase;margin:0 0 8px!important;color:var(--ed-navy)}
.ed-takeaways ul{margin:0;padding-left:1.2em}
.ed-takeaways li{margin:.45em 0;line-height:1.6}

/* Figures, tables, pull quotes */
.ed-figure{margin:24px 0 28px;max-width:100%}
.ed-figure figcaption{font-size:.875rem;color:var(--ed-muted);margin-top:8px;line-height:1.55}
.table-scroll{overflow-x:auto;border:1px solid var(--ed-line);border-radius:var(--ed-radius-sm);background:var(--ed-surface);-webkit-overflow-scrolling:touch}
.tfbd-editorial table{border-collapse:collapse;width:100%;font-size:.9375rem;line-height:1.55}
.tfbd-editorial th,.tfbd-editorial td{padding:10px 12px;text-align:left;vertical-align:top;border-bottom:1px solid var(--ed-line)}
.tfbd-editorial thead th{background:var(--ed-canvas);color:var(--ed-navy);font-weight:700;white-space:nowrap}
.tfbd-editorial tbody tr:last-child td{border-bottom:0}
.ed-pullquote{margin:32px 0;padding:4px 0 4px 20px;border-left:4px solid var(--ed-accent-2);font-size:1.25rem;line-height:1.5;font-weight:600;color:var(--ed-navy)}

/* Transaction entity modules */
.ed-entities{max-width:var(--ed-measure);margin:8px 0 32px}
.ed-entities h2{margin-top:0!important}
.ed-entity-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:0;padding:0;list-style:none}
.ed-entity{margin:0;padding:14px 16px;background:var(--ed-surface);border:1px solid var(--ed-line);border-radius:var(--ed-radius-sm);box-shadow:var(--ed-shadow);min-height:96px}
.ed-entity dt,.ed-entity .ed-role{font-size:.6875rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--ed-muted);margin:0 0 4px}
.ed-entity dd,.ed-entity .ed-name{margin:0;font-weight:700;color:var(--ed-navy);line-height:1.35}
.ed-entity .ed-note{display:block;margin-top:4px;font-size:.8125rem;font-weight:400;color:var(--ed-muted);line-height:1.45}

/* Sidebar cards */
.ed-card{background:var(--ed-surface);border:1px solid var(--ed-line);border-radius:var(--ed-radius);padding:16px 18px;box-shadow:var(--ed-shadow)}
.ed-card h2{font-size:.8125rem;letter-spacing:.1em;text-transform:uppercase;margin:0 0 10px;color:var(--ed-navy)}
.ed-facts{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0;font-size:.875rem;line-height:1.45}
.ed-facts dt{color:var(--ed-muted)}
.ed-facts dd{margin:0;color:var(--ed-ink);font-weight:600}
.ed-related{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.ed-related a{display:block;padding:8px 0;border-top:1px solid var(--ed-line);font-size:.9rem;line-height:1.4;text-decoration:none}
.ed-related li:first-child a{border-top:0}
.ed-cta p{margin:0 0 10px;font-size:.9rem;line-height:1.5;color:var(--ed-muted)}

/* Table of contents with scroll-spy state */
.ed-toc ol{list-style:none;margin:0;padding:0;border-left:2px solid var(--ed-line)}
.ed-toc li{margin:0}
.ed-toc a{display:block;padding:6px 0 6px 12px;margin-left:-2px;border-left:2px solid transparent;color:var(--ed-muted);text-decoration:none;font-size:.9rem;line-height:1.4}
.ed-toc a:hover{color:var(--ed-accent)}
.ed-toc a[aria-current=location]{color:var(--ed-navy);font-weight:700;border-left-color:var(--ed-accent-2)}
.ed-toc-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ed-toc-close{display:none}
.ed-backdrop{display:none}

.ed-foot{border-top:1px solid var(--ed-line);background:var(--ed-surface)}
.ed-foot-inner{max-width:1200px;margin:auto;padding:24px var(--ed-gap);display:flex;flex-wrap:wrap;gap:8px 20px;font-size:.9rem}
.ed-foot p{flex-basis:100%;margin:8px 0 0;color:var(--ed-muted);font-size:.85rem}

/* Tablet and mobile: single column, TOC becomes an accessible bottom sheet */
@media (max-width:63.99em){
  .ed-main,.ed-sidebar{grid-column:1/-1}
  .ed-sidebar-inner{position:static;max-height:none;overflow:visible;margin-top:32px}
  .ed-toc-toggle{display:inline-flex}
  .ed-toc{position:fixed;left:0;right:0;bottom:0;z-index:45;max-height:min(70vh,560px);overflow:auto;border-radius:16px 16px 0 0;transform:translateY(105%);transition:transform .22s ease;visibility:hidden;padding-bottom:max(16px,env(safe-area-inset-bottom))}
  .ed-toc[data-open=true]{transform:none;visibility:visible}
  .ed-toc-close{display:inline-flex}
  .ed-backdrop[data-open=true]{display:block;position:fixed;inset:0;z-index:44;background:rgb(10 25 47 / 45%)}
  .ed-anchor{display:none}
}
@media (max-width:35em){
  body.tfbd-editorial{font-size:16px}
  .ed-takeaways{padding:16px 18px}
}
@media (prefers-reduced-motion:reduce){.ed-toc{transition:none}.tfbd-editorial *{scroll-behavior:auto!important}}
@media print{.ed-progress,.ed-sidebar,.ed-share,.ed-masthead nav,.ed-toc-toggle,.ed-backdrop{display:none!important}.ed-main{grid-column:1/-1}body.tfbd-editorial{background:#fff;color:#000}}
