/* 求人検索フォーム (livewire/job-search-panel.blade.php) */
.ksp { --ksp-orange: var(--theme-color-primary-config-custom, #ff8000); }

/* 件数 */
.ksp .ks_search_chip span { display: inline-flex; align-items: center; gap: 6px; }
.ksp .ksp-count { font-size: 11px; font-weight: 600; color: #8a8178; font-variant-numeric: tabular-nums; }
.ksp .ks_search_chip input:checked + span .ksp-count { color: rgba(255, 255, 255, .85); }
.ksp .ks_search_chip.is_empty { cursor: default; }
.ksp .ks_search_chip.is_empty span { opacity: .45; background: #f2efeb; }

/* 職種 (大分類) は大きなボタンで 4 つ並べる。置き場所の幅が狭いとき (求人一覧の本文の列など) は 2 列 */
.ksp .ks_search_field:has(> .ksp-category) { container-type: inline-size; }
@container (max-width: 760px) {
  .ksp-category { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
.ksp-category { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ksp-category__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 72px; padding: 12px 8px; border: 1.5px solid #e2ddd6; border-radius: 14px; background: #fff; cursor: pointer;
  text-align: center; transition: background-color .15s, border-color .15s, color .15s; }
.ksp-category__item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ksp-category__label { font-size: 15px; font-weight: 700; line-height: 1.35; color: #1d1d1f; }
.ksp-category__count { font-size: 12px; font-weight: 600; color: #8a8178; font-variant-numeric: tabular-nums; }
.ksp-category__item:has(input:checked) { background: var(--ksp-orange); border-color: var(--ksp-orange); }
.ksp-category__item:has(input:checked) .ksp-category__label,
.ksp-category__item:has(input:checked) .ksp-category__count { color: #fff; }
.ksp-category__item:has(input:focus-visible) { outline: 2px solid #111; outline-offset: 2px; }
.ksp-category__item.is_empty { cursor: default; opacity: .45; background: #f2efeb; }

/* フリーワード */
.ksp-freeword { width: 100%; max-width: 480px; height: 44px; padding: 0 16px; border: 1px solid #ddd; border-radius: 22px; background: #fff; font-size: 14px; }

.ksp .ks_search_submit_count.is_loading { opacity: .4; }

/* 求人一覧・検索ページに置くとき (ページの枠の中なので外側の余白を詰める) */
.ksp--search, .ksp--list { padding: 0; margin: 0 0 40px; background: none; }
.ksp--search .common_wrap, .ksp--list .common_wrap,
.ksp--search .common_inner, .ksp--list .common_inner { width: 100%; max-width: none; padding: 0; margin: 0; }
.ksp--search .top_job_search_content_wrap, .ksp--list .top_job_search_content_wrap {
  padding: 28px 24px; border-radius: 24px; background: linear-gradient(170deg, #FFF1E2 0%, #F8F5F1 100%); }
.ksp--list { margin-top: 48px; }
.ksp-sheet-close { display: none; }

/* 市区町村の絞り込みページへのリンク */
.ksp-links { margin: -16px 0 40px; padding: 20px 24px; border: 1px solid #ece7e0; border-radius: 16px; background: #fff; }
.ksp-links__title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.ksp-links__list { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.ksp-links__list a { font-size: 13px; color: #1d1d1f; text-decoration: underline; text-underline-offset: 3px; }

/* スマホの「条件を変えて探す」ボタン (PC では出さない) */
.ksp-open { display: none; }

@media (max-width: 960px) {
  .ksp-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; width: 100%; margin: 0 0 20px;
    padding: 14px 16px; border: none; border-radius: 14px; background: var(--theme-color-primary-config-custom, #ff8000); color: #fff;
    font-weight: 700; cursor: pointer; box-shadow: 0 8px 18px rgba(255, 128, 0, .25); }
  .ksp-open img { width: 18px; }
  .ksp-open__main { font-size: 16px; }
  .ksp-open__sub { flex-basis: 100%; font-size: 11px; font-weight: 500; opacity: .9; text-align: center; }

  /* 求人一覧・絞り込みページ: スマホでは全画面のパネルで開く */
  .ksp--list { position: fixed; inset: 0; z-index: 10000; margin: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #F8F5F1; visibility: hidden; opacity: 0; transform: translateY(24px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
  .ksp--list.is_sheet_open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease, transform .2s ease; }
  .ksp--list .top_job_search_content_wrap { min-height: 100%; padding: 16px 14px 0; border-radius: 0; }
  .ksp--list .top_job_search_content_wrap .top_job_search_content_form .top_job_search_content_title_block { position: relative; justify-content: flex-start; padding: 4px 52px 0 4px; }
  .ksp--list .ksp-sheet-close { display: grid; place-items: center; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: none; border-radius: 50%; background: #fff; color: #1d1d1f; font-size: 24px; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
  .ksp--list .ks_search_submit_wrap { position: sticky; bottom: 0; z-index: 2; margin: 0 -14px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: rgba(248, 245, 241, .96); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06); }
  html.ksp-lock, html.ksp-lock body { overflow: hidden; }
}

@media (max-width: 640px) {
  .ksp-category { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ksp-category__item { min-height: 64px; }
  .ksp-category__label { font-size: 14px; }
  .ksp--search .top_job_search_content_wrap { padding: 18px 12px; border-radius: 18px; }
  /* 指で押しやすい大きさ */
  .ksp .ks_search_chip span { padding: 13px 16px; font-size: 13px; }
  .ksp-links { margin-top: -20px; padding: 16px; }
}
