/* =============================================================
 * Ligament Beta 求人検索 – プロトタイプ用スタイル
 * スコープ: .search-beta 配下のみ。既存画面には影響を出さない。
 * ============================================================= */

.search-beta {
    color: #1f2d3d;
    background: #ffffff;
    padding: 16px 0 80px;
}

.search-beta__inner {
    width: 100%;
    max-width: 1160px;
    padding: 0 16px;
    margin: 0 auto;
}

/* ---- Skip link ---- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    padding: 6px 12px;
    background: #003366;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    z-index: 200;
}
.skip-link:focus {
    top: 8px;
}

/* ---- Page header ---- */
.search-beta__title {
    font-size: 24px;
    margin: 8px 0 20px;
    font-weight: 700;
}

.search-beta__section-title {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 12px;
    margin: 8px 0 16px;
    border-left: 4px solid var(--member-primary-accent);
    background: var(--member-primary-bg);
}

/* ---- Layout ---- */
.search-beta__grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 2fr;
    gap: 24px;
    align-items: start;
}
.search-beta__grid--form-hidden {
    grid-template-columns: 1fr;
}
@media (max-width: 992px) {
    .search-beta__grid {
        grid-template-columns: 1fr;
    }
}

/* 検索フォーム開閉トグル（検索フォームの上に配置） */
.search-beta__form-toggle-row {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-start;
}
.search-beta__form-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.search-beta__form-toggle svg {
    flex-shrink: 0;
}

/* ---- Form ---- */
.search-beta__form {
    background: #fff;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: 16px;
}
@media (max-width: 992px) {
    .search-beta__form { position: static; }
}

.search-field { margin-bottom: 14px; }

/* ---- Form grid (1段組 / 2段組) ---- */
.search-beta__form-grid--stacked { display: block; }

.search-beta__form-grid--two-col {
    display: block;
}
@media (min-width: 768px) {
    .search-beta__form-grid--two-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 18px;
        row-gap: 0;
    }
    .search-beta__form-grid--two-col > .search-field--fullrow {
        grid-column: 1 / -1;
    }
}

.search-field__label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1f2d3d;
}

.search-field__trigger {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 8px 36px 8px 12px;
    background: #fff;
    border: 1px solid #c7d0dc;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.search-field__trigger::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid #5a6b7e;
    border-bottom: 2px solid #5a6b7e;
    transform: translateY(-70%) rotate(45deg);
}
.search-field__trigger:hover,
.search-field__trigger:focus-visible {
    border-color: var(--member-primary-accent);
    box-shadow: 0 0 0 3px rgba(0, 176, 240, 0.2);
    outline: none;
}
.search-field__placeholder {
    color: #8a96a5;
}

/* ---- Chip ---- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 10px;
    background: var(--member-primary-bg);
    color: #003366;
    border: 1px solid var(--member-primary);
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.2;
    max-width: 100%;
}
.chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip__remove {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #003366;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}
.chip__remove:hover,
.chip__remove:focus-visible {
    background: var(--member-primary-soft);
    outline: none;
}

/* ---- Checkbox group ---- */
.checkbox-group {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.checkbox-group legend {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2d3d;
}
.checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* ---- Keyword input ---- */
.search-beta__keyword {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #c7d0dc;
    border-radius: 6px;
}
.search-beta__keyword:focus-visible {
    outline: none;
    border-color: var(--member-primary-accent);
    box-shadow: 0 0 0 3px rgba(0, 176, 240, 0.2);
}

/* ---- Submit row ---- */
.search-beta__preview {
    font-size: 14px;
    color: #5a6b7e;
    text-align: center;
    margin-top: 10px;
}
.search-beta__preview strong {
    color: #ad0707;
    font-size: 18px;
    margin: 0 4px;
}

.search-beta__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.btn-beta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
    text-decoration: none;
}
.btn-beta--primary {
    background: var(--member-primary-accent);
    color: #fff;
}
.btn-beta--primary:hover { background: var(--member-primary); color: #fff; }
.btn-beta--outline {
    background: #fff;
    color: #003366;
    border-color: #c7d0dc;
}
.btn-beta--outline:hover { background: var(--member-primary-bg); color: #003366; }
.btn-beta:focus-visible {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

/* ---- Results ---- */
.results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.results__total { font-size: 15px; }
.results__total strong { color: #ad0707; font-size: 20px; margin: 0 4px; }
.results__sort label { font-size: 14px; }
.results__sort select {
    padding: 6px 10px;
    border: 1px solid #c7d0dc;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    min-height: 36px;
}

.results__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.results__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 10px;
    background: #fff;
    border: 1px solid #c7d0dc;
    border-radius: 999px;
    font-size: 13px;
    color: #1f2d3d;
}
.results__chip-remove {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #5a6b7e;
    font-size: 14px;
    cursor: pointer;
    border-radius: 999px;
    padding: 0;
    text-decoration: none;
}
.results__chip-remove:hover,
.results__chip-remove:focus-visible {
    background: #eef2f7;
    outline: none;
}

/* ---- Job card ---- */
.job-card {
    background: #fff;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.job-card:hover {
    border-color: var(--member-primary-accent);
    box-shadow: 0 2px 12px rgba(0, 176, 240, 0.12);
}

/* ---- Card media (image / placeholder) ---- */
.job-card__media {
    flex-shrink: 0;
    width: 180px;
    height: 135px;
    border-radius: 6px;
    overflow: hidden;
    background: #f4f7fa;
    border: 1px solid #e1e8f0;
}
.job-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.job-card__media--hellowork {
    background: #fff;
    border-color: var(--member-primary-text);
}
.job-card__media--hellowork .job-card__img {
    object-fit: contain;
    padding: 4px;
}
.job-card__noimage {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #8c9bad;
    background: linear-gradient(135deg, #eef2f7 0%, #dbe3ec 100%);
}
.job-card__noimage-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
}
.job-card__body {
    flex: 1;
    min-width: 0;
}

@media (max-width: 576px) {
    .job-card {
        flex-direction: column;
        gap: 10px;
    }
    .job-card__media {
        width: 100%;
        height: 210px;
    }
}

.job-card__header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 4px;
}
.job-card__title {
    font-size: 18px;
    margin: 0;
    color: #003366;
    font-weight: 700;
    flex: 1 1 auto;
}
.job-card__id {
    color: #5a6b7e;
    font-size: 13px;
    font-weight: 500;
}
.job-card__company {
    color: #1f2d3d;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid transparent;
}
.source-badge--hw {
    background: var(--member-primary-bg);
    color: var(--member-primary-hover);
    border-color: var(--member-primary-text);
}
.source-badge__icon {
    width: 12px;
    height: 12px;
}

.job-card__dl {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 4px 10px;
    margin: 0 0 12px;
    font-size: 14px;
}
.job-card__dl dt {
    color: #5a6b7e;
    font-weight: 600;
}
.job-card__dl dd {
    margin: 0;
    color: #1f2d3d;
    white-space: pre-wrap;
    word-break: break-word;
}

.job-card__footer {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---- Favorite toggle ---- */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #c7d0dc;
    border-radius: 6px;
    font-size: 14px;
    color: #5a6b7e;
    cursor: pointer;
    transition: background-color 150ms, color 150ms, border-color 150ms;
}
.favorite-btn[aria-pressed="true"] {
    background: #fff7e0;
    color: #b58400;
    border-color: #ffd87a;
}
.favorite-btn:hover,
.favorite-btn:focus-visible {
    outline: none;
    border-color: var(--member-primary-accent);
}
.favorite-btn__icon { font-size: 16px; }

/* ---- Empty state ---- */
.empty-state {
    background: #f7fafc;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}
.empty-state__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1f2d3d;
}
.empty-state__text {
    color: #5a6b7e;
    margin-bottom: 16px;
}

/* ---- Mobile sticky submit ---- */
@media (max-width: 992px) {
    .search-beta__actions--sticky {
        position: sticky;
        bottom: 0;
        background: #ffffffee;
        padding: 10px 0;
        backdrop-filter: blur(6px);
        z-index: 10;
        border-top: 1px solid #dfe5ec;
    }
}

/* ---- Modal enhancements ---- */
.modal-beta .modal-body { padding: 0; }
[x-cloak] { display: none !important; }

.modal-beta__tabs {
    display: flex;
    gap: 0;
    padding: 10px 16px 0;
    background: #fff;
    border-bottom: 1px solid #dfe5ec;
    position: sticky;
    top: 0;
    z-index: 2;
}
.modal-beta__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #dfe5ec;
    border-bottom: none;
    background: #f6f8fb;
    color: #5a6b7e;
    font-size: 14px;
    font-weight: 600;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
    transition: background 200ms, color 200ms, border-color 200ms;
    margin-right: 4px;
    margin-bottom: -1px;
}
.modal-beta__tab:hover {
    background: var(--member-primary-bg);
    color: #003366;
}
.modal-beta__tab--active {
    background: #fff;
    color: #003366;
    border-color: #dfe5ec;
    border-bottom: 1px solid #fff;
}
.modal-beta__tab svg {
    flex-shrink: 0;
}

.modal-beta__toolbar {
    position: sticky;
    top: 45px;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #dfe5ec;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    z-index: 1;
}
.modal-beta__toolbar-filter {
    flex: 1 1 200px;
    min-width: 0;
}
.modal-beta__toolbar-filter .modal-beta__filter {
    width: 100%;
}
.modal-beta__filter {
    flex: 1 1 200px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #c7d0dc;
    border-radius: 6px;
}
.modal-beta__toolbar-buttons {
    display: flex;
    gap: 6px;
}
.modal-beta__count {
    margin-left: auto;
    font-size: 13px;
    color: #5a6b7e;
}
.modal-beta__list { padding: 12px 16px; }
.modal-beta__fieldset {
    border: 0;
    padding: 0 0 16px;
    margin: 0;
}
.modal-beta__legend {
    font-size: 14px;
    font-weight: 700;
    color: #003366;
    padding: 6px 8px;
    background: var(--member-primary-bg);
    border-left: 3px solid var(--member-primary-accent);
    margin-bottom: 8px;
    width: 100%;
}
.modal-beta__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px 12px;
}
.modal-beta__items--single-column {
    grid-template-columns: 1fr;
}

/* ---- Japan map view ---- */
.japan-map {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas:
        ".    .    .    .    hok  hok"
        ".    .    .    toh  toh  toh"
        ".    .    hks  toh  toh  toh"
        ".    .    hks  kan  kan  kan"
        ".    .    tok  kan  kan  kan"
        "chu  chu  kns  kns  kns  ."
        "kyu  kyu  kns  kns  kns  ."
        "kyu  kyu  .    .    .    .";
    gap: 10px;
    background: linear-gradient(180deg, var(--member-primary-bg) 0%, var(--member-primary-bg) 100%);
    border-radius: 10px;
    margin: 12px;
}
.japan-map__region {
    background: #fff;
    border: 1px solid var(--member-primary);
    border-radius: 8px;
    padding: 8px 10px 10px;
    box-shadow: 0 1px 2px rgba(12, 48, 92, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.japan-map__region--hokkaido        { grid-area: hok; }
.japan-map__region--tohoku          { grid-area: toh; }
.japan-map__region--hokushinetsu    { grid-area: hks; }
.japan-map__region--kanto           { grid-area: kan; }
.japan-map__region--tokai           { grid-area: tok; }
.japan-map__region--kansai          { grid-area: kns; }
.japan-map__region--chugoku-shikoku { grid-area: chu; }
.japan-map__region--kyushu-okinawa  { grid-area: kyu; }

.japan-map__region-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #003366;
    padding: 1px 6px;
    background: var(--member-primary-bg);
    border-left: 3px solid var(--member-primary-accent);
    border-radius: 0 3px 3px 0;
    align-self: flex-start;
    letter-spacing: 0.02em;
}

.japan-map__tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.japan-map__tile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    min-width: 48px;
    font-size: 10.5px;
    font-weight: 500;
    background: var(--member-primary-bg);
    border: 1px solid var(--member-primary);
    border-radius: 3px;
    color: #003366;
    cursor: pointer;
    transition: background 200ms, border-color 200ms, color 200ms, box-shadow 200ms;
    user-select: none;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 0;
}
.japan-map__tile:hover {
    background: var(--member-primary-bg);
    border-color: var(--member-primary-accent);
}
.japan-map__tile--checked,
.japan-map__tile:has(input:checked) {
    background: #d32f2f;
    color: #fff;
    border-color: #a32020;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(163, 32, 32, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.japan-map__tile--checked::before {
    content: "✓";
    margin-right: 3px;
    font-weight: 700;
    font-size: 11px;
}
.japan-map__tile--checked:hover {
    background: #b71c1c;
    border-color: #7a1717;
}
.japan-map__tile input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    margin: 0;
}
.japan-map__tile:focus-within {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
    z-index: 1;
}

.japan-map__hint {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    font-size: 10px;
    color: #5a6b7e;
    text-align: center;
}

/* 北海道は1県なので中央寄せで目立たせる */
.japan-map__region--hokkaido .japan-map__tile {
    min-width: 60px;
    padding: 6px 10px;
    font-size: 11px;
}

/* モバイル: 地図レイアウトを縦積みにフォールバック */
@media (max-width: 576px) {
    .japan-map {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hok"
            "toh"
            "hks"
            "kan"
            "tok"
            "kns"
            "chu"
            "kyu";
        gap: 8px;
        padding: 12px;
    }
    .japan-map__tile {
        min-width: 54px;
        font-size: 11.5px;
    }
}

/* タブ無しモーダル用のツールバー位置補正 */
.modal-beta__toolbar--compact {
    top: 0;
}

/* ---- Occupation category view ---- */
.occupation-grid {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, var(--member-primary-bg) 0%, var(--member-primary-bg) 100%);
    border-radius: 10px;
    margin: 12px;
}
.occupation-category {
    background: #fff;
    border: 1px solid var(--member-primary);
    border-radius: 8px;
    padding: 8px 10px 10px;
    box-shadow: 0 1px 2px rgba(12, 48, 92, 0.06);
}
.occupation-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.occupation-category__title {
    font-size: 11.5px;
    font-weight: 700;
    color: #003366;
    padding: 2px 8px;
    background: var(--member-primary-bg);
    border-left: 3px solid var(--member-primary-accent);
    border-radius: 0 3px 3px 0;
    letter-spacing: 0.02em;
}
.occupation-category__select-btn {
    font-size: 10.5px;
    padding: 2px 8px;
    background: var(--member-primary-bg);
    border: 1px solid var(--member-primary);
    border-radius: 3px;
    color: #003366;
    cursor: pointer;
    transition: background 200ms, border-color 200ms;
    white-space: nowrap;
}
.occupation-category__select-btn:hover {
    background: var(--member-primary-bg);
    border-color: var(--member-primary-accent);
}
.occupation-category__tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.occupation-tile {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 6px 24px 6px 10px;
    min-width: 130px;
    max-width: 280px;
    background: var(--member-primary-bg);
    border: 1px solid var(--member-primary);
    border-radius: 4px;
    color: #003366;
    cursor: pointer;
    transition: background 200ms, border-color 200ms, color 200ms, box-shadow 200ms;
    user-select: none;
    line-height: 1.25;
    margin: 0;
}
.occupation-tile__main {
    font-size: 12px;
    font-weight: 700;
}
.occupation-tile__sub {
    font-size: 10px;
    color: #5a6b7e;
    margin-top: 2px;
    font-weight: 400;
}
.occupation-tile:hover {
    background: var(--member-primary-bg);
    border-color: var(--member-primary-accent);
}
.occupation-tile--checked {
    background: #d32f2f;
    color: #fff;
    border-color: #a32020;
    box-shadow: 0 1px 3px rgba(163, 32, 32, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.occupation-tile--checked .occupation-tile__sub {
    color: rgba(255, 255, 255, 0.85);
}
.occupation-tile--checked::before {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 11px;
    font-weight: 700;
}
.occupation-tile--checked:hover {
    background: #b71c1c;
    border-color: #7a1717;
}
.occupation-tile input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    margin: 0;
}
.occupation-tile:focus-within {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
    z-index: 1;
}

@media (max-width: 576px) {
    .occupation-grid {
        padding: 10px;
        margin: 10px;
    }
    .occupation-category__header {
        flex-wrap: wrap;
    }
    .occupation-tile {
        min-width: 100%;
        max-width: 100%;
    }
}

/* ---- A11y: focus visible ---- */
.search-beta :focus-visible {
    outline: 3px solid #ffb703;
    outline-offset: 2px;
}

/* ---- A11y: reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .search-beta *,
    .search-beta *::before,
    .search-beta *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ---- Pagination tweaks ---- */
.search-beta .pagination {
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 16px 0 0;
}
