/*
 * Single post — reading progress, article column, body typography, contents,
 * related row.
 *
 * The body is written in the block editor, so this sheet does two jobs: it sets the
 * reading typography, and it makes the four content patterns render as the design's
 * components when core blocks carry the lb- classes. Nothing here restyles a
 * component — where a pattern uses .lb-slip or .lb-callout, components.css is still
 * the definition and these rules only re-assert what the 17px body rule would
 * otherwise override.
 */

/* -------------------------------------------------------------------------
 * Reading progress
 *
 * Above the sticky header (z-index 30) and below the drawer (60). Purely
 * decorative — aria-hidden, and the page reads identically at 0% width when the
 * script never runs.
 * ---------------------------------------------------------------------- */

.lb-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 40;
  pointer-events: none;
}

.lb-progress__bar {
  display: block;
  height: 100%;
  /* Fixed full width, scaled from the left: scaleX animates on the compositor,
     where a width transition relayouts the bar every scroll frame. */
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--signal-amber);
  transition: transform var(--dur-fast) var(--ease-standard);
}

/* -------------------------------------------------------------------------
 * Article column
 * ---------------------------------------------------------------------- */

.lb-post {
  padding-block: var(--space-10) 0;
}

/* Narrower than the site container: 1040px, so the measure stays readable. */
.lb-post__inner {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: clamp(var(--gutter-mobile), 4vw, var(--gutter-desktop));
}

.lb-chrome a.lb-post__back {
  font-size: var(--text-small);
  color: var(--muted);
}

.lb-chrome a.lb-post__back:hover {
  color: var(--deep-green);
}

.lb-post__head {
  display: grid;
  gap: 14px;
  max-width: 700px;
  margin-block-start: var(--space-5);
}

.lb-post__category {
  margin: 0;
}

.lb-chrome .lb-post__category a {
  color: inherit;
}

.lb-chrome .lb-post__category a:hover {
  color: var(--deep-green);
  text-decoration: none;
}

.lb-post__title {
  text-wrap: pretty;
}

.lb-post__standfirst {
  margin: 0;
  font-size: var(--text-h3);
  line-height: var(--lh-bangla);
  color: var(--ink);
  text-wrap: pretty;
}

.lb-post__meta {
  margin: 0;
  font-size: var(--text-small);
  color: var(--muted);
}

.lb-post__hero {
  margin-block-start: 28px;
}

.lb-post__layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-10);
  align-items: flex-start;
  padding-block-start: var(--space-10);
}

/* -------------------------------------------------------------------------
 * Body
 * ---------------------------------------------------------------------- */

.lb-post__content {
  flex: 1 1 min(100%, 600px);
  max-width: 640px;
  min-width: 0;
  display: grid;
  gap: 22px;
}

/* The gap does the spacing; block margins would double it. */
.lb-post__content > * {
  margin-block: 0;
}

.lb-post__content p {
  font-size: 17px;
  line-height: var(--lh-bangla);
  color: var(--ink);
}

.lb-post__content h2,
.lb-post__content h3 {
  margin-block-start: var(--space-3);
  font-weight: var(--weight-semibold);
  color: var(--deep-green);
  text-wrap: pretty;
  /* Clears the sticky header when a contents link jumps here. */
  scroll-margin-top: 96px;
}

.lb-post__content h2 {
  font-size: var(--text-h2);
  line-height: 1.4;
}

.lb-post__content h3 {
  font-size: var(--text-h3);
  line-height: 1.4;
}

.lb-post__content ul,
.lb-post__content ol {
  display: grid;
  gap: 10px;
  padding-inline-start: 22px;
  font-size: 17px;
  color: var(--ink);
}

.lb-post__content li::marker {
  color: var(--muted);
  /* List numerals are data, so they stay Latin like every other figure. */
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

.lb-chrome .lb-post__content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lb-post__content img {
  border-radius: var(--radius-lg);
}

.lb-post__content figure {
  margin: 0;
}

.lb-post__content figcaption {
  margin-block-start: var(--space-2);
  font-size: var(--text-caption);
  line-height: var(--lh-caption);
  color: var(--muted);
}

/* A plain quote reads as the amber note — the pattern below is the same shape, and
   an editor who reaches for the quote block should not get a different one.
   1px, per the One Border Rule: the amber carries the emphasis, not thickness. */
.lb-post__content blockquote {
  margin: 0;
  border-left: var(--border-width) solid var(--signal-amber);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
}

.lb-post__content blockquote p {
  font-size: var(--text-body-size);
}

.lb-post__content blockquote cite {
  display: block;
  margin-block-start: var(--space-2);
  font-size: var(--text-caption);
  font-style: normal;
  color: var(--muted);
}

/* -------------------------------------------------------------------------
 * Patterns as rendered by the block editor
 *
 * Each of these re-asserts a component value that the 17px body rule above would
 * otherwise win against, or teaches a component built for spans how to sit around
 * the paragraphs a block pattern produces.
 * ---------------------------------------------------------------------- */

/*
 * Two inherited spacing rules have to be undone inside a pattern, and only inside
 * one: Astra pads every .wp-block-group that is a direct child of .entry-content,
 * and WordPress's flow layout puts 24px between sibling blocks. Both are correct
 * for a page assembled out of stacked groups. Inside a slip they put a white
 * margin above the Forest strip and push the rows three times further apart than
 * the component's own 10px.
 */
.lb-chrome .lb-post__content > .wp-block-group {
  padding: 0;
}

.lb-post__content :is(
  .lb-slip,
  .lb-slip__body,
  .lb-slip__row,
  .lb-slip__value,
  .lb-steps,
  .lb-steps__item,
  .lb-post-cta
) > * {
  margin-block: 0;
}

.lb-post__content .lb-callout,
.lb-post__content .is-style-lb-callout {
  border-left: var(--border-width) solid var(--signal-amber);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  font-size: var(--text-body-size);
}

.lb-post__content .lb-slip p {
  margin: 0;
  font-size: 15px;
}

.lb-post__content .lb-slip__head {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--white);
}

/* The component's row label is a span; a pattern's is a paragraph. */
.lb-post__content .lb-slip__row > p:first-child {
  font-family: var(--font-bangla), var(--font-body);
}

/* A value carrying a basis badge is a group of two blocks, not one span. */
.lb-post__content .lb-slip__value.wp-block-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.lb-post__content .lb-slip__value.wp-block-group p {
  font-weight: var(--weight-semibold);
}

/* The basis badge inside prose runs at its documented 11px (DESIGN.md's pill spec
   names this exact size) — restated locally only because the component default is
   12px on the light surfaces it was born on. */
.lb-post__content .lb-pill--basis {
  font-size: 11px;
  font-weight: var(--weight-regular);
  line-height: 1.7;
}

.lb-post__content .lb-steps p {
  margin: 0;
  font-size: 17px;
}

.lb-post__content .lb-steps__num {
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  color: var(--signal-amber);
}

/* CTA card — the design's closing block, and the reason the CTA band below the
   article stands down when a post carries one. */
.lb-chrome .lb-post__content .lb-post-cta {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 22px;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--green-tint-3);
}

.lb-post__content .lb-post-cta__title {
  font-size: var(--text-body-size);
  font-weight: var(--weight-semibold);
  color: var(--ink);
}

.lb-post__content .lb-post-cta__lede {
  font-size: 15px;
  color: var(--muted);
}

.lb-post-cta .wp-block-buttons {
  margin: 0;
}

.lb-chrome .lb-post-cta .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 0 var(--space-5);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: var(--action-primary);
  color: var(--white);
  font-family: var(--font-bangla), var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-standard);
}

.lb-chrome .lb-post-cta .wp-block-button__link:hover {
  background: var(--action-primary-hover);
  color: var(--white);
  text-decoration: none;
}

/* Core tables in the LogiBangla style. The table element itself cannot carry a
   class from the editor, so components.css matches it through the figure's. */
.lb-post__content .is-style-lb-table {
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--surface-card);
}

.lb-post__content .is-style-lb-table td.has-text-align-right,
.lb-post__content .is-style-lb-table th.has-text-align-right {
  text-align: right;
  font-weight: var(--weight-medium);
}

/* -------------------------------------------------------------------------
 * Side column
 *
 * Contents and the standing offer share one sticky column, so the sticky and the
 * rule live on the wrapper: the border runs the height of both rather than stopping
 * where the list ends. 240px rather than the list's old 200px — the slack was
 * already sitting unused at the end of the row, and the offer's button needs it.
 * ---------------------------------------------------------------------- */

.lb-post__aside {
  flex: 0 1 240px;
  position: sticky;
  top: 96px;
  display: grid;
  gap: var(--space-6);
  align-content: start;
  border-left: var(--border-width) solid var(--border-default);
  padding-left: 18px;
}

.lb-post__toc {
  display: grid;
  gap: 10px;
}

.lb-toc {
  display: grid;
  gap: 10px;
}

.lb-chrome a.lb-toc__item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--space-2);
  font-size: var(--text-small);
  line-height: 20px;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}

.lb-toc__num {
  font-size: var(--text-caption);
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-standard);
}

.lb-chrome a.lb-toc__item:hover,
.lb-chrome a.lb-toc__item.is-active {
  color: var(--deep-green);
  text-decoration: none;
}

.lb-chrome a.lb-toc__item.is-active {
  font-weight: var(--weight-semibold);
}

.lb-chrome a.lb-toc__item.is-active .lb-toc__num {
  color: var(--signal-amber);
}

/*
 * On a phone the column stops being a column and its two halves go to opposite ends
 * of the article. The contents move above it — the design's flex-wrap drops them
 * below, where a list of headings is no use to a reader who has already finished,
 * and as a jump menu at the top they earn their space. The offer goes the other way,
 * to the reader who has just put the piece down. display:contents is what lets them
 * separate without a second copy of either in the markup.
 */
@media (max-width: 900px) {
  .lb-post__aside {
    display: contents;
  }

  .lb-post__toc {
    order: -1;
    flex-basis: 100%;
    border-bottom: var(--border-width) solid var(--border-default);
    padding-bottom: var(--space-5);
  }

  .lb-post__offer {
    flex-basis: 100%;
    /* Full width it sits next to the body's own cards, so it takes their padding
       back — the 20px above is a concession to the 240px column, nothing else. */
    padding: var(--space-6);
  }

  .lb-post__layout {
    gap: var(--space-6);
  }
}

/* -------------------------------------------------------------------------
 * Standing offer
 *
 * The only dark surface in the reading view, and the only place amber sits beside
 * the body text. It carries that weight because it is the one thing on the page
 * asking for an action while the reader is still mid-article.
 * ---------------------------------------------------------------------- */

.lb-post__offer {
  display: grid;
  gap: var(--space-3);
  /* Tighter than the standard card: 24px of padding on a 240px column leaves the
     button too little room for its label. */
  padding: var(--space-5);
}

.lb-post__offer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--wash-on-dark);
  color: var(--signal-amber);
}

.lb-post__offer-title {
  margin: 0;
  font-size: var(--text-h3);
  /* The Bangla line-height, not --lh-h3: at 18px a 24px line crowds the matras. */
  line-height: var(--lh-bangla);
  font-weight: var(--weight-semibold);
  color: var(--white);
  text-wrap: pretty;
}

.lb-post__offer-body {
  margin: 0;
  font-size: var(--text-small);
  line-height: 22px;
  color: var(--text-on-dark-2);
}

.lb-post__offer-foot {
  margin: 0;
  font-size: var(--text-caption);
  line-height: var(--lh-caption);
  /* 4.9:1 on Deep Green — the floor for 12px text, not a decorative fade. */
  color: var(--text-on-dark-4);
}

/* -------------------------------------------------------------------------
 * FAQ — the pattern that also emits FAQPage schema (inc/post.php)
 *
 * Not an accordion. The landing page hides its answers behind <details> because a
 * visitor is scanning for one of seven; a reader who has got this far in an article
 * wants all of them, and collapsed text is worth less to an answer engine than open
 * text. The visual job here is only to mark the block as a set of Q&As.
 * ---------------------------------------------------------------------- */

.lb-post__content .lb-faq-list {
  display: grid;
  gap: var(--space-5);
  padding-block-start: var(--space-5);
  border-top: var(--border-width) solid var(--border-default);
}

.lb-post__content .lb-faq__item {
  display: grid;
  gap: 8px;
}

/* Tighter than a section h3: this is a question, not a new part of the article. */
.lb-post__content h3.lb-faq__q {
  margin: 0;
  font-size: 18px;
  line-height: var(--lh-bangla);
  color: var(--deep-green);
}

.lb-post__content p.lb-faq__a {
  margin: 0;
  color: var(--ink);
}

/* -------------------------------------------------------------------------
 * Related
 * ---------------------------------------------------------------------- */

.lb-post-related {
  padding-block: 56px 72px;
}

.lb-post-related__title {
  margin: 0 0 var(--space-5);
  /* The ramp's Title step — the card titles under it run as h3s at 18px, and a 26px
     section title gives the row the same lead the archive's own headings have. */
  font-size: var(--text-h2);
  line-height: var(--lh-h2);
  font-weight: var(--weight-semibold);
  color: var(--deep-green);
}
