/* =========================================================================
   Knowledge Library — shared article template
   Used by every /learn/* reference article (Article 01 onward).
   Visual language matches css/force-page.css's editorial mode (same warm
   cream/ink palette, same serif body from css/pages.css) so Knowledge
   Library pages read as part of the same site as /forces/*, not a
   separate microsite.
   ========================================================================= */

body.kb-article-body {
  background: #faf8f4;
  color: #2c2416;
}

.kb-article {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Breadcrumb ---------- */
.kb-breadcrumb {
  padding: 28px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  color: #a09888;
}
.kb-breadcrumb a { color: #a09888; text-decoration: none; }
.kb-breadcrumb a:hover { color: #2c2416; }
.kb-breadcrumb .bc-sep { margin: 0 8px; }
.kb-breadcrumb [aria-current="page"] { color: #7a7060; }

/* ---------- Hero ---------- */
.kb-hero {
  text-align: left;
  padding: 56px 0 72px;
  border-bottom: 1px solid rgba(44, 36, 22, 0.08);
}

.kb-hero-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a09888;
  margin-bottom: 20px;
}

.kb-hero-title {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 400;
  letter-spacing: 0.2px;
  color: #2c2416;
  margin-bottom: 20px;
  line-height: 1.2;
  max-width: 860px;
}

.kb-hero-dek {
  font-size: clamp(16px, 2vw, 18px);
  color: #7a7060;
  line-height: 1.85;
  font-style: italic;
  max-width: 620px;
}

.kb-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 28px;
  font-size: 12.5px;
  color: #a09888;
  letter-spacing: 0.3px;
}

/* ---------- Article body ---------- */
.kb-article-content {
  max-width: 830px;
  padding: 12px 0 96px;
}

/* ---------- Editorial hero image (one per article, placed after the
   opening and before the first numbered section). Deliberately not a
   card: no border, no background, no radius — just the image, given
   more width than the 830px text column since kb-article-content has
   no margin:auto and sits flush left within kb-article's own 1160px
   box, so widening here extends into real unused space rather than
   breaking the page's rhythm. Caps well short of kb-article's own edge
   so it still reads as inside the article, not a full-bleed hero.

   .kb-figure lives inside kb-article-content (830px), so its own
   max-width can't express past that without breaking out. --figure-extra
   tracks how much unused space actually exists to the right of the
   830px column within kb-article (0 below ~894px viewport, growing to
   a 170px cap once kb-article has room — well inside its real ~266px
   of slack, so this never pushes past kb-article's own edge). */
.kb-figure {
  --figure-extra: clamp(0px, calc(100vw - 894px), 170px);
  max-width: 1000px;
  width: calc(100% + var(--figure-extra));
  margin: 16px calc(-1 * var(--figure-extra)) 56px 0;
}
.kb-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.kb-section {
  padding-top: 64px;
}
.kb-section:first-child { padding-top: 0; }

.kb-section-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a09888;
  margin-bottom: 14px;
}

/* ---------- Act structure (opt-in) ----------
   For an article whose argument genuinely has a multi-part shape (see
   stems-and-branches.html) rather than a flat sequence of sections.
   A visual layer ABOVE .kb-section, not a numbering system: sections
   inside a .kb-act carry no .kb-section-kicker of their own — the act
   header is the only label. Most Learn articles will never use this;
   the plain 01/02/03 .kb-section-kicker pattern stays the default. */
.kb-act {
  padding-top: 88px;
}
.kb-act:first-of-type {
  padding-top: 0;
}
.kb-act .kb-section {
  padding-top: 48px;
}
.kb-act .kb-section:first-child {
  padding-top: 0;
}

.kb-act-header {
  margin-bottom: 40px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(44, 36, 22, 0.08);
}
.kb-act-number {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #c4bba8;
  margin-bottom: 5px;
}
.kb-act-name {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: #8a8064;
}

.kb-article-content h2 {
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 400;
  letter-spacing: 0.2px;
  color: #2c2416;
  line-height: 1.35;
  margin-bottom: 26px;
  scroll-margin-top: 24px;
}

.kb-article-content h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #2c2416;
  margin: 34px 0 14px;
}

.kb-article-content p {
  font-size: 16px;
  line-height: 1.95;
  color: #4a4030;
  margin-bottom: 24px;
}
.kb-article-content p:last-child { margin-bottom: 0; }

.kb-article-content strong { color: #2c2416; font-weight: 600; }
.kb-article-content em { font-style: italic; }

.kb-article-content ul {
  margin: 0 0 24px;
  padding-left: 22px;
}
.kb-article-content li {
  font-size: 16px;
  line-height: 1.85;
  color: #4a4030;
  margin-bottom: 12px;
}
.kb-article-content li:last-child { margin-bottom: 0; }
.kb-article-content li strong { color: #2c2416; }

/* Two questions lists in sequence (§5 pattern) get breathing room between groups */
.kb-article-content ul + ul { margin-top: -8px; }

/* Classical citation */
.kb-citation {
  margin: 8px 0 28px;
  padding: 4px 0 4px 22px;
  border-left: 2px solid #c8b890;
}
.kb-citation p {
  font-size: 15.5px;
  font-style: italic;
  color: #4a4030;
  margin-bottom: 8px;
}
.kb-citation cite {
  display: block;
  font-style: normal;
  font-size: 12.5px;
  color: #8a8070;
  letter-spacing: 0.2px;
}

/* Closing epigraph */
.kb-epigraph {
  margin: 8px 0 0;
  padding: 32px 0 0;
  text-align: left;
}
.kb-epigraph p {
  font-size: 18px;
  font-style: italic;
  color: #2c2416;
  line-height: 1.7;
  margin-bottom: 8px;
}
.kb-epigraph cite {
  display: block;
  font-style: italic;
  font-size: 13.5px;
  color: #8a8070;
}

/* ---------- CTA block (Understand → Experience) ---------- */
.kb-cta {
  margin-top: 12px;
  padding: 44px 0 0;
  border-top: 1px solid rgba(44, 36, 22, 0.08);
}
.kb-cta-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #b0a898;
  margin-bottom: 16px;
}
.kb-cta p {
  font-size: 16px;
  line-height: 1.85;
  color: #4a4030;
  margin-bottom: 20px;
  max-width: 620px;
}
.kb-cta-link {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 1px;
  color: #2c2416;
  text-decoration: none;
  border-bottom: 1px solid rgba(44, 36, 22, 0.4);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.kb-cta-link:hover { color: #6a5a30; border-color: #6a5a30; }
.kb-cta-note {
  margin-top: 20px;
  font-size: 13px;
  font-style: italic;
  color: #8a8070;
}

/* ---------- Related reading (populated once sibling articles exist) ---------- */
.kb-related {
  padding: 72px 0 96px;
  border-top: 1px solid rgba(44, 36, 22, 0.06);
}
.kb-related-title {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a09888;
  margin-bottom: 24px;
}
.kb-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 28px;
}
.kb-related-grid a {
  font-size: 14.5px;
  color: #4a4030;
  text-decoration: none;
  border-bottom: 1px solid rgba(44, 36, 22, 0.15);
  padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.kb-related-grid a:hover { color: #2c2416; border-color: #2c2416; }

/* ---------- Library index (/learn) ---------- */
/* 1160px matches .kb-article's own max-width so the index's content column
   lines up with every article page a reader clicks into (was 1080px,
   an unintentional 80px offset from the article template). */
.kb-index-content {
  max-width: 1160px;
  padding: 12px 0 120px;
}

.kb-cluster {
  padding-top: 56px;
}
.kb-cluster:first-child { padding-top: 0; }

.kb-cluster-title {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #4a4030;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(44, 36, 22, 0.1);
}

/* ---------- Editorial chapters within a cluster (Start Here / The Five
   Phases / Relationships, etc.) — three distinct visual grammars for three
   distinct editorial roles, not a single repeated component. ---------- */
.kb-subsection {
  padding-top: 52px;
  margin-top: 52px;
  border-top: 1px solid rgba(44, 36, 22, 0.08);
}
.kb-subsection:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.kb-subsection-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #a09888;
  margin-bottom: 18px;
}

.kb-subsection-intro {
  font-size: 15px;
  font-style: italic;
  color: #7a7060;
  line-height: 1.7;
  margin: -4px 0 28px;
  max-width: 560px;
}

/* ---------- Reusable editorial entry: label (optional) + title + excerpt
   + link, no card chrome. This is the one non-row building block for the
   whole Knowledge Library index — used standalone with the --featured
   modifier (Start Here) or stacked in .kb-entry-list (Relationships, and
   later any chapter with more than one substantial entry — BaZi's
   Orientation & Positioning, Mechanics, Interpretation; I Ching's
   Structure, Practice, Hexagrams). One component, not a new pattern per
   chapter or subject. ---------- */
.kb-entry {
  display: block;
  text-decoration: none;
  color: inherit;
  max-width: 680px;
}

.kb-entry-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a09888;
  margin-bottom: 10px;
}

.kb-entry-title {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: #2c2416;
  line-height: 1.4;
  margin: 0 0 10px;
  transition: color 0.25s ease;
}

.kb-entry-desc {
  font-size: 15px;
  line-height: 1.8;
  color: #6a6050;
  margin: 0 0 14px;
  max-width: 540px;
}

.kb-entry-link {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #4a4030;
  transition: color 0.25s ease;
}

.kb-entry:hover .kb-entry-title { color: #6a5a30; }
.kb-entry:hover .kb-entry-link { color: #6a5a30; }

/* Featured modifier (Start Here) — more typographic authority and
   breathing room; still no border, no background, no box. */
.kb-entry--featured {
  max-width: 720px;
}
.kb-entry--featured .kb-entry-title {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.3;
  margin-bottom: 18px;
}
.kb-entry--featured .kb-entry-desc {
  font-size: 16.5px;
  line-height: 1.85;
  color: #4a4030;
  max-width: 600px;
  margin-bottom: 22px;
}
.kb-entry--featured .kb-entry-link {
  font-size: 14px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(44, 36, 22, 0.4);
  padding-bottom: 2px;
}
.kb-entry--featured:hover .kb-entry-link { border-color: #6a5a30; }

/* Stacked list of entries — whitespace and a fine rule between items,
   never a card border. */
.kb-entry-list {
  display: flex;
  flex-direction: column;
}
.kb-entry-list .kb-entry {
  padding: 28px 0;
  border-top: 1px solid rgba(44, 36, 22, 0.08);
}
.kb-entry-list .kb-entry:first-child {
  padding-top: 0;
  border-top: none;
}
.kb-entry-list .kb-entry:last-child {
  padding-bottom: 0;
}

/* ---------- Chapter 2: The Five Phases (parallel same-level series,
   read top to bottom like a table of contents) ---------- */
.kb-row-list {
  display: flex;
  flex-direction: column;
}
.kb-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(44, 36, 22, 0.08);
  text-decoration: none;
  color: inherit;
}
.kb-row-list .kb-row:first-child { padding-top: 0; }
.kb-row-list .kb-row:last-child { border-bottom: none; }

.kb-row-label {
  flex: 0 0 84px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a09888;
}
.kb-row-main {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.kb-row-title {
  flex: 1 1 auto;
  font-size: 17px;
  line-height: 1.45;
  color: #2c2416;
  transition: color 0.25s ease;
}
.kb-row-arrow {
  flex: 0 0 auto;
  font-size: 15px;
  color: #a09888;
  transition: color 0.25s ease, transform 0.25s ease;
}
.kb-row:hover .kb-row-title { color: #6a5a30; }
.kb-row:hover .kb-row-arrow { color: #6a5a30; transform: translateX(3px); }

/* auto-fit + a capped card width, not auto-fill: a single card keeps its
   natural size and sits with intention rather than stretching to fill a
   full-width row; additional cards will wrap into a real grid later
   without any structural change. */
.kb-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
  gap: 28px;
  justify-content: start;
}

.kb-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 32px 30px;
  border: 1px solid rgba(44, 36, 22, 0.1);
  border-radius: 4px;
  background: #fffdf9;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.kb-card:hover {
  border-color: rgba(44, 36, 22, 0.3);
  transform: translateY(-2px);
}

.kb-card-tag {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a09888;
  margin-bottom: 14px;
}

.kb-card-title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  color: #2c2416;
  margin: 0 0 12px;
}

.kb-card-desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: #6a6050;
  margin: 0 0 18px;
}

.kb-card-link {
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #4a4030;
}

/* ---------- Footer (matches home.html / iching-collection.html's rich
   4-column variant — same class name by established site convention, same
   background/grid/brand typography; horizontal padding uses this template's
   own content gutter instead of home.html's page-local --page-pad-x var). */
.site-footer--home {
  background: #1c1914;
  color: #a89060;
  padding: 40px 32px 28px;
}
.site-footer--home .footer-top {
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
.site-footer--home .footer-brand-name {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-variant: normal;
}

/* footer.css's base .footer-inner caps at 1000px site-wide; on Knowledge
   Library pages that's narrower than this template's own 1160px content
   column, so the footer visibly doesn't align with the page above it.
   Scoped to body.kb-article-body only — home.html and iching-collection.html
   also use .site-footer--home but are plain <body>, so this rule does not
   touch them. */
body.kb-article-body .footer-inner {
  max-width: 1160px;
}

@media (max-width: 680px) {
  .kb-article { padding: 0 18px; }
  .kb-hero { padding: 36px 0 48px; }
  .kb-article-content { padding: 8px 0 64px; }
  .kb-figure { margin: 12px 0 40px; }
  .kb-section { padding-top: 48px; }
  .kb-act { padding-top: 56px; }
  .kb-act .kb-section { padding-top: 36px; }
  .kb-act-header { margin-bottom: 28px; padding-bottom: 16px; }
  .kb-card-grid { grid-template-columns: 1fr; }
  .site-footer--home { padding: 32px 18px 24px; }
  .site-footer--home .footer-top { grid-template-columns: 1fr; }

  .kb-subsection { padding-top: 40px; margin-top: 40px; }
  .kb-entry-desc,
  .kb-entry--featured .kb-entry-desc { max-width: none; }
  .kb-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px 0;
  }
  .kb-row-label { flex: 0 0 auto; }
}
