/* 共通変数＠スマホ設定，縦横表示の切替をシームレスに */
:root {
/*    --hero-image-height: 400px; */
/*    --hero-text-h2-font-size: 36px; */
/*    --hero-text-p-font-size: 30px; */
    --logo-color: #ea5b2a;
    --hero-image-height: 40vw;
    --hero-text-h2-font-size: 4vw;
    --hero-text-p-font-size: 3vw;
    --header-flex-direction: column;
    --nav-ul-gap: 10px;
    --nav-ul-flex-wrap: wrap;
    --nav-li-width: 35%;
    --h2-font-size: 7vw;
    --section-id-scroll-margin-top: 50vw;
    --example-group-max-height: 600px;
    --group-icon-max-width: 320px;
    --group-icon-margin-right: 0px;
    --group-icon-margin-bottom: 8px;
    --group-icon-background-position: center;

}

/* 横長モニタ */
@media screen and (min-width: 800px) {
    :root {
/*        --hero-image-height: 600px; */
/*        --hero-text-h2-font-size: 48px; */
/*        --hero-text-p-font-size: 42px; */
        --logo-color: #000000;
        --header-flex-direction: row;
        --nav-ul-gap: 20px;
        --nav-ul-flex-wrap: nowrap;
        --nav-li-width: auto;
        --h2-font-size: 32px;
        --section-id-scroll-margin-top: 4vw;
        --example-group-max-height: 180px;
        --group-icon-max-width: 200px;
        --group-icon-margin-right: 15px;
        --group-icon-margin-bottom: 0px;
        --group-icon-background-position: top;
    }
}

/* 基本的なスタイルリセットとフォント設定 */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダーのスタイル */
.header {
    background-color: #fff;
    border-bottom: 2px solid #ddd;
    position: sticky; /* スクロールしてもヘッダーを固定 */
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    flex-direction: var(--header-flex-direction);
}

.logo {
    margin: 0;
    font-size: 24px;
/*    color: #007bff; */
    color: var(--logo-color);
    /* --- 追加 --- */
    display: flex; /* ロゴ画像とテキストを横並びにする */
    align-items: center; /* 垂直方向の中央揃え */
    gap: 10px; /* ロゴとテキストの間隔を設定 */
    /* ------------ */
}

.logo-link {
    color: var(--logo-color);
    text-decoration: none;
}

.logo-link:visited {
    color: var(--logo-color);
    text-decoration: none;
}

.logo-link:active {
    color: var(--logo-color);
    text-decoration: none;
}

.logo-link:hover {
    color: var(--logo-color);
    text-decoration: none;
}

/* --- 新規追加 --- */
.logo-image {
    height: 30px; /* ロゴ画像の高さを設定 (h1のフォントサイズに合わせて調整) */
    width: auto; /* 幅はアスペクト比を維持して自動調整 */
    vertical-align: middle; /* テキストと高さを合わせる (flexを使っているため冗長だが念のため) */
}
/* -------------- */

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
/*    gap: 20px; */
    gap: var(--nav-ul-gap);
/*    flex-direction: var(--header-flex-direction); */
    flex-wrap: var(--nav-ul-flex-wrap);
}

.nav li {
    width: var(--nav-li-width);
    margin-left: 0;	/* 8% */
    margin-right: 0;   /* 5% */
}

.nav a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
    transition: color 0.3s;
}

.nav a:hover {
    color: #007bff;
}

/* ここから追加：ヒーローイメージのスタイル */
.hero-image {
    position: relative; /* 子要素の配置基準に */
    width: 100%;
/*    height: 600px; */ /* 画像の高さ。必要に応じて調整してください */
    height: var(--hero-image-height);
    overflow: hidden; /* 画像がはみ出さないように */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff; /* テキストの色 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* テキストの影 */
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像がコンテナに合わせてトリミングされるように */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* テキストより奥に配置 */
}

.hero-text {
    position: relative; /* 画像より手前に配置 */
    z-index: 2;
    text-align: center;
}

.hero-text h2 {
/*    font-size: 36px; */ /* テキストのフォントサイズ */
    font-size: var(--hero-text-h2-font-size); /* テキストのフォントサイズ */
    margin-bottom: 10px;
    border-bottom: none; /* 下線を削除 */
}

.hero-text p {
/*    font-size: 24px; */
    font-size: var(--hero-text-p-font-size);
}
/* ここまで追加 */


/* --- 新規追加 --- */
/* 会社概要の表のスタイル */
.company-table {
    width: 100%; /* 親要素の幅いっぱいに広げる */
    border-collapse: collapse; /* セルの境界線を重ねて表示 */
    margin-top: 30px; /* 上部にスペースを追加 */
}

.company-table th,
.company-table td {
    border: 1px solid #ddd; /* セルの境界線 */
    padding: 12px; /* セル内の余白 */
    text-align: left; /* テキストを左寄せ */
}

.company-table th {
    background-color: #f2f2f2; /* ヘッダーの背景色 */
    font-weight: bold;
    width: 30%; /* 項目列の幅を調整 */
}
/* -------------- */
/* ▼ 新規追加・修正 ▼ */

/* 1列目（項目名）の装飾 */
.company-table td:first-child {
    background-color: #f9f9f9; /* わずかに薄い背景色 */
    font-weight: bold; /* テキストを太字に */
    width: 30%; /* 幅を固定して見やすく */
    color: #555; /* 色を少し濃く */
}

/* 2列目（詳細）の装飾 */
.company-table td:nth-child(2) {
    width: 70%;
    /* 背景色を白に戻す */
    background-color: #fff; 
    font-weight: normal; 
}
/* ▲ 新規追加・修正 ▲ */


/* ▼ ここから「沿革」の表のスタイルを追加 ▼ */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
}

/* セル共通のスタイル */
.history-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

/* 1列目（年月）のスタイル */
.history-table td:first-child {
    background-color: #f9f9f9;
    font-weight: bold;
    width: 20%; /* 年月なので幅を狭く調整 */
    color: #555;
}

/* 2列目（出来事）のスタイル */
.history-table td:nth-child(2) {
    width: 80%;
    background-color: #fff;
    font-weight: normal;
}
/* ▲ ここまで「沿革」の表のスタイルを追加 ▲ */


/* メインコンテンツのスタイル */
.main {
    padding: 20px 0;
}

.section {
/*    padding: 60px 0; */
    padding: 20px 0;
    background-color: #fff;
    margin-bottom: 20px;
}

.section[id] {
    scroll-margin-top: var(--section-id-scroll-margin-top);
}

.section:nth-child(even) {
    background-color: #e9e9e9;
}

h2 {
    text-align: center;
/*    margin-bottom: 40px; */
    margin-bottom: 10px;
/*    font-size: 32px; */
    font-size: var(--h2-font-size);
    border-bottom: 2px solid #007bff;
    display: inline-block;
    padding-bottom: 5px;
}

h3 {
    text-align: left;
/*    margin-bottom: 40px; */
    font-size: 24px;
	margin-top: 12px;
	margin-bottom: 12px;
/*    border-bottom: 2px solid #007bff; */
/*    display: inline-block; */
/*    padding-bottom: 5px; */
}

h4 {
/*    text-align: center; */
    margin-bottom: 0px;
    font-size: 24px;
/*    border-bottom: 2px solid #007bff; */
/*    display: inline-block; */
/*    padding-bottom: 5px; */
}

/* サービスセクションのスタイル */
.service-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.service-item {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-basis: 75%;
    text-align: center;
}

/* 事業セクションのスタイル */
.business-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.business-item {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-basis: 75%;
    text-align: left;
}


/* --------------------------------------
 * 1. ラッパーにFlexboxを適用し、画像とリストを横並びにする
 * -------------------------------------- */
.example-group {
    display: flex;
    flex-direction: var(--header-flex-direction);
    /* 画像とリストの先頭を垂直方向の上端で揃える */
    align-items: flex-start; 
    margin-top: 10px;
    max-height: var(--example-group-max-height);
}

.example-port {
    /* 縦長画像に設定 */
    max-height: calc(var(--example-group-max-height) + 100px);
}

/* --------------------------------------
 * 2. アイコン（グループ画像）の設定
 * -------------------------------------- */
.group-icon {
    /* アイコンのサイズを固定し、リストが長くなっても縮まないようにする */
/*    width: 24px; */
/*    min-width: 24px; */
/*    height: 24px; */
/*    margin-right: 15px; */ /* アイコンとリスト本文との間のスペース */

	width: 100%;
    max-width: var(--group-icon-max-width); 
    height: 0;
    max-height: 320px;
    padding-top: 75%; /* 画像横縦比＝4:3, 横長を前提 */
    align-self: flex-start;
    margin-right: var(--group-icon-margin-right); /* アイコンとリスト本文との間のスペース */
    margin-bottom: var(--group-icon-margin-bottom);
    
    /* ★ここに背景画像としてアイコンのパスを指定★ */
/*    background-size: contain; */
    background-size: 100% auto;
    background-position: var(--group-icon-background-position);
    background-repeat: no-repeat;
    
    /* アイコンがリストの上端（一行目）と一致するように微調整が必要なら
       heightやmargin-topで調整してください */
}

.icon-fa {
    background-image: url('sample_fa.jpg'); /* 用意する画像は横長かつ横200pxとする */
}

.icon-roke {
    background-image: url('sample_roke.jpg');
    height: 320px;  /* 縦長画像に設定 */
}

.icon-jig {
    background-image: url('sample_jig.jpg');
}

/* --------------------------------------
 * 3. リスト（ul）の設定
 * -------------------------------------- */
.example-list {
    /* リストがコンテナの残りの全幅を使うようにする */
    margin: 0; /* デフォルトマージンのリセット */
    padding-left: 0;
    list-style: none;
    flex-grow: 1;
}

.example-list li {
    margin-bottom: 10px; /* 各リストアイテム間の縦方向のスペース */
}

.example-list li:last-child {
    margin-bottom: 0px;
}

/* コンタクトセクションのスタイル */
.contact-button {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.contact-button:hover {
    background-color: #0056b3;
}

/* フッターのスタイル */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
}
