/* ──────────────────────────────────────────────────────────────────
 * /css/chinese-astrology.css — BaZi-specific components for /chinese-astrology/
 *
 * The page chrome (hero-cosmic, form-frame, results-section, sr-altar,
 * bc-suggest, loader) is reused verbatim from css/solar-return.css. This file
 * adds only what is new to the Four Pillars tool:
 *   - @font-face BaziGlyphs (the ~30-glyph CJK subset)
 *   - the four pillar seal-cards (large stacked glyphs, Day-Master crown)
 *   - the five-element balance bar
 *   - the solar-year-adjusted gold callout
 *   - the "Included with membership." line
 *
 * Brand palette (never hardcode elsewhere): parchment #FBF3DC, ink #2D1F38,
 * burgundy #6B1F2C, aubergine #3A1F38, gold #B89150 / #D4AC68 / #8E6E3A.
 * Element colors (tuned to sit on parchment): wood #4A7A3A, fire #9E2B25,
 * earth #B8862D, metal #C9B98A, water #1F3A5F.
 * ────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'BaziGlyphs';
  src: url('/fonts/NotoSerifSC-bazi-subset.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

body.cn-page {
  --cn-parchment: #FBF3DC;
  --cn-ink:       #2D1F38;
  --cn-gold:      #B89150;
  --cn-gold-lt:   #D4AC68;
  --cn-gold-dk:   #8E6E3A;
  --cn-wood:  #4A7A3A;
  --cn-fire:  #9E2B25;
  --cn-earth: #B8862D;
  --cn-metal: #C9B98A;
  --cn-water: #1F3A5F;
}

/* ═══════════════════════════════════════════════════════════
   1 · FOUR PILLAR CARDS
═══════════════════════════════════════════════════════════ */
body.cn-page .cn-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin: 2.4rem 0 1rem;
}

body.cn-page .cn-pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.6rem 0.9rem 1.4rem;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.5);
  border-top: 4px solid var(--cn-el, var(--cn-gold));
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(45, 31, 56, 0.08), inset 0 0 0 1px rgba(255, 251, 239, 0.6);
}

/* Corner flourishes echo the form-frame filigree */
body.cn-page .cn-pillar::before,
body.cn-page .cn-pillar::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(184, 145, 80, 0.55);
  pointer-events: none;
}
body.cn-page .cn-pillar::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
body.cn-page .cn-pillar::after  { bottom: 8px; right: 8px; border-left: none; border-top: none; }

body.cn-page .cn-pillar-label {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #77592B; /* deep readable gold */
  margin-bottom: 0.2rem;
}
body.cn-page .cn-pillar-sublabel {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.02rem;
  color: #6B1F2C; /* wine */
  margin-bottom: 0.9rem;
  min-height: 1.1em;
}

body.cn-page .cn-glyphs {
  font-family: 'BaziGlyphs', 'Marcellus', serif;
  line-height: 1.02;
  color: var(--cn-el, var(--cn-ink));
  margin: 0.2rem 0 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.cn-page .cn-glyph {
  font-size: 3.9rem;
  display: block;
}
body.cn-page .cn-glyph-stem   { color: var(--cn-el, var(--cn-ink)); }
body.cn-page .cn-glyph-branch { color: rgba(45, 31, 56, 0.82); font-size: 3.5rem; }

body.cn-page .cn-pinyin {
  font-family: 'Cinzel', serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6B1F2C; /* wine */
  margin-bottom: 0.45rem;
}
body.cn-page .cn-pillar-en {
  font-family: 'EB Garamond', serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--cn-ink);
}
body.cn-page .cn-pillar-en .cn-dot { color: var(--cn-gold); margin: 0 0.3em; }

/* ── DAY-MASTER crown card ── */
body.cn-page .cn-pillar--day {
  border-color: var(--cn-gold);
  box-shadow: 0 4px 18px rgba(139, 110, 58, 0.24), inset 0 0 0 1px rgba(212, 172, 104, 0.35);
}
body.cn-page .cn-crown {
  position: absolute;
  top: -36px; /* fully above the card so all four pillar labels align */
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  width: max-content;
  max-width: calc(100% - 8px);
  text-align: center;
  line-height: 1.3;
  background: linear-gradient(180deg, #E7C877 0%, #C9A860 55%, #B89150 100%);
  color: #3A1F38;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.34rem 0.9rem;
  border-radius: 14px;
  box-shadow: 0 2px 7px rgba(139, 110, 58, 0.4);
}
body.cn-page .cn-pillars { overflow: visible; }
@media (max-width: 620px) {
  body.cn-page .cn-crown {
    font-size: 0.66rem;
    letter-spacing: 0.07em;
    padding: 0.28rem 0.6rem;
    top: -32px;
  }
  /* crown floats above row 1 on the 2-col layout — give it headroom */
  body.cn-page .cn-pillars { margin-top: 3rem; }
}

/* ── HOUR pillar in the "awaits" state ── */
body.cn-page .cn-pillar--awaits {
  border-top-color: rgba(184, 145, 80, 0.4);
  background: repeating-linear-gradient(135deg, rgba(251,243,220,0.9) 0 14px, rgba(244,234,206,0.9) 14px 28px);
}
body.cn-page .cn-awaits-mark {
  font-family: 'Italianno', cursive;
  font-size: 3.4rem;
  color: rgba(184, 145, 80, 0.7);
  line-height: 1;
  margin: 0.6rem 0 0.5rem;
}
body.cn-page .cn-awaits-note {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(45, 31, 56, 0.6);
  line-height: 1.45;
  max-width: 15ch;
}

@media (max-width: 620px) {
  body.cn-page .cn-pillars { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  body.cn-page .cn-glyph { font-size: 3rem; }
  body.cn-page .cn-glyph-branch { font-size: 2.7rem; }
}
@media (max-width: 360px) {
  body.cn-page .cn-pillars { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   2 · ELEMENT BALANCE BAR
═══════════════════════════════════════════════════════════ */
body.cn-page .cn-elements {
  margin: 2.6rem auto 1.4rem;
  text-align: center;
}
body.cn-page .cn-elements-eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #77592B;
  margin-bottom: 1.2rem;
}
body.cn-page .cn-bar {
  display: flex;
  width: 100%;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(184, 145, 80, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 251, 239, 0.4);
}
body.cn-page .cn-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FBF3DC;
  min-width: 42px;
  padding: 0 0.75rem;
  transition: flex-grow 0.4s ease;
  border-right: 1px solid rgba(251, 243, 220, 0.25);
}
body.cn-page .cn-seg:last-child { border-right: none; }
body.cn-page .cn-seg--empty {
  background: repeating-linear-gradient(135deg, rgba(45,31,56,0.05) 0 8px, rgba(45,31,56,0.12) 8px 16px) !important;
  color: rgba(45, 31, 56, 0.5);
}
body.cn-page .cn-seg-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 1;
}
body.cn-page .cn-seg-count {
  font-family: 'EB Garamond', serif;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.05;
}

body.cn-page .cn-seg--wood  { background: var(--cn-wood); }
body.cn-page .cn-seg--fire  { background: var(--cn-fire); }
body.cn-page .cn-seg--earth { background: var(--cn-earth); }
body.cn-page .cn-seg--metal { background: var(--cn-metal); color: #3A2A12; }
body.cn-page .cn-seg--water { background: var(--cn-water); }

body.cn-page .cn-balance-line {
  font-family: 'Marcellus', serif;
  font-size: 1.45rem;
  color: var(--cn-ink);
  margin: 1.3rem 0 0.55rem;
}
body.cn-page .cn-balance-line strong { color: #6B1F2C; font-weight: 600; }
body.cn-page .cn-missing-note {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.35rem;
  color: #4A1620; /* burgundy-deep — reads clearly on parchment */
  line-height: 1.55;
  max-width: 52ch;
  margin: 0 auto;
}

/* results-meta line ("the eight characters of your birth · …") */
body.cn-page .results-meta { font-size: 1.12rem; }

@media (max-width: 620px) {
  body.cn-page .cn-bar { height: 78px; }
  body.cn-page .cn-seg { min-width: 34px; }
  body.cn-page .cn-seg-count { font-size: 1.5rem; }
  body.cn-page .cn-seg-name { font-size: 0.68rem; }
  body.cn-page .cn-elements-eyebrow { font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════════
   3 · SOLAR-YEAR-ADJUSTED CALLOUT
═══════════════════════════════════════════════════════════ */
body.cn-page .cn-adjusted[hidden] { display: none; }
body.cn-page .cn-adjusted {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 1.8rem auto 0.4rem;
  max-width: 58ch;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(180deg, rgba(231, 200, 119, 0.16) 0%, rgba(184, 145, 80, 0.08) 100%);
  border: 1px solid var(--cn-gold);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(139, 110, 58, 0.14);
}
body.cn-page .cn-adjusted-mark {
  font-size: 1.05rem;
  color: var(--cn-gold-dk);
  line-height: 1.5;
}
body.cn-page .cn-adjusted-body {
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--cn-ink);
  margin: 0;
}
body.cn-page .cn-adjusted-body strong { color: var(--cn-gold-dk); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   3b · LORE ROWS (image left / image right)
═══════════════════════════════════════════════════════════ */
body.cn-page .cn-lore-section {
  padding: 3.6rem 0 1.6rem;
  background: var(--cn-parchment);
}
body.cn-page .cn-lore-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.6rem;
  align-items: center;
  margin: 0 auto 3.2rem;
  max-width: 860px;
}
body.cn-page .cn-lore-row--flip { grid-template-columns: 1fr 280px; }
body.cn-page .cn-lore-row--flip .cn-lore-art { order: 2; }
body.cn-page .cn-lore-row--flip .cn-lore-text { order: 1; }

body.cn-page .cn-lore-art {
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.5);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: 0 2px 12px rgba(45, 31, 56, 0.08);
}
body.cn-page .cn-seal-svg { display: block; width: 100%; height: auto; }
body.cn-page .cn-seal-ring text {
  font-family: 'BaziGlyphs', serif;
  font-size: 9px;
}
body.cn-page .cn-lore-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: #6B1F2C;
  margin: 0 0 0.8rem;
}
body.cn-page .cn-lore-text p {
  font-family: 'EB Garamond', serif;
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--cn-ink);
  margin: 0;
}
body.cn-page .cn-lore-text strong { color: #6B1F2C; }

@media (max-width: 720px) {
  body.cn-page .cn-lore-row,
  body.cn-page .cn-lore-row--flip { grid-template-columns: 1fr; gap: 1.4rem; }
  body.cn-page .cn-lore-row--flip .cn-lore-art { order: 1; }
  body.cn-page .cn-lore-row--flip .cn-lore-text { order: 2; }
  body.cn-page .cn-lore-art { max-width: 260px; margin: 0 auto; }
}

/* ═══════════════════════════════════════════════════════════
   3c · FIND YOUR ANIMAL
═══════════════════════════════════════════════════════════ */
body.cn-page .cn-animals-section {
  padding: 2.8rem 0 3.4rem;
  background: linear-gradient(180deg, var(--cn-parchment) 0%, #F6ECD2 100%);
  text-align: center;
}
body.cn-page .cn-animals-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: #6B1F2C;
  margin: 0 0 0.4rem;
}
body.cn-page .cn-animals-sub {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: #6B1F2C;
  margin: 0 0 1.8rem;
}
body.cn-page .cn-animals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto 1.6rem;
}
body.cn-page .cn-animal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem 0.6rem 1rem;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.5);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(45, 31, 56, 0.06);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
body.cn-page a.cn-animal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(45, 31, 56, 0.15);
  border-color: var(--cn-gold-lt);
}
body.cn-page .cn-animal-glyph {
  font-family: 'BaziGlyphs', serif;
  font-size: 2.1rem;
  line-height: 1.1;
  color: #6B1F2C;
}
body.cn-page .cn-animal-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #77592B;
  margin: 0.35rem 0 0.3rem;
}
body.cn-page .cn-animal-years {
  font-family: 'EB Garamond', serif;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.5;
  color: #2D1F38;
}
body.cn-page .cn-animals-caveat {
  font-family: 'EB Garamond', serif;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--cn-ink);
  max-width: 62ch;
  margin: 0 auto;
}
body.cn-page .cn-animals-caveat strong { color: #6B1F2C; }
body.cn-page .cn-animals-caveat a { color: #77592B; font-weight: 600; }

@media (max-width: 760px) {
  body.cn-page .cn-animals-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
  body.cn-page .cn-animals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   4 · READING + "Included with membership."
═══════════════════════════════════════════════════════════ */
body.cn-page .cn-reading { margin-top: 2.2rem; }

body.cn-page .cn-upsell-note[hidden] { display: none; }
body.cn-page .cn-upsell-note {
  margin-top: 0.9rem;
  padding: 0.7rem 1rem;
  font-family: 'EB Garamond', serif;
  font-size: 1.08rem;
  line-height: 1.5;
  text-align: center;
  color: #FBF3DC;
  background: rgba(212, 172, 104, 0.16);
  border: 1px solid rgba(212, 172, 104, 0.55);
  border-radius: 8px;
}

body.cn-page .cn-included-line {
  margin-top: 0.9rem;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  color: rgba(251, 243, 220, 0.78);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   5 · ILLUSTRATION SET — pillar medallions · Day-Master plate ·
       Find-Your-Animal medallions · per-section reading emblems
   Shared across the free JS page, the paid view, and the member
   dashboard so all three read as one system.
═══════════════════════════════════════════════════════════ */

/* ── Pillar-card animal medallion (round, gold-ringed; between the
      sublabel and the glyphs). Hour-awaits cards carry none. ── */
body.cn-page .cn-medallion {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(184, 145, 80, 0.9);
  box-shadow: 0 2px 8px rgba(45, 31, 56, 0.2), inset 0 0 0 1px rgba(255, 251, 239, 0.5);
  background: #FBF3DC;
}
@media (max-width: 620px) {
  body.cn-page .cn-medallion { width: 60px; height: 60px; }
}

/* ── Find Your Animal — a larger medallion above each glyph ── */
body.cn-page .cn-animal-medallion {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 0.55rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(184, 145, 80, 0.9);
  box-shadow: 0 2px 8px rgba(45, 31, 56, 0.18), inset 0 0 0 1px rgba(255, 251, 239, 0.5);
  background: #FBF3DC;
}
@media (max-width: 540px) {
  body.cn-page .cn-animal-medallion { width: 72px; height: 72px; }
}

/* ── Day-Master plate — archetype art beside "Yang Earth · The Mountain" ── */
body.cn-page .cn-dm-plate {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  max-width: 640px;
  margin: 2.6rem auto 0.6rem;
  padding: 1.5rem 1.8rem;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid var(--cn-gold);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(139, 110, 58, 0.18), inset 0 0 0 1px rgba(212, 172, 104, 0.3);
}
body.cn-page .cn-dm-art {
  flex: 0 0 auto;
  width: 180px;
  height: 180px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(184, 145, 80, 0.9);
  box-shadow: 0 3px 12px rgba(45, 31, 56, 0.2);
  background: #FBF3DC;
}
body.cn-page .cn-dm-copy { text-align: left; }
body.cn-page .cn-dm-eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #77592B;
  margin-bottom: 0.35rem;
}
body.cn-page .cn-dm-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.1;
  color: #6B1F2C;
}
body.cn-page .cn-dm-glyph {
  font-family: 'BaziGlyphs', serif;
  font-size: 2.1rem;
  color: var(--cn-ink);
  margin-left: 0.45rem;
  vertical-align: -0.12em;
}
body.cn-page .cn-dm-archetype {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  color: #4A1620;
  margin-top: 0.3rem;
}
@media (max-width: 620px) {
  body.cn-page .cn-dm-plate { flex-direction: column; text-align: center; gap: 1.1rem; padding: 1.4rem; }
  body.cn-page .cn-dm-copy { text-align: center; }
  body.cn-page .cn-dm-art { width: 150px; height: 150px; }
}

/* ── Per-section reading emblems (injected after each pillar <h2>
      at render time by Generators::baziDecorateReadingHtml) ── */
body.cn-page .cn-emblem {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.25rem 0 1.5rem;
  padding: 0.6rem 0.95rem;
  background: linear-gradient(90deg, rgba(231, 200, 119, 0.16) 0%, rgba(184, 145, 80, 0.05) 100%);
  border-left: 3px solid var(--cn-gold);
  border-radius: 0 8px 8px 0;
}
body.cn-page .cn-emblem-img {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(184, 145, 80, 0.9);
  box-shadow: 0 2px 6px rgba(45, 31, 56, 0.18);
  background: #FBF3DC;
}
body.cn-page .cn-emblem-glyphs {
  font-family: 'BaziGlyphs', serif;
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--cn-ink);
}
body.cn-page .cn-emblem-text {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6B1F2C; /* wine — the emblem's headline */
  line-height: 1.2;
}
/* "Four Pillars: Goat · Goat · Tiger · Dragon" line in the stored summary plate */
body.cn-page .sr-view-body .sr-summary-best {
  font-size: 1.45rem;
  font-weight: 700;
  font-family: 'Marcellus', serif;
  color: var(--cn-ink);
}
body.cn-page .cn-fp-label { color: #6B1F2C; }

/* Sibling-tool crosslink under the altar — sits on the dark results night sky */
body.cn-page .ac-crosslink {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.6;
  text-align: center;
  color: rgba(251, 243, 220, 0.82);
  max-width: 56ch;
  margin: 1.8rem auto 0;
}
body.cn-page .ac-crosslink strong { color: #E7C877; font-style: normal; }
body.cn-page .ac-crosslink a {
  color: #D4AC68;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(212, 172, 104, 0.45);
  text-underline-offset: 3px;
}
body.cn-page .ac-crosslink a:hover { color: #F0D89A; }
