:root {
    --header-height: 70px; /* ヘッダーの高さ */
    --bg-color: #f9f5f1; /* 背景色 */
    --text-color: #3D2B1F; /* 文字色 */
    --header-footer-bg: #000000; /* ヘッダーとフッターの背景色 */
    --accent-color: #8F5132; /* アクセントカラー */
    --header-link-color: #f9f5f1; /* ヘッダーのリンク色 */
    --footer-text-color: #f9f5f1; /* フッターの文字色 */
}

body {
    font-family: 'Noto Sans JP', sans-serif; /* 全体のフォント */
    background-color: var(--bg-color); /* 背景色 */
    color: var(--text-color); /* 文字色 */
    margin: 0; /* ページの余白をなくす */
}

header {
    background-color: var(--header-footer-bg); /* ヘッダーの背景色 */
    position: fixed; /* ヘッダーを画面上部に固定 */
    width: 100%;
    top: 0;
    z-index: 100; /* 他の要素より前に表示 */
    height: var(--header-height);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* ロゴとナビゲーションを左右に配置 */
    padding: 0 40px;
    box-sizing: border-box;
}

.logo img {
    display: block;
    height: 40px; /* ロゴの高さ */
}

nav ul {
    list-style: none; /* リストのスタイルをなくす */
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 30px; /* リンク間のスペース */
}

nav ul li a {
    color: var(--header-link-color); /* リンクの文字色 */
    text-decoration: none; /* 下線をなくす */
    font-weight: 500;
}

nav ul li a:hover {
    color: #e0e0e0; /* ホバー時のリンク色 */
}

.container {
    box-sizing: border-box;
}

section {
    scroll-margin-top: var(--header-height); /* スクロール時にヘッダーの高さ分の余白を確保 */
    padding: 80px 0; /* セクション上下の余白 */
}

/* ヒーローセクション：画像を横幅いっぱいに表示 */
.hero {
    position: relative;
    background-image: url('images/retro-office.jpg'); /* 背景画像 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 80vh; /* ビューポート全体の高さ */
}


.hero-content {
    position: absolute;
    top: 50%; /* 垂直方向に中央 */
    left: 50%; /* 水平方向に中央 */
    transform: translate(-50%, -50%); /* 中央揃え */
    text-align: center; /* テキストの中央揃え */
    opacity: 0; /* 初期状態は非表示 */
    animation: fadeIn 2s ease-in-out; /* フェードインアニメーションを適用 */
    animation-fill-mode: forwards; /* アニメーション後に状態を保持 */
}


.hero-content h1 {
    color: var(--bg-color) !important; /* 文字色 */
    font-size: 3em;
    margin: 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* 黒い影を追加 */
}

.hero-content p {
    color: var(--bg-color) !important; /* 文字色 */
    font-size: 1.5em;
    margin: 20px 0 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* 黒い影を追加 */
}


.black-bar {
    background-color: #000000; /* 黒いバーの背景色 */
    height: 80px;
    width: 100%;
}

/* フェードインのアニメーション定義 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px); /* 下からスライドしながらフェードイン */
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}


/* フェードインアニメーションの適用 */
.hero-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s ease-in-out, transform 2s ease-in-out;
}



/* 全体の見出しのスタイル */
h1, h2, h3, h4 {
    color: var(--text-color); /* 文字色 */
    font-weight: bold;
    margin: 20px 0;
    padding: 0px;
}

/* 固定されるセクションタイトルのスタイル */
.sticky-title {
    position: sticky;
    top: var(--header-height); /* ヘッダーの下に配置 */
    background-color: var(--bg-color);
    padding: 10px 0; /* 上下に余白を追加 */
    width: 100%; /* 横幅を画面いっぱいに設定 */
    left: 0;
    margin: 0; /* 余分な隙間をなくす */
    text-align: center;
    z-index: 99;
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.2); /* 下部にのみ影を追加 */
}

/* セクションタイトルの共通スタイル */
.section-title {
    color: var(--text-color); /* 文字色 */
    font-weight: bold;
    text-align: center; /* 中央揃え */
    margin: 20px 0;
    padding: 10px 0;
    position: sticky;
    top: var(--header-height); /* ヘッダーの高さに応じて位置を調整 */
    background-color: var(--bg-color); /* 背景色 */
    z-index: 99; /* 他の要素より前に表示 */
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.2); /* 下部に影を追加 */
}


/* 全体の段落とリスト項目のスタイル */
p, li {
    line-height: 1.6; /* 行間を広げて読みやすく */
    color: var(--text-color);
    margin: 20px 0;
}

/* 会社概要セクションのスタイル */
.about-company {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 100px;
    gap: 50px;
    transition: transform 0.3s ease-in-out; /* マウスオーバー時のアニメーション */
}

/* Foresightについてセクションのカスタマイズ */
#about-foresight {
    display: flex;
    align-items: center;
    justify-content: center; /* コンテンツを左右に配置 */
    margin-bottom: 50px;
}

#about-foresight .section-image {
    width: 30%; /* 画像を全体幅の30%に設定 */
    height: auto;
    padding-left: 8%;
    margin-right: 5%; /* テキストとの間に余白を追加 */
    border-radius: 5px; /* 角を少し丸める */
}

#about-foresight .section-text {
    flex: 1; /* テキストが残りの幅を占める */
    line-height: 1.6; /* 行間を調整 */
    text-align: left; /* 左揃えに設定 */
    padding-left: 0px; /* テキストと画像の間に余白を設定 */
}

/* 経営者略歴セクション全体を右に移動 */
.about-history-content {
    display: flex;
    justify-content: space-evenly; /* 左右に配置 */
    align-items: flex-start;
    gap: 50px; /* 左右のスペースを調整 */
    flex-wrap: wrap; /* レスポンシブ対応で折り返し可能に */
    margin-left: 30%; /* セクション全体を右に移動 */
}

/* 本文のスタイル */
.about-history-text {
    flex: 2; /* 左側の幅を多めに確保 */
    max-width: 60%; /* 本文の最大幅を設定 */
    text-align: left;
}

.about-history-text ul {
    list-style: none; /* リストのスタイルを削除（必要なら） */
    padding: 0; /* 内側の余白をリセット */
    margin: 0 0 20px 20px; /* 全体の左マージンを追加 */
}

.about-history-text ul li {
    text-indent: -5.2em; /* ぶら下げの設定 */
    padding-left: 5.2em; /* 行の開始位置を揃える */
    margin-bottom: 10px; /* 各項目の間隔を調整 */
}


/* 右側の画像のスタイル */
.about-history-images {
    flex: 1; /* 右側の幅を少なめに設定 */
    flex-direction: column; /* 縦方向に配置 */
    align-items: center; /* 画像を中央揃え */
    gap: 20px; /* 上下画像の間隔 */
    padding-top: 70px;
}

.about-history-image,
.designation-image {
    width: 100%; /* 右側の画像を親要素の幅に合わせる */
    max-width: 300px; /* 画像の最大幅を設定 */
    height: auto;
    border-radius: 5px; /* 角を少し丸める */
}

/* 会社概要の画像をホバー時に拡大し、テキストを右に移動 */
.about-company-content:hover .section-image {
    transform: scale(1.1);
}

.about-company-content:hover .section-text {
    transform: translateX(15px); /* 画像拡大に伴いテキストも右に移動 */
}

/* サービス紹介セクション */
.service-item {
    display: flex;
    align-items: flex-start;
    margin-top: 50px;
    margin-bottom: 40px;
    padding: 0px 10%; /* 左右に余白を追加 */
    transition: transform 0.3s ease-in-out;
}

.service-image {
    width: 15%; /* 画像の幅を全体の25%に設定 */
    height: auto;
    margin-right: 20px;
    border-radius: 5px;
    transition: transform 0.3s ease-in-out;
}

.service-text {
    flex: 1;
    transition: transform 0.3s ease-in-out;
}

/* ホバー時の拡大 */
.service-item:hover .service-image {
    transform: scale(1.3);
}

.service-item:hover .service-text {
    transform: translateX(30px); /* 画像拡大に伴いテキストも右に移動 */
}

.inline-icon {
    width: 24px;
    height: auto;
    vertical-align: middle;
    margin-right: 10px;
}


/* お問い合わせフォーム */
.contact form {
    max-width: 600px;
    margin: 0 auto; /* 中央に配置 */
}

.contact label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.contact input,
.contact select,
.contact textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #d2c4b2;
    border-radius: 5px;
    background-color: #fff;
    color: var(--text-color);
}

.contact input:focus,
.contact select:focus,
.contact textarea:focus {
    outline: 2px solid var(--accent-color); /* フォーカス時のアウトライン */
}

button {
    background-color: var(--accent-color);
    color: #fff;
    padding: 15px;
    border: none;
    width: 100%;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #7a452b; /* ボタンのホバー時の色 */
}

#form-message {
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
    color: green;
}

footer {
    background-color: var(--header-footer-bg); /* フッター背景色 */
    color: var(--footer-text-color); /* テキスト色を背景と同じに設定 */
    padding: 20px;
    text-align: center;
    font-size: 14px; /* フォントサイズを小さくする（オプション） */
}


@media screen and (max-width: 768px) {
    header .container {
        padding: 0 20px;
    }

    nav ul {
        flex-direction: column;
        background-color: var(--header-footer-bg);
        position: absolute;
        top: calc(var(--header-height) + 15px);
        left: 0;
        right: 0;
        display: none; /* モバイルメニューはデフォルトで非表示 */
        padding: 20px 0;
        margin: 0;
    }

    nav ul li {
        margin: 15px 0;
        text-align: center;
    }

    nav ul li a {
        font-size: 18px;
    }

    header .container {
        flex-wrap: wrap;
    }

    .service-item {
        flex-direction: column;
    }

    .service-image {
        width: 100%; /* モバイル表示では画像を全幅に */
        margin-right: 0;
        margin-bottom: 20px;
    }

    #about .section-image {
        width: 100%; /* モバイル表示では画像を全幅に */
    }
}
