/* 糸巻量計算ツール。
   コンテナ・見出し・入力欄・fieldset・表・カードは common/components.css の .th-* を使い、
   ここに残すのは入力欄の並べ方と、リール検索の結果表示。クラスは lc- 接頭辞。 */

/* --- ページ内目次 --- */
.lc-toc {
  margin-bottom: 24px;
}

/* 目次から飛んだ節が固定ヘッダの下に隠れないようにする */
.lc-section[id] {
  scroll-margin-top: 80px;
}

.lc-lead {
  margin-bottom: 16px;
}

/* --- 入力欄の並び --- */
.lc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.lc-field {
  width: 130px;
}

/* 材質・単位の選択は選択肢の文字が長い */
.lc-field-select {
  width: 180px;
}

/* 入力値は数値なので等幅で。linecapacity.js が type を text に変えるので
   input[type="number"] の指定では効かない */
.lc-field input,
.lc-table input {
  font-family: var(--th-font-num);
}

.lc-field input::-webkit-outer-spin-button,
.lc-field input::-webkit-inner-spin-button,
.lc-table input::-webkit-outer-spin-button,
.lc-table input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lc-field input[type="number"],
.lc-table input[type="number"] {
  -moz-appearance: textfield;
}

/* --- リール検索: 検索ボタンと、選んだリールの表示 --- */
.lc-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.lc-selected-reel {
  margin: 0;
  font-size: 13px;
}

/* 以下の 4 つは reel_lookup.js が生成する要素。クラス名は JS 側に合わせる */
.linecapacity-selected-reel-name {
  display: block;
  font-weight: 700;
  color: var(--th-color-heading);
}

.linecapacity-selected-reel-capacity {
  display: block;
  font-size: 12px;
  color: var(--th-color-text-muted);
}

.linecapacity-selected-reel-capacity-label {
  font-weight: 700;
}

.linecapacity-reel-lookup-note {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--th-color-text-muted);
}

/* --- 結果 --- */
.lc-table {
  max-width: 420px;
}

.lc-table input {
  width: 100%;
}

.lc-result {
  display: inline-block;
  min-width: 60px;
  font-family: var(--th-font-num);
  font-weight: 700;
  color: var(--th-color-heading);
}

/* 下糸の長さ: 数値カード。結果は 1 つなので幅は中身に合わせる */
.lc-result-card {
  width: fit-content;
  min-width: 220px;
  margin-top: 8px;
}

/* 計算前は空なので、欄があることが分かるようダッシュを置く */
.lc-result:empty::before,
.lc-result-card .th-card-stat-value span:empty::before {
  content: "—";
  color: var(--th-gray-400);
}

.lc-error {
  margin-top: 12px;
}

@media screen and (max-width: 768px) {
  /* 入力欄を画面幅いっぱいに伸ばさず、ラベル左・入力欄右の1行にする */
  .lc-field,
  .lc-field-select {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  /* ラベルの幅を揃えて、行をまたいで入力欄の頭を合わせる */
  .lc-field > label {
    flex: none;
    width: 8em;
    margin-bottom: 0;
  }

  .lc-field input,
  .lc-field select {
    flex: 1;
    min-width: 0;
    max-width: 220px;
  }

  /* 表の中の入力欄はセル幅に合わせる */
  .lc-table input {
    max-width: none;
  }
}
