/* ギズモリクルート 求人詳細モーダル＋求人カード・詳細・投稿フォーム
 * 設計言語はギズモショッピングと共通（生成りの紙・墨・深い朱・金）。
 * 窓の寸法は従来どおり：幅 約70%・高さ 約85%・窓の内側でスクロール（スマホは幅92%）。 */
:root {
  --gr-bg: #faf6ee;
  --gr-surface: #fffefa;
  --gr-surface-alt: #f3ecdd;
  --gr-border: #e4dac6;
  --gr-text: #2a2019;
  --gr-dim: #7c6c5a;
  --gr-accent: #a83a28;
  --gr-accent-deep: #8f2f1d;
  --gr-accent-soft: #f9e9e2;
  --gr-gold: #a97e14;
  --gr-serif: "Hiragino Mincho ProN", "Hiragino Mincho", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  --gr-shadow: 0 1px 2px rgba(74, 55, 25, .05), 0 10px 28px -20px rgba(74, 55, 25, .35);
}

.gr-modal-overlay {
  position: fixed; inset: 0; background: rgba(42, 32, 25, .55);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.gr-modal-overlay.open { display: flex; }
.gr-modal {
  background: var(--gr-surface); width: 70vw; max-width: 900px; height: 85dvh;
  border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 640px) { .gr-modal { width: 92vw; } }
.gr-modal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--gr-accent-deep); color: #fff; padding: 8px 10px 8px 18px; flex: 0 0 auto;
}
.gr-modal-bar strong { font-family: var(--gr-serif); font-size: 1rem; line-height: 1.4; }
.gr-modal-close {
  background: transparent; border: 0; color: #fff; font-size: 1.5rem; line-height: 1;
  cursor: pointer; width: 44px; height: 44px; padding: 0; flex: 0 0 auto;
}
.gr-modal-body { overflow-y: auto; padding: 18px 20px 26px; }
.gr-modal-body .gr-detail-title { font-size: 1.35rem; }
.gr-modal-body a { color: #9c3a24; }
.gr-modal-note { font-size: .85rem; color: var(--gr-dim); margin-top: 14px; }

/* 求人カード */
.gr-job-card {
  background: var(--gr-surface); border: 1px solid var(--gr-border); border-radius: 14px;
  box-shadow: var(--gr-shadow);
  padding: 15px 16px; margin: 10px 0;
}
.gr-job-title { font-size: 17.5px; font-weight: 700; margin: 0 0 2px; line-height: 1.45; }
.gr-job-card .gr-job-title a { text-decoration: none; color: var(--gr-text); }
.gr-job-card .gr-job-title a:hover { text-decoration: underline; }
.gr-job-company { margin: 0 0 6px; font-size: 14px; color: var(--gr-dim); }
.gr-job-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; }
.gr-tag { background: var(--gr-surface-alt); color: var(--gr-text); font-size: 12px; border-radius: 4px; padding: 3px 9px; }
/* カテゴリの札は「金の格」：色ではなく格で示す */
.gr-tag-cat { background: var(--gr-gold); color: #fff; font-weight: 700; }
.gr-tag-sample { background: #fbf3d9; color: #6b5410; border: 1px solid #e3cf8f; }
.gr-job-points { margin: 0; }
.gr-job-points > div { display: flex; gap: 10px; font-size: 14px; padding: 3px 0; }
.gr-job-points dt { flex: 0 0 52px; color: var(--gr-dim); font-weight: 700; font-size: 13px; padding-top: 1px; }
.gr-job-points dd { margin: 0; }
.gr-job-no { margin: 8px 0 0; font-size: 12px; color: var(--gr-dim); }

/* 求人詳細 */
.gr-detail-head { margin-bottom: 12px; }
.gr-detail-title { font-family: var(--gr-serif); font-weight: 700; line-height: 1.5; margin: 0 0 4px; }
.gr-detail-table {
  width: 100%; border-collapse: collapse; background: var(--gr-surface);
  border: 1px solid var(--gr-border); border-radius: 12px;
}
.gr-detail-table th, .gr-detail-table td {
  border-bottom: 1px solid var(--gr-border); padding: 12px 13px; text-align: left; vertical-align: top; font-size: 15px; line-height: 1.8;
}
.gr-detail-table tr:last-child th, .gr-detail-table tr:last-child td { border-bottom: 0; }
.gr-detail-table th { width: 108px; background: var(--gr-surface-alt); font-size: 13.5px; color: var(--gr-text); font-weight: 700; }
.gr-apply-box {
  background: var(--gr-accent-soft); border: 1px solid var(--gr-accent); border-radius: 14px;
  padding: 16px 18px; margin-top: 18px;
}
.gr-apply-box h2 { font-family: var(--gr-serif); margin-top: 0; font-size: 18px; }
.gr-apply-box p { white-space: pre-wrap; margin: 6px 0; line-height: 1.8; }

/* 投稿フォーム・お知らせ */
.gr-form label { display: block; font-size: 14px; font-weight: 700; margin: 13px 0 4px; }
.gr-form input[type="text"], .gr-form input[type="date"], .gr-form select, .gr-form textarea {
  width: 100%; padding: 12px 11px; font-size: 16px; border: 1px solid #cfc2a6; border-radius: 10px;
  background: var(--gr-surface); color: var(--gr-text); box-sizing: border-box;
}
.gr-form input[type="text"]:focus, .gr-form input[type="date"]:focus,
.gr-form select:focus, .gr-form textarea:focus {
  border-color: var(--gr-accent); outline: 3px solid var(--gr-accent-soft); outline-offset: 0;
}
.gr-form-row { display: block; }
@media (min-width: 700px) {
  .gr-form-row { display: flex; gap: 12px; }
  .gr-form-row > label { flex: 1; }
}
.gr-req { color: var(--gr-accent); }
.gr-agree { font-weight: 400; }
.gr-agree input { width: auto; }
.gr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 26px; box-sizing: border-box;
  background: var(--gr-accent); color: #fff !important;
  border: 0; border-radius: 12px; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.gr-btn:hover { background: var(--gr-accent-deep); }
/* 副ボタンは輪郭で示す（主＝朱の塗り、副＝罫の輪郭） */
.gr-btn-sub { background: transparent; color: var(--gr-text) !important; border: 1.5px solid #cfc2a6; }
.gr-btn-sub:hover { background: var(--gr-surface-alt); }
.gr-btn-big { width: 100%; margin-top: 16px; padding: 15px; min-height: 56px; }
.gr-notice {
  background: var(--gr-surface-alt); border-left: 5px solid var(--gr-gold); border-radius: 8px;
  padding: 13px 15px; margin: 12px 0; line-height: 1.8;
}
.gr-notice-err { background: var(--gr-accent-soft); border-left-color: var(--gr-accent); }
.gr-box {
  background: var(--gr-surface); border: 1px solid var(--gr-border); border-radius: 14px;
  box-shadow: var(--gr-shadow); padding: 18px 16px;
}
.gr-form-note { font-size: 14px; color: var(--gr-dim); line-height: 1.8; }
.gr-my-actions { font-size: 14px; }
.gr-my-list { margin-top: 8px; }

/* カード全体を押せるようにする（cardlink fix 2026-11-02）
 * 求人カードのモーダル起動リンク（a.gr-job-open）をカード全面へ広げる。
 * 対象はこのリンクを持つカードだけ：自分の投稿一覧のカード（編集・削除の
 * リンクを持つもの）には gr-job-open が無いため、一切影響しない。
 * モーダルの起動仕様（modal.js の a.gr-job-open 委譲）はそのまま使う。 */
.gr-job-card { position: relative; }
.gr-job-card .gr-job-title a.gr-job-open::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
}
.gr-job-card:has(a.gr-job-open) { cursor: pointer; }
.gr-job-card:has(a.gr-job-open):hover { border-color: #d9c491; }
.gr-job-card:has(a.gr-job-open:focus-visible) {
  outline: 3px solid var(--gr-accent); outline-offset: 2px;
}
.gr-job-card .gr-job-title a.gr-job-open:focus-visible { outline: none; }

/* 横はみ出し修正（2026-11-10）
 * 症状：スマホで求人詳細モーダルの本文が横に動いて文字が枠の外に切れる。
 * 求人の個別ページでも、詳細表が画面幅を超えてページ全体が横に広がる。
 * 原因は、求人本文に書かれた長いURL（応募先アドレス等）である。
 * 親テーマ Cocoon の「* { overflow-wrap: break-word }」が全要素に直接
 * 効いているが、break-word は「はみ出したら折る」だけで、要素の最小幅は
 * 一番長い単語（URL）の幅のままになる。自動レイアウトの表は最小幅で
 * 列幅を決めるため、57文字のURL（15pxで実測390px）が詳細表を押し広げ
 * ていた（390px幅の実測：モーダル本文 scrollWidth 513px／表示幅359px、
 * 個別ページ document幅 489px／画面幅390px）。
 * 対策（表示だけの是正。文面・寸法・色・余白は一切変えない）：
 * 1) overflow-wrap: anywhere を本文の要素へ「直接」指定する。anywhere は
 *    最小幅の計算でも折り返しを認めるため、表が親の幅に収まる。親テーマ
 *    の * 指定が全要素に直接効いているので、コンテナへの指定（継承頼み）
 *    では効かず、要素自身への指定が必要だった。
 * 2) モーダルの本文は横方向のスクロール自体を止め、縦スクロールだけに
 *    する（窓が画面内に固定される）。
 * 3) 本文に画像が含まれる場合も、親の幅を超えないようにする（予防）。 */
.gr-modal-body { overflow-x: hidden; overflow-wrap: anywhere; }
.gr-modal-body p, .gr-modal-body td, .gr-modal-body th,
.gr-detail-table td, .gr-detail-table th, .gr-detail-table p,
.gr-apply-box p { overflow-wrap: anywhere; }
.gr-detail-table { max-width: 100%; }
.gr-modal-body img, .gr-detail-table img { max-width: 100%; height: auto; }
