/* ==========================================================
 * 【統合・最適化版】共通レスポンシブスタイル (PC・タブレット・スマホ)
 * ========================================================== */

/* --------------------------------------------------
 * 1. タブレット・大型スマホ向け（max-width: 1024px 以下）
 * -------------------------------------------------- */
@media screen and (max-width: 1024px) {
  /* レイアウトベース */
  main {
    flex-direction: column-reverse;
  }
  .top-main {
    flex-direction: column;
  }
  .main-content {
    width: 100%;
    padding: 0;
  }

  /* 検索機能周り */
  .top-mapsearch {
    display: none; /* スマホ・タブでは地図検索を非表示 */
  }
  .top-detailedsearch {
    width: 100%;
    padding: 0;
  }

  /* 下層：アーカイブ・サイドバー */
  .u-useful-archive {
    grid-template-columns: repeat(2, 1fr); /* 2列に縮小 */
  }
  .u-sidebar {
    width: 100%;
    margin-top: 3rem;
    padding: 0;
  }
  .form-label p {
    width: 220px;
  }
  .form-row {
    padding: 1rem 0.5rem;
  }
  .sp-top-banner {
    display: block;
  }
}

/* --------------------------------------------------
 * 2. 中型タブレット・横持ちスマホ（max-width: 800px 以下）
 * -------------------------------------------------- */
@media screen and (max-width: 800px) {
  .logo {
    width: 140px;
  }
  .logo-phrase {
    font-size: 0.8rem;
  }
  .top-news-banner-wrap {
    flex-direction: column;
  }
  .top-news {
    width: 100%;
  }
  .news-side-banner {
    width: 100%;
    max-width: 500px;
    margin: 3rem auto 0;
  }
}

/* --------------------------------------------------
 * 3. 標準スマートフォン向け（max-width: 768px 以下）
 * ※前回個別に作成した新規セクション用CSSもこの中に記述すると管理が楽です
 * -------------------------------------------------- */
@media screen and (max-width: 768px) {
  
  /* 共通ブロックの画面いっぱい広げる設定 */
  .topB, .topC, .topE {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0;
  }

  /* お問い合わせフォーム（Contact Form 7等）の1列化 */
  .form-row {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
  .form-label, 
  .form-label p,
  .wpcf7-form-control-wrap {
    width: 100%;
  }
  .form-label p {
    margin-bottom: 5px;
  }
  input, textarea, select {
    width: 100%;
    box-sizing: border-box;
    font-size: 15px;
    padding: 12px 15px;
  }
  .wpcf7-form-control.wpcf7-submit {
    width: 100%;
    font-size: 16px;
    padding: 15px;
  }

  /* ヘッダー・スマホナビゲーション */
  .header-contact-btnwrap,
  .header-actions {
    display: none; /* PC用のボタン類を非表示 */
  }
  .header-inner {
    height: auto;
    justify-content: flex-start;
  }
  .header-main {
    display: flex;
    justify-content: space-between;
    height: 60px;
    width: 100%;
  }
  .openbtn {
    display: block;
  }

  /* スライドイン型スマホメニュー (.sp-nav) */
  .sp-nav {
    z-index: 9999; /* DOCKや他要素に負けないように調整 */
    display: block;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    background-color: #fff;
    transition: transform 0.5s ease;
    transform: translateX(100%);
  }
  .sp-nav.active {
    transform: translateX(0);
  }
  .sp-nav ul {
    height: 100%;
    padding: 6rem 1.5rem 1rem 1.5rem;
    list-style: none;
    display: flex;
    flex-direction: column;
  }
  .sp-nav a {
    padding: 1rem 0;
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
  }
  .sp-header-contact-btn {
    margin-top: 2rem;
    width: 100%;
    max-width: 250px;
    text-align: center;
  }
  .sp-header-contact-btn a {
    background-color: #ff914c;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
    display: block;
  }

  /* 下層：コラムアーカイブ（1列化） */
  .u-useful-archive {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
  }
  .u-useful-item {
    display: flex !important;
    flex-direction: column !important;
    padding: 1rem !important;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
  }
  .u-useful-img,
  .u-useful-textwrap {
    width: 100% !important;
    padding: 0 !important;
  }
  .u-useful-img img {
    width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
  }
  .u-useful-item-title {
    font-size: 1.1rem !important;
    margin-top: 0.5rem;
  }
  .u-useful-item-text {
    font-size: 0.9rem !important;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 下層：求人検索結果・詳細ページ */
  .u-job-item-search-result-item,
  .u-job-details {
    width: 100%;
    max-width: none;
  }
  .job-item-top-info,
  .job-item-info,
  .u-job-info-container,
  .joblisting-morewrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px;
  }
  .job-info-img,
  .u-job-info-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .job-info-img img,
  .u-job-info-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
  .joblisting-morewrap a {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .job-info-des-table {
    width: 100%;
    display: block;
    overflow-x: auto; /* テーブルが溢れたら横スクロール可能に */
  }
  .job-info-des-table th {
    width: 30% !important;
  }

  /* サンクスページ・プライバシーポリシー */
  .contact-thanks-box {
    padding: 2rem 1rem;
  }
  .contact-thanks-box h2 { font-size: 1.3rem; }
  .privacy-item h2 { font-size: 1.2rem; }
  .privacy-item { font-size: 0.95rem; }

  /* 下層：詳細シングルページ（コラム・ニュース共通） */
  .useful-single, .news-single {
    padding: 2rem 1rem;
  }
  .useful-single-textwrap h2, .news-single-textwrap h2 { font-size: 1.2rem; }
  .useful-single-textwrap h3, .news-single-textwrap h3 { font-size: 1.1rem; }
  .useful-single-textwrap p, .news-single-textwrap p { font-size: 0.95rem; line-height: 1.6; }
}

/* --------------------------------------------------
 * 4. 小型スマートフォン向け（max-width: 480px 以下）
 * -------------------------------------------------- */
@media screen and (max-width: 480px) {
  .top-area-several {
    flex-direction: column;
  }
  .top-area-several + .top-area-several {
    margin-top: 0.5rem;
  }
  .several-items {
    width: 100%;
    margin-top: 0.5rem;
    margin-left: 0;
  }
  .more-btn {
    margin: 2rem auto 0;
  }
  
  /* カード・エリア内パディングの最適化 */
  .top-detailedsearch-contents,
  .top-features-contents.slider,
  .useful-contents,
  .top-area-contents,
  .mapsearch-wrap,
  .u-qa {
    padding: 1rem !important;
  }
}