/* ==========================================================================
   Chaé Editorial — single-post stylesheet
   --------------------------------------------------------------------------
   Install : bb-theme-child/css/chae-editorial.css
   Enqueue : see chae-editorial-enqueue.php (single posts only)
   Target  : .single-post .fl-post-content  (Beaver Builder theme wrapper,
             confirmed 929px on chaeorganics.com)
   Fonts   : Comfortaa + Roboto are already loaded by the theme — this file
             adds no font requests.

   Component names mirror the IQ Factor system (iqa-* → chae-*) so that
   porting that system's markup or JS later is a find-and-replace, not a
   rewrite.

   SECTIONS
     0. Tokens
     1. Width system
     2. Base typography ....... applies to all existing posts, no markup change
     3. Article header kit .... chae-eyebrow / -title / -article-deck /
                                -article-meta / -topic-row
     4. chae-hero-answer ...... "the short version"
     5. chae-toc
     6. chae-at-glance ........ numbered summary grid
     7. chae-tech-snapshot .... fact tiles
     8. chae-note
     9. chae-pullquote
    10. chae-editorial-figure
    11. Tables
    12. chae-inci / chae-term
    13. chae-spotlight ....... commerce block (no IQ Factor equivalent)
    14. chae-reference-list
    15. Print
   ========================================================================== */


/* 0. TOKENS ================================================================ */

.single-post .fl-post-content {
  /* palette — light, drawn from the live site chrome */
  --chae-paper:     #ffffff;
  --chae-surface:   #f6f9f5;  /* pale sage fill for callouts */
  --chae-surface-2: #eef3ec;  /* one step deeper, for header strips */
  --chae-ink:       #14312c;  /* deep teal-black body copy */
  --chae-ink-2:     #47605a;
  --chae-muted:     #7d8f88;
  --chae-rule:      #dde5dd;
  --chae-rule-2:    #edf1ec;
  --chae-brand:     #14524c;  /* site header teal */
  --chae-teal:      #2a7d72;
  --chae-amber:     #c9661f;  /* wild-orange — secondary accent only */

  /* widths — the single most important numbers in this file */
  --chae-measure: 36rem;      /* 576px ≈ 68 characters. Was 929px ≈ 116. */
  --chae-mid:     44rem;      /* figures, tables */
  --chae-wide:    100%;       /* full-bleed blocks, up to the 929px wrapper */

  /* rhythm */
  --chae-flow:    1.35em;     /* space between paragraphs. Was a flat 10px. */
}


/* 1. WIDTH SYSTEM ==========================================================
   Constrain every direct child to the reading measure, then opt specific
   blocks out to wider tracks. This is what fixes the 116-character line on
   all 41 existing posts without editing any of them.
   ========================================================================== */

.single-post .fl-post-content > * {
  max-width: var(--chae-measure);
  margin-inline: auto;
}

/* medium track — imagery and data */
.single-post .fl-post-content > figure,
.single-post .fl-post-content > .chae-editorial-figure,
.single-post .fl-post-content > .chae-tablewrap,
.single-post .fl-post-content > .wp-block-image,
.single-post .fl-post-content > .wp-block-table {
  max-width: var(--chae-mid);
}

/* full track — structural components */
.single-post .fl-post-content > .chae-at-glance,
.single-post .fl-post-content > .chae-tech-snapshot,
.single-post .fl-post-content > .chae-spotlight,
.single-post .fl-post-content > .chae-wide {
  max-width: var(--chae-wide);
}

/* nested content inside a full-track block returns to a comfortable measure */
.single-post .fl-post-content .chae-at-glance__item p,
.single-post .fl-post-content .chae-tech-snapshot__item p {
  max-width: 34rem;
}


/* 2. BASE TYPOGRAPHY =======================================================
   Everything here applies to posts that have no Chaé classes at all.
   ========================================================================== */

.single-post .fl-post-content {
  color: var(--chae-ink);
}

.single-post .fl-post-content p {
  font-size: 17px;
  line-height: 1.72;
  margin: 0 0 var(--chae-flow);
}

.single-post .fl-post-content h2 {
  font-family: Comfortaa, Roboto, sans-serif;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -.005em;
  color: var(--chae-brand);
  margin: 2.1em 0 .5em;
  text-wrap: balance;
}

.single-post .fl-post-content h3 {
  font-family: Comfortaa, Roboto, sans-serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.35;
  color: var(--chae-ink);
  margin: 1.9em 0 .4em;
}

.single-post .fl-post-content h4 {
  font-family: Comfortaa, Roboto, sans-serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.4;
  color: var(--chae-ink);
  margin: 1.6em 0 .35em;
}

/* first heading should not push a huge gap under the title */
.single-post .fl-post-content > :first-child { margin-top: 0; }

.single-post .fl-post-content ul,
.single-post .fl-post-content ol {
  padding-left: 1.3em;
  margin: 0 0 var(--chae-flow);
}

.single-post .fl-post-content li {
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: .55em;
}

.single-post .fl-post-content li > ul,
.single-post .fl-post-content li > ol { margin-top: .5em; }

.single-post .fl-post-content a {
  color: var(--chae-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.single-post .fl-post-content a:hover,
.single-post .fl-post-content a:focus-visible { text-decoration-thickness: 2px; }
.single-post .fl-post-content a:focus-visible {
  outline: 2px solid var(--chae-teal);
  outline-offset: 2px;
  border-radius: 2px;
}

.single-post .fl-post-content strong { font-weight: 700; }
.single-post .fl-post-content em { font-style: italic; }

.single-post .fl-post-content hr {
  border: 0;
  border-top: 1px solid var(--chae-rule);
  margin: 2.6em auto;
}

.single-post .fl-post-content img { height: auto; border-radius: 5px; }

/* plain blockquote in legacy posts */
.single-post .fl-post-content blockquote:not([class]) {
  border-left: 3px solid var(--chae-teal);
  background: var(--chae-surface);
  margin: 2em 0;
  padding: 16px 20px;
  border-radius: 0 5px 5px 0;
}
.single-post .fl-post-content blockquote:not([class]) > :last-child { margin-bottom: 0; }


/* 3. ARTICLE HEADER KIT ==================================================== */

.single-post .fl-post-content .chae-eyebrow {
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--chae-teal);
  margin: 0 0 12px;
}

.single-post .fl-post-content .chae-title {
  font-family: Comfortaa, Roboto, sans-serif;
  font-weight: 700;
  font-size: clamp(27px, 3.6vw, 36px);
  line-height: 1.18;
  color: var(--chae-brand);
  margin: 0 0 14px;
  text-wrap: balance;
}

.single-post .fl-post-content .chae-article-deck {
  font-size: 19px;
  line-height: 1.55;
  color: var(--chae-ink-2);
  margin: 0 0 18px;
}

.single-post .fl-post-content .chae-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  font-size: 13px;
  color: var(--chae-muted);
  border-block: 1px solid var(--chae-rule-2);
  padding-block: 11px;
  margin: 0 0 14px;
}
.single-post .fl-post-content .chae-article-meta b {
  color: var(--chae-ink-2);
  font-weight: 500;
}

.single-post .fl-post-content .chae-topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
}
.single-post .fl-post-content .chae-topic-row li {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--chae-ink-2);
  background: var(--chae-surface);
  border: 1px solid var(--chae-rule);
  border-radius: 3px;
  padding: 5px 9px;
  margin: 0;
}


/* shared small label used by several components */
.single-post .fl-post-content .chae-label {
  font-family: Roboto, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin: 0 0 12px;
}


/* 4. HERO ANSWER =========================================================== */

.single-post .fl-post-content .chae-hero-answer {
  background: var(--chae-surface);
  border-left: 3px solid var(--chae-teal);
  border-radius: 0 5px 5px 0;
  padding: 20px 22px;
  margin: 0 0 30px;
}
.single-post .fl-post-content .chae-hero-answer .chae-label { color: var(--chae-teal); }
.single-post .fl-post-content .chae-hero-answer p,
.single-post .fl-post-content .chae-hero-answer li {
  font-size: 16px;
  line-height: 1.62;
  margin-bottom: .6em;
}
.single-post .fl-post-content .chae-hero-answer > :last-child,
.single-post .fl-post-content .chae-hero-answer ul > li:last-child { margin-bottom: 0; }


/* 5. TABLE OF CONTENTS ===================================================== */

.single-post .fl-post-content .chae-toc {
  border-block: 1px solid var(--chae-rule);
  padding-block: 18px;
  margin: 0 0 34px;
}
.single-post .fl-post-content .chae-toc .chae-label { color: var(--chae-muted); }
.single-post .fl-post-content .chae-toc ol {
  columns: 2;
  column-gap: 30px;
  margin: 0;
  padding-left: 1.2em;
}
.single-post .fl-post-content .chae-toc li {
  font-size: 15px;
  break-inside: avoid;
  margin-bottom: 7px;
}
.single-post .fl-post-content .chae-toc a {
  color: var(--chae-ink);
  text-decoration: none;
}
.single-post .fl-post-content .chae-toc a:hover {
  color: var(--chae-teal);
  text-decoration: underline;
}
@media (max-width: 540px) {
  .single-post .fl-post-content .chae-toc ol { columns: 1; }
}


/* 6. AT A GLANCE ===========================================================
   Light treatment: pale sage panel with a teal top rule. Distinguished from
   .chae-tech-snapshot by fill + numbering rather than by a bordered box.
   ========================================================================== */

.single-post .fl-post-content .chae-at-glance {
  background: var(--chae-surface);
  border: 1px solid var(--chae-rule);
  border-top: 3px solid var(--chae-teal);
  border-radius: 3px 3px 6px 6px;
  padding: 24px;
  margin: 34px auto;
}

.single-post .fl-post-content .chae-at-glance__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--chae-teal);
  border-bottom: 1px solid var(--chae-rule);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.single-post .fl-post-content .chae-at-glance__head span:last-child {
  color: var(--chae-muted);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: none;
}

.single-post .fl-post-content .chae-at-glance__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px 28px;
}
@media (min-width: 600px) {
  .single-post .fl-post-content .chae-at-glance__grid { grid-template-columns: 1fr 1fr; }
}

.single-post .fl-post-content .chae-at-glance__item .num {
  display: block;
  font-family: Roboto, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--chae-teal);
  margin-bottom: 7px;
}
.single-post .fl-post-content .chae-at-glance__item h4 {
  font-family: Comfortaa, sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--chae-brand);
  margin: 0 0 6px;
}
.single-post .fl-post-content .chae-at-glance__item p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--chae-ink-2);
  margin: 0;
}


/* 7. TECH SNAPSHOT ========================================================= */

.single-post .fl-post-content .chae-tech-snapshot {
  border: 1px solid var(--chae-rule);
  border-radius: 6px;
  margin: 34px auto;
  overflow: hidden;
}

.single-post .fl-post-content .chae-tech-snapshot__head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  align-items: baseline;
  background: var(--chae-surface-2);
  border-bottom: 1px solid var(--chae-rule);
  padding: 11px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--chae-ink-2);
}
.single-post .fl-post-content .chae-tech-snapshot__head span:last-child {
  color: var(--chae-muted);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: none;
}

.single-post .fl-post-content .chae-tech-snapshot__grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) {
  .single-post .fl-post-content .chae-tech-snapshot__grid { grid-template-columns: repeat(3, 1fr); }
}

.single-post .fl-post-content .chae-tech-snapshot__item {
  padding: 18px;
  border-top: 1px solid var(--chae-rule-2);
}
@media (min-width: 620px) {
  .single-post .fl-post-content .chae-tech-snapshot__item {
    border-top: 0;
    border-left: 1px solid var(--chae-rule-2);
  }
  .single-post .fl-post-content .chae-tech-snapshot__item:first-child { border-left: 0; }
}

.single-post .fl-post-content .chae-tech-snapshot__item .lbl {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--chae-muted);
  margin-bottom: 8px;
}
.single-post .fl-post-content .chae-tech-snapshot__item .val {
  display: block;
  font-family: Comfortaa, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--chae-brand);
  margin-bottom: 8px;
}
.single-post .fl-post-content .chae-tech-snapshot__item p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--chae-ink-2);
  margin: 0;
}


/* 8. NOTE ================================================================== */

.single-post .fl-post-content .chae-note {
  background: var(--chae-surface);
  border: 1px solid var(--chae-rule);
  border-radius: 6px;
  padding: 18px 20px;
  margin: 30px auto;
}
.single-post .fl-post-content .chae-note h3,
.single-post .fl-post-content .chae-note h4 { margin: 0 0 7px; font-size: 17px; }
.single-post .fl-post-content .chae-note p { font-size: 15.5px; }
.single-post .fl-post-content .chae-note > :last-child { margin-bottom: 0; }


/* 9. PULLQUOTE ============================================================= */

.single-post .fl-post-content .chae-pullquote {
  border-left: 3px solid var(--chae-amber);
  background: none;
  padding: 4px 0 4px 20px;
  margin: 32px auto;
  font-family: Comfortaa, sans-serif;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--chae-brand);
}
.single-post .fl-post-content .chae-pullquote cite {
  display: block;
  font-family: Roboto, sans-serif;
  font-size: 13px;
  font-style: normal;
  color: var(--chae-muted);
  margin-top: 10px;
}


/* 10. FIGURE =============================================================== */

.single-post .fl-post-content .chae-editorial-figure { margin: 32px auto; }
.single-post .fl-post-content .chae-editorial-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--chae-surface);
}
.single-post .fl-post-content .chae-editorial-figure--contain img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}
.single-post .fl-post-content .chae-editorial-figure figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--chae-muted);
  margin-top: 9px;
}
.single-post .fl-post-content .chae-editorial-figure figcaption b {
  color: var(--chae-teal);
  font-weight: 700;
}


/* 11. TABLES =============================================================== */

.single-post .fl-post-content .chae-tablewrap {
  overflow-x: auto;
  margin: 28px auto;
  -webkit-overflow-scrolling: touch;
}
.single-post .fl-post-content .chae-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 15px;
}
.single-post .fl-post-content .chae-table th,
.single-post .fl-post-content .chae-table td {
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--chae-rule-2);
  vertical-align: top;
}
.single-post .fl-post-content .chae-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--chae-muted);
  border-bottom-color: var(--chae-rule);
}
.single-post .fl-post-content .chae-table td:first-child {
  font-weight: 500;
  color: var(--chae-brand);
}
.single-post .fl-post-content .chae-table tbody tr:last-child td { border-bottom: 0; }


/* 12. INGREDIENT NAMES & GLOSSARY TERMS ====================================
   .chae-term carries data-definition and is styled ready for the glossary
   JS if that gets ported from IQ Factor. Without the JS it is still a
   legible, accessible marked term.
   ========================================================================== */

.single-post .fl-post-content .chae-inci {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .87em;
  background: var(--chae-surface);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--chae-ink);
}

.single-post .fl-post-content .chae-term {
  border-bottom: 1px dotted var(--chae-teal);
  cursor: help;
  color: inherit;
}
.single-post .fl-post-content .chae-term:focus-visible {
  outline: 2px solid var(--chae-teal);
  outline-offset: 2px;
  border-radius: 2px;
}


/* 13. PRODUCT SPOTLIGHT ====================================================
   The one component with no IQ Factor equivalent. `> p { display: contents }`
   neutralises WordPress's wpautop, which otherwise wraps the card image in a
   paragraph and breaks the layout.
   ========================================================================== */

.single-post .fl-post-content .chae-spotlight {
  border-top: 2px solid var(--chae-brand);
  margin: 48px auto 0;
  padding-top: 22px;
}
.single-post .fl-post-content .chae-spotlight .chae-label { color: var(--chae-teal); }

.single-post .fl-post-content .chae-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 20px;
}
@media (min-width: 600px) {
  .single-post .fl-post-content .chae-products { grid-template-columns: 1fr 1fr; }
}

.single-post .fl-post-content .chae-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.single-post .fl-post-content .chae-card > p { display: contents; }
.single-post .fl-post-content .chae-card__img {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--chae-rule);
  border-radius: 5px;
}
.single-post .fl-post-content .chae-card__body { flex: 1 1 auto; min-width: 0; }
.single-post .fl-post-content .chae-card h4 {
  font-family: Comfortaa, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--chae-brand);
  margin: 0 0 4px;
}
.single-post .fl-post-content .chae-card p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--chae-ink-2);
  margin: 0 0 7px;
}
.single-post .fl-post-content .chae-card .price {
  display: block;
  font-size: 12.5px;
  color: var(--chae-muted);
  margin-bottom: 8px;
}
.single-post .fl-post-content .chae-card .btn {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  background: var(--chae-teal);
  color: #fff;
  padding: 7px 13px;
  border-radius: 3px;
}
.single-post .fl-post-content .chae-card .btn:hover,
.single-post .fl-post-content .chae-card .btn:focus-visible {
  background: var(--chae-brand);
  color: #fff;
  text-decoration: none;
}


/* 14. REFERENCE LIST ======================================================= */

.single-post .fl-post-content .chae-reference-list {
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--chae-rule);
}
.single-post .fl-post-content .chae-reference-list .chae-label { color: var(--chae-muted); }
.single-post .fl-post-content .chae-reference-list ol {
  font-size: 14px;
  color: var(--chae-ink-2);
  padding-left: 1.3em;
  margin: 0;
}
.single-post .fl-post-content .chae-reference-list li {
  margin-bottom: 7px;
  line-height: 1.5;
}


/* 15. PRINT ================================================================
   Covers the "Print / PDF" behaviour without needing the IQ Factor JS.
   ========================================================================== */

@media print {
  .single-post .fl-post-content > * { max-width: none; }
  .single-post .fl-post-content p,
  .single-post .fl-post-content li { font-size: 11pt; line-height: 1.5; }
  .single-post .fl-post-content h2 { font-size: 16pt; }
  .single-post .fl-post-content h3 { font-size: 13pt; }
  .single-post .fl-post-content .chae-at-glance,
  .single-post .fl-post-content .chae-tech-snapshot,
  .single-post .fl-post-content .chae-note,
  .single-post .fl-post-content .chae-hero-answer {
    break-inside: avoid;
    background: none;
    border: 1px solid #bbb;
  }
  .single-post .fl-post-content .chae-spotlight,
  .single-post .fl-post-content .chae-toc { display: none; }
  .single-post .fl-post-content a { text-decoration: underline; color: inherit; }
  .single-post .fl-post-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
    word-break: break-all;
  }
}


/* 16. MOTION =============================================================== */

@media (prefers-reduced-motion: no-preference) {
  .single-post .fl-post-content .chae-card .btn { transition: background .15s ease; }
}
