/* WeMeet 疾患一覧
 * 配色は /lp/ の変数に合わせる（--primary #ec9657 / --third #fdefe7）。
 * テーマ側に変数が無い場合のフォールバック値を併記している。
 */

.wmda {
  --wmda-primary: var(--primary, #ec9657);
  --wmda-deep: #e76f00;
  --wmda-third: var(--third, #fdefe7);
  --wmda-forth: var(--forth, #ffe1d1);
  --wmda-ink: #2f1e11;
  --wmda-muted: #7d6e62;
  --wmda-line: #ece3db;
  --wmda-surface: #fff;
  --wmda-radius: 14px;

  margin: 0 auto;
  max-width: 1080px;
}

.wmda *,
.wmda *::before,
.wmda *::after { box-sizing: border-box; }

/* ---------- 症状フィルター ---------- */

.wmda-filter {
  background: var(--wmda-third);
  border-radius: var(--wmda-radius);
  padding: 26px 19px 21px;
  margin-bottom: 38px;
  text-align: center;
}

.wmda-filter__h {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--wmda-ink);
  line-height: 1.5;
}

.wmda-filter__lead {
  font-size: 15px;
  color: var(--wmda-muted);
  margin: 0 0 18px;
  line-height: 1.7;
}

.wmda-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.wmda-chip {
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--wmda-ink);
  background: var(--wmda-surface);
  border: 1.5px solid var(--wmda-forth);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  /* タップ領域を確保する */
  min-height: 40px;
}

.wmda-chip:hover { border-color: var(--wmda-primary); }

.wmda-chip[aria-pressed="true"] {
  background: var(--wmda-primary);
  border-color: var(--wmda-primary);
  color: #fff;
  font-weight: 700;
}

.wmda-chip:focus-visible,
.wmda-reset:focus-visible,
.wmda-card:focus-visible {
  outline: 3px solid var(--wmda-deep);
  outline-offset: 2px;
}

.wmda-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: 16px;
  min-height: 19px;
}

.wmda-status__txt {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--wmda-deep);
}

.wmda-reset {
  font: inherit;
  font-size: 14px;
  color: var(--wmda-muted);
  background: transparent;
  border: 1px solid var(--wmda-line);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
}

.wmda-reset:hover { color: var(--wmda-ink); border-color: var(--wmda-muted); }

.wmda-empty {
  background: var(--wmda-third);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--wmda-ink);
  margin: 0 0 32px;
}

/* ---------- カテゴリ ---------- */

.wmda-cat { margin-bottom: 42px; }
.wmda-cat[hidden] { display: none; }

.wmda-cat__head {
  border-left: 4px solid var(--wmda-primary);
  padding-left: 13px;
  margin-bottom: 18px;
}

.wmda-cat__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--wmda-ink);
  line-height: 1.5;
}

.wmda-cat__note {
  font-size: 14px;
  color: var(--wmda-muted);
  margin: 3px 0 0;
  line-height: 1.7;
}

/* ---------- カード ---------- */

.wmda-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.wmda-item[hidden] { display: none; }

/* セルフチェックがある疾患は、カードの下にリンクを足す。
   カード本体が <a> なので入れ子にできず、li を縦積みにして並べる。 */
.wmda-item {
  display: flex;
  flex-direction: column;
}

.wmda-item .wmda-card { flex: 1; }

.wmda-item.is-checkable .wmda-card {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.wmda-check {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--wmda-deep);
  background: var(--wmda-third);
  border: 1px solid var(--wmda-line);
  border-top: 1px dashed var(--wmda-forth);
  border-radius: 0 0 var(--wmda-radius) var(--wmda-radius);
  transition: background .15s, color .15s;
}

.wmda-check::before {
  content: "✓";
  margin-right: .4em;
  font-weight: 700;
}

.wmda-check:hover {
  background: var(--wmda-primary);
  border-color: var(--wmda-primary);
  color: #fff;
}

.wmda-check:focus-visible {
  outline: 3px solid var(--wmda-deep);
  outline-offset: 2px;
}

.wmda-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  padding: 16px 18px;
  background: var(--wmda-surface);
  border: 1px solid var(--wmda-line);
  border-radius: var(--wmda-radius);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color .15s, background .15s;
}

.wmda-card:hover {
  border-color: var(--wmda-primary);
  background: var(--wmda-third);
}

/* 病名。一覧の主役なので記事タイトルではなく病名そのものを出す。 */
.wmda-card__name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--wmda-ink);
  position: relative;
  padding-right: 16px;
}

.wmda-card__name::after {
  content: "›";
  position: absolute;
  right: 0;
  color: var(--wmda-primary);
  font-weight: 700;
}

.wmda-card__lead {
  font-size: 15px;
  line-height: 1.7;
  color: var(--wmda-muted);
}

/* ---------- スマホ ---------- */

@media (max-width: 600px) {
  .wmda-filter { padding: 20px 14px 16px; }
  .wmda-filter__h { font-size: 18px; }
  .wmda-filter__lead { font-size: 14px; }
  .wmda-chip { font-size: 14px; padding: 8px 14px; }

  .wmda-cat__title { font-size: 18px; }

  .wmda-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .wmda-card { padding: 14px 16px; }
  .wmda-card__name { font-size: 16px; }
  .wmda-card__lead { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .wmda-card { transition: none; }
}
