/* =========================================================================
 * トップスライダーの高さを画面幅に応じて調整
 * @概要: 100vhから50vhまで段階的に縮小
 * @仕様: PC→タブレット→スマホで高さを変更
 * ========================================================================= */

/* デフォルト：PC表示用（コメントのみ、実際の指定はメインCSSにある前提） */
/* .top-slider { height: 100vh; } */

/* PCデバイスのみのホバーエフェクト */
@media (hover: hover) and (pointer: fine) {

  /* モバイルメニュー内のSNSリンクホバー効果 */
  .mobile-sns-link:hover {
    opacity: 0.8;
  }
}

/* タッチデバイス用の無効化 */
@media (hover: none) {
  .mobile-sns-link:hover {
    opacity: 1;
  }
}

/* タブレット大画面 */
@media (max-width: 1200px) {

  /* ニュースセクションのパディング調整 */
  /**
   * .news-section
   * 1200px以下でパディングを60pxに設定
   */
  .news-section {
    padding: clamp(1.5rem, 0.536rem + 4.29vw, 3.75rem);
  }

  /* ===========================================================================
   * 会社案内ページ（about）レスポンシブ対応
   * @概要: 1200px以下でabout-content縦並び、タイトル中央、表・マップ・沿革調整
   * @仕様: 指定要件に基づく
   * @制限事項: 他ページに影響しないようセレクタ限定
   * ========================================================================= */

  /**
   * .about-content
   * 1200px以下で縦並び・中央寄せ・パディング調整
   */
  .about-content {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 0 10px;
  }

  .about-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .about-image {
    width: 100%;
    max-width: 350px;
    min-width: 0;
    margin: 0 auto;
    display: block;
  }

  .company-description {
    width: 100%;
    margin-top: 0;
  }

  .about-section .section-header,
  .about-section .section-title {
    padding-left: clamp(0.25rem, -0.286rem + 2.38vw, 1.5rem);
  }

  .about-section {
    padding: 80px 0 clamp(0.25rem, -0.286rem + 2.38vw, 1.5rem) 0;
  }

  /**
   * .company-table-wrapper
   * テーブル幅を画面幅に合わせて縮小
   */
  .company-table-wrapper {
    max-width: 100%;
    padding: 0 4vw;
  }

  /**
   * .company-table th, .company-table td
   * テーブルセルのパディング調整
   */
  .company-table th,
  .company-table td {
    padding: 12px 0;
    font-size: 15px;
  }

  /**
   * .company-table td 所在地セル
   * 郵便番号で改行し、住所は折り返さず表示
   */
  .company-table td[data-label="所在地"] {
    white-space: pre-line;
    word-break: keep-all;
  }

  /**
   * .access-map iframe
   * マップを画面幅に合わせて縮小
   */
  .access-map iframe {
    width: 100% !important;
    min-width: 0;
    max-width: 100vw;
    height: 45vw !important;
    min-height: 200px;
    max-height: 400px;
  }

  /**
   * .timeline
   * 沿革セクションの幅調整
   */
  .timeline {
    max-width: 100%;
    padding: 0 4vw;
  }

  /**
   * .timeline-item
   * 年代とテキストを縦並びに
   */
  .timeline-item {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 16px 0;
  }

  /**
   * .timeline-date
   * 1200px以下でflexプロパティをリセットし幅を100%に
   */
  .timeline-date {
    flex: none !important;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
  }

  .timeline-content {
    width: 100%;
  }

  /**
   * .company-address
   * 会社概要テーブルの住所セルで改行を有効化（brや\n対応）
   * @仕様: white-space: pre-line; で改行反映
   */
  .company-address {
    white-space: pre-line;
    word-break: break-all;
  }

  .service-area__content {
    flex-direction: column;
    align-items: center;
  }

  .service-flow {
    flex-direction: column;
    margin: clamp(3.438rem, 3.077rem + 1.6vw, 5rem) clamp(0.938rem, -1.01rem + 8.65vw, 9.375rem) 0;
    gap: 0;
  }

  .service-flow__steps {
    margin-top: 0;
  }
}

/* タブレット標準 */
@media (max-width: 991px) {
  .top-slider {
    height: 70vh;
  }

  /* ニュースアイテムヘッダーのレイアウト調整 */
  /**
   * .news-item-header
   * タブレット以下で日付とカテゴリを横並び、タイトルを下に表示
   */
  .news-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
  }

  .news-date,
  .news-category {
    order: 1;
  }

  .news-item-title {
    width: 100%;
    order: 2;
    margin-top: 8px;
  }

  /**
   * .concept-content, .service-content
   * タブレット以下でflex方向をcolumnにし、テキストが上・画像が下になるように調整
   */
  .concept-content,
  .service-content {
    flex-direction: column;
    align-items: center;
  }

  .concept-image,
  .service-image {
    order: 2;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-top: 24px;
  }

  .text-content-wrapper {
    order: 1;
    width: 100%;
    margin-bottom: 0;
  }

  /**
   * サブフッター
   * タブレット以下で縦並び・区切り線を横線に変更
   */
  .sub-footer-row {
    flex-direction: column;
    gap: clamp(0rem, -1.339rem + 5.95vw, 3.125rem);
  }

  .sub-footer-divider {
    width: 100%;
    height: 1px;
    margin: 32px 0;
  }

  .sub-footer-col {
    width: 100%;
  }

  /**
   * ヘッダー：タブレット以下でサイトタイトル非表示
   */
  .site-title {
    display: none;
  }

  .pc-only {
    display: none;
  }

  .footer-bottom-row {
    justify-content: center;
  }

  .service-flow__step-description {
    margin: 0;
  }

  .service-flow__step-number {
    min-width: 0;
    font-size: 2.5rem;
  }

  .recruit-person {
    flex-direction: column;
    align-items: center;
  }

  .recruit-flow__item {
    flex-direction: column;
    align-items: center;
  }

  .recruit-flow__image {
    flex: none;
  }

  .contact-intro {
    padding: 0 1.25rem;
  }

  .contact-form {
    padding: 0 1.25rem;
  }

  /* ACFテキスト内の改行を表示 */
  .acf-br br {
    display: inline;
  }

  /* .sp-brクラスの改行も表示（既存クラスがあれば） */
  .sp-br {
    display: inline;
  }

  /* ACFテキストを持つ段落の余白調整 */
  p.acf-br,
  .acf-br p {
    margin-bottom: 0.5em;
  }
}

/* スマホ横向き/小型タブレット */
@media (max-width: 767px) {
  .top-slider {
    height: 60vh;
  }

  .slider-item {
    background-position: center center;
  }

  .slider-content {
    width: 90%;
    margin: 0 auto;
    top: 75%;
  }
}

/* スマホ縦向き */
@media (max-width: 576px) {
  .top-slider {
    height: 50vh;
  }

  /**
   * ヘッダー：スマホでSNSアイコン非表示、ハンバーガーメニューでメニュー表示
   */
  .social-link {
    display: none;
  }

  .hamburger-menu {
    display: block;
  }

  .dummy-block {
    display: block;
  }

  /**
   * ハンバーガーメニュー内SNSリンク（アイコン＋ラベル横並び）
   */

  .menu-container {
    width: 100%;
  }

  .mobile-sns-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid #fff;
    width: 70%;
  }

  .mobile-sns-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-family: "Noto Serif JP", serif;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
    padding: 5px 0;
    transition: color 0.3s ease;
  }

  .mobile-social-icon {
    width: 30px;
    height: 30px;
    display: inline-block;
    vertical-align: middle;
  }

  .footer-company-info {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  /**
   * .about-image
   * スマホで画像幅を350pxに固定し中央
   */
  .about-image {
    margin: 0 auto;
    display: block;
  }

  /**
   * .company-table-wrapper, .timeline
   * スマホで左右余白をさらに詰める
   */
  .company-table-wrapper,
  .timeline {
    padding: 0 2vw;
  }

  /**
   * .access-map iframe
   * スマホで高さを200pxに
   */
  .access-map iframe {
    height: 200px !important;
  }

  /**
   * .address-br
   * 会社概要テーブルの住所セルで改行用<br>を画面幅で表示/非表示切り替え
   * @仕様: デフォルト非表示、576px以下で表示
   */
  .address-br {
    display: inline;
  }

  .news-list__link {
    flex-direction: column;
    align-items: center;
  }

  .news-list .section-header {
    padding-left: 0;
  }

  .news-list__thumb-wrap {
    overflow: unset;
  }

  .news-list .section-header {
    margin-bottom: 0;
  }
}

@media (min-width: 577px) {
  .mobile-sns-links {
    display: none !important;
  }
}

/* ==========================================================================
 * ACFテキストフィールドの改行制御
 * @概要: PCでは改行を非表示、タブレット以下で改行表示
 * @仕様: .acf-brクラスを付与した要素で改行の表示/非表示を制御
 * ========================================================================== */

/* PC表示時（991px超）は改行を無効化 */
@media (min-width: 992px) {

  /* ACFテキスト内の改行を非表示 */
  .acf-br br {
    display: none;
  }

  /* .sp-brクラスの改行も非表示（既存クラスがあれば） */
  .sp-br {
    display: none;
  }
}

/* タブレット以下の表示時（991px以下）は改行を有効化 */
@media (max-width: 991px) {

  /* ACFテキスト内の改行を表示 */
  .acf-br br {
    display: inline;
  }

  /* .sp-brクラスの改行も表示（既存クラスがあれば） */
  .sp-br {
    display: inline;
  }

  /* ACFテキストを持つ段落の余白調整 */
  p.acf-br,
  .acf-br p {
    margin-bottom: 0.5em;
  }
}