/* ================================================================
   detail.css — 求人詳細ページ（detail.php）＋応募確認モーダル専用
================================================================ */

/* 重複応募エラーバナー（?applied=1 の時に表示） */
.detail-applied-alert {
  margin: 0 0 24px;
  padding: 14px 18px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  color: #856404;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

/* ----------------------------------------------------------------
   ページレイアウト
---------------------------------------------------------------- */
.detail-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 52px 40px 100px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

/* ----------------------------------------------------------------
   パンくずリスト
---------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-light);
  text-decoration: none;
  transition: var(--ease);
}

.breadcrumb a:hover { color: var(--gold); }

.breadcrumb-sep { color: var(--border); }

/* ----------------------------------------------------------------
   求人ヘッダー
---------------------------------------------------------------- */
.detail-header {
  margin-bottom: 28px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

/* detail専用バッジサイズ（components.cssのbadgeを上書き） */
.detail-badges .badge {
  padding: 4px 10px;
  font-size: 11px;
}

/* 先行応募者対応中バッジ（detail専用） */
.badge-pending {
  background: #f4a460;
  color: #fff;
  border: 1px solid #e08e3e;
}

.detail-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: 10px;
}

.detail-branch-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

/* ----------------------------------------------------------------
   求人情報セクション＆テーブル
---------------------------------------------------------------- */
.detail-section {
  margin-bottom: 40px;
}

.detail-section-title {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  padding: 10px 0 10px 14px;
  border-left: 3px solid var(--gold);
  margin-bottom: 16px;
}

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

.detail-table tr {
  border-bottom: 1px solid var(--border);
}

.detail-table tr:first-child {
  border-top: 1px solid var(--border);
}

.detail-table th {
  width: 160px;
  padding: 14px 16px;
  background: var(--cream-dark);
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  letter-spacing: .04em;
  vertical-align: top;
  white-space: nowrap;
  border-bottom: 1px solid #d8d8d8;
}

.detail-table td {
  padding: 14px 16px;
  color: var(--text);
  line-height: 1.8;
  vertical-align: top;
}

/* 給与「応募後に確認」テキスト */
.td-salary-hidden {
  color: var(--text-light);
  font-size: 13px;
}

/* 診療科目タグ */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--cream-dark);
  border: 1px solid var(--border);
  color: var(--text-mid);
}

/* ----------------------------------------------------------------
   戻るリンク
---------------------------------------------------------------- */
.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--ease);
  margin-bottom: 32px;
}

.btn-back:hover { color: var(--gold); }

/* ----------------------------------------------------------------
   サイドバー
---------------------------------------------------------------- */
.detail-sidebar {
  position: sticky;
  top: 88px;
}

.sidebar-box {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.sidebar-box-head {
  background: #bdac1e;
  padding: 16px 20px;
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  color: #fff;
  letter-spacing: .08em;
}

.sidebar-box-body {
  padding: 20px;
}

.sidebar-key-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-key-item:last-child { border-bottom: none; }

.sidebar-key-label {
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: .1em;
  font-weight: 700;
}

.sidebar-key-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.sidebar-key-value.gold { color: var(--gold-dark); }

/* ----------------------------------------------------------------
   応募ボタン
---------------------------------------------------------------- */
.btn-apply {
  width: 100%;
  padding: 16px;
  background: #bdac1e;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Noto Serif JP', serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .1em;
  cursor: pointer;
  transition: var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 10px;
}

.btn-apply:hover {
  background: var(--gold);
  color: #fff;
}

.btn-apply.is-ended {
  background: #aaa;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-note {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.8;
  text-align: center;
}

/* ----------------------------------------------------------------
   応募確認モーダル
---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  transform: translateY(24px);
  transition: transform .2s;
}

.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-head {
  background: #bdac1e;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
}

.modal-head-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  color: #fff;
  letter-spacing: .06em;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  transition: var(--ease);
}

.modal-close:hover { color: #fff; }

.modal-body { padding: 28px; }

.modal-section-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  padding: 8px 0 8px 12px;
  border-left: 3px solid var(--gold);
  margin-bottom: 14px;
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}

.modal-table tr { border-bottom: 1px solid var(--border); }
.modal-table tr:first-child { border-top: 1px solid var(--border); }

.modal-table th {
  width: 130px;
  padding: 10px 14px;
  background: var(--cream-dark);
  font-weight: 700;
  color: var(--text-mid);
  text-align: left;
  font-size: 11px;
  letter-spacing: .04em;
  vertical-align: top;
  white-space: nowrap;
}

.modal-table td {
  padding: 10px 14px;
  color: var(--text);
  line-height: 1.7;
  vertical-align: top;
}

.modal-salary-box {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.modal-salary-label {
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: .1em;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-salary-main {
  font-family: 'Noto Serif JP', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.modal-salary-sub {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.8;
}

.modal-remarks-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-remarks-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.15);
}

.modal-caution {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.8;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal-back {
  flex: 1;
  padding: 14px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--ease);
}

.btn-modal-back:hover { border-color: var(--navy); color: var(--navy); }

.btn-modal-send {
  flex: 2;
  padding: 14px;
  background: #bdac1e;
  border: none;
  border-radius: var(--radius);
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  cursor: pointer;
  transition: var(--ease);
  letter-spacing: .08em;
}

.btn-modal-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(189,172,30,.4);
}

/* ----------------------------------------------------------------
   スマホ（640px以下）：サイドバーのsticky解除・表示順変更
---------------------------------------------------------------- */
@media (max-width: 640px) {
  .detail-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 24px 16px 56px;
  }

  .detail-sidebar {
    display: contents;
  }

  /* 表示順: メイン → キーポイント → 応募 → 戻る */
  .detail-main       { order: 1; }
  #sidebarKeyPointsBox { order: 2; margin-bottom: 32px; }
  #sidebarApplyBox   { order: 3; }
  #btnBackLink       { order: 4; }

  .detail-table th {
    width: 84px;
    padding: 12px 8px;
    white-space: normal;
  }

  .detail-table td { padding: 12px 10px; }

  .btn-modal-back { font-size: 13px; }
  .btn-modal-send { font-size: 13px; letter-spacing: 0; }
}
