/* =====================================================================
   বিরল রোগ এসএমএ এবং এর ওষুধ

   A Bangla article. Kalpurush is the site's Bangla face already; the
   stack below is the same one mcq.css and research.css use, so the
   article matches the rest of the site rather than inventing a voice.
   Latin runs inside Bangla text are marked lang="en" and kept on Inter,
   because Kalpurush has no Latin design worth reading at body size.
   ===================================================================== */
@font-face {
  font-family: 'Kalpurush';
  src: url('/assets/fonts/Kalpurush.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

.sma-page {
  --bn: 'Kalpurush', 'Noto Sans Bengali', 'Hind Siliguri', 'Nirmala UI', 'Vrinda', system-ui, sans-serif;
  font-family: var(--bn);
  /* Bangla sits taller than Latin and its conjuncts need the room; the site's
     default leading makes a page of it feel cramped. */
  line-height: 1.95;
}
.sma-page [lang="en"] { font-family: Inter, system-ui, sans-serif; line-height: 1.5; }

/* ---------- reading progress ---------- */
.sma-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.sma-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width 0.08s linear;
}

/* ---------- hero ---------- */
.sma-hero { padding: 26px 0 8px; }
.sma-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(1.95rem, 4.4vw, 3rem);
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.sma-lede {
  max-width: 44rem;
  margin: 0 0 18px;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.85;
  color: var(--ink-2);
}
.sma-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.sma-hero-meta li { display: inline-flex; align-items: center; gap: 7px; }
.sma-hero-meta i { width: 16px; height: 16px; }

.sma-origin {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 46rem;
  margin: 18px 0 0;
  padding: 15px 18px;
  border-radius: var(--r-lg);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--ink-2);
}
.sma-origin i { flex: none; width: 19px; height: 19px; margin-top: 5px; color: var(--brand); }
.sma-origin em { font-style: normal; font-weight: 600; color: var(--brand-ink); }

/* ---------- the two-column body ---------- */
.sma-body {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 26px;
  padding-bottom: 40px;
}
.sma-rail { position: sticky; top: 90px; }
.sma-rail-k {
  margin: 0 0 10px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.sma-rail ol {
  margin: 0;
  padding: 0 0 0 1px;
  list-style: none;
  border-left: 2px solid var(--line);
}
.sma-rail li { margin: 0; }
.sma-rail a {
  display: block;
  padding: 7px 0 7px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  text-decoration: none;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}
.sma-rail a:hover { color: var(--ink); }
.sma-rail a.is-on {
  color: var(--brand-ink);
  border-left-color: var(--brand);
  font-weight: 600;
}

.sma-article { max-width: 42rem; }
.sma-article h2 {
  margin: 44px 0 14px;
  font-size: clamp(1.4rem, 2.8vw, 1.8rem);
  line-height: 1.45;
  scroll-margin-top: 90px;
}
.sma-article section:first-child h2 { margin-top: 0; }
.sma-article p { margin: 0 0 18px; font-size: 1.1rem; color: var(--ink-2); }

/* ---------- SMA types ---------- */
.sma-types { margin: 24px 0; }
.sma-types figcaption {
  margin-bottom: 12px;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--muted);
}
.sma-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sma-type {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 17px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.sma-type-n { font-size: 1.1rem; font-weight: 700; color: var(--brand-ink); }
.sma-type-age { font-size: var(--fs-sm); color: var(--muted); }
.sma-type-cap { font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-2); }

/* ---------- shared figure shell ---------- */
.sma-fig {
  margin: 28px 0;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.sma-fig-k {
  margin: 0 0 16px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.sma-fig-note {
  margin: 14px 0 0;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--muted);
}
.sma-btn {
  margin-top: 14px;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  font-family: var(--bn);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.sma-btn:hover { border-color: var(--brand); }
.sma-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- inheritance ---------- */
.sma-parents { display: flex; gap: 28px; justify-content: center; margin-bottom: 6px; }
.sma-parent { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); }
.sma-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #8f5509;
  background: var(--warn-tint);
  border: 1px solid #f0dcb4;
}
.sma-kids {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-2);
}
.sma-kid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 13px 8px;
  border-radius: 13px;
  cursor: pointer;
  font: inherit;
  font-family: var(--bn);
  background: var(--wash);
  border: 1px solid var(--line);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.sma-kid span { font-family: Inter, sans-serif; font-size: 1rem; font-weight: 700; color: var(--ink); }
.sma-kid em { font-style: normal; font-size: 0.78rem; line-height: 1.45; color: var(--muted); text-align: center; }
.sma-kid:hover, .sma-kid.is-picked { transform: translateY(-2px); border-color: var(--brand); }
.sma-kid.is-affected { background: #fdeceb; border-color: #f3c6c3; }
.sma-kid.is-affected span { color: #b4232a; }
.sma-kid.is-affected em { color: #8f3b3b; }

/* ---------- the cipher ---------- */
.sma-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.sma-code-row:last-of-type { border-bottom: 0; }
.sma-code-tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--wash-2);
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--muted);
}
.sma-code code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.sma-code-msg { flex: 1 1 100%; font-size: var(--fs-sm); line-height: 1.7; color: var(--muted); }
/* The changed letter is only marked once the reader has had a chance to find it. */
.sma-code .sma-diff { border-radius: 4px; padding: 1px 2px; transition: background 0.2s ease, color 0.2s ease; }
.sma-code.is-revealed .sma-diff {
  background: var(--warn);
  color: #fff;
  font-weight: 700;
}

/* ---------- the splicing stepper ---------- */
.sma-step-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.sma-step-btn {
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  font-family: var(--bn);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--wash);
  border: 1px solid var(--line);
}
.sma-step-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.sma-step-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.sma-step-btn.is-on { color: #fff; background: var(--brand); border-color: var(--brand); }

.sma-stage {
  padding: 10px 4px;
  border-radius: var(--r);
  background: var(--wash);
}
.sma-stage svg { display: block; width: 100%; height: auto; }

.sma-seg { fill: var(--brand); opacity: 0.92; transition: opacity 0.2s ease; }
.sma-seg.is-intron { fill: #c3cbd9; }
.sma-seg.is-exon7 { fill: var(--teal-deep); }
.sma-seg.is-dropped { fill: none; stroke: #c3cbd9; stroke-width: 2; stroke-dasharray: 6 5; }
.sma-seg.is-dead { opacity: 0.25; }
.sma-seg-t {
  font-family: 'Kalpurush', system-ui, sans-serif;
  font-size: 13px;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
}
.sma-svg-k { font-family: 'Kalpurush', system-ui, sans-serif; font-size: 13px; font-weight: 700; fill: #5d6a82; }
.sma-none { font-family: 'Kalpurush', system-ui, sans-serif; font-size: 14px; fill: #b4232a; }
.sma-drug { fill: var(--warn); }
.sma-drug-t { font-family: 'Kalpurush', system-ui, sans-serif; font-size: 12px; font-weight: 700; fill: #8f5509; text-anchor: middle; }
.sma-out { font-family: 'Kalpurush', system-ui, sans-serif; font-size: 15px; font-weight: 700; fill: var(--ink); }
.sma-out.is-full { fill: #0f7a52; }
.sma-out.is-short { fill: #8f5509; }
.sma-out.is-none { fill: #b4232a; }

.sma-step-text {
  margin: 14px 0 0 !important;
  font-size: var(--fs-sm) !important;
  line-height: 1.85;
  color: var(--ink-2) !important;
}
.sma-step-dots { display: flex; gap: 6px; margin-top: 12px; }
.sma-step-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.sma-step-dots span.is-on { background: var(--brand); }

/* ---------- asides and pull quote ---------- */
.sma-aside {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin: 26px 0;
  padding: 17px 20px;
  border-radius: var(--r-lg);
  background: var(--teal-tint);
  border: 1px solid color-mix(in srgb, var(--teal-deep) 22%, transparent);
}
.sma-aside i { flex: none; width: 20px; height: 20px; margin-top: 5px; color: var(--teal-deep); }
.sma-aside p { margin: 0 !important; font-size: 1.05rem !important; color: var(--ink-2) !important; }
.sma-aside.is-key { background: var(--warn-tint); border-color: #f0dcb4; }
.sma-aside.is-key i { color: var(--warn); }

.sma-pull {
  margin: 30px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--brand);
  font-size: 1.25rem;
  line-height: 1.85;
  color: var(--ink);
}

/* ---------- the author's own figure ---------- */
.sma-authorfig { margin: 30px 0; }
.sma-zoom {
  display: block;
  width: 100%;
  padding: 0;
  position: relative;
  cursor: zoom-in;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
}
.sma-zoom img { display: block; width: 100%; height: auto; }
.sma-zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  background: rgba(11, 27, 63, 0.82);
  color: #fff;
  font-family: var(--bn);
  font-size: var(--fs-xs);
}
.sma-zoom-hint i { width: 14px; height: 14px; }
.sma-authorfig figcaption {
  margin-top: 12px;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--muted);
}
.sma-authorfig figcaption em { font-style: normal; color: var(--brand-ink); }

.sma-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 27, 63, 0.88);
  cursor: zoom-out;
}
.sma-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; background: #fff; }
.sma-lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
}
.sma-lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }

/* ---------- references, disclaimer, share ---------- */
.sma-disclaimer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 30px 0 !important;
  font-size: var(--fs-sm) !important;
  font-style: italic;
  color: var(--muted) !important;
}
.sma-disclaimer i { flex: none; width: 16px; height: 16px; margin-top: 5px; }

.sma-refs ol { margin: 0; padding-left: 1.2rem; }
.sma-refs li { margin-bottom: 12px; font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-2); }
.sma-ref-j { font-style: italic; font-weight: 600; }
.sma-refs a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  word-break: break-all;
}
.sma-refs a i { width: 13px; height: 13px; flex: none; }

.sma-share { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ---------- narrow screens ---------- */
@media (max-width: 920px) {
  .sma-body { grid-template-columns: 1fr; gap: 0; }
  /* The rail becomes a strip that scrolls sideways, so it stays useful on a phone
     instead of becoming a tall list the reader has to get past to reach the article. */
  .sma-rail {
    position: static;
    margin-bottom: 22px;
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sma-rail::-webkit-scrollbar { display: none; }
  .sma-rail ol { display: flex; gap: 6px; border-left: 0; }
  .sma-rail a {
    white-space: nowrap;
    padding: 7px 13px;
    margin: 0;
    border-left: 0;
    border-radius: 20px;
    background: var(--wash);
    border: 1px solid var(--line);
  }
  .sma-rail a.is-on { background: var(--brand-soft); border-color: var(--brand); }
  .sma-article { max-width: none; }
  .sma-type-grid { grid-template-columns: 1fr; }
  .sma-kids { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sma-progress span, .sma-kid { transition: none; }
}
