/* ホームワインアカデミー J.S.A.ソムリエ・ワインエキスパート 無料一問一答ドリル（1,000問DB）
 * ブランド規約準拠: #FFFCF3 / #FDFAF2 / #F4F0E6 / #A58847 / #600F18 / #1B1B1B
 */
.hwd-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 0 40px;
  color: #333333;
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
}

.hwd-hero {
  background: #FDFAF2;
  border: 1px solid #DFD6C3;
  border-top: 4px solid #A58847;
  border-radius: 6px;
  padding: 22px 24px 20px;
  margin-bottom: 20px;
}

.hwd-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #600F18;
  background: #EFEADB;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.hwd-title {
  font-size: clamp(19px, 3.1vw, 26px);
  font-weight: 700;
  line-height: 1.45;
  color: #1B1B1B;
  margin: 0 0 10px;
  word-break: auto-phrase;
}

.hwd-lead {
  font-size: 14.5px;
  line-height: 1.75;
  color: #333333;
  margin: 0 0 14px;
}

.hwd-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: #5A5245;
  border-top: 1px solid #E6DEC8;
  padding-top: 10px;
}

/* 学習ステータスバー */
.hwd-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.hwd-stat-card {
  background: #FFFFFF;
  border: 1px solid #DFD6C3;
  border-radius: 6px;
  padding: 11px 12px;
  text-align: center;
}

.hwd-stat-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #7A6A58;
  margin-bottom: 3px;
}

.hwd-stat-val {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #1B1B1B;
  line-height: 1.25;
}

.hwd-stat-val.-accent {
  color: #600F18;
}

/* モード切替バー */
.hwd-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hwd-mode-btn {
  appearance: none;
  border: 1px solid #CBBBA0;
  background: #FFFFFF;
  color: #1B1B1B;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hwd-mode-btn:hover {
  border-color: #A58847;
  background: #FDFAF2;
}

.hwd-mode-btn.is-active {
  background: #1B1B1B;
  border-color: #1B1B1B;
  color: #FFFCF3;
}

.hwd-mode-btn.-bordeaux {
  background: #600F18;
  border-color: #600F18;
  color: #FFFCF3;
}

.hwd-mode-btn.-bordeaux:hover {
  background: #7A1420;
}

/* 10問セット切替タブ */
.hwd-set-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.hwd-set-tab {
  appearance: none;
  border: 1px solid #DFD6C3;
  background: #F4F0E6;
  color: #333333;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.hwd-set-tab.is-active {
  background: #A58847;
  border-color: #A58847;
  color: #FFFFFF;
}

.hwd-set-tab.is-done {
  border-color: #1E6B43;
}

/* 問題演習メインカード */
.hwd-stage {
  background: #FFFFFF;
  border: 2px solid #A58847;
  border-radius: 8px;
  padding: 22px 24px 24px;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(27, 27, 27, 0.05);
}

.hwd-q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hwd-q-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hwd-chap-tag {
  font-size: 12px;
  font-weight: 700;
  background: #EFEADB;
  color: #5A4827;
  padding: 3px 9px;
  border-radius: 3px;
}

.hwd-q-counter {
  font-size: 13.5px;
  font-weight: 700;
  color: #1B1B1B;
}

.hwd-weak-toggle {
  appearance: none;
  border: 1px solid #D5C8B0;
  background: #FDFAF2;
  color: #5A4827;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
}

.hwd-weak-toggle.is-saved {
  background: #600F18;
  border-color: #600F18;
  color: #FFFCF3;
}

.hwd-progress-track {
  width: 100%;
  height: 6px;
  background: #EFEADB;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}

.hwd-progress-fill {
  height: 100%;
  background: #A58847;
  width: 0%;
  transition: width 0.25s ease;
}

.hwd-q-text {
  font-size: clamp(16.5px, 2.4vw, 19px);
  font-weight: 700;
  line-height: 1.65;
  color: #1B1B1B;
  margin: 0 0 18px;
  word-break: auto-phrase;
}

.hwd-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hwd-choice-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  background: #FFFCF3;
  border: 1.5px solid #D5C8B0;
  border-radius: 6px;
  color: #1B1B1B;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.hwd-choice-btn:hover:not(:disabled) {
  border-color: #A58847;
  background: #F7F2E4;
}

.hwd-choice-btn:disabled {
  cursor: default;
}

.hwd-choice-num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #A58847;
  background: #FFFFFF;
  color: #7A6332;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.hwd-choice-label {
  flex: 1;
}

.hwd-choice-btn.is-correct {
  background: #EBF6F0;
  border-color: #1E6B43;
  color: #12472B;
}

.hwd-choice-btn.is-correct .hwd-choice-num {
  background: #1E6B43;
  border-color: #1E6B43;
  color: #FFFFFF;
}

.hwd-choice-btn.is-wrong {
  background: #FDF0F0;
  border-color: #851515;
  color: #600F18;
}

.hwd-choice-btn.is-wrong .hwd-choice-num {
  background: #851515;
  border-color: #851515;
  color: #FFFFFF;
}

.hwd-choice-btn.is-dimmed {
  opacity: 0.62;
}

/* 解答・解説ボックス */
.hwd-feedback {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 6px;
  background: #FDFAF2;
  border: 1px solid #DFD6C3;
  border-left: 4px solid #A58847;
}

.hwd-feedback.is-ok {
  border-left-color: #1E6B43;
  background: #F4FAF6;
}

.hwd-feedback.is-ng {
  border-left-color: #851515;
  background: #FDF7F7;
}

.hwd-fb-head {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1B1B1B;
}

.hwd-feedback.is-ok .hwd-fb-head {
  color: #1E6B43;
}

.hwd-feedback.is-ng .hwd-fb-head {
  color: #851515;
}

.hwd-fb-exp {
  font-size: 14.5px;
  line-height: 1.75;
  color: #333333;
  margin: 0 0 16px;
}

.hwd-next-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.hwd-next-btn {
  appearance: none;
  width: 100%;
  background: #600F18;
  color: #FFFCF3;
  border: none;
  border-radius: 6px;
  padding: 14px 20px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}

.hwd-next-btn:hover {
  background: #7B1622;
}

.hwd-key-hint {
  font-size: 11.5px;
  color: #7A6A58;
  margin-top: 6px;
  text-align: right;
}

/* セット完了サマリー画面 */
.hwd-result-box {
  text-align: center;
  padding: 12px 6px 4px;
}

.hwd-result-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #A58847;
  margin: 0 0 6px;
}

.hwd-result-score {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  color: #1B1B1B;
  margin: 0 0 8px;
}

.hwd-result-msg {
  font-size: 14.5px;
  color: #333333;
  line-height: 1.7;
  margin: 0 0 18px;
}

.hwd-result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.hwd-res-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 16px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid #1B1B1B;
  background: #FFFFFF;
  color: #1B1B1B;
}

.hwd-res-btn.-primary {
  background: #600F18;
  border-color: #600F18;
  color: #FFFCF3;
}

.hwd-res-btn.-gold {
  background: #A58847;
  border-color: #A58847;
  color: #FFFFFF;
}

/* 全20章グリッド（ハブ＆下部回遊用） */
.hwd-section-ttl {
  font-size: 20px;
  font-weight: 700;
  color: #1B1B1B;
  border-left: 4px solid #A58847;
  padding: 4px 0 4px 12px;
  margin: 34px 0 14px;
}

.hwd-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.hwd-chapter-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #DFD6C3;
  border-radius: 6px;
  padding: 15px 16px;
  text-decoration: none;
  color: #1B1B1B;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hwd-chapter-card:hover {
  border-color: #A58847;
  box-shadow: 0 3px 10px rgba(165, 136, 71, 0.14);
}

.hwd-chapter-card.is-current {
  border: 2px solid #600F18;
  background: #FDFAF2;
}

.hwd-chap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #7A6332;
  margin-bottom: 6px;
}

.hwd-chap-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: #1B1B1B;
  margin: 0 0 10px;
}

.hwd-chap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #5A5245;
  margin-top: 4px;
}

.hwd-mini-bar {
  width: 100%;
  height: 5px;
  background: #EFEADB;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.hwd-mini-bar > span {
  display: block;
  height: 100%;
  background: #A58847;
  width: 0%;
}

/* 静的SEO一覧アコーディオン */
.hwd-static-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 32px;
}

.hwd-static-item {
  background: #FFFFFF;
  border: 1px solid #E2D9C5;
  border-radius: 6px;
  overflow: hidden;
}

.hwd-static-item summary {
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.6;
  color: #1B1B1B;
  cursor: pointer;
  list-style: none;
  background: #FFFCF3;
}

.hwd-static-item summary::-webkit-details-marker {
  display: none;
}

.hwd-static-choices {
  margin: 6px 0 0;
  padding-left: 0;
  list-style: none;
  font-weight: 500;
  font-size: 13.5px;
  color: #4A443B;
}

.hwd-static-body {
  padding: 14px 16px;
  border-top: 1px solid #EFEADB;
  background: #FDFAF2;
  font-size: 14px;
  line-height: 1.75;
}

.hwd-static-ans {
  font-weight: 700;
  color: #600F18;
  margin: 0 0 6px;
}

/* 前後章ページャー */
.hwd-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 26px 0;
}

.hwd-pager-link {
  display: block;
  padding: 13px 16px;
  background: #FDFAF2;
  border: 1px solid #DFD6C3;
  border-radius: 6px;
  text-decoration: none;
  color: #1B1B1B;
  font-size: 13.5px;
  font-weight: 700;
}

.hwd-pager-link:hover {
  border-color: #A58847;
}

.hwd-pager-sub {
  display: block;
  font-size: 11px;
  color: #7A6332;
  margin-bottom: 3px;
}

@media (max-width: 640px) {
  .hwd-hero {
    padding: 16px 16px 14px;
  }
  .hwd-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .hwd-stage {
    padding: 16px 15px 18px;
  }
  .hwd-choice-btn {
    padding: 12px 13px;
    font-size: 15px;
  }
  .hwd-pager {
    grid-template-columns: 1fr;
  }
  .hwd-key-hint {
    display: none;
  }
}
