/*
Theme Name: Butcher Boy Ba Zi
Theme URI: https://www.butcherboy.com.sg/
Author: Butcher Boy Ba Zi
Description: Custom ink-and-gold theme for Butcher Boy Ba Zi — precision Chinese metaphysics. Hand-built, no page builders, Core Web Vitals first.
Version: 1.16.1
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: butcherboy
Tags: custom-theme, one-column, custom-menu
*/

/* ============ Fonts (self-hosted, latin variable subsets) ============ */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============ Tokens ============ */
:root {
  --paper: #FAF7F2;
  --surface: #FFFDF9;
  --ink: #1A1A1A;
  --ink-soft: #3A362F;
  --gold: #C6A15B;
  --gold-deep: #8A6C2F;
  --vermillion: #9E2B25;
  --mist: #6F6858;
  --line: rgba(26, 24, 20, 0.14);
  --line-soft: rgba(26, 24, 20, 0.08);
  --band: #1A1A1A;
  --band-text: #F0EBE2;
  --band-text-soft: rgba(240, 235, 226, 0.72);
  --shadow: 0 1px 2px rgba(26,24,20,.04), 0 8px 28px rgba(26,24,20,.06);
  --serif: 'Fraunces', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --cjk: 'Songti SC', 'STSong', 'Noto Serif SC', 'SimSun', serif;
  --w-content: 720px;
  --w-wide: 1140px;
  --gutter: clamp(20px, 5vw, 48px);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; overflow: hidden; position: absolute !important;
  word-wrap: normal !important;
}
.skip-link { left: 8px; top: 8px; z-index: 999; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip-link:focus-visible { clip: auto; clip-path: none; height: auto; width: auto; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 380;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(34px, 5.4vw, 56px); font-variation-settings: 'opsz' 110; }
h2 { font-size: clamp(26px, 3.6vw, 38px); font-variation-settings: 'opsz' 84; }
h3 { font-size: clamp(21px, 2.4vw, 26px); font-variation-settings: 'opsz' 48; font-weight: 420; }
h4 { font-size: 19px; font-weight: 460; }
p { margin: 0 0 1.2em; }
.hanzi { font-family: var(--cjk); }

.wrap { max-width: var(--w-wide); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wrap-narrow { max-width: var(--w-content); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* section label device */
.device { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.device::before { content: ''; width: 42px; height: 1px; background: var(--gold); flex: none; }
.device span { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--mist); }
.band .device span { color: rgba(240,235,226,.7); }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line-soft); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }

.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-seal { width: 38px; height: 38px; flex: none; transform: rotate(-2deg); }
.brand-name {
  font-family: var(--serif); font-variant-caps: all-small-caps;
  font-size: 23px; letter-spacing: .13em; font-weight: 430;
  font-variation-settings: 'opsz' 40; line-height: 1;
}
.brand-sub { display: block; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--mist); margin-top: 3px; }

.primary-nav ul { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.primary-nav a {
  font-size: 13.5px; font-weight: 550; letter-spacing: .04em;
  text-decoration: none; color: var(--ink-soft); padding: 6px 0;
  border-bottom: 1px solid transparent; white-space: nowrap;
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--ink); border-bottom-color: var(--gold); }
/* Dropdown submenu (Learn → the arts) */
.primary-nav li { position: relative; }
.primary-nav .menu-item-has-children > a::after { content: '⌄'; margin-left: 5px; font-size: 12px; opacity: .55; position: relative; top: -1px; }
.primary-nav .sub-menu {
  display: block; /* override the flex row from `.primary-nav ul` so items stack */
  position: absolute; top: 100%; left: 0; min-width: 210px; list-style: none; margin: 0; padding: 8px 0; z-index: 60;
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease;
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.primary-nav .sub-menu a { display: block; padding: 9px 20px; border-bottom: 0; white-space: nowrap; font-size: 13.5px; font-weight: 500; }
.primary-nav .sub-menu a:hover { color: var(--gold-deep); background: rgba(198,161,91,.09); }
/* App menu item — outlined gold, one step below the solid CTA */
.primary-nav li.nav-app > a {
  color: var(--gold-deep); font-weight: 600;
  border: 1px solid var(--gold); border-radius: 2px; padding: 7px 15px;
}
.primary-nav li.nav-app > a:hover {
  color: var(--gold-deep); background: rgba(198, 161, 91, 0.12); border-bottom-color: var(--gold);
}
.nav-cta { margin-left: 8px; }
.primary-nav .nav-cta a.btn {
  padding: 10px 18px; border-bottom: 0; color: #FFFDF7;
}
.primary-nav .nav-cta a.btn:hover { color: #FFFDF7; border-bottom: 0; }

.bb-lang { order: 3; font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; }
.bb-lang__link { color: var(--mist); text-decoration: none; padding: 4px 2px; }
.bb-lang__link--active { color: var(--ink); }
a.bb-lang__link:hover { color: var(--gold-deep); }
.bb-lang__sep { color: var(--line); margin: 0 5px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 2px; padding: 9px 11px; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { display: block; }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .primary-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px var(--gutter) 26px;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 4px; }
  .primary-nav a { display: block; padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line-soft); }
  .primary-nav .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; background: transparent; padding: 0 0 4px 16px;
  }
  .primary-nav .sub-menu a { font-size: 15px; padding: 9px 0; }
  .nav-cta { margin: 14px 0 0; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  padding: 14px 28px; border-radius: 2px; cursor: pointer; border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  text-align: center;
}
.btn-primary { background: var(--gold-deep); color: #FFFDF7; }
.btn-primary:hover { background: #A9853F; color: #FFFDF7; }
.btn-verm { background: var(--vermillion); color: #FFFDF7; }
.btn-verm:hover { background: #B23A31; color: #FFFDF7; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.band .btn-ghost { border-color: var(--band-text); color: var(--band-text); }
.band .btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-small { padding: 10px 18px; font-size: 12px; }

/* ============ Hero ============ */
.hero { padding: clamp(64px, 10vw, 130px) 0 clamp(56px, 8vw, 100px); }
.hero-grid { display: flex; align-items: flex-start; gap: clamp(24px, 4vw, 48px); }
.hero h1 {
  font-size: clamp(42px, 7.2vw, 84px);
  font-variation-settings: 'opsz' 144;
  font-weight: 340; max-width: 14ch;
}
.hero h1 em { font-style: italic; font-weight: 320; }
.hero-tagline {
  font-family: var(--serif); font-style: italic; font-weight: 350;
  font-size: clamp(19px, 2.3vw, 24px); color: var(--ink-soft); margin: 18px 0 0;
}
.hero-lede { font-size: 18px; color: var(--ink-soft); max-width: 56ch; margin: 22px 0 34px; }
.hero-seal { flex: none; width: clamp(84px, 11vw, 128px); margin-top: 10px; transform: rotate(-2deg); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 640px) { .hero-seal { display: none; } }

/* ============ Sections ============ */
.section { padding-top: clamp(56px, 8vw, 100px); padding-bottom: clamp(56px, 8vw, 100px); }
.section + .section { border-top: 1px solid var(--line-soft); }
.section-head { max-width: 62ch; margin-bottom: clamp(30px, 4vw, 44px); }
.section-head p { color: var(--ink-soft); }

/* Four pillars strip */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pillar {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px;
  box-shadow: var(--shadow); padding: 24px 20px 22px; text-align: center;
}
.pillar .glyph { font-family: var(--cjk); font-size: 40px; line-height: 1; display: block; }
.pillar .glyph::after { content: ''; display: block; width: 26px; height: 2px; background: var(--gold); margin: 12px auto; }
.pillar b { display: block; font-family: var(--serif); font-size: 18px; font-weight: 440; margin-bottom: 4px; }
.pillar span { font-size: 13px; color: var(--mist); line-height: 1.5; display: block; }
@media (max-width: 760px) { .pillars { grid-template-columns: repeat(2, 1fr); } }

/* ============ Article cards ============ */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--gold); }
.card-thumb { aspect-ratio: 16 / 10; background: #E9E3D8; display: block; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-cat {
  font-size: 11px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-deep); text-decoration: none; margin-bottom: 10px; display: inline-block;
}
.card-title { font-size: 20px; font-weight: 420; line-height: 1.25; margin: 0 0 8px; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--gold-deep); }
.card-excerpt { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 14px; }
.card-meta { margin-top: auto; font-size: 12.5px; color: var(--mist); }

/* ============ Dark band ============ */
.band { background: var(--band); color: var(--band-text); }
.band h2, .band h3 { color: var(--band-text); }
.band p { color: var(--band-text-soft); }
.band blockquote {
  margin: 26px 0 0; padding-left: 22px; border-left: 1px solid var(--gold);
  font-family: var(--serif); font-style: italic; font-size: 19px; max-width: 46ch; line-height: 1.55;
}
.band-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 860px) { .band-inner { grid-template-columns: 1fr; } }

/* ============ Newsletter / lead forms ============ */
.capture { max-width: 560px; }
.capture-form { display: flex; gap: 12px; flex-wrap: wrap; }
.capture-form input[type="email"] { flex: 1 1 260px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], select, textarea {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 2px; padding: 13px 15px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-deep); outline-offset: 0; border-color: transparent; }
.band input[type="email"], .band input[type="text"], .band input[type="tel"], .band select, .band textarea { background: rgba(250,247,242,.06); border-color: rgba(240,235,226,.25); color: var(--band-text); }
.band select option { background: var(--band); color: var(--band-text); }
.band input::placeholder, .band textarea::placeholder { color: rgba(240,235,226,.45); }
label { font-size: 13px; font-weight: 600; letter-spacing: .04em; display: block; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-note { font-size: 12.5px; color: var(--mist); margin-top: 10px; }
.form-success {
  border: 1px solid var(--gold); border-radius: 3px; background: var(--surface);
  padding: 16px 20px; font-size: 15px; margin-bottom: 26px;
}
.bb-hp { position: absolute !important; left: -9999px !important; height: 1px; width: 1px; overflow: hidden; }
.bb-email-hint { font-size: 13px; color: var(--mist); margin: 8px 0 0; }
.bb-email-hint button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--gold-deep); text-decoration: underline; cursor: pointer; }
.band .bb-email-hint { color: var(--band-text-soft); }
.band .bb-email-hint button { color: var(--gold); }
.capture-form .bb-email-hint { order: 10; flex: 1 1 100%; margin: 0; }

/* ============ Breadcrumbs ============ */
.breadcrumbs { font-size: 12.5px; color: var(--mist); margin: 26px 0 0; }
.breadcrumbs a { text-decoration: none; color: var(--mist); }
.breadcrumbs a:hover { color: var(--gold-deep); }
.breadcrumbs .separator { margin: 0 7px; color: var(--gold); }

/* ============ Single article ============ */
.article-header { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); }
.article-header .cat-link {
  font-size: 12px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-deep); text-decoration: none;
}
.article-header h1 { margin: 14px 0 18px; max-width: 22ch; }
.article-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--mist); flex-wrap: wrap; }
.article-meta .sep { color: var(--gold); }
.article-hero-img { border-radius: 4px; overflow: hidden; margin: 10px 0 0; aspect-ratio: 16 / 8; }
.article-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.entry-content { max-width: var(--w-content); }
.entry-content > * { max-width: 100%; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--gold); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
  margin: 1.6em 0; padding: .2em 0 .2em 22px; border-left: 1px solid var(--gold);
  font-family: var(--serif); font-style: italic; font-size: 1.12em; color: var(--ink-soft);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img { border-radius: 4px; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { font-size: 13px; color: var(--mist); margin-top: 8px; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.6em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.entry-content th { font-weight: 600; background: var(--surface); font-size: 13.5px; letter-spacing: .02em; }
.entry-content code { font-size: .9em; background: var(--surface); border: 1px solid var(--line-soft); padding: 2px 6px; border-radius: 3px; }
.table-scroll { overflow-x: auto; }

/* TOC */
.bb-toc {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px;
  padding: 22px 26px; margin: 2em 0; max-width: var(--w-content); box-shadow: var(--shadow);
}
.bb-toc-label { font-size: 11px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; color: var(--mist); margin-bottom: 12px; }
.bb-toc ol { margin: 0; padding-left: 1.2em; font-size: 14.5px; }
.bb-toc li { margin-bottom: .35em; }
.bb-toc a { text-decoration: none; color: var(--ink-soft); }
.bb-toc a:hover { color: var(--gold-deep); }

/* Post-footer CTA band */
.post-cta {
  background: var(--band); color: var(--band-text);
  border-radius: 4px; box-shadow: var(--shadow);
  padding: clamp(28px, 4.5vw, 44px);
  margin: 3em 0 0; max-width: var(--w-content);
  display: flex; flex-direction: column; gap: 20px;
  align-items: center; text-align: center;
}
.post-cta .device { margin-bottom: 14px; justify-content: center; }
.post-cta .device span { color: rgba(240,235,226,.7); }
.post-cta h2 { color: var(--band-text); font-size: clamp(22px, 3vw, 28px); margin-bottom: 10px; }
.post-cta p { color: var(--band-text-soft); font-size: 15px; max-width: 58ch; margin: 0 auto; }
.post-cta-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.post-cta .btn-ghost { border-color: var(--band-text); color: var(--band-text); }
.post-cta .btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* Sticky header vs WP admin bar (logged-in only) */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

/* Author box */
.author-box {
  display: flex; gap: 18px; align-items: flex-start;
  border-top: 1px solid var(--line); margin-top: 3em; padding-top: 2em; max-width: var(--w-content);
}
.author-box img { border-radius: 50%; flex: none; }
.author-box b { font-family: var(--serif); font-size: 17px; font-weight: 460; display: block; margin-bottom: 4px; }
.author-box p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* Related */
.related { border-top: 1px solid var(--line-soft); padding: clamp(48px, 7vw, 80px) 0; }

/* ============ Archive ============ */
.archive-header { padding: clamp(44px, 7vw, 80px) 0 clamp(20px, 3vw, 36px); }
.archive-header .description { color: var(--ink-soft); max-width: 62ch; font-size: 17px; }
.pagination { margin: 48px 0 0; font-size: 14px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 2px;
  text-decoration: none; color: var(--ink-soft);
}
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination .page-numbers:hover { border-color: var(--gold-deep); color: var(--gold-deep); }

/* ============ Page ============ */
.page-header { padding: clamp(44px, 7vw, 80px) 0 clamp(20px, 3vw, 32px); }
.page-content { padding-bottom: clamp(56px, 8vw, 100px); }

/* ============ 404 / search ============ */
.plain-center { text-align: center; padding: clamp(80px, 12vw, 160px) 0; }
.plain-center .seal-mark { width: 72px; margin: 0 auto 28px; opacity: .92; transform: rotate(-2deg); }
.search-form-inline { display: flex; gap: 12px; max-width: 460px; margin: 26px auto 0; }

/* ============ Footer ============ */
.site-footer { background: var(--band); color: var(--band-text); margin-top: clamp(56px, 8vw, 100px); }
.footer-inner { padding-top: clamp(48px, 7vw, 80px); padding-bottom: 36px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand-name { color: var(--band-text); }
.footer-brand p { color: var(--band-text-soft); font-size: 14px; max-width: 34ch; margin-top: 14px; }
.footer-col b { font-size: 11.5px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; color: rgba(240,235,226,.66); display: block; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14.5px; color: var(--band-text-soft); text-decoration: none; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(240,235,226,.12); margin-top: clamp(36px, 5vw, 56px);
  padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: rgba(240,235,226,.62);
}

/* ============ Ba Zi calculator ============ */
#bz-result { margin-top: 40px; }
.bz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 700px) { .bz-grid { grid-template-columns: repeat(2, 1fr); } }
.bz-pillar {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px;
  box-shadow: var(--shadow); padding: 20px 14px 18px; text-align: center;
  border-top: 2px solid var(--gold);
}
.bz-pillar.bz-empty { border-top-color: var(--line); }
.bz-label { display: block; font-size: 11px; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; color: var(--mist); margin-bottom: 12px; }
.bz-chars { display: block; font-family: var(--cjk); font-size: clamp(34px, 5vw, 44px); line-height: 1.15; }
.bz-pinyin { display: block; font-family: var(--serif); font-style: italic; font-size: 14px; margin-top: 8px; color: var(--ink-soft); }
.bz-meta { display: block; font-size: 12px; color: var(--mist); margin-top: 5px; line-height: 1.5; }
.bz-daymaster { margin-top: 36px; }
.bz-dm-line { font-size: 16.5px; max-width: 62ch; }
.bz-dm-line b { font-family: var(--cjk); font-size: 26px; font-weight: 500; color: var(--vermillion); margin-right: 8px; }
.bz-elements { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.bz-el { font-size: 13px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.bz-el i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bz-el-wood { background: #5B7A55; } .bz-el-fire { background: #9E2B25; }
.bz-el-earth { background: #B08D57; } .bz-el-metal { background: #A6A6A0; }
.bz-el-water { background: #2E4A62; }

/* ============ Library hub grid ============ */
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 960px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
.hub-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 2px solid var(--gold); border-radius: 3px; box-shadow: var(--shadow);
  color: var(--ink-soft); text-decoration: none;
  transition: border-color .18s, color .18s, transform .18s;
}
.hub-card:hover { color: var(--gold-deep); border-color: var(--gold); border-left-color: var(--gold-deep); transform: translateY(-2px); }
.hub-card-media { aspect-ratio: 16 / 10; background: #E9E3D8; display: block; position: relative; }
.hub-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-card--noimg .hub-card-media { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--gold) 0%, var(--vermillion) 100%); }
.hub-card-glyph { color: rgba(250, 247, 242, .92); font-size: 40px; line-height: 1; }
.hub-card-label { padding: 12px 15px; font-size: 14px; font-weight: 550; line-height: 1.3; }
@media (max-width: 520px) { .hub-card-label { font-size: 13px; padding: 10px 12px; } }

/* ============ Zodiac finder ============ */
#zf-result { margin-top: 34px; }
.zf-card { background: var(--surface); border: 1px solid var(--line-soft); border-top: 2px solid var(--gold);
  border-radius: 4px; box-shadow: var(--shadow); padding: 28px 30px; max-width: 560px; }
.zf-big { font-family: var(--cjk); font-size: 56px; line-height: 1; display: block; color: var(--vermillion); margin-bottom: 14px; }
.zf-answer { font-size: 18px; margin: 0 0 10px; }
.zf-note { font-size: 14px; color: var(--ink-soft); background: var(--paper); border-left: 2px solid var(--gold);
  padding: 10px 14px; margin: 12px 0; }
.zf-links { font-size: 14px; margin: 14px 0 0; }

/* ============ Compatibility calculator ============ */
.cp-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .cp-inputs { grid-template-columns: 1fr; } }
.cp-inputs fieldset { border: 1px solid var(--line-soft); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); padding: 20px 22px 24px; }
.cp-inputs legend { font-family: var(--serif); font-size: 18px; font-weight: 440; padding: 0 8px; }
#cp-result { margin-top: 40px; }
.cp-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .cp-charts { grid-template-columns: 1fr; } }
.cp-person { background: var(--surface); border: 1px solid var(--line-soft); border-top: 2px solid var(--gold); border-radius: 4px; box-shadow: var(--shadow); padding: 20px 22px; }
.cp-name { font-size: 11px; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; color: var(--mist); margin-bottom: 12px; }
.cp-pillars { display: flex; gap: 14px; flex-wrap: wrap; }
.cp-pillar span { display: block; font-size: 11px; color: var(--mist); }
.cp-pillar b { font-family: var(--cjk); font-size: 26px; font-weight: 500; }
.cp-dm { font-size: 13.5px; color: var(--ink-soft); margin: 14px 0 0; }
.cp-dm b { font-family: var(--cjk); font-size: 18px; color: var(--vermillion); }
.cp-section { margin-top: 30px; }
.cp-section p { max-width: 62ch; }
.cp-caveat { margin-top: 26px; font-size: 13.5px; color: var(--mist); border-top: 1px solid var(--line-soft); padding-top: 16px; }

/* no-js fallback */
.no-js .primary-nav { display: block; position: static; border: 0; padding: 0; }

/* ============ WhatsApp floating button ============ */
.wa-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 998;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 56px;
  padding: 0 13px;
  border-radius: 28px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: gap .2s ease, padding .2s ease, box-shadow .2s ease, transform .15s ease;
  overflow: hidden;
}
.wa-fab:hover,
.wa-fab:focus-visible {
  gap: 9px;
  padding-right: 20px;
  color: #fff;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}
.wa-fab:active { transform: scale(.97); }
.wa-fab svg { flex: 0 0 auto; display: block; }
.wa-fab-text {
  max-width: 0;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transition: max-width .2s ease, opacity .2s ease;
}
.wa-fab:hover .wa-fab-text,
.wa-fab:focus-visible .wa-fab-text {
  max-width: 240px;
  opacity: 1;
}
@media (max-width: 520px) {
  .wa-fab { right: 16px; bottom: 16px; height: 52px; padding: 0 11px; }
}
