/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.

/* ========== Legacy (Bootstrap era) ========== */
/* TODO: Tailwind化後に削除予定 */
.top-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f5fbff 60%, #e3f2fd 100%);
}

.top-hero .text-primary {
  color: #0d6efd !important; /* Bootstrapのprimaryブルー */
}

.top-hero-card {
  border-radius: 0.75rem;
}

/* モバイルで少し余白ゆったりめに */
@media (max-width: 767.98px) {
  .top-hero {
    padding-top: 1.5rem;
  }
}

.detail-heading {
  display: inline-block;
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  margin: 0.5rem 0;
  border-left: 4px solid #6c757d;
  background-color: #f8f9fa;
}

/* ========== DetailUX: 注意情報の視認性向上 (#185) ========== */
/* 注意点・禁忌 全体の枠（カード風） */
.kampo-detail-box {
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  background: #fff;
}

/* 本文の読みやすさ */
.kampo-detail {
  line-height: 1.7;
  word-break: break-word; /* 長い単語やURL対策 */
}

/* 段落の余白を適度に */
.kampo-detail p {
  margin: 0 0 0.75rem 0;
}

/* 箇条書きっぽい行（・）を読みやすく */
.kampo-detail p:has(.detail-heading) {
  margin-top: 0.25rem;
}

/* 見出し（#182で付けたspan）をさらに見出しっぽく */
.detail-heading {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #ced4da;
  background: #f8f9fa;
  margin: 0.25rem 0;
}

/* 見出しの直後の本文が詰まらないように */
.detail-heading + br {
  display: block;
  margin-bottom: 0.25rem;
}

/* 未登録表示（特記事項無し）を“薄く” */
.is-default-text {
  font-style: italic;
}

/* Stepper (image-like) */
.stepper {
  --accent: #ff7a00;      /* オレンジ */
  --muted: #cfd6dd;       /* グレー */
  --bg: #ffffff;
  --dot: 10px;
  --stroke: 2px;
  margin: 0;
}

.stepper__list {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 0;
  padding: 0;
  margin: 0;
  position: relative;
}

/* つなぐ線（全体のグレー） */
.stepper__list::before {
  content: "";
  position: absolute;
  left: calc(var(--dot) / 2);
  right: calc(var(--dot) / 2);
  top: calc(var(--dot) / 2);
  height: var(--stroke);
  background: var(--muted);
}

/* “完了分だけ”オレンジの線を重ねる */
.stepper__list::after {
  content: "";
  position: absolute;
  left: calc(var(--dot) / 2);
  top: calc(var(--dot) / 2);
  height: var(--stroke);
  background: var(--accent);
  width: var(--progress, 0%);
}

.stepper__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding-top: 0;
  z-index: 1; /* 線の上に出す */
}

.stepper__dot {
  width: var(--dot);
  height: var(--dot);
  border-radius: 999px;
  background: var(--bg);
  border: var(--stroke) solid var(--muted);
  box-sizing: border-box;
}

.stepper__label {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
  user-select: none;
}

/* 完了：塗りつぶし */
.stepper__item.is-complete .stepper__dot {
  background: var(--accent);
  border-color: var(--accent);
}
.stepper__item.is-complete .stepper__label {
  color: var(--accent);
  font-weight: 600;
}

/* 現在：枠だけオレンジ */
.stepper__item.is-current .stepper__dot {
  border-color: var(--accent);
  background: var(--bg);
}
.stepper__item.is-current .stepper__label {
  color: var(--accent);
  font-weight: 700;
}

/* これから：グレーのまま（デフォルト） */
.stepper__item.is-upcoming .stepper__dot { }
.stepper__item.is-upcoming .stepper__label { }

/* スマホで詰まるとき */
@media (max-width: 480px) {
  .stepper__item { min-width: 40px; }
  .stepper__label { font-size: 11px; }
}

.stepper__item.is-current .stepper__dot {
  border-color: var(--accent);
  background: #fff;
  transform: scale(1.3);
}

.stepper__item.is-current .stepper__label {
  color: var(--accent);
  font-weight: 800;
}

/* PR③: ResultLayout（横スクロール防止・文字サイズ調整） */
.result-layout {
  max-width: 100%;
  overflow-x: hidden; /* 横スクロールの根本を遮断 */
}

/* 子要素が原因で横にはみ出るのを防ぐ */
.result-layout * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* スマホで読みやすい文字サイズを“下地”として統一 */
.result-layout {
  font-size: 14px;   /* text-sm 相当 */
  line-height: 1.7;  /* leading-relaxed 相当 */
}

@media (min-width: 640px) {
  .result-layout {
    font-size: 16px; /* text-base 相当 */
  }
}
