/* Journal articles: body tables match .bt-journal-table, and the "Updated" date replaces the original date. */
body.single-post .entry-content .wp-block-table { max-width: 100%; overflow-x: auto; margin: 28px 0; border: 1px solid var(--bt-line, #dce5e0); border-radius: var(--bt-radius-card, 8px); -webkit-overflow-scrolling: touch; }
body.single-post .entry-content .wp-block-table table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
body.single-post .entry-content .wp-block-table thead { border-bottom: 0; }
body.single-post .entry-content .wp-block-table :is(th, td) { padding: 12px 16px; border: 0; border-top: 1px solid var(--bt-line, #dce5e0); text-align: left; vertical-align: top; word-break: normal; overflow-wrap: normal; }
body.single-post .entry-content .wp-block-table thead :is(th, td) { border-top: 0; font-size: 13px; font-weight: 650; background: var(--bt-paper, #f1f5f3); color: var(--bt-ink, #182b2b); }
body.single-post .entry-content .wp-block-table figcaption { padding: 12px 16px; margin: 0; font-size: 13px; color: var(--bt-muted, #62716d); }

.blog-post-meta .posted-on:has(.btllc-updated) time.published { display: none; }
.blog-post-meta .posted-on .btllc-updated time.updated { display: inline; margin-left: 0; }

@media (max-width: 767px) {
  /* Fixed layout squeezed four columns into one word per line; let wide tables scroll instead. */
  body.single-post .entry-content .wp-block-table table.has-fixed-layout { table-layout: auto; }
  body.single-post .entry-content .wp-block-table table:has(thead th:nth-child(3)) { min-width: 560px; }
  body.single-post .entry-content .wp-block-table :is(th, td) { padding: 10px 12px; font-size: 14px; }
}

/* ---- Journal articles, v2 components (btllc-journal.js adds the interactive parts) ---- */
body.single-post .entry-content .wp-block-table tbody td:first-child { font-weight: 600; color: var(--bt-ink, #182b2b); }
body.single-post .entry-content .wp-block-table.btllc-keyfacts thead :is(th, td) { background: var(--bt-ink, #182b2b); color: #fff; }
body.single-post .entry-content .wp-block-table.btllc-keyfacts td:last-child { font-variant-numeric: tabular-nums; }

/* Charts and diagrams: inline SVG; a narrow variant replaces the wide one on phones. */
.entry-content .btllc-chart { margin: 32px 0; }
.entry-content .btllc-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.entry-content .btllc-chart .btllc-svg-narrow { display: none; }
@media (max-width: 600px) {
  .entry-content .btllc-chart .btllc-svg-wide { display: none; }
  .entry-content .btllc-chart .btllc-svg-narrow { display: block; }
}
.entry-content .btllc-chart figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--bt-muted, #62716d); }
.btllc-chart [data-tip] { cursor: pointer; transition: opacity .12s; }
.btllc-chart [data-tip]:hover, .btllc-chart [data-tip].is-active { opacity: .72; }
.btllc-chart [data-tip]:focus-visible { outline: 2px solid var(--bt-focus, #a87b30); outline-offset: 2px; }
.btllc-tip { position: fixed; z-index: 9999; transform: translate(-50%, -100%); max-width: 240px; padding: 6px 10px; border-radius: 6px; background: var(--bt-ink, #182b2b); color: #fff; font: 600 13px/1.35 var(--bt-font-body, Arial, sans-serif); text-align: center; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }

/* View switches (only shown when JavaScript can use them) */
.btllc-seg { display: none; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.btllc-js .btllc-seg { display: flex; }
.btllc-seg button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--bt-line, #dce5e0); border-radius: 999px; background: #fff; color: var(--bt-ink, #182b2b); font: 600 13px/1 var(--bt-font-body, Arial, sans-serif); cursor: pointer; }
.btllc-seg button[aria-pressed="true"] { border-color: var(--bt-primary, #185c53); background: var(--bt-primary, #185c53); color: #fff; }
.btllc-seg button:focus-visible { outline: 2px solid var(--bt-focus, #a87b30); outline-offset: 2px; }

/* Sortable tables and CSV export */
.btllc-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.btllc-sort::after { content: "\2195"; font-size: 11px; opacity: .5; }
th[aria-sort="ascending"] .btllc-sort::after { content: "\2191"; opacity: 1; }
th[aria-sort="descending"] .btllc-sort::after { content: "\2193"; opacity: 1; }
.btllc-sort:focus-visible { outline: 2px solid var(--bt-focus, #a87b30); outline-offset: 2px; }
.btllc-csv-btn { margin-left: 10px; padding: 6px 12px; border: 1px solid var(--bt-line, #dce5e0); border-radius: 999px; background: #fff; color: var(--bt-primary, #185c53); font: 600 12px/1.2 var(--bt-font-body, Arial, sans-serif); cursor: pointer; }

/* Phones: tables with 3+ columns read as labelled cards (reference article layout) */
@media (max-width: 600px) {
  body.single-post .entry-content .wp-block-table.btllc-cards { overflow: visible; border: 0; border-radius: 0; }
  body.single-post .entry-content .wp-block-table.btllc-cards :is(table, tbody, tr, td) { display: block; width: auto; min-width: 0 !important; }
  body.single-post .entry-content .wp-block-table.btllc-cards thead { display: none; }
  body.single-post .entry-content .wp-block-table.btllc-cards tr { margin: 0 0 12px; padding: 6px 0; border: 1px solid var(--bt-line, #dce5e0); border-radius: 10px; background: #fff; }
  body.single-post .entry-content .wp-block-table.btllc-cards td { padding: 5px 14px; border: 0; }
  body.single-post .entry-content .wp-block-table.btllc-cards td:not(:first-child)::before { content: attr(data-label); display: block; color: var(--bt-muted, #62716d); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
  body.single-post .entry-content .wp-block-table.btllc-cards figcaption { padding: 4px 0 0; }
}

/* Interactive widgets: a worked example shows until the script takes over */
.entry-content .btllc-widget { margin: 32px 0; padding: 20px; border: 1px solid var(--bt-line, #dce5e0); border-radius: var(--bt-radius-card, 12px); background: var(--bt-paper, #f1f5f3); }
.btllc-widget__title { margin: 0 0 4px; color: var(--bt-ink, #182b2b); font: 700 18px/1.3 var(--bt-font-body, Arial, sans-serif); }
.btllc-widget__intro { margin: 0 0 16px; color: var(--bt-muted, #62716d); font-size: 14px; line-height: 1.5; }
.btllc-widget__app { display: none; }
.btllc-widget.is-ready .btllc-widget__app { display: block; }
.btllc-widget.is-ready .btllc-widget__fallback { display: none; }
.btllc-widget__fallback { font-size: 15px; }
.btllc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.btllc-field { display: grid; gap: 6px; margin: 0 0 14px; }
.btllc-field label, .btllc-field legend { color: var(--bt-ink, #182b2b); font-size: 13px; font-weight: 650; }
.btllc-field :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select) { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--bt-line, #dce5e0); border-radius: 8px; background: #fff; color: var(--bt-ink, #182b2b); font: 16px/1.3 var(--bt-font-body, Arial, sans-serif); box-sizing: border-box; }
.btllc-field input[type="range"] { width: 100%; accent-color: var(--bt-primary, #185c53); }
.btllc-field :is(input, select):focus-visible { outline: 2px solid var(--bt-focus, #a87b30); outline-offset: 1px; }
.btllc-out { padding: 14px 16px; border: 1px solid var(--bt-line, #dce5e0); border-radius: 10px; background: #fff; }
.btllc-out__label { color: var(--bt-muted, #62716d); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.btllc-out__value { color: var(--bt-ink, #182b2b); font: 700 24px/1.25 var(--bt-font-body, Arial, sans-serif); font-variant-numeric: tabular-nums; }
.btllc-out__note { color: var(--bt-muted, #62716d); font-size: 13px; line-height: 1.45; }
.btllc-out.is-good { border-color: var(--bt-success, #216445); }
.btllc-out.is-warn { border-color: var(--bt-gold, #a87b30); }
.btllc-out.is-bad { border-color: var(--bt-danger, #a5333d); }
.btllc-widget__foot { margin-top: 12px; color: var(--bt-muted, #62716d); font-size: 12.5px; line-height: 1.5; }

/* Checklists: plain lists that become checkboxes with a running message */
.entry-content .btllc-checklist { margin: 28px 0; padding: 18px 20px; border: 1px solid var(--bt-line, #dce5e0); border-radius: var(--bt-radius-card, 12px); background: #fff; }
.btllc-checklist ul { margin: 0; padding-left: 20px; }
.btllc-checklist.is-ready ul { padding: 0; list-style: none; }
.btllc-checklist.is-ready li { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 0; border-top: 1px solid var(--bt-line, #dce5e0); }
.btllc-checklist.is-ready li:first-child { border-top: 0; }
.btllc-checklist input { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--bt-primary, #185c53); }
.btllc-checklist__result { margin: 12px 0 0; color: var(--bt-ink, #182b2b); font-weight: 650; }
.btllc-checklist:not(.is-ready) .btllc-checklist__result { display: none; }

/* Notes: method notes, myth vs fact, "what we see at the counter" */
.entry-content .btllc-note { margin: 28px 0; padding: 14px 18px; border-left: 3px solid var(--bt-gold, #a87b30); background: #fff; font-size: 15.5px; line-height: 1.6; }
.entry-content .btllc-note > :first-child { margin-top: 0; }
.entry-content .btllc-note > :last-child { margin-bottom: 0; }

/* Live items from btllc-spot-pages ([btllc_live]): charts and tables are blocks, numbers stay inline. */
.entry-content div.btllc-live { display: block; min-width: 0; }
.entry-content span.btllc-live { display: inline; }

/* Product cards in articles ([btllc_product_cards], agni-cartify): the home page's canonical Woo cards and grid.
   count 8 → 4 / 6 / 8 cards on phone / tablet / desktop; count 4 → 4 everywhere (2 × 2 below 1100px). */
.entry-content .btllc-products { margin: 28px 0 32px; padding: 20px 0 4px; border-top: 1px solid var(--bt-line, #dce5e0); }
.entry-content .btllc-products__label { margin: 0 0 12px; font-size: 11px; line-height: 1.5; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bt-muted, #62716d); }
.entry-content .btllc-products ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; width: auto; margin: 0; padding: 0; list-style: none; }
.entry-content .btllc-products ul.products::before, .entry-content .btllc-products ul.products::after { display: none; }
.entry-content .btllc-products ul.products li.product { width: auto; max-width: none; margin: 0; padding: 0; float: none; list-style: none; }
.entry-content .btllc-products ul.products li.product::before { content: none; }
.entry-content .btllc-products--2 ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.entry-content .btllc-products__note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--bt-muted, #62716d); }
@media (max-width: 1100px) {
  .entry-content .btllc-products--8 ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-content .btllc-products--8 ul.products > li:nth-child(n+7) { display: none; }
  .entry-content .btllc-products--4 ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .entry-content .btllc-products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .entry-content .btllc-products--8 ul.products > li:nth-child(n+5) { display: none; }
}
