/*
Theme Name: Lightning Child
Template: lightning
Description: Lightning用の子テーマ
*/

/* =========================================================
   1) 共通：不要要素の非表示（巻き込み最小）
   ========================================================= */

/* ページヘッダー・パンくずは全体で非表示（必要ならここだけコメントアウト） */
.entry-title,
.page-header,
#breadcrumb,
.breadcrumb,
.breadcrumb ol[itemscope],
.breadcrumb [itemtype*="BreadcrumbList"] {
  display: none !important;
}

/* 投稿メタ系は「単一投稿」だけ非表示（一覧や固定ページを巻き込まない） */
body.single-post .entry-meta-item-author,
body.single-post .entry-meta-item-updated,
body.single-post .entry-meta-item-date,
body.single-post .nav-below,
body.single-post .next-prev {
  display: none !important;
}

/* LightningのCopyright 2行目（テーマ差分対策で複数セレクタ） */
.footer .copySection p:nth-child(2),
.site-footer-copyright p:nth-child(2) {
  display: none !important;
}

/* =========================================================
   2) 投稿（単一）ページ：余白を詰める（崩れない範囲）
   ========================================================= */

body.single-post .page-header {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-post .site-body,
body.single-post .site-body-container {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* 全体は少し余白、single-post はゼロ（競合排除） */
.site-body-bottom {
  margin: 0 !important;
  padding: 10px 0 !important;
}
body.single-post .site-body-bottom {
  padding: 0 !important;
  min-height: 0 !important;
}

/* =========================================================
   3) 求人：タイトル（job-heading）
   ========================================================= */

.job-heading {
  background: linear-gradient(135deg, #2d7bff, #0056c9 60%, #003e91);
  padding: 28px 36px !important;
  margin-bottom: 32px;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
  border-radius: 14px;
  letter-spacing: 0.02em;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.12),
    inset 0 1px 4px rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.job-heading h1,
.job-heading h2,
.job-heading p {
  margin: 0 !important;
  line-height: 1.5 !important;
}

/* =========================================================
   4) 求人：テーブル（job-table）
   ========================================================= */

.job-table {
  width: 100%;
  border-collapse: collapse;
}

.job-table th,
.job-table td {
  border: 1px solid #000;
  padding: 8px 12px;
  vertical-align: top;
}

/* セクション見出し行 */
.job-table th.section-title {
  background-color: #abb8c3 !important;
  color: #000;
  text-align: center;
}

/* 左側ラベル */
.job-table .label {
  background-color: #8ed1fc;
  font-weight: bold;
  width: 25%;
}

/* 値 */
.job-table .value {
  background-color: #ffffff;
}

/* セクション区切り用の空行（不可視文字なしの安全版） */
.job-table .section-divider td {
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
}

/* 見出しの上に線を入れる */
.job-table .section-title {
  border-top: 2px solid #555;
  padding: 12px;
}

/* テーブル内リンク色固定 */
.job-table a {
  color: #0066cc;
  background-color: transparent;
}

/* =========================================================
   5) 求人：応募ボタン（HWブルー統一）
   ========================================================= */

.job-apply-button {
  display: inline-block;
  padding: 0.85em 2.6em;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: #ffffff !important;
  background: linear-gradient(135deg, #2d7bff, #0056c9);
  border-radius: 999px;
  border: none;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.18),
    0 3px 8px rgba(0, 0, 0, 0.12);
  line-height: 1.6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-apply-button:visited {
  color: #ffffff !important;
}

@media (hover: hover) {
  .job-apply-button:hover {
    opacity: 0.95;
    transform: translateY(1px);
    box-shadow:
      0 6px 14px rgba(0, 0, 0, 0.18),
      0 2px 6px rgba(0, 0, 0, 0.12);
  }
}

.job-apply-button:focus {
  outline: 2px solid #003e91;
  outline-offset: 2px;
}

/* =========================================================
   6) AdSense：求人テーブル内の“自動広告だけ”を消す（安全寄せ）
   ========================================================= */

/* テーブル内に入り込んだ自動広告のみ */
.wp-block-flexible-table-block-table table.job-table .google-auto-placed,
.wp-block-flexible-table-block-table table.is-stacked-on-mobile .google-auto-placed {
  display: none !important;
}

/* ネイティブ系 Auto Ads（念のため） */
.wp-block-flexible-table-block-table table.job-table ins.adsbygoogle[data-ad-format="autorelaxed"],
.wp-block-flexible-table-block-table table.is-stacked-on-mobile ins.adsbygoogle[data-ad-format="autorelaxed"] {
  display: none !important;
}

/* タイトル直前の自動広告（:has 対応ブラウザのみ。single-post に限定して事故防止） */
body.single-post .google-auto-placed:has(+ .job-heading),
body.single-post ins.adsbygoogle:has(+ .job-heading) {
  display: none !important;
}

/* 広告行の見た目だけ整える（あなたのHTMLで tr.job-ad-row を使う前提） */
.job-table tr.job-ad-row,
.job-table tr.job-ad-row > td {
  border: none !important;
}
.job-table tr.job-ad-row > td {
  background: transparent !important;
  padding: 12px 0 !important;
}
.job-table tr.job-ad-row .job-ad {
  margin: 0 !important;
}

/* =========================================================
   7) 旧テーブル（削除予定）：新 .job-table には効かない安全版
   ========================================================= */

table.is-stacked-on-mobile:not(.job-table) > tbody > tr > th:first-child,
table.is-stacked-on-mobile:not(.job-table) > tbody > tr > td:first-child {
  width: 26% !important;
  box-sizing: border-box;
}
table.is-stacked-on-mobile:not(.job-table) > tbody > tr > th:nth-child(2),
table.is-stacked-on-mobile:not(.job-table) > tbody > tr > td:nth-child(2) {
  width: 74% !important;
  box-sizing: border-box;
}

/* =========================================================
   8) スマホ：求人テーブル縦並び（899px以下に一本化）
   ========================================================= */

@media (max-width: 899px) {

  /* ===== 新 job-table を縦並び ===== */
  .wp-block-flexible-table-block-table table.job-table,
  .wp-block-flexible-table-block-table table.job-table tbody,
  .wp-block-flexible-table-block-table table.job-table tr,
  .wp-block-flexible-table-block-table table.job-table th,
  .wp-block-flexible-table-block-table table.job-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* ラベル→値 の縦並び */
  .wp-block-flexible-table-block-table table.job-table th.label,
  .wp-block-flexible-table-block-table table.job-table td.label,
  .wp-block-flexible-table-block-table table.job-table td.value {
    width: 100% !important;
  }

  /* スマホ時の枠線を黒で統一（th/tdのみ） */
  .wp-block-flexible-table-block-table .job-table th,
  .wp-block-flexible-table-block-table .job-table td {
    border: 1px solid #000 !important;
    padding: 6px 8px;
    font-size: 1.02em;
  }

  .wp-block-flexible-table-block-table table.job-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  /* ===== 旧 is-stacked-on-mobile（.job-table除外）も縦並び ===== */
  table.is-stacked-on-mobile:not(.job-table),
  table.is-stacked-on-mobile:not(.job-table) tbody,
  table.is-stacked-on-mobile:not(.job-table) tr,
  table.is-stacked-on-mobile:not(.job-table) th,
  table.is-stacked-on-mobile:not(.job-table) td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  table.is-stacked-on-mobile:not(.job-table) th,
  table.is-stacked-on-mobile:not(.job-table) td {
    padding: 8px 10px;
    font-size: 1.02em;
  }

  table.is-stacked-on-mobile:not(.job-table) {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  table.is-stacked-on-mobile:not(.job-table) th[colspan="2"] {
    width: 100% !important;
    text-align: center;
  }

  table.is-stacked-on-mobile:not(.job-table) > tbody > tr > th:first-child,
  table.is-stacked-on-mobile:not(.job-table) > tbody > tr > td:first-child,
  table.is-stacked-on-mobile:not(.job-table) > tbody > tr > th:nth-child(2),
  table.is-stacked-on-mobile:not(.job-table) > tbody > tr > td:nth-child(2) {
    width: 100% !important;
  }
}

/* =========================================================
   9) スマホ：本文左右余白（767px以下）
   ========================================================= */

@media (max-width: 767px) {
  .site-body-container.container,
  .main-section.container,
  .entry-body {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .job-heading,
  .wp-block-flexible-table-block-table {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0;
  }
}

/* =========================================================
   10) フッター（リスト表示）
   ========================================================= */

.ft-block {
  margin-bottom: 25px;
}

.ft-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #444;
  letter-spacing: 0.03em;
}

.ft-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ft-list li {
  margin: 6px 0;
}

.ft-list li a {
  color: #555;
  font-size: 14px;
  text-decoration: none;
  padding: 3px 0;
  display: inline-block;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .ft-title { font-size: 14px; }
  .ft-list li a { font-size: 13px; }

  .job-card {
    margin: 18px 0;
    padding: 16px 15px 14px;
    border-radius: 16px;
  }

  .job-card > h2,
  .job-card .related-block > h2 {
    font-size: 14px;
  }

  .job-card ul li a,
  .latest-jobs-list li a {
    font-size: 13px;
  }
}

/* =========================================================
   11) ヘッダーロゴ：横伸び防止（PC/スマホ共通 + スマホ上限）
   ========================================================= */

.site-header .site-logo img,
.navbar-brand img,
.site-header-logo img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: contain;
}

@media (max-width: 767px) {
  .site-header .site-logo img,
  .navbar-brand img,
  .site-header-logo img {
    max-height: 48px;
    width: auto;
    height: auto;
  }
}

/* =========================================================
   12) 求人詳細のメタ情報を並び替え
   ========================================================= */

.entry-footer {
  display: flex;
  flex-direction: column;
}

.entry-footer .entry-meta-data-list--category { order: 1; }
.entry-footer .entry-meta-data-list--license { order: 2; }
.entry-footer .entry-meta-data-list--prefectures { order: 3; }
.entry-footer .entry-meta-data-list--city { order: 4; }
.entry-footer .entry-meta-data-list--employmenttype { order: 5; }
.entry-footer .entry-meta-data-list--post_tag { order: 6; }
.entry-footer .entry-meta-data-list--periodtype { display: none; }

/* =========================================================
   13) job-closed：資格リンク一覧
   ========================================================= */

.job-closed-qual-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

@media (min-width: 768px) {
  .job-closed-qual-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
  }
}

@media (max-width: 767px) {
  .job-closed-qual-list { display: block; }
  .job-closed-qual-list li { margin-bottom: 10px; }
}

.job-closed-qual-list li a {
  display: block;
  padding: 14px;
  background: #f5f9ff;
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  text-decoration: none;
  color: #003e91;
  font-weight: 600;
  line-height: 1.4;
  transition: all 0.2s ease;
}

@media (hover: hover) {
  .job-closed-qual-list li a:hover {
    background: #e8f0ff;
    transform: translateY(-1px);
  }
}

/* =========================================================
   14) ボタン周辺：被さりクリック事故の防止
   ========================================================= */

.wp-block-vk-blocks-button {
  position: relative;
}

.wp-block-vk-blocks-button::before,
.wp-block-vk-blocks-button::after {
  pointer-events: none;
}

.wp-block-vk-blocks-button .job-apply-button {
  position: relative;
  z-index: 2147483647;
  pointer-events: auto;
  display: inline-block;
}

/* ボタンの親ブロック内に “全体リンク” がある場合に無効化する */
.wp-block-vk-blocks-button a:not(.job-apply-button) {
  pointer-events: none;
}
.wp-block-vk-blocks-button a.job-apply-button {
  pointer-events: auto;
}

/* =========================================================
   15) A8net広告：控えめなテキスト
   ========================================================= */

.a8-job-link {
  display: inline-block;
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: #f5f9ff;
  color: #1a73e8;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}
.a8-job-link:hover {
  background: #e8f0fe;
}

/* =========================================================
   16) 職種アーカイブ（job_type）共通
   ========================================================= */

.tax-job_type .container {
  max-width: 1100px;
}

/* h1（職種名） */
.tax-job_type h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* 職種説明 */
.tax-job_type .term-description {
  background: #f8f9fa;
  padding: 1.2rem 1.4rem;
  border-radius: 6px;
  margin-bottom: 1.8rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* 子職種一覧 */
.tax-job_type .job-type-children {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 2rem;
  padding-left: 0;
}

.tax-job_type .job-type-children li {
  list-style: none;
}

.tax-job_type .job-type-children a {
  display: block;
  padding: 0.6rem 0.8rem;
  background: #ffffff;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  text-decoration: none;
}

.tax-job_type .job-type-children a:hover {
  background: #eef6ff;
  border-color: #c6defa;
}

/* 導入文ブロック（SEO②-1） */
.tax-job_type .job-type-intro {
  margin: 2.5rem 0 1.5rem;
  padding-left: 1rem;
  border-left: 4px solid #2c7be5;
}

.tax-job_type .job-type-intro h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.tax-job_type .job-type-intro p {
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ===== 都道府県リンク（A-4） ===== */
.tax-job_type .job-pref-links {
  margin: 2rem 0 2.2rem;
}

.tax-job_type .job-pref-links__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  padding-left: 0;
  margin: 1rem 0 0;
}

.tax-job_type .job-pref-links__item {
  list-style: none;
}

.tax-job_type .job-pref-links__item a {
  display: block;
  padding: 0.6rem 0.8rem;
  background: #ffffff;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  text-decoration: none;
}

.tax-job_type .job-pref-links__item a:hover {
  background: #eef6ff;
  border-color: #c6defa;
}

.tax-job_type .job-pref-links__count {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.85em;
  opacity: 0.75;
}

/* 求人一覧 */
.tax-job_type .job-list {
  padding-left: 0;
  margin-bottom: 2rem;
}

.tax-job_type .job-list li {
  list-style: none;
  border-bottom: 1px solid #eee;
}

.tax-job_type .job-list li a {
  display: block;
  padding: 0.9rem 0.2rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.tax-job_type .job-list li a:hover {
  background: #fafafa;
}

/* ページネーション */
.tax-job_type .pagination {
  margin: 2rem 0;
  text-align: center;
}

/* モバイル最適化 */
@media (max-width: 768px) {
  .tax-job_type h1 {
    font-size: 1.5rem;
  }
  .tax-job_type .job-type-children {
    grid-template-columns: repeat(2, 1fr);
  }
  .tax-job_type .job-pref-links__list {
    grid-template-columns: repeat(2, 1fr);
  }
}