/* 検索カード(レーダー重ね)の試作スタイル。独立した試作用で、サイトのCSSには依存しない。
 * 調整用の変数(index.html のスライダーが書き換える):
 *   --fill-op   レーダー内部の塗りの不透明度(初期 0.25)
 *   --grid-op   目盛り枠・放射線の濃さ(初期 0.30。薄く)
 *   --back-op   C案の背景の白さ(初期 0.45)
 */
.rc-wrap { --fill-op: .25; --grid-op: .30; --back-op: .45; font-family: "メイリオ", Meiryo, "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", sans-serif; color: #222; }

/* ---- グリッド: 列数は .cols4(PC) / .cols2(スマホ) ---- */
.rc-grid { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rc-grid.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); --name-lines: 2; --name-size: 13px; }
.rc-grid.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; --name-lines: 3; --name-size: 12px; }

/* ---- カード ---- */
.rc-item { display: flex; min-width: 0; }
.rc-item > div { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.rc-item .rc-card { flex: 1; }
.rc-card { display: flex; flex-direction: column; width: 100%; min-width: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; color: inherit; text-decoration: none; }
.rc-card:hover, .rc-card:focus-visible { border-color: #5B67E8; box-shadow: 0 0 0 2px rgba(91, 103, 232, .25); }
.rc-card:focus-visible { outline: 2px solid #5B67E8; outline-offset: 1px; }

/* 画像枠は 4:3 固定。画像は加工せず、枠の中にそのまま収める(切り抜かない) */
.rc-imgbox { position: relative; aspect-ratio: 4 / 3; background: #f0f0f0; }
/* 画像は枠に絶対配置で収める(縦長の画像でも枠が4:3より縦に伸びない。2026-11-05 修正: 以前は縦長画像(takomusume18.jpg)で枠が伸びていた) */
.rc-imgbox img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.rc-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #888; font-size: 12px; background: repeating-linear-gradient(45deg, #f4f4f4 0 8px, #ececec 8px 16px); }

.rc-body { display: flex; flex-direction: column; flex: 1; padding: 8px 8px 9px; }
/* 商品名: 行数を固定して切り詰め、行数ぶんの高さを常に確保する(価格の位置を揃える) */
.rc-name { font-size: var(--name-size, 13px); line-height: 1.4; font-weight: bold; margin: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--name-lines, 2); line-clamp: var(--name-lines, 2);
  overflow: hidden; overflow-wrap: anywhere; min-height: calc(var(--name-lines, 2) * 1.4em); }
/* 価格は常にカードの下端側へ */
.rc-price { margin: auto 0 0; padding-top: 6px; font-size: 14px; font-weight: bold; color: #b3261e; }
.rc-price.rc-none { color: #888; font-weight: normal; font-size: 12px; }
.cols2 .rc-price { font-size: 13px; }

/* ---- レーダー: 画像枠の右上。クリックはカードに通す ---- */
.rc-radar { position: absolute; top: 6px; right: 6px; width: var(--rsize, 36%); min-width: 44px; aspect-ratio: 1; pointer-events: none; }
.rc-radar-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rc-radar-svg polygon, .rc-radar-svg line { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
/* 目盛り枠と放射線: 薄く */
.rc-r-grid { stroke: #333; stroke-opacity: var(--grid-op); fill: none; stroke-width: 1px; }
.rc-r-ring-mid { stroke-dasharray: 2 2; }
/* データの多角形 */
.rc-r-fill { fill: #8892f2; fill-opacity: var(--fill-op); stroke: none; }
.rc-r-line { fill: none; stroke: #5B67E8; stroke-width: var(--line-w, 2px); }
.rc-r-halo { fill: none; stroke: none; }
.rc-r-back { fill: none; }

/* ---- 案A: 小さめ(画像枠の幅の28%)、輪郭 1.5px ---- */
.rc-wrap[data-variant="a"] { --rsize: 28%; --line-w: 1.5px; }
/* ---- 案B: 標準(36%)、輪郭 2px ---- */
.rc-wrap[data-variant="b"] { --rsize: 36%; --line-w: 2px; }
/* ---- 案C: Bの大きさ + 輪郭の白い縁取り + 背景の薄い白い円 + 輪郭を少し太く ---- */
.rc-wrap[data-variant="c"] { --rsize: 36%; --line-w: 2.2px; }
.rc-wrap[data-variant="c"] .rc-r-back { fill: #fff; fill-opacity: var(--back-op); }
.rc-wrap[data-variant="c"] .rc-r-halo { stroke: #fff; stroke-opacity: .95; stroke-width: calc(var(--line-w) + 2.4px); }
.rc-wrap[data-variant="c"] .rc-r-grid { stroke: #222; }
/* ---- 並べ替え時だけ出す中央の数値(2026-11-05 改訂)。通常時は要素自体を出さない ----
 * 数値はレーダーの多角形とは独立した前面レイヤー(HTML要素)で、レーダー枠の中心に固定する。
 * 評価図形の形(細長い・点・針状 など)で位置が変わらない。評価は数値のみ(項目名・「点」なし)、投稿数は「51件」。
 * 色は並べ替えボタンと同じ識別色(--sc)。白い縁取りで、暗い画像や図形の上でも読めるようにする。 */
.rc-radar { container-type: inline-size; }
.rc-score { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: baseline; justify-content: center;
  white-space: nowrap; line-height: 1; font-weight: 800; color: var(--sc, #222); pointer-events: none; font-variant-numeric: tabular-nums;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff, 0 -2px 0 #fff, 0 2px 0 #fff, -2px 0 0 #fff, 2px 0 0 #fff, 0 0 5px #fff; }
.rc-score .n { font-size: 18px; font-size: 46cqw; }
.rc-score .u { font-size: 11px; font-size: 20cqw; margin-left: .06em; }
.rc-score.is-posts .n { font-size: 17px; font-size: 31cqw; }
.rc-wrap.no-outline .rc-score { text-shadow: none; }
/* レーダーがなく、投稿数順のときだけ: 図形なしで件数だけを同じ位置に出す(要確認の仮案) */
.rc-radar.rc-nofig::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(255, 255, 255, .6); border: 1px dashed rgba(0, 0, 0, .35); }
/* 並べ替えに使った軸の強調(任意。既定はオフ)。色は識別色 */
.rc-r-hlspoke { stroke: var(--sc, #5B67E8); stroke-width: 2px; stroke-opacity: .95; fill: none; }
.rc-r-hldot { fill: #fff; stroke: var(--sc, #5B67E8); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.rc-wrap.no-hl .rc-r-hlspoke, .rc-wrap.no-hl .rc-r-hldot { display: none; }

/* ---- 並べ替えボタン(識別色と、選択状態のしるし)----
 * 選択中は「色の塗りつぶし + 白い太字 + ✓ + 二重の枠」で示し、色が見分けにくい人でも状態が分かる。aria-pressed と読み上げ用の「選択中」も付ける。 */
.rc-sortbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.rc-sortbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px; border: 2px solid var(--sc, #555); border-radius: 8px;
  background: #fff; color: #222; font: inherit; font-size: 13px; cursor: pointer; }
.rc-sortbtn .chip { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--sc, #555); }
.rc-sortbtn .ck { display: none; font-weight: bold; }
.rc-sortbtn[aria-pressed="true"] { background: var(--sc, #555); color: #fff; font-weight: bold; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sc, #555); }
.rc-sortbtn[aria-pressed="true"] .chip { background: #fff; }
.rc-sortbtn[aria-pressed="true"] .ck { display: inline; }
.rc-sortbtn:focus-visible { outline: 3px solid #222; outline-offset: 2px; }
.rc-sortbar .rc-sortnote { flex-basis: 100%; font-size: 11px; color: #777; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
/* ---- 案D: 白い四角いパネル(不透明100%)に、五角形をできるだけ大きく置く(2026-11-05 追加)----
 * 円形の背景・影・太い枠は使わない(1pxの細い枠だけ。白い画像でもパネルの縁が分かるように。切り替え可)。大きさはB・C案と同じ(画像枠の幅の36%)。
 * 五角形の拡大率(外接領域の幅/パネル幅の目安 90・94・97%)と、線が切れない上限は radar.js の buildPanelSvg を参照。 */
.rc-wrap[data-variant="d"] { --rsize: 36%; --line-w: 2px; }
/* 白い四角の「背景だけ」を半透明にできる(--panel-alpha: 0.80/0.85/0.90/1.00)。opacity は使わない(使うと図形・数値まで薄くなるため)。
 * 図形(SVG)・中央の数値・縁取り・目盛りは、背景の透明度とは無関係に、従来どおりの濃さで前面に描く。 */
.rc-wrap[data-variant="d"] .rc-radar { background: rgba(255, 255, 255, var(--panel-alpha, 1)); border-radius: 2px; outline: 1px solid rgba(0, 0, 0, .14); }
.rc-wrap[data-variant="d"].no-panel-line .rc-radar { outline: none; }
.rc-wrap[data-variant="d"] .rc-r-grid { stroke: #222; }
/* 投稿数順で図形がないときも、円ではなく白い四角に件数だけを出す */
.rc-wrap[data-variant="d"] .rc-radar.rc-nofig::before { display: none; }
/* ---- ユーザー投稿数順の専用パネル(D案のみ。レーダーは描かない。2026-11-05 追加)----
 * 位置・幅はレーダーのパネルと同じ(画像枠の右上・幅36%の正方形)。背景は配色案の色で不透明100%
 * (五角形がなく、数字の読みやすさを優先するため、レーダー用の白背景80%(--panel-alpha)は適用しない)。
 * 文字色は並べ替えボタン(ユーザー投稿数順)の選択中の色と共通。件数は「51件」、0件は「―」、不明のカードにはパネルを出さない。
 * パターン1(data-pat=1): 件数だけ大きく / パターン2(data-pat=2): 件数+小さく「ユーザー投稿」(2行に分けて、幅の狭いスマホでも詰め込まない)。
 * 文字の大きさはパネル幅(cqw)に比例し、桁数(data-digits)が増えるほど少し小さくして、3桁でも欠けない。 */
.rc-wrap[data-variant="d"] .rc-radar.rc-postpanel { background: var(--pp-bg, #FFF4DA); color: var(--pp-fg, #75400B); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }       /* 要素の間隔はgapではなく、子の margin-top(cqw)で取る。自身のgapの cqw は親の枠で解決されるため */
.rc-postpanel .rc-score { position: static; transform: none; text-shadow: none; color: var(--pp-fg, #75400B); }
.rc-postpanel .rc-score .n { font-size: 24px; font-size: 44cqw; }
.rc-postpanel .rc-score .u { font-size: 13px; font-size: 24cqw; margin-left: .04em; }
.rc-postpanel[data-digits="3"] .rc-score .n { font-size: 18px; font-size: 32cqw; }
.rc-postpanel[data-digits="3"] .rc-score .u { font-size: 11px; font-size: 19cqw; }
.rc-postpanel[data-pat="2"] .rc-score .n { font-size: 19px; font-size: 33cqw; }
.rc-postpanel[data-pat="2"] .rc-score .u { font-size: 11px; font-size: 19cqw; }
.rc-postpanel[data-pat="2"][data-digits="3"] .rc-score .n { font-size: 17px; font-size: 29cqw; }
.rc-postpanel[data-pat="2"][data-digits="3"] .rc-score .u { font-size: 10px; font-size: 17cqw; }
.rc-postpanel .pp-label { display: flex; flex-direction: column; align-items: center; font-weight: 700; line-height: 1.15; white-space: nowrap; margin-top: 3px; margin-top: 4cqw; color: var(--pp-fg, #75400B); font-size: 10px; font-size: clamp(10px, 17cqw, 14px); }
/* レーダーを隠す(画像だけを見る) */
.rc-wrap.no-radar .rc-radar { display: none; }
