/**
 * 転職サイト診断ブログパーツ
 * 要件定義書準拠
 */

/* ===== CSS変数（カラーパレット） ===== */
.jsd {
  --jsd-header-bg: #f7931e;
  --jsd-header-text: #ffffff;
  --jsd-accent: #f7931e;
  --jsd-accent-dark: #e67e22;
  --jsd-content-bg: #ffffff;
  --jsd-text: #333333;
  --jsd-text-light: #666666;
  --jsd-border: #e0e0e0;
  --jsd-button-selected-bg: #fff5eb;
  --jsd-progress-bg: #f5f5f5;
  --jsd-back-button-bg: #f0f0f0;
  --jsd-font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

/* ===== コンテナ ===== */
.jsd {
  /* max-width: 800px; */
  margin: 0 auto;
  font-family: var(--jsd-font);
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
  border: 2px solid #ff8800;
  /* border-radius: 8px; */
  overflow: hidden;
  background: var(--jsd-content-bg);
}

/* ===== ヘッダー ===== */
.jsd__header {
  background: var(--jsd-header-bg);
  padding: 24px 20px;
  text-align: center;
}

.jsd__header-user-count {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jsd-header-text);
  margin: 0 0 12px;
}

.jsd__header-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--jsd-header-text);
  margin: 0 0 16px;
}

.jsd__cta-button {
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--jsd-accent);
  background: #ffffff;
  border: 2px solid var(--jsd-accent);
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.1s;
}

.jsd__cta-button:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

.jsd__cta-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.jsd__cta-button:focus {
  outline: 2px solid var(--jsd-header-text);
  outline-offset: 2px;
}

/* ===== コンテンツ ===== */
.jsd__content {
  padding: 24px;
  background: var(--jsd-content-bg);
}

.jsd__loading {
  color: var(--jsd-text-light);
  text-align: center;
  margin: 24px 0;
}

/* ===== 質問エリア ===== */
.jsd__question-area {
  min-height: 120px;
}

.jsd__question-label {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jsd-accent);
  margin: 0 0 8px;
  text-align: center;
}

.jsd__question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--jsd-accent);
  margin: 0 0 16px !important;
  text-align: center;
}

.jsd__question-text::before {
  content: none !important;
  display: none !important;
}

.jsd__progress-box {
  background: var(--jsd-progress-bg);
  padding: 12px 20px;
  border-radius: 8px;
  margin: 0 0 16px;
  text-align: center;
}

.jsd__progress-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jsd-text);
}

.jsd__instruction {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--jsd-text);
  margin: 0 0 12px;
}

/* ===== 選択肢グリッド ===== */
.jsd__options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px 12px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 24px;
}

.jsd__option {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--jsd-text);
  background: #ffffff;
  border: 1px solid var(--jsd-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.jsd__option:hover {
  border-color: var(--jsd-accent);
}

.jsd__option--selected {
  background: var(--jsd-button-selected-bg);
  border: 2px solid var(--jsd-accent);
  color: var(--jsd-accent);
}

/* 質問4: ピル型 */
.jsd__options--pill .jsd__option {
  padding: 10px 20px;
  border-radius: 20px;
}

/* 質問5: 複数選択・小さいボタン */
.jsd__options--prefectures .jsd__option {
  padding: 8px 12px;
}

.jsd__options--prefectures .jsd__option--selected {
  color: var(--jsd-accent-dark);
}

/* ===== 戻るボタン ===== */
.jsd__back-wrap {
  text-align: center;
}

.jsd__back-button {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--jsd-text);
  background: var(--jsd-back-button-bg);
  border: 1px solid var(--jsd-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.jsd__back-button:hover {
  background: #e8e8e8;
}

.jsd__back-button:focus {
  outline: 2px solid var(--jsd-accent);
  outline-offset: 2px;
}

/* ===== 結果表示エリア ===== */
.jsd__result-area {
  margin-top: 24px;
}

.jsd__result-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--jsd-text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--jsd-accent);
}

.jsd__result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jsd__result-item {
  margin-bottom: 12px;
}

.jsd__result-link {
  display: block;
  padding: 12px 16px;
  background: var(--jsd-progress-bg);
  border-radius: 6px;
  color: var(--jsd-accent);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.jsd__result-link:hover {
  background: var(--jsd-button-selected-bg);
}

.jsd__result-empty {
  color: var(--jsd-text-light);
  padding: 24px;
  text-align: center;
}

/* ===== レスポンシブ ===== */
@media (max-width: 599px) {
  .jsd {
    margin-left: 10px;
    margin-right: 10px;
  }

  .jsd__content {
    padding: 16px;
  }

  .jsd__header {
    padding: 20px 16px;
  }

  .jsd__header-title {
    font-size: 22px;
  }

  .jsd__question-text {
    font-size: 18px;
  }

  .jsd__options {
    justify-content: center;
    gap: 8px 10px;
    width: 100%;
    max-width: none;
    margin: 0 0 24px;
  }

  .jsd__option {
    padding: 10px 12px;
    font-size: 13px;
  }

  .jsd__options--prefectures .jsd__option {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 399px) {
  .jsd__options--prefectures {
    justify-content: center;
  }
}

/* ===== 結果ページ（別ページ表示） ===== */
/* 結果ページだけ .post_content の余白・背景（SWELL用） */
.job-site-diagnosis-result-page .post_content {
  margin-top: 40px;
  background: none !important;
}

/* 結果ページのみ SWELL の h3::before を無効化 */
.job-site-diagnosis-result-page .post_content h3:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title))::before {
  content: none;
  display: none;
}

/* 結果ページのみ .post_content h3 の margin-top をリセット（SWELL が !important の場合は PHP の wp_head インラインで上書き） */
.job-site-diagnosis-result-page .post_content h3 {
  margin-top: 0 !important;
}

/* 結果ページのみ SWELL の last-child 余白リセットを打ち消す */
.job-site-diagnosis-result-page .post_content dd > :last-child,
.job-site-diagnosis-result-page .post_content div > :last-child,
.job-site-diagnosis-result-page .post_content > :last-child {
  margin-bottom: 20px !important;
  margin-top: 5px !important;
}

/* パンくずは横幅いっぱいにしない（summary の全幅処理の影響を打ち消す） */
.job-site-diagnosis-result-page .p-breadcrumb.-bg-on {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* 結果ページの .jsd のみボーダーを非表示 */
.jsd.jsd--result-page {
  border: none;
}

.jsd--result-page {
  --jsd-result-bg: #ffebf0;
  --jsd-result-title-color: #c41e3a;
  --jsd-result-tag-bg: #ffffff;
  --jsd-result-tag-color: #c41e3a;
  --jsd-result-count-bg: #ffebf0;
}

/* 選択タグエリア：JSで .post_content の直前に移動。ページ横幅いっぱい・紺青背景 */
.jsd-result__summary {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  box-sizing: border-box;
  background: #ff972a;
  text-align: center;
}

/* コンテンツは中央揃え・表示領域は今の通り */
.jsd-result__summary-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  box-sizing: border-box;
}

.jsd-result__summary-inner p{
  font-size: 24px;
  font-weight: bold;
}
.jsd-result__title {
  font-size: 32px;
  font-weight: bold;
  color: var(--jsd-result-title-color);
  margin: 0 0 16px;
}

/* summary 内：タイトル・見出しは白文字 */
.jsd-result__summary .jsd-result__title {
  color: #fff;
}

.jsd-result__summary .jsd-result__lead {
  /* font-size: 14px; */
  color: #fff;
  margin: 0 0 12px;
}

/* 選択タグの白い大枠（角を少し丸めた矩形・枠線なし） */
.jsd-result__tags-box {
  background: #fff;
  border: none;
  padding: 20px 28px;
  margin: 0 auto 24px;
  max-width: 640px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  box-shadow: none;
}

/* 各タグ：細い濃い枠・角は直角・白背景に透かし風 */
.jsd-result__tag {
  display: inline-block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #ff8800;
  background: transparent;
  border: 3px solid #ff8800;
  border-radius: 0;
}

/* 「の条件に合った…」：白文字 */
.jsd-result__count-lead {
  font-size: 14px;
  color: #fff;
  margin: 0 0 8px;
  text-align: center;
}

/* 「○件 見つかりました」：件数は白枠・白文字で「見つかりました」 */
.jsd-result__summary .jsd-result__count-wrap {
  margin: 0 0 28px;
  text-align: center;
  font-size: 24px;
  color: #fff;
}

.jsd-result__count {
  display: inline-block;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 700;
  color: #ff8800;
  background: #fff;
  line-height: 1.2;
  margin-right: 4px;
  vertical-align: middle;
}

.jsd-result__count-tail {
  font-size: 24px;
  color: #fff;
}

.jsd-result__list-wrap {
  background: var(--jsd-content-bg);
  /* padding: 24px 20px; */
  margin: 0 0 48px;
  text-align: left;
}

/* 結果ページ：白背景を伸ばさず、下に余白だけ確保 */
.job-site-diagnosis-result-page #job-site-diagnosis-result .jsd-result__list-wrap {
  margin-bottom: 48px;
}

/* .jsd-result__list-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--jsd-text);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--jsd-accent);
} */

.jsd-result__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jsd-result__list .jsd__result-item {
  margin-bottom: 12px;
}

/* サービスカード */
.jsd-result__cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.jsd-result__card {
  /* border: 1px solid var(--jsd-border); */
  overflow: visible;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid #000;
}

/* 画像だけカードの左右 padding を打ち消して横幅いっぱいに表示 */
.jsd-result__card-image {
  margin: 10px -18px 14px;
  width: calc(100% + 36px);
  max-width: none;
  overflow: hidden;
}

/* キャッチコピー直後のアイキャッチとの間 */
.jsd-result__card-catchphrase + .jsd-result__card-image {
  margin-top: 10px;
}

.jsd-result__card-image img {
  display: block;
  width: 100%;
  height: auto;
}

.jsd-result__card-body {
  padding: 16px 18px 20px;
}

/* 転職サイト名（pタグで表示・SWELLのh3スタイルを避ける） */
.jsd-result__card-title,
#job-site-diagnosis-result .jsd-result__card-title {
  margin: 0;
  line-height: 1;
  font-size: 22px;
  font-weight: 700;
  color: var(--jsd-text);
  text-align: center;
}

.jsd-result__card-catchphrase {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--jsd-text-light);
  text-align: center;
}

.jsd-result__card-link {
  font-size: 14px;
  color: var(--jsd-text);
  margin: 0 0 10px;
  text-align: right;
}

.jsd-result__card-link a {
  font-size: 14px;
  color: var(--jsd-accent);
  text-decoration: underline;
  word-break: break-all;
  font-weight: bold;
}

.jsd-result__card-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--jsd-text);
  margin: 0 0 16px;
}

.jsd-result__card-cta {
  text-align: center;
  margin: 0;
}

.jsd-result__card-button {
  display: inline-block;
  min-width: 240px;
  padding: 12px 20px;
  background: #ff8800;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.jsd-result__card-button:hover {
  opacity: 0.92;
}

@media (max-width: 599px) {
  .jsd-result__summary-inner {
    padding: 20px 16px 28px;
  }

  .jsd-result__summary-inner p {
    font-size: 18px;
  }

  .jsd-result__tags-box {
    padding: 16px 20px;
    gap: 10px;
  }

  .jsd-result__count {
    font-size: 24px;
    padding: 5px 10px;
  }

  .jsd-result__tag {
    padding: 6px 12px;
    font-size: 13px;
  }

  .jsd-result__card-body {
    padding: 14px 16px 18px;
  }

  .jsd-result__card-link {
    font-size: 11px;
    text-align: center;
  }

  .jsd-result__card-link a {
    font-size: 11px;
  }

  .jsd-result__card-image {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }

  .jsd-result__card-button {
    min-width: 200px;
    width: 100%;
  }
}

/* SWELLレイアウト上書きは結果ページだけに限定 */
.job-site-diagnosis-result-page .l-topTitleArea {
  display: none;
}

.job-site-diagnosis-result-page .l-content {
  padding: 0;
  margin: 0;
}

.job-site-diagnosis-result-page .l-container {
  padding: 0;
  margin: 0;
  max-width: 100%;
}

.job-site-diagnosis-result-page.-frame-on .l-mainContent {
  padding: 0;
}

.job-site-diagnosis-result-page .l-mainContent__inner > .post_content {
  /* margin: 0; */
  /* padding: 0; */
}