﻿  :root {
    --transition-duration: 600ms;
    --header-height: 64px;
    --side-panel-width: 320px; /* 追加: サイドメニューの共通張り出し幅 */
    --font-size-large: 1.2rem;
    --font-size-medium: 1rem;
    --font-size-small: 0.9rem;
    --topic-blue: #0b66c2; /* 追加: index.html の TOPIC と同じ青色（必要なら別の値に変更） */
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  /* 固定式ヘッダーのスタイル */
  .site-header {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height); background-color: #fff; color: #000; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; z-index: 1000; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); font-size: 1rem; transition: background-color 260ms ease, color 200ms ease;
  }

  .site-header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: sans-serif;
    line-height: 1;
    display: flex;
    align-items: center;
  }
  /* 追加: ロゴ（タイトル）ホバー時に色を明るく */
  .site-header .logo a:hover {
    opacity: 0.75;
    transition: opacity 0.18s;
  }

  .site-header nav { display: flex; gap: 1rem; align-items: center; }

  .site-header nav a {
    color: #000;
    text-decoration: none;
    font-size: 0.9rem; /* 文字サイズを小さく調整 */
    font-family: sans-serif;
    padding: 0.4rem 0.8rem; /* 余白を調整 */
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }
  @media (max-width: 1200px) {
    :root {
      --header-height: 56px;
    }
    .site-header {
      font-size: 0.85rem;
    }
    .site-header nav a {
      font-size: 0.8rem;
      padding: 0.3rem 0.6rem;
    }
  }

  .accident-btn-icon { height:1.8em; width:auto; object-fit:contain; vertical-align:middle; margin-right:4px; clip-path:inset(12%); }
  .site-header nav .accident-btn-icon { filter: brightness(0); transition: filter 200ms ease; }
  .site-header nav a:hover .accident-btn-icon { filter: brightness(0) invert(1); }
  .site-header.at-top nav .accident-btn-icon { filter: brightness(0) invert(1); }
  .mobile-panel .accident-btn-icon { height:24px; }
  .site-header nav a.accident-btn,
  .site-header nav a.inquiry-btn {
    height: 2em;
  }
  .site-header.at-top nav a.accident-btn {
    background-color: transparent;
  }
  .site-header.at-top nav a.accident-btn:hover {
    background-color: #6B7B8C;
  }
  .site-header nav a.inquiry-btn {
    background-color: #0b66c2;
    color: #fff !important;
    border-radius: 4px;
    font-weight: 600;
  }
  .site-header nav a.inquiry-btn:hover {
    background-color: #0955a8 !important;
    color: #fff !important;
  }
  .site-header.at-top nav a.inquiry-btn {
    background-color: rgba(11,102,194,0.9);
  }
  .site-header nav a:hover {
    background-color: #6B7B8C;
    color: #fff;
  }

  /* スクロール時のヘッダーの色変更 */
  .site-header.at-top { background-color: transparent; color: #fff; box-shadow: none; }
  .site-header.at-top .logo, .site-header.at-top nav a { color: #fff; }
  .site-header.at-top .hamburger .bars span { background: #fff; }

  /* ハンバーガーメニュー */
  .hamburger {
    display: none;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
  }

  .hamburger .bars {
    width: 28px;
    height: 20px;
    position: relative;
    display: block;
  }

  .hamburger .bars span {
    position: absolute;
    left: 0; right: 0;
    height: 3px;
    background: #000;
    border-radius: 2px;
    transition: transform 220ms, opacity 220ms;
    display: block;
  }

  .hamburger .bars span:nth-child(1) { top: 0; }
  .hamburger .bars span:nth-child(2) { top: 8px; }
  .hamburger .bars span:nth-child(3) { top: 16px; }

  .hamburger.open .bars span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.open .bars span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.open .bars span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* モバイルパネル */
  .mobile-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: min(var(--side-panel-width), 90vw);
    height: calc(100vh - var(--header-height));
    background: rgba(255,255,255,0.78);
    border-radius: 60px 0 0 60px / 100% 0 0 100%;
    box-shadow: -12px 0 40px rgba(12,12,12,0.22);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255,255,255,0.5);
    border-left: 3px solid rgba(25,118,210,0.5);
    font-family: sans-serif;
    letter-spacing: normal;
    transform: translateX(100%);
    transition: transform 260ms cubic-bezier(.2,.9,.3,1), opacity 200ms;
    opacity: 0;
    z-index: 1099;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 16px;
    align-items: center;
  }

  .mobile-panel.open {
    transform: translateX(0);
    opacity: 1;
  }

  .mobile-panel a {
    color: #222;
    text-decoration: none;
    font-size: 1.1rem;
    font-family: sans-serif;
    font-weight: 400;
    letter-spacing: normal;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    transition: background 0.18s, transform 0.2s cubic-bezier(0.22,1,0.36,1), color 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-panel a:hover {
    color: #1a56d6;
    background: rgba(11,102,194,0.09);
    transform: translateX(5px);
  }

  /* パネル内テキストもリセット */
  .mobile-panel p {
    font-family: sans-serif;
    color: #888;
    letter-spacing: normal;
    text-shadow: none;
    text-align: center;
    margin-top: 32px !important;
    margin-bottom: 0 !important;
  }

  /* モバイル時のみ表示 */
  @media (max-width: 900px) {
    .hamburger { display: flex; }
    .site-header nav { display: none; }
    .mobile-panel { display: flex; }
    .site-header .logo { font-size: 1.5rem; }
  }
  @media (min-width: 901px) {
    .mobile-panel { display: none !important; }
  }

  /* リスポンシブデザイン */
  @media (max-width: 1200px) {
    :root { --header-height: 56px; }
    .site-header { font-size: 0.9rem; }
  }

  @media (max-width: 900px) {
    .hamburger { display: flex; }
    .site-header nav { display: none; }
    .mobile-panel { display: flex; }
    .site-header .logo { font-size: 1.5rem; }
  }

  @media (max-width: 768px) {
    :root { --header-height: 48px; }
    .site-header { font-size: 0.8rem; }
    .site-header .logo { font-size: 1.3rem; }
  }

  @media (max-width: 480px) {
    .site-header { padding: 0 0.75rem; }
    .site-header .logo { font-size: 1.3rem; }
    .site-header nav a { padding: 0.6rem 0.8rem; font-size: 0.95rem; }
    .mobile-panel { width: min(var(--side-panel-width), 90vw); padding: 16px; box-sizing: border-box; }
    .mobile-panel a { padding: 0.75rem 12px; font-size: 1.12rem; }
  }

  /* Google Map のレスポンシブ対応 */
  .map-embed { width: 100%; max-width: 100%; text-align: center; }
  .map-embed .map-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%; /* 16:9 のアスペクト比 */
    height: 0;
    overflow: hidden;
  }
  .map-embed .map-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 0;
  }

  /* 小さい画面で高さを少し低くする（任意） */
  @media (max-width: 480px) {
    .map-embed .map-wrapper { padding-bottom: 66.66%; } /* 縦長に調整 */
  }

  /* 会社概要テーブル・沿革テーブルの共通スタイル */
  .overview-table,
  #history {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 40px;
    font-size: 1rem;
  }
  .overview-table { table-layout: fixed; }
  .overview-table th,
  #history th {
    text-align: left;
    padding: 8px;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
  }
  .overview-table th { white-space: nowrap; }
  .overview-table td,
  #history td {
    padding: 8px;
    border: 1px solid #ddd;
  }

  /* --- 追加: 沿革の年月をどの画面でも改行させない --- */
  /* 左列の幅を固定（必要に応じて調整） */
  #history colgroup col:first-child { width: 120px; min-width: 96px; max-width: 160px; }

  /* 年月セルは改行させず、幅を超える場合は省略表示にする */
  #history th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 年月が th ではなく td に入るケースがあれば同様に扱う */
  #history td:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 追加: 役員リストの表示を揃える */
  .officers { display: flex; flex-direction: column; gap: 8px; }
  .officer { display: flex; align-items: center; gap: 12px; }
  .officer .role { flex: 0 0 140px; /* 役職欄固定幅 */ font-weight: 600; color: #333; }
  .officer .name { flex: 1 1 auto; color: #333; white-space: normal; }
  /* 小さい画面で幅調整 */
  @media (max-width: 480px) {
    .officer .role { flex-basis: 110px; }

    /* スマホ版のみ括弧を改行させるためのクラス */
    .mobile-linebreak { display: inline; } 
    .map-embed .map-wrapper { padding-bottom: 66.66%; } /* 縦長に調整 */
    /* スマホでブロック表示（改行）させる */
    .mobile-linebreak { display: inline; }
    @media (max-width: 480px) {
      .mobile-linebreak { display: block; }
    }
  }

  /* 変更: 本文見出しをコンテンツ領域に揃えて左寄せにする */
  .section-title {
    width: 100%;              /* 親のコンテナ幅に合わせる（左揃えに整列） */
    max-width: 1000px;        /* main の max-width と同じにして揃える */
    margin: 32px 0;           /* 上下の余白を確保、左右は 0 にして左寄せ */
    text-align: left;         /* 左寄せ */
    font-size: 24px;
    color: var(--topic-blue);
    font-family: sans-serif;
    font-weight: 700;
    line-height: 1.2;
    padding-left: 0;          /* 余白が必要ならここで調整（現在は無し） */
    position: relative;
    padding-bottom: 0.3em;
    background: none;
  }
  .section-title::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
  }
  @media (max-width: 1199px) {
    .section-title { font-size: 20px; /* 幅は親に依存するので幅指定は削除 */ }
  }
  @media (max-width: 599px) {
    .section-title { font-size: 18px; margin: 20px 0; }
  }

  /* 追加: 見出しサイズを index の TOPIC(h3 24px) に揃える（上書き） */
  .section-title {
    font-size: 24px !important;
    line-height: 1.2;
  }

  /* 小画面でも 24px を維持（必要なら微調整） */
  @media (max-width: 599px) {
    .section-title { font-size: 24px !important; }
  }
  @media (max-width: 1199px) {
    .section-title { font-size: 24px !important; }
  }

  /* スマホのみで（非常勤）を改行して表示 */
  .mobile-linebreak { display: inline; }
  @media (max-width: 480px) {
    .mobile-linebreak { display: block; margin-top: 2px; }
  }

  /* スマホ版: 会社概要テーブルの項目欄をやや狭め、内容欄を広げる */
  @media (max-width: 480px) {
    /* overview-table の左列を縮小し右列を拡げる */
    .overview-table col:first-child { width: 24% !important; min-width: 70px; }
    .overview-table col:last-child  { width: 76% !important; }

    /* セル内余白と文字サイズをスマホ向けに微調整 */
    .overview-table th,
    .overview-table td {
      padding: 6px 6px;
      font-size: 0.88rem;
      line-height: 1.15;
      word-break: break-word;
    }
  }

  /* 追加: レスポンシブ最適化（会社概要ページ） */
  @media (max-width: 480px) {
    .site-header { padding: 0 0.75rem; }
    .site-header .logo { font-size: 1.3rem; }
    .mobile-panel { width: min(var(--side-panel-width), 90vw); padding: 12px; box-sizing: border-box; }
    .overview-table th, .overview-table td { padding: 6px 6px; font-size: 0.88rem; }
    .section-title { font-size: 18px; margin: 20px 0; }
    .map-embed .map-wrapper { padding-bottom: 66.66%; }
  }

  @media (min-width: 481px) and (max-width: 900px) {
    .mobile-panel { width: min(320px, 86vw); }
    .overview-table th, .overview-table td { font-size: 0.95rem; padding: 8px; }
  }

  /* ごあいさつセクション追加 */
  .greeting-section {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
  }
  .greeting-photo {
    flex: 0 0 260px;
    max-width: 260px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .greeting-message {
    flex: 1 1 0;
    font-size: 1.08rem;
    color: #222;
    line-height: 1.8;
    padding-top: 8px;
  }
  @media (max-width: 900px) {
    .greeting-section {
      gap: 20px;
    }
    .greeting-photo {
      max-width: 240px;
      flex-basis: 180px;
    }
  }
  @media (max-width: 600px) {
    .greeting-section {
      display: block;
      margin-bottom: 32px;
    }
    .greeting-photo {
      max-width: 100%;
      width: 100%;
      margin: 0 auto 18px auto;
      display: block;
    }
    .greeting-photo img {
      max-width: 320px;
      width: 100%;
      margin: 0 auto;
      display: block;
    }
    .greeting-message {
      padding-top: 0;
      font-size: 0.98rem;
    }
  }
  /* スマホのみでアクセス方法の鉄道・自動車道の後で改行 */
  .mobile-br { display: none; }
  @media (max-width: 480px) {
    .mobile-br { display: block; height: 0; }
  }

  .footer-link {
    white-space: nowrap;
    display: inline-block;
  }
  
  /* モバイル専用クイックリンク（事故・お問い合わせ） */
  .hero-quick-links {
    display: none;
    position: absolute;
    bottom: 20px;
    right: 12px;
    z-index: 10;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
  }
  @media (max-width: 900px) {
    .hero-quick-links { display: flex; }
  }
  .hero-quick-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.42);
    color: #fff;
    text-decoration: none;
    padding: 6px 14px 6px 10px;
    border-radius: 24px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.18s;
    white-space: nowrap;
  }
  .hero-quick-btn:hover,
  .hero-quick-btn:active {
    background: rgba(11,102,194,0.72);
  }
  .hero-quick-btn img {
    width: auto !important;
    height: 18px !important;
    object-fit: contain !important;
    flex-shrink: 0;
  }
  .hero-quick-btn svg {
    flex-shrink: 0;
  }
  
  /* hero文字レスポンシブ */
  .hero h1 { font-size: clamp(1.2rem, 5.5vw, 2rem) !important; line-height: 1.25 !important; }
  .hero p  { font-size: clamp(0.8rem, 3.2vw, 1rem) !important; line-height: 1.7; }
  
  /* リンクデフォルトスタイルリセット */
  a { text-decoration: none; transition: opacity 0.18s; }
  a:hover { text-decoration: none; opacity: 0.72; }

      .greeting-section {
        display: flex;
        align-items: flex-start;
        gap: 40px;
        margin-bottom: 40px;
      }
      .greeting-photo {
        flex: 0 0 260px;
        max-width: 260px;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
      }
      .greeting-message {
        flex: 1 1 0;
        font-size: 1.08rem;
        color: #222;
        line-height: 1.8;
        padding-top: 8px;
      }
      @media (max-width: 900px) {
        .greeting-section {
          gap: 20px;
        }
        .greeting-photo {
          max-width: 240px;
          flex-basis: 180px;
        }
      }
      @media (max-width: 600px) {
        .greeting-section {
          display: block;
          margin-bottom: 32px;
        }
        .greeting-photo {
          max-width: 100%;
          width: 100%;
          margin: 0 auto 18px auto;
          display: block;
        }
        .greeting-photo img {
          max-width: 320px;
          width: 100%;
          margin: 0 auto;
          display: block;
        }
        .greeting-message {
          padding-top: 0;
          font-size: 0.98rem;
        }
      }
  .hero-quick-btn svg {
    flex-shrink: 0;
  }
  
  /* hero文字レスポンシブ */
  .hero h1 { font-size: clamp(1.2rem, 5.5vw, 2rem) !important; line-height: 1.25 !important; }
  .hero p  { font-size: clamp(0.8rem, 3.2vw, 1rem) !important; line-height: 1.7; }
  
  /* リンクデフォルトスタイルリセット */
  a { text-decoration: none; transition: opacity 0.18s; }
  a:hover { text-decoration: none; opacity: 0.72; }

  .hero-quick-btn svg {
    flex-shrink: 0;
  }
  
  /* hero文字レスポンシブ */
  .hero h1 { font-size: clamp(1.2rem, 5.5vw, 2rem) !important; line-height: 1.25 !important; }
  .hero p  { font-size: clamp(0.8rem, 3.2vw, 1rem) !important; line-height: 1.7; }
  
  /* リンクデフォルトスタイルリセット */
  a { text-decoration: none; transition: opacity 0.18s; }
  a:hover { text-decoration: none; opacity: 0.72; }

  .map-btn{font-size:0.85em;color:#1976d2;text-decoration:none;border:1px solid #1976d2;border-radius:12px;padding:1px 9px;display:inline-block;transition:background .18s,color .18s;}
  .map-btn:hover{background:#1976d2;color:#fff;}
  .hero-quick-btn svg {
    flex-shrink: 0;
  }
  
  /* hero文字レスポンシブ */
  .hero h1 { font-size: clamp(1.2rem, 5.5vw, 2rem) !important; line-height: 1.25 !important; }
  .hero p  { font-size: clamp(0.8rem, 3.2vw, 1rem) !important; line-height: 1.7; }
  
  /* リンクデフォルトスタイルリセット */
  a { text-decoration: none; transition: opacity 0.18s; }
  a:hover { text-decoration: none; opacity: 0.72; }


/* 大型モニターではヘッダーリンクを拡大 */
@media (min-width: 1200px) {
  .site-header nav a { font-size: 1rem; }
}
@media (min-width: 1600px) {
  .site-header nav a { font-size: 1.1rem; }
}
