/* いまの日本を数字で見る(/philosophy/numbers/ のページ・2026-10-29 に理念ページのアコーディオンから移した)。2026-10-15 本人が UI案10個から「G タイル」を選んだ＝
   小さな絵と問いのタイルを並べる(スマホ2列・PC幅3列)。タイルを押すと、その行のすぐ下に答え(大きな数字・棒グラフ・要点・説明・出典)が広がる。
   答えの場所を行の下へ動かすのは assets/issues.js。JSが止まっている時は、各タイルの「答えを見る」(<details>)でその場に開く。
   .iq の中だけで効く(ほかのページの部品と名前がぶつからないように)。カードの中身の正本は philosophy/numbers/index.html */
.iq { container-type: inline-size; --iq-tint: #e4f4fb; word-break: auto-phrase; overflow-wrap: anywhere; }
.iq p { margin: 0; }
.iq img { display: block; max-width: 100%; height: auto; }
.iq strong { font-weight: 900; }
.iq .nm { font-weight: 700; color: var(--heading); line-height: 1.15; font-size: 1.05rem; }
.iq .pt-main { font-weight: 700; color: var(--heading); }
.iq .pt-sub, .iq .nt { color: var(--text-sub); }
.iq .nt { font-size: 0.95rem; line-height: 1.8; }
.iq .sc { font-size: 0.76rem; line-height: 1.85; color: var(--text-sub); padding-top: 0.5rem; border-top: 1px dashed var(--line); }
.iq .sc a { color: var(--blue-text); }

/* タイル：絵(4:3)＋問い。押せることが分かるように、乗せると浮く・選ぶと青い枠 */
.iq .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.iq .rows > .c { display: flex; flex-direction: column; min-width: 0; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 3px 12px rgba(38, 52, 61, 0.1); }
.iq .pic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.iq .tx { display: flex; flex-direction: column; gap: 0.7rem; flex: 1; min-width: 0; padding: 0.7rem 0.75rem 0.85rem; }
/* 問いは <wbr> の所(言葉の切れ目)だけで折る */
.iq .q { word-break: keep-all; font-size: 0.86rem; font-weight: 700; color: var(--heading); line-height: 1.6; }

/* 答え(開いた時)：A＋大きな数字、棒グラフ、要点、説明、出典 */
.iq .ab { display: flex; flex-direction: column; gap: 0.6rem; }
.iq .ab > .nm { position: relative; padding-left: 2.5rem; }
.iq .ab > .nm::before { content: "A"; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--blue-text); color: #fff; font-size: 1rem; font-weight: 900; display: grid; place-items: center; line-height: 1; }
.iq .ab > .nm strong { color: var(--blue-text); font-size: 2.8rem; }

/* 棒グラフ：答えを開いた時にのびる(CSSだけ・動きを減らす設定では動かさない) */
.iq .chart { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 0.85rem; border-radius: 12px; background: #fff; }
.iq .br { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.6rem; font-size: 0.85rem; line-height: 1.5; }
.iq .br .k { color: var(--text-sub); }
.iq .br .s { font-weight: 700; color: var(--heading); }
.iq .trk { grid-column: 1 / -1; height: 12px; border-radius: 6px; background: #dde9ee; overflow: hidden; margin-top: 0.15rem; }
.iq .fill { display: block; height: 100%; width: var(--bw); border-radius: 6px; background: #9fc3d3; }
.iq .br:last-child .fill { background: var(--blue-text); }
@keyframes iq-grow { from { width: 0; } }
.iq .ans[open] .fill, .iq .panel .fill { animation: iq-grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.iq .ans[open] .br:nth-child(2) .fill, .iq .panel .br:nth-child(2) .fill { animation-delay: 0.15s; }
.iq .ans[open] .br:nth-child(3) .fill, .iq .panel .br:nth-child(3) .fill { animation-delay: 0.3s; }

/* JSが止まっている時だけ：タイルの中の「答えを見る」で、その場に開く */
.iq .ans > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.9rem; border-radius: 999px; border: 2px solid var(--blue-text); background: #fff; color: var(--blue-text); font-size: 0.85rem; font-weight: 700; }
.iq .ans > summary::-webkit-details-marker { display: none; }
.iq .ans[open] .ab { margin-top: 0.7rem; }

/* JSが動いている時(.is-js)：タイル全体が押せるボタン。答えは行の下の .panel に出す */
.iq.is-js .ans { display: none; }
.iq.is-js .rows > .c { cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.iq.is-js .rows > .c:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(38, 52, 61, 0.14); }
.iq.is-js .rows > .c:focus-visible { outline: 3px solid var(--blue-text); outline-offset: 3px; }
.iq.is-js .rows > .c.is-on { box-shadow: 0 0 0 3px var(--blue-text), 0 8px 20px rgba(38, 52, 61, 0.14); }
.iq.is-js .tx::after { content: "答えを見る"; margin-top: auto; align-self: flex-start; font-size: 0.8rem; font-weight: 700; color: var(--blue-text); }
.iq.is-js .rows > .c.is-on .tx::after { content: "答えを閉じる"; }
.iq .panel { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.7rem; padding: 1.1rem 1.1rem 1.2rem; border-radius: 16px; background: var(--iq-tint); text-align: left; }
.iq .panel > .q { font-size: 0.95rem; }
.iq .panel-close { align-self: flex-end; margin-top: 0.2rem; padding: 0.35rem 1rem; border: 2px solid var(--blue-text); border-radius: 999px; background: #fff; color: var(--blue-text); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }

/* とても狭い時(320px の画面など)は問いを少し小さく＝言葉の途中で折れないように */
@container (max-width: 300px) { .iq .q { font-size: 0.8rem; } .iq .tx { padding: 0.6rem; } }

/* PC幅(枠が700px以上)：3列・タイルの文字を少し大きく・答えは左に大きな数字、右に棒グラフ */
@container (min-width: 700px) {
  .iq .rows { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .iq .tx { padding: 0.9rem 1rem 1rem; }
  .iq .q { font-size: 0.98rem; }
  .iq .panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 1.8rem; row-gap: 0.7rem; padding: 1.5rem 1.7rem; }
  .iq .panel > .q, .iq .panel > .panel-close { grid-column: 1 / -1; }
  .iq .panel > .panel-close { justify-self: end; }
  .iq .panel .ab { display: contents; }
  .iq .panel .ab > .nm { grid-column: 1; align-self: center; }
  .iq .panel .ab > .chart { grid-column: 2; grid-row: span 2; }
  .iq .panel .ab > .pt { grid-column: 1; }
  .iq .panel .ab > .nt, .iq .panel .ab > .sc { grid-column: 1 / -1; }
  .iq .panel .ab > .nm strong { font-size: 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .iq .fill { animation: none !important; }
  .iq.is-js .rows > .c { transition: none; }
}
