/* ━━━ 易のいろは 爻個別ページ（yao）固有スタイル ━━━ */

/* ─── Main ─── */
.main { max-width: 900px; margin: 20px auto 60px; padding: 0 20px; }

/* ─── Hero card ─── */
.hero { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 36px 40px; margin-bottom: 20px; display: grid; grid-template-columns: 110px 1fr; gap: 36px; align-items: start; }
.hexagram-fig { display: flex; flex-direction: column; gap: 0; padding-top: 4px; width: fit-content; }
.trigram-group { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.trigram-group + .trigram-group { border-top: 1px dashed var(--border); }
.trigram-group-label { font-size: 0.65rem; color: var(--muted); letter-spacing: 0.05em; padding-left: 32px; margin-bottom: -2px; }
.yao-row { display: flex; align-items: center; gap: 8px; }
.yao-label { font-size: 0.68rem; color: var(--muted); width: 24px; text-align: right; flex-shrink: 0; }
.yao-line { width: 64px; height: 9px; background: var(--accent); border-radius: 2px; position: relative; }
.yao-line.yin { background: transparent; }
.yao-line.yin::before, .yao-line.yin::after { content: ''; position: absolute; top: 0; bottom: 0; width: 27px; background: var(--accent); border-radius: 2px; }
.yao-line.yin::before { left: 0; }
.yao-line.yin::after  { right: 0; }
/* アクティブ爻（爻ページ固有） */
.yao-line.active      { background: var(--red); box-shadow: 0 0 6px rgba(192,57,43,.35); }
.yao-line.yin.active  { background: transparent; }
.yao-line.yin.active::before, .yao-line.yin.active::after { background: var(--red); box-shadow: 0 0 6px rgba(192,57,43,.35); }
.hero-kana { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 2px; }
.hero-title { font-family: var(--serif); font-size: 2rem; color: var(--accent); line-height: 1.2; margin-bottom: 2px; letter-spacing: 0.1em; }
.hero-yao { font-family: var(--serif); font-size: 1rem; color: var(--muted); margin-bottom: 18px; }

/* ─── 爻辞ブロック ─── */
.kiji-block { background: var(--panel); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; padding: 14px 18px; margin-bottom: 14px; }
.kiji-original { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); font-weight: bold; margin-bottom: 4px; }
.kiji-reading { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.kiji-trans { font-size: 0.88rem; color: var(--text); }
.kikkyo-badge { display: inline-block; color: var(--white); font-family: var(--serif); font-size: 0.82rem; padding: 5px 16px; border-radius: 20px; letter-spacing: 0.05em; }

/* ─── 上卦・下卦カード ─── */
.trigram-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.trigram-card { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; text-decoration: none; display: block; transition: border-color .15s, background .15s; }
.trigram-card:hover { border-color: var(--accent-lt); background: #f0e8e0; }
.trigram-card-label { font-size: 0.68rem; color: var(--muted); display: block; margin-bottom: 2px; }
.trigram-card-name { font-family: var(--serif); font-size: 0.95rem; color: var(--accent); font-weight: bold; }
.trigram-card-symbol { font-size: 1.1rem; margin-left: 4px; }
.trigram-card-attr { font-size: 0.72rem; color: var(--muted); display: block; margin-top: 2px; }

/* ─── Anchor nav ─── */
.anchor-nav { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 18px 22px; margin-bottom: 28px; }
.anchor-nav-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.08em; }
.anchor-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.anchor-nav a { display: inline-block; background: var(--panel); color: var(--accent); text-decoration: none; font-size: 0.8rem; padding: 5px 13px; border-radius: 20px; border: 1px solid var(--border); transition: background .15s, color .15s; }
.anchor-nav a:hover { background: var(--accent); color: var(--white); }

/* ─── Oracle section ─── */
.oracle { background: var(--white); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 14px; overflow: hidden; }
.oracle-head { background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px 22px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; }
.oracle-icon { font-size: 1.1rem; grid-row: 1/3; align-self: center; }
.oracle-head h2 { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); grid-column: 2; grid-row: 1; }
.oracle-summary { font-size: 0.82rem; color: var(--muted); grid-column: 2; grid-row: 2; font-style: italic; letter-spacing: 0.02em; }
.kikkyo { grid-column: 3; grid-row: 1/3; align-self: center; display: inline-block; font-family: var(--serif); font-size: 0.75rem; font-style: normal; padding: 3px 10px; border-radius: 3px; white-space: nowrap; font-weight: bold; letter-spacing: 0.05em; }
.kikkyo-daikichi { background: #c8960c; color: #fff; }
.kikkyo-kichi    { background: #2e7d32; color: #fff; }
.kikkyo-chukichi { background: #558b2f; color: #fff; }
.kikkyo-shokichi { background: var(--accent); color: #fff; }
.kikkyo-hei      { background: #78909c; color: #fff; }
.kikkyo-shokyou  { background: #e65100; color: #fff; }
.kikkyo-kyou     { background: #b71c1c; color: #fff; }
.kikkyo-daikyou  { background: #4a148c; color: #fff; }
.oracle-body { padding: 22px 24px; }
.sensei-block { display: flex; gap: 14px; align-items: flex-start; }
.sensei-avatar { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--white); font-family: var(--serif); font-size: 0.6rem; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.4; }
.oracle-text { flex: 1; font-size: 0.94rem; line-height: 2; color: var(--text); }
.oracle-text p { margin-bottom: 0.75em; }
.oracle-text p:last-child { margin-bottom: 0; }
.advice { margin-top: 14px; background: var(--panel); border-left: 3px solid var(--red); padding: 9px 14px; font-size: 0.82rem; color: var(--muted); border-radius: 0 4px 4px 0; }
.advice strong { color: var(--red); }

/* ─── 関連リンク ─── */
.related { margin-top: 32px; text-align: center; }
.related h3 { font-family: var(--serif); font-size: 0.88rem; color: var(--muted); margin-bottom: 12px; }
.related ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.related a { font-size: 0.82rem; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.related a:hover { border-color: var(--accent); }

/* ─── 占い結果バナー（?theme= 時のみ JS で表示） ─── */
.oracle-banner { display: none; background: var(--accent); background-image: linear-gradient(135deg, #4a2318 0%, #6B3A2A 100%); color: var(--white); padding: 14px 20px; position: sticky; top: 58px; z-index: 90; }
.oracle-banner.show { display: block; }
.oracle-banner-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.oracle-banner-label { font-size: 0.65rem; letter-spacing: 0.15em; opacity: 0.7; display: block; margin-bottom: 2px; }
.oracle-banner-title { font-family: var(--serif); font-size: 1rem; letter-spacing: 0.06em; }
.oracle-banner-title strong { font-size: 1.1rem; }
.oracle-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.oracle-banner-btn { display: inline-block; background: rgba(255,255,255,0.18); color: var(--white); text-decoration: none; font-size: 0.8rem; padding: 7px 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.3); white-space: nowrap; transition: background .15s; }
.oracle-banner-btn:hover { background: rgba(255,255,255,0.28); }
.oracle-banner-btn-outline { background: transparent; border-color: rgba(255,255,255,0.4); }

/* ─── 爻の解説セクション ─── */
.yao-section { margin-bottom: 32px; }
.yao-section-heading { font-family: var(--serif); font-size: 1.15rem; color: var(--accent); padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 20px; letter-spacing: 0.06em; }
.yao-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.yao-meta-card { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; text-align: center; }
.yao-meta-label { font-size: 0.65rem; color: var(--muted); letter-spacing: 0.1em; display: block; margin-bottom: 4px; }
.yao-meta-value { font-family: var(--serif); font-size: 1rem; color: var(--accent); display: block; }
.yao-meta-sub { font-size: 0.72rem; color: var(--muted); display: block; margin-top: 2px; }
.yao-desc-heading { font-family: var(--serif); font-size: 0.95rem; color: var(--accent); margin: 20px 0 8px; padding-left: 10px; border-left: 3px solid var(--accent); }
.yao-body-text { font-size: 0.88rem; line-height: 2; color: var(--text); margin-bottom: 12px; }
.yao-body-text strong { color: var(--accent); }
.kigo-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.kigo { background: var(--panel); border: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; padding: 3px 12px; border-radius: 20px; }

/* ─── 占い区切り ─── */
.oracle-divider { display: flex; align-items: center; gap: 14px; margin: 36px 0 0; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.1em; }
.oracle-divider::before, .oracle-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oracle-divider span { white-space: nowrap; background: var(--bg); padding: 0 4px; }

/* ─── スクロール余白 ─── */
.oracle { scroll-margin-top: 76px; }
body.oracle-mode .oracle { scroll-margin-top: 140px; }

/* ─── Oracle アクティブ強調 ─── */
.oracle.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(107,58,42,0.15); }
.oracle.active .oracle-head { background: var(--accent); }
.oracle.active .oracle-head h2 { color: var(--white); }
.oracle.active .oracle-summary { color: rgba(255,255,255,0.75); }
.oracle.active .kikkyo { border: 1px solid rgba(255,255,255,0.4); }

/* ─── Responsive ─── */
@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; padding: 24px 20px; gap: 24px; }
  .hero-title { font-size: 1.6rem; }
  .yao-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .oracle-banner-actions { width: 100%; }
}
