/* Credocrux 共通の見た目。
   色と書体は Figma「実装正本｜Credocrux PC｜Claude引き継ぎ」（133:3057）の変数から写した。
   寸法は 1440px 幅の設計の値。860px 以下の割り付けは、設計が PC だけのため Claude が決めた */

:root {
  /* Figma の変数 */
  --ink-900: #1e1f1b;        /* color/ink-900 */
  --sumi: #242523;           /* 文字/墨 */
  --marble: #f5f5f5;         /* 背景/大理石 */
  --rule: #d4d4d3;           /* 罫線/グレー */
  --paper-100: #efe7da;      /* color/paper-100 */
  --paper-50: #f7f3ec;       /* color/paper-50 */
  --ink-600: #5b5a52;        /* color/ink-600、アクセント/オリーブグレー */
  --olive: #5b5a52;
  --white: #ffffff;          /* 背景/白 */
  --light-gray: #cacbc7;     /* 文字/薄いグレー */
  --bright-gray: #e6e6e3;    /* 文字/明るいグレー */
  --gallery: #303130;        /* 背景/ギャラリー */
  --gray-bg: #e9e9e8;        /* 背景/グレー */
  --charcoal: #252625;       /* 背景/チャコール */

  --mincho: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --ud-mincho: "BIZ UDMincho", "Hiragino Mincho ProN", serif;
  --ud-pmincho: "BIZ UDPMincho", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 58px;            /* 設計の左右の余白 */
  --bar-h: 60px;             /* ページの上の帯の高さ。2026-11-28 の社長の指示「トップページにヘッダーを正として、他のページにも反映」で、トップと同じ 60px にした（前は 98px） */

  /* 試作 v8.3 の展示室が使う名前（front.css） */
  --wall: #111111;
  --stone: #5b5a52;
  --paper: #f7f3ec;
  --ink: #1e1f1b;
  --green: #1b251c;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--marble); color: var(--sumi); font: 400 16px/1.9 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
figure, p, h1, h2, h3, h4, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
.ph { display: inline-block; max-width: 100%; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 文節の途中で行を割らない（言葉そのものは変えない） */
p, li, dd, h1, h2, h3 { word-break: auto-phrase; line-break: strict; }

/* ---------- 共通の部品 ---------- */
/* [ LABEL ]（Press/Label 68:2850）：英字は DM Mono 11px、日本語は Noto Sans JP */
.ccx-label { display: block; font: 400 11px/normal var(--mono); letter-spacing: .06em; color: var(--ink-900); }
.ccx-label.jp { font-family: var(--sans); }
.ccx-label.on-dark { color: var(--white); }
/* 丸い枠のボタン（Press/Pill 68:2858） */
.ccx-pill { display: inline-flex; align-items: flex-start; padding: 10px 20px 11px; border: 1px solid var(--ink-900); border-radius: 999px; font: 400 14px/normal var(--sans); color: var(--ink-900); text-decoration: none; background: none; cursor: pointer; transition: background-color .2s, color .2s; }
.ccx-pill:hover { background: var(--ink-900); color: var(--white); }
.ccx-pill.on-dark { border-color: var(--light-gray); color: var(--paper-50); }
.ccx-pill.on-dark:hover { background: var(--paper-50); color: var(--gallery); }
/* 塗りのボタン（サポーターになる 109:3098） */
.ccx-btn { display: inline-flex; align-items: flex-start; padding: 14px 22px; border: 1px solid var(--olive); border-radius: 4px; background: var(--olive); color: var(--paper-50); font: 400 14px/normal var(--sans); text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s; }
.ccx-btn:hover { background: var(--white); color: var(--olive); }
.ccx-rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- 上の帯 ---------- */
.site-bar { z-index: 30; color: var(--white); }
.site-bar .bar { display: flex; align-items: center; gap: 40px; }
.bar-logo { display: block; flex: none; color: inherit; }
.bar-logo-mark { display: block; width: 140px; height: 38px; background: currentColor; -webkit-mask: url(../img/fig/logo.svg) center / contain no-repeat; mask: url(../img/fig/logo.svg) center / contain no-repeat; }
.site-bar .nav { display: flex; gap: 40px; margin-left: auto; }
.site-bar .nav a, .site-bar .nav-current { font: 400 14px/1.85 var(--sans); letter-spacing: .02em; color: inherit; text-decoration: none; white-space: nowrap; }
.site-bar .nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.site-bar .nav-current { color: var(--bright-gray); }
.bar-tools { display: flex; align-items: center; gap: 16px; }
.bar-btn { background: none; border: 0; padding: 4px 0; cursor: pointer; color: inherit; }
.menu-btn { display: none; font: 400 13px/1.85 var(--sans); }
/* スマートフォンのメニュー：ハンバーガーの印（2026-11-28 の社長の指示「スマホ版のハンバーガーメニューへの変更」、21 言語とも）。
   印は 22×16px の 3 本の線（太さ 2px）、押せる範囲は 40×40px。開いているときは × にする */
.menu-icon { position: relative; display: block; width: 22px; height: 16px; }
.menu-icon > span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 1px; background: currentColor; transition: transform .25s, opacity .2s, top .25s; }
.menu-icon > span:nth-child(1) { top: 0; }
.menu-icon > span:nth-child(2) { top: 7px; }
.menu-icon > span:nth-child(3) { top: 14px; }
.menu-btn[aria-expanded="true"] .menu-icon > span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon > span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .menu-icon > span:nth-child(3) { top: 7px; transform: rotate(-45deg); }
.lang-badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; font: 400 14px/1.85 var(--sans); letter-spacing: .02em; }
.lang-badge .flag { display: block; width: 29px; height: auto; }

/* トップ以外：トップのヘッダー（front.css の .site-bar.is-hero）と同じ高さ、ロゴの大きさ、余白にし、下へ送っても上に留める。
   地の色は、トップで展示室を下へ送った後（.solid）と同じチャコール（2026-11-28 の社長の指示。前は高さ 98、ロゴ 140×38 で、ページと一緒に流れた） */
.site-bar.is-page { position: sticky; top: 0; background: var(--charcoal); }
.admin-bar .site-bar.is-page { top: 32px; }   /* ログインしている人（管理画面の黒い帯の下に留める） */
@media (max-width: 782px) { .admin-bar .site-bar.is-page { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-bar.is-page { top: 0; } }   /* この幅では管理画面の帯が一緒に流れる */
.site-bar.is-page .bar { height: var(--bar-h); padding: 0 38px 0 58px; }
.site-bar.is-page .bar-logo-mark { width: 108px; height: 29.4px; }
html { scroll-padding-top: 60px; }   /* ページの中の見出しへ移るリンク（#amounts など）の行き先が、上に留まるヘッダーに隠れないように */

/* ---------- フッター（119:3081） ---------- */
.site-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 56px var(--gutter) 48px; background: var(--charcoal); color: var(--white); }
.footer-logo { display: block; color: var(--white); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.footer-links a { font: 400 13px/1.85 var(--sans); letter-spacing: .02em; color: var(--white); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-copy { font: 400 12px/1.85 var(--sans); letter-spacing: .02em; }

/* ---------- スマートフォン（Claude の割り付け） ---------- */
@media (max-width: 860px) {
  :root { --gutter: 20px; --bar-h: 60px; }
  .site-bar .bar { gap: 16px; }
  .site-bar.is-page .bar { padding: 0 16px; }
  .site-bar.is-page .bar-logo-mark { width: 96px; height: 26px; }   /* トップのスマートフォンと同じ（front.css） */
  .bar-logo-mark { width: 107px; height: 29px; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 -9px; padding: 0; }   /* 印の右端を帯の右の余白（16px）にそろえる */
  .site-bar .nav { display: none; position: absolute; z-index: 5; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 20px 16px; background: var(--charcoal); }
  .site-bar .nav.open { display: flex; }
  .site-bar .nav a, .site-bar .nav-current { padding: 12px 0; font-size: 14px; color: var(--white); }
  .site-bar .nav-current { color: var(--bright-gray); }
  .bar-tools { margin-left: auto; }
  .lang-badge { padding: 4px 0; font-size: 13px; gap: 6px; }
  .lang-badge .flag { width: 24px; }
  .site-footer { padding: 40px 20px 36px; }
  .footer-links { flex-direction: column; gap: 4px; }
}

/* ---- 言語の切り替え（2026-11-28、多言語。inc/i18n.php の ccx_lang_switcher） ----
   寸法と色は Figma の「言語の選択（国旗と英語の表記、21 言語）」（149:3060）と「言語の項目」（149:3059）の値をそのまま写す。
   列の幅 140 × 3、行の高さ 34、列の間 8、行の間 6、内側 上下 24・左右 16、地は #5B5A52 の 50%。
   項目：内側 6 / 10 / 6 / 8、国旗と名前の間 10、角 4、名前 14px・行の高さ 20・字間 2%。選択中：白 20% の地と、内側の白 55% の線 */
.lang-switch { position: relative; }
button.lang-badge { border: 0; background: none; color: inherit; cursor: pointer; }
button.lang-badge:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.lang-panel { position: absolute; right: 0; top: calc(100% + 12px); z-index: 30; padding: 24px 16px; background: rgba(91, 90, 82, .5); }
.lang-panel[hidden] { display: none; }
.lang-list { display: grid; grid-template-columns: repeat(3, 140px); grid-auto-rows: 34px; gap: 6px 8px; align-items: start; justify-items: start; margin: 0; padding: 0; list-style: none; }
.lang-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; border-radius: 4px; color: #fff; text-decoration: none; font: 400 14px/20px "Noto Sans", "Noto Sans JP", sans-serif; letter-spacing: .02em; white-space: nowrap; }
.lang-item[lang="ja"] { font-family: "Noto Sans JP", sans-serif; }
.lang-item:hover { background: rgba(255, 255, 255, .12); }
.lang-item.is-current { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.lang-item .flag { display: block; flex: none; width: 29px; height: 19.33px; border-radius: 3px; }
@media (max-width: 860px) {
  .lang-list { grid-template-columns: repeat(2, 140px); }   /* スマートフォンの幅では 3 列が入らないので 2 列（列の幅と間は Figma のまま） */
}

/* ---- 日本語以外のページ（2026-11-28、多言語）。欧文は Figma のカンプの EB Garamond と、本文は Noto Sans ---- */
html:not([lang="ja"]) {
  --mincho: "EB Garamond", "BIZ UDPMincho", serif;
  --ud-mincho: "EB Garamond", "BIZ UDMincho", serif;
  --ud-pmincho: "EB Garamond", "BIZ UDPMincho", serif;
  --sans: "Noto Sans", "Noto Sans JP", system-ui, sans-serif;
}
html:not([lang="ja"]) .ph { display: inline; }
html:not([lang="ja"]) :is(p, li, dd, h1, h2, h3, .lead-sp, .eps-card-title) { word-break: normal; line-break: auto; overflow-wrap: break-word; hyphens: manual; }
html[lang="de"] :is(p, li, dd, .lead-sp) { hyphens: auto; }   /* ドイツ語だけは長い複合語を語の切れ目で分ける */

/* ---- 残りの 15 言語（2026-11-28、多言語。site_home/多言語対応_実装の記録_20261128.md §10） ----
   ラテン文字の語は、ほかの言語と同じ EB Garamond と Noto Sans で出し、その言語の文字は Noto の書体で出す（inc/i18n.php が言語ごとに読み込む） */
html[lang="he"] { --mincho: "EB Garamond", "Noto Serif Hebrew", serif; --ud-mincho: "EB Garamond", "Noto Serif Hebrew", serif; --ud-pmincho: "EB Garamond", "Noto Serif Hebrew", serif; --sans: "Noto Sans", "Noto Sans Hebrew", system-ui, sans-serif; }
html[lang="ar"] { --mincho: "EB Garamond", "Noto Naskh Arabic", serif; --ud-mincho: "EB Garamond", "Noto Naskh Arabic", serif; --ud-pmincho: "EB Garamond", "Noto Naskh Arabic", serif; --sans: "Noto Sans", "Noto Sans Arabic", system-ui, sans-serif; }
html[lang="hi"] { --mincho: "EB Garamond", "Noto Serif Devanagari", serif; --ud-mincho: "EB Garamond", "Noto Serif Devanagari", serif; --ud-pmincho: "EB Garamond", "Noto Serif Devanagari", serif; --sans: "Noto Sans", "Noto Sans Devanagari", system-ui, sans-serif; }
html[lang="bn"] { --mincho: "EB Garamond", "Noto Serif Bengali", serif; --ud-mincho: "EB Garamond", "Noto Serif Bengali", serif; --ud-pmincho: "EB Garamond", "Noto Serif Bengali", serif; --sans: "Noto Sans", "Noto Sans Bengali", system-ui, sans-serif; }
html[lang="pa"] { --mincho: "EB Garamond", "Noto Serif Gurmukhi", serif; --ud-mincho: "EB Garamond", "Noto Serif Gurmukhi", serif; --ud-pmincho: "EB Garamond", "Noto Serif Gurmukhi", serif; --sans: "Noto Sans", "Noto Sans Gurmukhi", system-ui, sans-serif; }
html[lang="ta"] { --mincho: "EB Garamond", "Noto Serif Tamil", serif; --ud-mincho: "EB Garamond", "Noto Serif Tamil", serif; --ud-pmincho: "EB Garamond", "Noto Serif Tamil", serif; --sans: "Noto Sans", "Noto Sans Tamil", system-ui, sans-serif; }
html[lang="te"] { --mincho: "EB Garamond", "Noto Serif Telugu", serif; --ud-mincho: "EB Garamond", "Noto Serif Telugu", serif; --ud-pmincho: "EB Garamond", "Noto Serif Telugu", serif; --sans: "Noto Sans", "Noto Sans Telugu", system-ui, sans-serif; }
html[lang="ml"] { --mincho: "EB Garamond", "Noto Serif Malayalam", serif; --ud-mincho: "EB Garamond", "Noto Serif Malayalam", serif; --ud-pmincho: "EB Garamond", "Noto Serif Malayalam", serif; --sans: "Noto Sans", "Noto Sans Malayalam", system-ui, sans-serif; }
html[lang="ko"] { --mincho: "EB Garamond", "Noto Serif KR", serif; --ud-mincho: "EB Garamond", "Noto Serif KR", serif; --ud-pmincho: "EB Garamond", "Noto Serif KR", serif; --sans: "Noto Sans", "Noto Sans KR", system-ui, sans-serif; }
/* アラビア文字とインドの文字は、字の間を空けると字のつながりが切れるので、字の間を 0 にする */
html:is([lang="ar"], [lang="hi"], [lang="bn"], [lang="pa"], [lang="ta"], [lang="te"], [lang="ml"]) body * { letter-spacing: 0 !important; }
/* 韓国語は語の区切りで改行する */
html[lang="ko"] :is(p, li, dd, h1, h2, h3, .lead-sp, .eps-card-title) { word-break: keep-all; overflow-wrap: break-word; }
/* 言語の一覧：21 項目が画面の高さを超えるときは、一覧の中で送る */
.lang-panel { max-height: calc(100vh - var(--bar-h) - 24px); max-height: calc(100dvh - var(--bar-h) - 24px); overflow-y: auto; overscroll-behavior: contain; }

/* ---- 右から左へ書く言語（ヘブライ語、アラビア語）。<html dir="rtl"> で文と flex の並びは反転する。左右を決め打ちした所だけを反転させる ---- */
html[dir="rtl"] .site-bar .nav { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .lang-panel { right: auto; left: 0; direction: ltr; }   /* 一覧の中は Figma のとおり左から並べる（名前は英語の表記） */
html[dir="rtl"] .lang-badge { direction: ltr; }
html[dir="rtl"] .legal-prose ul { padding-left: 0; padding-right: 1.4em; }
html[dir="rtl"] .sp-tier { text-align: right; }
html[dir="rtl"] .contact-hp { left: auto; right: -9999px; }
html[dir="rtl"] .ep-video-btn { left: auto; right: 32px; }
/* トップの右下の操作と説明の文：PC では左右を反転させない（2026-11-28 の社長の指摘「右から流れる言語についての表示がトップページおかしい」）。
   展示室の額は 3D で左に固定され、LIST の表示では額の下に名前と社名が出る。操作の欄を左へ移すと、そこに重なった（手元で撮って確かめた）。
   文だけを右から左にし、右寄せで並べる */
html[dir="rtl"] :is(.arrows, .toggle) { direction: ltr; }   /* 矢印は画面の左右の向きなので、並びを反転させない */
@media (min-width: 861px) {
  html[dir="rtl"] .ctrl { align-items: flex-start; }   /* 右から左のページでは、縦に並べた欄の始まりが右。英語と同じく右に寄せる */
}
@media (max-width: 860px) {
  html[dir="rtl"] .bar-tools { margin-left: 0; margin-right: auto; }
  html[dir="rtl"] .lang-panel { position: fixed; left: 16px; top: calc(var(--bar-h) + 12px); }   /* 言語の記号が画面の左寄りにあり、記号の左端から開くと右へはみ出すため、画面の左端から 16px に置く */
  html[dir="rtl"] .ep-video-btn { left: auto; right: 12px; }
  html[dir="rtl"] .hint { text-align: right; }
  html[dir="rtl"] .arrows { justify-content: flex-end; }   /* スマートフォンは格子が左右反転し、矢印の欄は右側。矢印を右端に寄せる */
}

/* ---- トップの説明の文と右下の操作（日本語以外。2026-11-28、21 言語） ----
   訳の文は日本語より長く、操作の案内の文が折り返して、見出しと重なった（手元で 21 言語を測った。日本語は重ならない）。
   PC：操作の欄の幅を日本語の設計（214px）に近い 240px までにし、案内の文を欄の中で折り返す。
   スマートフォン：案内の文と一覧へのリンクは、日本語と同じく同じ行に並べ、文の下端をリンクにそろえる（2026-11-28 の社長の指示。案内の文の位置を赤字で示した画像）。
   見出しの下端は front.js が操作の欄の高さから決める */
@media (max-width: 860px) {
  /* 一覧へのリンクの文が長い言語（タミル語など）で、案内の文の列が細くなり、切り替えがリンクの幅まで伸びたため（手元で 21 言語を撮って確かめた）、
     リンクの幅を 11.5 字分までにして折り返し、切り替えは元の幅のまま端に寄せる */
  html:not([lang="ja"]) .ctrl { grid-template-columns: minmax(0, 1fr) auto; }
  html:not([lang="ja"]) .ctrl .to-list { max-width: 11.5em; text-align: end; justify-self: end; }
  html:not([lang="ja"]) .ctrl .toggle { justify-self: end; }
}
@media (min-width: 861px) {
  html:not([lang="ja"]) .ctrl { max-width: 240px; }
  html:not([lang="ja"]) .ctrl .to-list { text-align: right; }
}
