/*
 * Mike's Balance editorial system, v1 (all Polylang languages).
 * Applies only to single-post Gutenberg prose. Does not restyle archives,
 * homepage widgets, charts, calculators or existing sidebar positioning.
 *
 * Authoring contracts:
 * - mb-e-takeaways / mb-e-references applied by mb-editorial-system.js
 * - mb-e-reading-pause, mb-e-research-note, mb-e-figure-note, mb-e-metric-card
 *   available to future Gutenberg blocks.
 * - Colour is neutral unless the source proves a meaningful category.
 */
body.single-post .main-article .post-content .text {
  --mb-e-ink:#34404a;
  --mb-e-muted:#56626c;
  --mb-e-soft:#f8f7f4;
  --mb-e-border:#e3ddd5;
  --mb-e-accent:#aa9885;
  --mb-e-link:#375f67;
}
body.single-post .main-article .post-content .text :is(.mb-e-takeaways-title,.mb-e-references-title) {
  color:var(--mb-e-ink);
}
body.single-post .main-article .post-content .text .mb-e-takeaways-title {
  margin:2.1rem 0 1rem;
  font-size:clamp(23px,2.4vw,27px);
  line-height:1.2;
  letter-spacing:-.018em;
}
body.single-post .main-article .post-content .text .mb-e-takeaways-title::before {
  content:"";
  display:block;
  width:37px;height:2px;
  margin:0 0 13px;
  background:var(--mb-e-accent);
}
body.single-post .main-article .post-content .text ul.mb-e-takeaways {
  list-style:none;
  display:grid;
  gap:12px;
  margin:0 0 2.2rem;
  padding:0;
  max-width:740px;
}
body.single-post .main-article .post-content .text ul.mb-e-takeaways > li {
  display:block;
  list-style:none;
  margin:0;
  padding:.08rem 0 .08rem 16px;
  border-left:2px solid #d6d0c7;
  line-height:1.55;
  font-weight:400;
}
body.single-post .main-article .post-content .text ul.mb-e-takeaways > li::marker {
  content:"";
}
body.single-post .main-article .post-content .text ul.mb-e-takeaways > li strong {
  color:var(--mb-e-ink);
  font-weight:700;
}
/* Summaries from older posts using custom mb-tldr blocks. */
body.single-post .main-article .post-content .text .mb-tldr {
  background:var(--mb-e-soft);
  border:1px solid var(--mb-e-border);
  border-left:3px solid var(--mb-e-accent);
  color:var(--mb-e-ink);
  border-radius:6px;
  padding:1rem 1.15rem;
  line-height:1.58;
  margin:1.35rem 0 1.8rem;
}
body.single-post .main-article .post-content .text .mb-tldr :last-child {margin-bottom:0}
/* References are compact but always open, indexable and linkable. */
body.single-post .main-article .post-content .text .mb-e-references-title {
  margin-bottom:1rem;
}
body.single-post .main-article .post-content .text ol.mb-e-references,
body.single-post .main-article .post-content .text ul.mb-e-references {
  margin:0 0 2rem;
  padding-inline-start:1.6rem;
  max-width:760px;
}
body.single-post .main-article .post-content .text :is(ol,ul).mb-e-references > li {
  margin:0 0 .85rem;
  padding-inline-start:.12rem;
  font-size:15.5px!important;
  line-height:1.5!important;
  color:#4e5963!important;
  overflow-wrap:anywhere;
}
body.single-post .main-article .post-content .text :is(ol,ul).mb-e-references a {
  color:var(--mb-e-link);
  text-decoration:underline;
  text-underline-offset:2px;
  overflow-wrap:anywhere;
}
/* Older translations may store a reference list as one paragraph with line breaks. */
body.single-post .main-article .post-content .text p.mb-e-references-paragraph {
  font-size:15.5px!important;
  line-height:1.7!important;
  color:#4e5963!important;
  margin:0 0 1.8rem;
}
body.single-post .main-article .post-content .text p.mb-e-references-paragraph a {
  color:var(--mb-e-link);
  text-decoration:underline;
  text-underline-offset:2px;
  overflow-wrap:anywhere;
}
/* Generic Gutenberg table shell: leave custom table behaviour and sorting intact. */
body.single-post .main-article .post-content .text figure.wp-block-table {
  max-width:100%;
  margin-block:1.45rem 1.7rem;
  border:1px solid var(--mb-e-border);
  border-radius:9px;
  background:#fff;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
body.single-post .main-article .post-content .text figure.wp-block-table th {
  color:#3e3934;
  background:#f6f3ee;
}
body.single-post .main-article .post-content .text figure.wp-block-table :is(th,td) {
  line-height:1.5;
  overflow-wrap:break-word;
}
body.single-post .main-article .post-content .text figure.wp-block-table figcaption,
body.single-post .main-article .post-content .text figure.wp-block-image figcaption {
  color:#59646d!important;
  font-size:13px!important;
  line-height:1.52!important;
}
body.single-post .main-article .post-content .text .mb-e-figure-note,
body.single-post .main-article .post-content .text .mb-e-data-note {
  font:400 13px/1.56 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  color:#56626c!important;
}
body.single-post .main-article .post-content .text .mb-e-figure-note a {
  color:var(--mb-e-link);
  text-decoration:underline;
}
body.single-post .main-article .post-content .text .mb-e-reading-pause {
  margin:1.85rem 0 1.95rem;
  border-left:3px solid #b5a695;
  background:var(--mb-e-soft);
  color:var(--mb-e-ink);
  padding:.7rem 1.15rem;
  font-size:1.045em!important;
  line-height:1.55!important;
}
body.single-post .main-article .post-content .text details.mb-e-research-note,
body.single-post .main-article .post-content .text details.mb-coffee-research-note,
body.single-post .main-article .post-content .text details.mb-coffee-decaf-methods {
  border:1px solid var(--mb-e-border);
  border-radius:9px;
  background:var(--mb-e-soft);
  padding:.85rem 1.1rem;
  margin:1.4rem 0 1.65rem;
  color:var(--mb-e-ink);
}
body.single-post .main-article .post-content .text details :is(summary) {
  cursor:pointer;
  color:var(--mb-e-ink);
  font-weight:650;
  line-height:1.5;
}
body.single-post .main-article .post-content .text details summary:focus-visible {
  outline:2px solid #316a72;
  outline-offset:4px;
}
body.single-post .main-article .post-content .text details :is(p,li) {
  line-height:1.58;
}
/* Opt-in evidence callouts, suitable for any language.
   Colour conveys hierarchy, never unproven clinical safety. */
body.single-post .main-article .post-content .text .mb-e-evidence,
body.single-post .main-article .post-content .text .mb-e-metric-card {
  background:#f8f7f4;
  border:1px solid var(--mb-e-border);
  border-radius:10px;
  padding:clamp(15px,2.8vw,24px);
  color:var(--mb-e-ink);
}
body.single-post .main-article .post-content .text .mb-e-metric {
  color:#414b54;
  font-variant-numeric:tabular-nums;
  font-weight:700;
}
body.single-post .main-article .post-content .text .mb-e-outcome-label {
  display:block;
  color:#555f67;
  font:700 12px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:.035em;
}
body.single-post .main-article .post-content .text .mb-e-evidence-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));
  gap:12px;
}
body.single-post .main-article .post-content .text .mb-e-evidence-grid > * {
  min-width:0;
}
/*
 * Legacy coffee translations: scientific colour semantics must be consistent.
 * Override status-like green/rust inline colours in the 100/400 mg comparison
 * without touching the study numbers, captions, native graphs or source HTML.
 * This also covers existing untranslated numerical blocks in other languages.
 */
body.single-post .main-article .post-content .text .mb-coffee-gardiner > div[style*="background:#e9eee9"] {
  background:#f1efec!important;
  border:1px solid #e0dcd6;
}
body.single-post .main-article .post-content .text .mb-coffee-gardiner [style*="color:#3e5c4a"] {
  color:#4b5360!important;
}
body.single-post .main-article .post-content .text .mb-coffee-gardiner [style*="color:#895b40"] {
  color:#514d49!important;
}
body.single-post .main-article .post-content .text .mb-coffee-gardiner [style*="border-top:4px solid #926247"] {
  border-top:3px solid #b5aaa0!important;
}
/* Compatibility: existing custom editorial side-callouts keep their layout. */
body.single-post .main-article .post-content .text .mb-editorial-callout p,
body.single-post .main-article .post-content .text .mb-editorial-insert p {
  line-height:1.55;
}
@media (max-width:767px) {
  body.single-post .main-article .post-content .text .mb-e-takeaways-title {
    margin-top:1.7rem;
    font-size:23px;
  }
  body.single-post .main-article .post-content .text ul.mb-e-takeaways {gap:11px}
  body.single-post .main-article .post-content .text .mb-e-reading-pause {
    margin:1.5rem 0;
    padding:.65rem 1rem;
  }
  body.single-post .main-article .post-content .text figure.wp-block-table {
    border:0;
    background:transparent;
  }
  body.single-post .main-article .post-content .text :is(ol,ul).mb-e-references > li {
    font-size:15px!important;
    line-height:1.55!important;
  }
}
