/* Rayne-Lab spacious navigation / TOP spacing v7 */

/*
 * Self-contained header fallback.
 * Some isolated tool pages (notably 六壬神課) receive the shared header/postprocess
 * but do not load static/style.css. Keep the brand usable in that case instead of
 * falling back to an unstyled purple link / rotated bare R.
 * Values intentionally mirror static/style.css and use fallbacks so normal pages
 * that already load style.css render unchanged.
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.09));
  background: rgba(9,9,11,.82);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.header-inner {
  width: min(1280px, calc(100% - 72px));
  height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  color: var(--gold-bright, #e3bf68);
  font-size: .82rem;
  line-height: 1;
  transform: none;
  /* 2026-09-23 brand logo v1.1: 陰陽◇R ロゴ（ファビコンと同一SVG）を表示 */
  background: url("/static/icons/favicon.svg") center / contain no-repeat;
}

/* 旧マーク（回転した文字R）はロゴ画像に置き換えたため非表示。スクリーンリーダー向けの名称は .brand の aria-label が担う */
.brand-mark > span { display: none !important; }

.brand-name {
  color: var(--fg, #f0eee9);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .07em;
}

.site-nav { display: none !important; }

/* Global fixed menu trigger: always stays at the upper-right on every page. */
.site-menu-toggle {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(159,73,57,.52);
  border-radius: 50%;
  background: rgba(9,9,11,.76);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 72;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}

.site-menu-toggle span {
  width: 17px;
  height: 1px;
  background: rgba(207,104,82,.88);
  transform-origin: center;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .2s ease;
}

.site-menu-toggle:hover {
  border-color: rgba(207,104,82,.86);
  background: rgba(18,14,14,.88);
}

body.site-menu-open .site-menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.site-menu-open .site-menu-toggle span:nth-child(2) { opacity: 0; }
body.site-menu-open .site-menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Global fixed account icon: sits just left of the menu trigger, always visible. */
.site-account-icon {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(159,73,57,.52);
  border-radius: 50%;
  background: rgba(9,9,11,.76);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 14px;
  right: 80px;
  z-index: 72;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  color: rgba(207,104,82,.88);
  text-decoration: none;
  overflow: hidden;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}

.site-account-icon:hover {
  border-color: rgba(207,104,82,.86);
  background: rgba(18,14,14,.88);
}

.site-account-icon__body {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.site-account-icon__glyph {
  width: 22px;
  height: 22px;
}

.site-account-icon__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.site-account-icon__dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(210,170,77,.92);
  border: 1.5px solid rgba(9,9,11,.9);
  display: none;
}

.site-account-icon[data-auth="in"] .site-account-icon__dot { display: block; }

/* WEB-083: search icon, same fixed-position design as the account icon, one slot
   to its left (account right:80 + width46 + 10px gap = 136). */
.site-search-icon {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(159,73,57,.52);
  border-radius: 50%;
  background: rgba(9,9,11,.76);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 14px;
  right: 136px;
  z-index: 72;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  color: rgba(207,104,82,.88);
  text-decoration: none;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}

.site-search-icon:hover {
  border-color: rgba(207,104,82,.86);
  background: rgba(18,14,14,.88);
}

.site-search-icon__glyph {
  width: 20px;
  height: 20px;
}

.site-menu-backdrop {
  position: fixed;
  inset: 74px 0 0;
  z-index: 68;
  background: rgba(0,0,0,.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .32s ease, visibility .32s ease;
}

.site-menu-panel {
  position: fixed;
  top: 74px;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(230px, 78vw);
  padding: 38px 34px;
  /* JMG-007: 神々を追加しても小さな画面で会員・朋・想・お問い合わせまで辿れる。 */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background:
    radial-gradient(circle at 100% 0%, rgba(159,73,57,.06), transparent 20rem),
    linear-gradient(180deg, rgba(16,16,19,.99), rgba(9,9,11,.995));
  border-left: 1px solid rgba(210,170,77,.07);
  box-shadow: -30px 0 90px rgba(0,0,0,.32);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .42s cubic-bezier(.16,.84,.24,1), visibility .42s ease;
}

body.site-menu-open { overflow: hidden; }
body.site-menu-open .site-menu-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.site-menu-open .site-menu-panel {
  transform: translateX(0);
  visibility: visible;
}

.site-menu-kicker {
  margin: 0 0 1.45rem;
  color: rgba(210,170,77,.58);
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .20em;
  white-space: nowrap;
}

/* Vermilion stamps in a single calm vertical line. */
.site-menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}

.site-menu-list a {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(159,73,57,.72);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(9,9,11,.34);
  box-shadow: inset 0 0 0 1px rgba(207,104,82,.025);
  transition: border-color .22s ease, background .22s ease, transform .22s ease;
}

.site-menu-list a:hover {
  border-color: rgba(207,104,82,.96);
  background: rgba(56,20,17,.17);
  transform: translateX(-3px);
}

.site-menu-label {
  color: rgba(207,104,82,.92);
  font-family: "Shippori Mincho", serif;
  font-size: .86rem;
  line-height: 1;
  letter-spacing: .03em;
}

.site-menu-index,
.site-menu-count { display: none !important; }

/* TOP: treat the first view as an intentional canvas, not a dashboard. */
.home-hero {
  min-height: calc(100svh - 74px);
  padding-top: clamp(120px, 17vh, 210px) !important;
  padding-bottom: clamp(130px, 18vh, 220px) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-hero .eyebrow { margin-bottom: 1.35rem; }
.home-hero h1 { margin-top: 0; margin-bottom: 1.7rem; }
.home-hero .hero-lead { max-width: 760px; margin-bottom: 0; }
.home-hero .hero-meta { margin-top: 2.35rem; }

.home-section {
  padding-top: clamp(120px, 16vh, 210px) !important;
  padding-bottom: clamp(120px, 16vh, 210px) !important;
}

.home-section .section-heading {
  margin-bottom: clamp(64px, 8vw, 110px) !important;
}

/* 知: Rayne-Lab独自の中核モデルだけ、他の理論カードより一段強く見せる。 */
.subcategory-card[href="/01_chi/rayne-model/"] {
  position: relative;
  border-color: rgba(210,170,77,.55);
  background:
    radial-gradient(circle at 92% 12%, rgba(210,170,77,.10), transparent 9rem),
    linear-gradient(145deg, rgba(210,170,77,.085), rgba(159,73,57,.025) 58%, rgba(255,255,255,.014));
  box-shadow:
    inset 0 1px 0 rgba(227,191,104,.10),
    0 18px 48px rgba(0,0,0,.20);
}

.subcategory-card[href="/01_chi/rayne-model/"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  right: 22px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(227,191,104,.92), transparent);
}

.subcategory-card[href="/01_chi/rayne-model/"] .subcategory-title {
  color: var(--gold-bright);
}

.subcategory-card[href="/01_chi/rayne-model/"]:hover {
  border-color: rgba(227,191,104,.78);
  background:
    radial-gradient(circle at 92% 12%, rgba(210,170,77,.16), transparent 10rem),
    rgba(210,170,77,.055);
}

@media (max-width: 680px) {
  .header-inner { width: calc(100% - 32px); height: 64px; }
  .site-menu-backdrop { top: 64px; }
  .site-menu-panel {
    top: 64px;
    width: min(190px, 76vw);
    padding: 32px 28px;
  }
  .site-menu-toggle {
    width: 42px;
    height: 42px;
    top: 11px;
    right: 16px;
  }
  .site-account-icon {
    width: 42px;
    height: 42px;
    top: 11px;
    right: 66px;
  }
  .site-account-icon__glyph { width: 19px; height: 19px; }
  .site-account-icon__dot { width: 9px; height: 9px; }
  .site-search-icon {
    width: 42px;
    height: 42px;
    top: 11px;
    right: 118px;
  }
  .site-search-icon__glyph { width: 18px; height: 18px; }
  .site-menu-list { gap: 11px; }
  .site-menu-list a {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }
  .site-menu-label { font-size: .82rem; }
  .home-hero {
    min-height: calc(100svh - 64px);
    padding-top: 92px !important;
    padding-bottom: 108px !important;
  }
  .home-section {
    padding-top: 96px !important;
    padding-bottom: 96px !important;
  }
}


/* Global Observation AI Lite entry point. Hidden on the chat page itself by JS. */
.observation-ai-float {
  position: fixed;
  right: 24px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 64;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(210,170,77,.58);
  border-radius: 18px 18px 4px 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(210,170,77,.13), transparent 7rem),
    rgba(13,13,16,.92);
  color: var(--fg, #f0eee9);
  text-decoration: none;
  box-shadow: 0 14px 42px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.observation-ai-float::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -8px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(210,170,77,.58);
  background: rgba(13,13,16,.96);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.observation-ai-float:hover {
  transform: translateY(-2px);
  border-color: rgba(227,191,104,.9);
  background: rgba(24,20,17,.96);
}

.observation-ai-float:focus-visible {
  outline: 2px solid var(--gold-bright, #e3bf68);
  outline-offset: 4px;
}

.observation-ai-float__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: none;
  line-height: 0;
}

.observation-ai-float__icon svg {
  display: block;
}

.observation-ai-float__label {
  font-family: "Shippori Mincho", serif;
  font-size: .88rem;
  line-height: 1;
  letter-spacing: .06em;
}

/* プラン表示。文字の高さが違うので、上揃えではなく中央でそろえる。 */
.observation-ai-float__lite {
  align-self: center;
  color: var(--gold-soft, #d2aa4d);
  font-size: .62rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .observation-ai-float {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    min-height: 44px;
    padding: 0 14px;
  }
}

@media print {
  .observation-ai-float { display: none !important; }
}

/* パンくず（postprocess_site.py が入れる .breadcrumb-page）。
   文字は小さいままで、指が当たる高さだけ確保する。 */
.breadcrumb-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 .35rem;
}
.breadcrumb-page a,
.breadcrumb-page .breadcrumb-current {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
@media (max-width: 680px) {
  .breadcrumb-page a,
  .breadcrumb-page .breadcrumb-current { min-height: 44px; }
}

/* ------------------------------------------------------------------
 * WEB-175: 指で押す領域の最低サイズ
 *
 * 2026-09-24、360px幅で実際に描画して測った結果にもとづく。
 * 指の腹はおよそ9〜10mm（CSSピクセルで44前後）ある。
 *
 *   a.brand                     30x30  テンプレートページのロゴ
 *   .topbar .brand              93x25 / 130x30  ツールページのロゴ
 *   追従パンくずの a            25x17  「TOP」など（全ツールページ）
 *   button.v10-calendar-retry   84x27  六壬の「暦を再読み込み」
 *   a.diag-back / a.about-back  77x25 / 74x25
 *   a.article-favorite         243x32
 *
 * このファイルはテンプレートページ（bundle-core経由）と、
 * postprocess_site.py が差し込む手書きツールページの両方が読むので、
 * ここに置けば1箇所で両方に効く。
 *
 * ロゴは見た目の高さを変えたくないので、当たり判定だけを擬似要素で広げる。
 * それ以外は min-height で素直に確保する（文字サイズは変えない）。
 * ------------------------------------------------------------------ */
html body .brand { position: relative; }
html body .brand::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 44px);
  height: 44px;
  transform: translate(-50%, -50%);
}

html body .v10-calendar-retry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .9rem;
}

html body .diag-back,
html body .about-back,
html body .article-favorite {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* 「戻る」は左端に寄っているため、余白は右と縦だけに足す */
html body .diag-back,
html body .about-back { padding: .55rem .75rem .55rem 0; }

/* WEB-237: 「動きを減らす」設定を無視して共通ヘッダーが動いていた（2026-09-30 実測）。
   サイト全体のガードは style.css（= bundle-core-v1.css）の * ルール1本だけだが、
   bundle-core を読まないページが15本ある（404 / 暦ツール6本 / 御札ギャラリー /
   朔のゲーム5本 / 六壬2本）。この15本では固定メニュー・アイコン・ドロワー・
   観測AIフロートのトランジションがそのまま残り、ドロワーは0.42秒スライドしていた。
   残り288ページでは同じ要素が .01ms に潰れている＝15ページだけがルールから漏れていた。
   共通navに自前のガードを置いて挙動をそろえる。* の全体ガードを足す形にしないのは、
   ページ側が reduced-motion 時に意図して残している opacity フェードを消さないため。 */
@media (prefers-reduced-motion: reduce) {
  .site-menu-toggle,
  .site-menu-toggle span,
  .site-account-icon,
  .site-search-icon,
  .site-menu-backdrop,
  .site-menu-panel,
  .site-menu-list a,
  .observation-ai-float {
    transition: none;
  }
}
