/*
 * 応募フォームのスタイル。Threads からの流入はほぼモバイルなので、
 * スマホ幅を基準に書き、広い画面では中央に寄せるだけにしている。
 *
 * 配色は明るい方に固定している。ダークモードに追随させると、
 * 「見送り」の案内文と「保留」の案内文の色の差が端末によって変わり、
 * 落ちたのかどうかが読み取りにくくなるため。背景色は明示的に塗る
 * （指定しないと閲覧側のテーマが透けて、意図しない配色になる）。
 */

:root {
  --bg: #ffffff;
  --surface: #f7f7f5;
  --border: #dcdcd6;
  --text: #1f1f1c;
  --muted: #6b6b63;
  --accent: #2f6f4f;
  --accent-weak: #eaf3ee;
  --warn: #8a5a00;
  --warn-weak: #fdf4e3;
  --stop: #8a3a3a;
  --stop-weak: #fbeeee;
  --radius: 10px;
  /* タップ領域の下限。iOS の推奨に合わせる */
  --tap: 44px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  /* iOS が入力欄フォーカス時に拡大するのを防ぐ（16px 未満だと拡大される） */
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}

h1 {
  font-size: 22px;
  line-height: 1.5;
  margin: 0 0 4px;
}

h2 {
  font-size: 18px;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 16px;
  margin: 24px 0 8px;
}

p { margin: 0 0 12px; }

a { color: var(--accent); }

.lede {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* --- 冒頭の掲載情報 ---------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 20px;
}

.panel h3 { margin-top: 0; }

.panel ul { margin: 0; padding-left: 1.2em; }

.terms {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.terms th,
.terms td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.terms th {
  width: 38%;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* 賞与・昇給・退職手当・相談窓口は「なし」でも省略できない明示義務項目 */
.terms tr[data-required-disclosure] th,
.terms tr[data-required-disclosure] td { font-weight: 600; color: var(--text); }

/* 表が狭い画面からはみ出す場合に、表だけを横スクロールさせる。
   body ごと横スクロールすると読む位置を見失う */
.table-scroll { overflow-x: auto; }

/* 冒頭の要点。応募するかどうかを決める材料だけを、他より目立つ形で置く */
.summary { border-color: var(--accent); background: var(--accent-weak); }
.summary .terms th,
.summary .terms td { border-bottom-color: rgba(47, 111, 79, 0.18); }
.summary .terms tr:last-child th,
.summary .terms tr:last-child td { border-bottom: 0; }
.summary .sub { color: var(--muted); font-size: 13px; }

/*
 * 折りたたみ。**中身は同じページに残っている**（別ページに移していない）。
 * 労働条件の全文を冒頭に開いたまま置くと、スマホで最初の設問まで
 * 6画面ぶんスクロールすることになり、読む前に離脱する。
 */
.fold {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--bg);
}

.fold > summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}

/* 既定の三角マークを消して、自前の矢印に置き換える（Safari 対策も含む） */
.fold > summary::-webkit-details-marker { display: none; }

.fold > summary::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform .15s;
  margin-left: 2px;
}

.fold[open] > summary::before { transform: rotate(45deg); }
.fold[open] > summary { border-bottom: 1px solid var(--border); }
.fold > *:not(summary) { padding: 0 14px; }
.fold > .table-scroll { padding: 0 14px 4px; }
.fold > p { padding-top: 10px; padding-bottom: 12px; margin: 0; }

/* --- 設問 -------------------------------------------------------------- */

.q {
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

.q legend,
.q .q-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 8px;
  padding: 0;
  display: block;
}

.q .hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 10px;
  white-space: pre-line;
}

.required::after {
  content: "必須";
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-weak);
  border-radius: 4px;
  padding: 2px 6px;
  vertical-align: 2px;
}

.optional::after {
  content: "任意";
  margin-left: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: 2px;
}

/* 選択肢。ラベル全体を押せるようにして、丸そのものを狙わせない */
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.choice input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

textarea { min-height: 96px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 開始〜終了。狭い画面でも「〜」を挟んで1行に収める */
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row select { flex: 1; min-width: 0; }
.range-sep { flex: none; color: var(--muted); }

/*
 * 同伴のお願い。読ませたうえで同意を取るので、選択肢の直前に置く。
 * 折りたたまないのは、読まずに同意されては意味がないため。
 * そのぶん見出しで区切り、自分に関係のある箇所を拾えるようにする。
 */
.rule-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 12px;
}

.rule-group + .rule-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

.rule-group h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.rules {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.8;
}

.rules li + li { margin-top: 5px; }

/* 先に知らせておくための一文。同意を取る欄ではないので、
   選択肢と同じ見た目にはしない（押すものだと誤解させない） */
.notice {
  background: var(--warn-weak);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.8;
}

.field { margin-bottom: 16px; }

.field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint { margin-top: 4px; margin-bottom: 0; }

/* --- 同意文 ------------------------------------------------------------ */

/*
 * 折りたたまない。全文をスクロールで読める形にする、という設計判断。
 * 高さを固定して中だけスクロールさせるのも避けている（読まずに飛ばせるため）。
 */
.consent-body {
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

/* --- 結果表示 ---------------------------------------------------------- */

.result {
  border-radius: var(--radius);
  padding: 20px 16px;
  margin: 24px 0;
  white-space: pre-line;
}

.result h2 {
  margin: 0 0 8px;
  border: 0;
  padding: 0;
  font-size: 18px;
}

.result--stop { background: var(--stop-weak); border: 1px solid var(--stop); }
.result--stop h2 { color: var(--stop); }

.result--hold { background: var(--warn-weak); border: 1px solid var(--warn); }
.result--hold h2 { color: var(--warn); }

.result--done { background: var(--accent-weak); border: 1px solid var(--accent); }
.result--done h2 { color: var(--accent); }

.result .next {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  white-space: normal;
}

/* --- ボタン ------------------------------------------------------------ */

.actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg) 24px);
  padding: 24px 0 16px;
}

button {
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

button:disabled { background: var(--muted); cursor: not-allowed; }

button.secondary {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* --- 表示制御 ---------------------------------------------------------- */

/*
 * Netlify Forms はデプロイ時に静的HTMLを走査してフォーム定義を拾う。
 * DOM から外すと検出されず送信が丸ごと失われるので、
 * 出し分けは必ず表示制御だけで行う。
 */
[hidden] { display: none !important; }

.error {
  color: var(--stop);
  font-size: 14px;
  margin-top: 6px;
}

/* honeypot。人には見せず、DOM には残す */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

@media (min-width: 600px) {
  .wrap { padding: 40px 24px 96px; }
  h1 { font-size: 26px; }
}

/* 募集案内。既存の入力部品・送信処理と共通の緑を使う。 */
html { scroll-behavior: smooth; }
:focus-visible { outline: 3px solid #b47b0e; outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; background: #fff; z-index: 10; }
.skip-link:focus { top: 12px; }
.site-header {
  max-width: 1128px; margin: auto; padding: 22px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-size: 23px; font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.brand span { font-size: 14px; font-weight: 400; letter-spacing: 0; margin-left: 20px; color: var(--muted); }
.header-link { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; }
.recruitment { max-width: 1128px; padding-top: 48px; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 50px; }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .04em; margin: 0 0 20px; }
.hero h1 { font-size: clamp(32px, 4.4vw, 51px); line-height: 1.5; letter-spacing: -.035em; margin-bottom: 24px; }
.hero-description { line-height: 2; margin-bottom: 20px; }
.hero-location { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.apply-link {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 16px 24px; min-height: 56px; border-radius: 6px;
  text-decoration: none; font-weight: 700; color: #fff; background: var(--accent);
}
.apply-link:hover { background: #225139; }
.text-link { display: block; font-size: 14px; margin-top: 16px; text-underline-offset: 4px; }
.hero-photo { position: relative; margin: 0; overflow: hidden; border-radius: 90px 8px 8px 8px; background: var(--surface); }
.hero-photo img { display: block; width: 100%; height: 510px; object-fit: cover; object-position: 50% 55%; }
.hero-photo figcaption { position: absolute; left: 16px; bottom: 16px; right: 16px; background: rgba(255,255,255,.95); padding: 10px 14px; font-size: 14px; }
.quick-facts { display: grid; grid-template-columns: 1.1fr 1fr 1fr; margin: 40px 0 0; padding: 28px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.quick-facts > div { padding: 0 24px; border-left: 1px solid var(--border); }
.quick-facts > div:first-child { padding-left: 0; border-left: 0; }
.quick-facts dt { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.quick-facts dd { margin: 0; font-size: 24px; line-height: 1.6; font-weight: 700; }
.quick-facts dd span, .quick-facts dd small { font-size: 16px; margin: 0 3px; }
.quick-facts p { font-size: 14px; font-weight: 400; color: var(--muted); margin: 5px 0 0; }
.eligibility-note { padding: 24px; background: var(--accent-weak); margin: 32px 0 0; border-left: 3px solid var(--accent); }
.eligibility-note h2 { margin: 0 0 10px; border: 0; padding: 0; font-size: 17px; }
.eligibility-note p { margin-bottom: 8px; font-size: 14px; }
.eligibility-note p:last-child { margin-bottom: 0; }
.reading-column { max-width: 760px; margin: 52px auto 0; }
.reading-column > h2 { font-size: 23px; margin-top: 44px; }
.recruitment .summary { background: #fff; border-color: var(--border); }
.recruitment .terms th { width: 26%; white-space: normal; }
.recruitment .terms td, .recruitment .terms th { padding-top: 14px; padding-bottom: 14px; }
.recruitment .fold { border-radius: 6px; }
.recruitment .fold summary { padding: 16px; }
#job-details, #application, .q, #rest { scroll-margin-top: 24px; }
#application { margin-top: 56px; padding-top: 30px; border-top: 3px solid var(--accent); }
.application-intro .eyebrow { margin-bottom: 12px; }
.application-intro h2 { border: 0; margin: 0 0 12px; padding: 0; font-size: 26px; }
.application-steps { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: step; margin: 24px 0 32px; }
.application-steps li { counter-increment: step; background: var(--accent-weak); padding: 12px 10px; font-size: 14px; text-align: center; }
.application-steps li::before { content: counter(step) ". "; color: var(--accent); font-weight: 700; }
.gate-progress { margin: 0 0 24px; }
.gate-progress p { font-size: 14px; color: var(--accent); font-weight: 600; margin: 0 0 6px; }
.gate-progress progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; background: var(--accent-weak); accent-color: var(--accent); }
.gate-progress progress::-webkit-progress-bar { background: var(--accent-weak); }
.gate-progress progress::-webkit-progress-value { background: var(--accent); }
.gate-progress progress::-moz-progress-bar { background: var(--accent); }
@media (max-width: 760px) {
  .site-header { padding: 14px 20px; }
  .brand { font-size: 21px; }
  .brand span { margin-left: 12px; font-size: 12px; }
  .recruitment { padding: 28px 20px 64px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero .eyebrow { margin-bottom: 14px; }
  .hero h1 { font-size: clamp(29px, 7.9vw, 42px); margin-bottom: 16px; }
  .hero-description { margin-bottom: 12px; }
  .hero-location { margin-bottom: 20px; }
  .apply-link { display: flex; width: 100%; }
  .hero-photo { border-radius: 56px 6px 6px 6px; }
  .hero-photo img { height: 280px; object-position: 50% 62%; }
  .hero-photo figcaption { left: 12px; right: 12px; bottom: 12px; font-size: 13px; }
  .quick-facts { margin-top: 24px; grid-template-columns: 1fr; padding: 0; }
  .quick-facts > div, .quick-facts > div:first-child { border-left: 0; padding: 18px 0; display: grid; grid-template-columns: 80px 1fr; align-items: baseline; gap: 8px; }
  .quick-facts > div + div { border-top: 1px solid var(--border); }
  .quick-facts dd { font-size: 22px; }
  .eligibility-note { padding: 20px; margin-top: 24px; }
  .reading-column { margin-top: 32px; }
  .recruitment .terms th { width: 28%; }
  .recruitment .terms th, .recruitment .terms td { padding-left: 4px; padding-right: 4px; }
  .application-intro h2 { font-size: 23px; }
  .application-steps { gap: 4px; }
  .application-steps li { padding: 10px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
