/* --- 基本設定 --- */
body {
    font-family: 'Noto Sans JP', sans-serif;
    color: #4A4A4A; /* ダークグレー */
    background-color: #fdfaf6; /* オフホワイト */
    line-height: 1.8;
    margin: 0;
}
.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}
h1, h2, h3 { font-family: 'M PLUS Rounded 1c', sans-serif; }

/* --- ヘッダー --- */
header {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky; /* スクロール追従 */
    top: 0;
    z-index: 1000;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
header .logo img { max-height: 70px; } /* ロゴサイズ調整 */
header nav ul { list-style: none; display: flex; margin: 0; padding: 0; }
header nav ul li a {
    padding: 10px 15px;
    text-decoration: none;
    color: #4A4A4A;
    font-weight: bold;
    transition: color 0.3s ease;
}
header nav ul li a:hover, header nav ul li a.active { color: #C06C58; /* オレンジブラウン */ }
.mobile-menu-toggle { display: none; /* スマホ表示で有効化 */ }


/* --- ヒーローカルーセル --- */
#hero-carousel {
    position: relative;
    height: 70vh; /* ビューポートの高さの70% */
    overflow: hidden;
    background-color: #ddd; /* 画像読み込み中の背景 */
}
#hero-carousel .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
#hero-carousel .slide.active { opacity: 1; }
#hero-carousel .slide-content { color: white; }
#hero-carousel .slide-content h2 { font-size: 2.8rem; margin-bottom: 15px; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
#hero-carousel .slide-content p { font-size: 1.4rem; text-shadow: 0 0 8px rgba(0,0,0,0.5); }
.carousel-prev, .carousel-next { /* スタイル省略。別途JavaScriptと合わせて実装 */ }

/* --- セクション共通 --- */
main section { padding: 60px 0; }
.section-title { text-align: center; font-size: 2.2rem; color: #C06C58; margin-bottom: 40px; }
.section-title-jp { text-align: center; font-size: 2.5rem; color: #E27D60; margin-bottom: 20px; } /* テラコッタ */
.lead { font-size: 1.1rem; text-align: center; margin-bottom: 30px; }
.bg-light { background-color: #fff; } /* ベースがオフホワイトなので白で区別 */

/* --- 理念セクション --- */
#philosophy { background-color: #fdfaf6; } /* ベースカラー */
#philosophy .lead { line-height: 2; }

/* --- ボタンとテキスト中央揃え --- */
.text-center {
    text-align: center;
}
.btn {
    display: inline-block;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
    border: none;
    margin-top: 20px;
}
.btn-primary { background-color: #E27D60; color: white; }
.btn-primary:hover { background-color: #d16a4f; }
.btn-secondary { background-color: #85A87D; color: white; }
.btn-secondary:hover { background-color: #74966d; }

/* --- サービス --- */
.service-grid {
    display: grid;
    grid-template-columns: 1fr; /* ★サービス項目が1つのため、1列に */
    gap: 30px;
}

.service-item {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    text-align: center;
}

.service-icon-wrapper {
    width: 100%;
    height: 250px; /* 施工事例の写真と同じ高さを指定 */
    overflow: hidden;
    margin: 0 auto 20px auto; /* 水平中央寄せ、下に20pxの余白 */
    border-radius: 5px;
    background-color: #f0f0f0; /* 画像読み込み中の背景 */
    max-width: 450px; /* ★画像の最大幅を調整 (例: 450px) これで横に広がりすぎるのを防ぐ */
}

.service-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-item h3 {
    font-size: 1.5rem;
    color: #C06C58;
    margin-bottom: 10px;
}

/* --- 施工事例プレビュー --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* PCでは複数列 */
    gap: 20px;
}

.portfolio-item {
    height: 250px;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #f0f0f0;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- フッター --- */
footer { background-color: #4A4A4A; color: #f0f0f0; padding: 40px 0 20px; margin-top: 40px; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.footer-logo { max-height: 70px; margin-bottom: 1px; }
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav ul li a { color: #f0f0f0; text-decoration: none; padding: 5px 0; display: block; }
.footer-nav ul li a:hover { color: #E27D60; }
.copyright { text-align: center; font-size: 0.9rem; border-top: 1px solid #666; padding-top: 20px; margin-top: 20px;}

/* --- 下層ページ共通 --- */
.page-title-section {
    padding: 80px 0;
    text-align: center;
    background-size: cover;
    background-position: center;
    color: white;
    position: relative;
}

.page-title-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.page-title-section .container {
    position: relative;
    z-index: 2;
}

.page-title-section h1 {
    font-size: 2.8rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

main section:not(#hero-carousel):not(.page-title-section) .container {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* --- 事業内容ページ (#business-process) --- */
#business-process .section-subtitle {
    text-align: center;
    font-size: 1.8rem; /* 少し小さめに */
    color: #4A4A4A; /* ダークグレー */
    margin-bottom: 15px;
}

#business-process .lead-text { /* サブタイトルの下の補足テキスト */
    font-size: 1rem;
    color: #555;
    margin-bottom: 50px;
}

.process-steps {
    max-width: 800px; /* 全体の幅を制限して中央に */
    margin: 0 auto;
}

.step-item {
    display: flex;
    align-items: flex-start; /* 上揃え */
    margin-bottom: 50px;
    padding: 20px;
    background-color: #fff; /* 各ステップをカード風に */
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}

.step-number-icon {
    display: flex;
    flex-direction: column; /* 番号とアイコンを縦に */
    align-items: center;
    margin-right: 25px;
    flex-shrink: 0; /* 縮まないように */
    width: 100px; /* 固定幅 */
}

.step-number {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #E27D60; /* テラコッタ */
    margin-bottom: 10px;
    line-height: 1;
}

.step-icon {
    max-width: 80px; /* アイコンの最大幅 */
    height: auto;
}

.step-content h3 {
    font-size: 1.5rem;
    color: #C06C58; /* オレンジブラウン */
    margin-top: 0; /* 上の余白をリセット */
    margin-bottom: 15px;
}

.step-content p {
    line-height: 1.8;
    color: #555;
    margin: 0;
}

/* スマホ表示時の調整 */
@media (max-width: 768px) {
    .step-item {
        flex-direction: column; /* スマホでは縦積みに */
        align-items: center; /* 全体を中央揃えに */
        text-align: center; /* テキストも中央揃えに */
    }

    .step-number-icon {
        margin-right: 0;
        margin-bottom: 20px; /* アイコンとテキストの間の余白 */
        width: auto; /* 幅の制限を解除 */
    }
    .step-icon {
        max-width: 70px; /* スマホでは少し小さく */
    }
}


/* --- 施工事例ページ (#portfolio-gallery, #guest-voices) --- */
#portfolio-gallery .section-subtitle { /* "物件の施工事例一覧"など */
    font-size: 1.8rem;
    color: #4A4A4A;
    margin-bottom: 15px;
}

#portfolio-gallery .lead-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 50px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 列の最小幅と最大幅 */
    gap: 20px; /* グリッド間の余白 */
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden; /* 画像がはみ出ないように */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.gallery-item a { /* ライトボックス用のリンク */
    display: block;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 220px; /* ★高さを固定 (調整可能) */
    object-fit: cover; /* 画像の比率を保ちつつ、コンテナを覆う */
    display: block; /* 画像下の余白を防ぐ */
}

.gallery-caption {
    padding: 15px;
    font-size: 0.95rem;
    color: #333;
    text-align: center;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

/* ゲストの声セクション */
#guest-voices {
    padding-top: 40px; /* 上のセクションとの余白 */
}
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.voice-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.voice-item img { /* スクリーンショットの手書きメッセージ画像用 */
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #eee;
}
.voice-item p { /* テキスト化する場合 */
    font-size: 0.9rem;
    line-height: 1.7;
    color: #444;
    margin-top:10px;
}


/* レスポンシブ対応 (既存の @media ブロック内に追加) */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* スマホでは少し小さめ */
    }
    .gallery-item img {
        height: 180px; /* スマホでは高さを少し低く */
    }
    .voice-grid {
         grid-template-columns: 1fr; /* スマホでは1列 */
    }
}

/* ライトボックス用の基本的なスタイル (もしLightbox2などを使う場合、ライブラリのCSSが優先される) */
/* body.lb-disable-scrolling { overflow: hidden; } */
/* .lightboxOverlay { position: absolute; top: 0; left: 0; z-index: 9999; background-color: black; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); opacity: 0.8; display: none; } */
/* .lightbox { position: absolute; left: 0; width: 100%; z-index: 10000; text-align: center; line-height: 0; font-weight: normal; } */
/* ... (Lightbox2などのライブラリを使用する場合は、そのライブラリのCSSとJSを導入してください) */

/* --- 会社概要ページ (#company-info) --- */
.company-table {
    width: 100%;
    max-width: 800px; /* テーブルの最大幅 */
    margin: 0 auto; /* 中央揃え */
    border-collapse: collapse; /* ボーダーを重ねる */
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-radius: 8px;
    overflow: hidden; /* 角丸を有効にするため */
}

.company-table th,
.company-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e9e9e9;
    vertical-align: top; /* セル内のテキストを上揃え */
}

.company-table th {
    background-color: #f9f9f9; /* 見出しセルの背景色 */
    font-weight: bold;
    color: #333;
    width: 30%; /* 見出しセルの幅 */
    white-space: nowrap; /* 見出しが改行されないように */
}

.company-table td {
    color: #555;
    line-height: 1.7;
}

.company-table tr:last-child th,
.company-table tr:last-child td {
    border-bottom: none; /* 最後の行の下線を消す */
}

/* アクセスマップ (オプション) */
#access-map {
    padding-top: 40px;
}
#access-map .section-subtitle {
    font-size: 1.8rem;
    color: #4A4A4A;
    margin-bottom: 30px;
}
.map-responsive {
    overflow: hidden;
    padding-bottom: 56.25%; /* 16:9 のアスペクト比 */
    position: relative;
    height: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}


/* --- プライバシーポリシーページ (#privacy-policy-content) --- */
#privacy-policy-content .container {
    max-width: 800px; /* 本文の幅を少し狭めて読みやすく */
}

.policy-section {
    margin-bottom: 30px;
}

.policy-section h2 {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.policy-section h3 { /* もし小見出しを使う場合 */
    font-size: 1.3rem;
    color: #444;
    margin-top: 20px;
    margin-bottom: 10px;
}

.policy-section p,
.policy-section ul {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #555;
}

.policy-section ul {
    list-style: disc;
    padding-left: 25px;
}

.policy-section ul li {
    margin-bottom: 8px;
}

/* スマホ表示時のテーブル調整 (必要であれば) */
@media (max-width: 768px) {
    .company-table th,
    .company-table td {
        padding: 12px 15px;
    }
    .company-table th {
        width: 35%; /* スマホでは見出しセルの幅を少し広げるなど */
    }
     /* もしテーブルが横にはみ出す場合は、テーブル全体を横スクロール可能にするなどの対応も検討 */
    /*
    #company-info .container {
        overflow-x: auto;
    }
    */
}

/* ---------- 代表者挨拶ページ用スタイル（修正後） ---------- */

.message-section {
    padding: 60px 0;
}

/* 写真＋テキストを横並びにする */
.message-content {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/* 代表者写真のラッパー：幅を50%に固定 */
.message-photo-wrapper {
    flex: 0 0 50%;
}

/* 代表者写真：横幅いっぱいに */
.message-photo {
    width: 100%;
    height: auto;
    border-radius: 50%;     /* 丸型にしたい場合はそのまま */
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 挨拶文コンテナ：幅を50%に固定 */
.message-text {
    flex: 0 0 50%;
}

/* 挨拶文の見出し */
.message-text h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    font-weight: 700;
}

/* 段落間の余白 */
.message-text p {
    margin-bottom: 16px;
    line-height: 1.8;
    color: #333;
}

/* スマホなど小画面時は縦並びにする */
@media screen and (max-width: 768px) {
    .message-content {
        flex-direction: column;
        text-align: center;
    }
    .message-photo-wrapper,
    .message-text {
        flex: 0 0 auto;
        width: 100%;
    }
    .message-photo {
        margin: 0 auto 24px;
        width: 80%;  /* スマホ向けに少し余白を残す例 */
    }
}

/* --- 運営物件一覧ページ (#properties-list) --- */
#properties-list .section-subtitle {
    font-size: 1.8rem;
    color: #4A4A4A;
    margin-bottom: 30px; /* 少し詰める */
    text-align: center;
}

.property-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
    margin-bottom: 30px; /* 少し詰める */
    padding: 20px; /* 内側の余白 */
    /* display: flex; を一旦解除 */
    /* align-items: stretch; を一旦解除 */
    /* order プロパティも一旦解除 */
}

.property-image {
    width: 100%; /* 画像コンテナの幅を100%に */
    max-width: 400px; /* ★画像の最大幅を指定 (これでおおよその中央寄せとサイズ調整) */
    height: auto;     /* ★画像の高さは元の比率を保つ */
    margin: 0 auto 20px auto; /* ★画像コンテナを中央揃えにし、下に余白 */
    border-radius: 5px;
    overflow: hidden; /* 画像が角丸からはみ出ないように */
    background-color: #f0f0f0;
}

.property-image img {
    width: 100%;
    height: auto; /* ★画像の高さをautoにして比率を保つ */
    object-fit: contain; /* ★画像全体が表示されるように (coverだとトリミングされる) */
    display: block;
}

.property-details {
    text-align: center; /* テキストコンテンツを中央揃え */
    /* padding: 20px 0; */ /* 上下のパディングを調整 */
}

.property-details h3 {
    font-size: 1.6rem;
    color: #C06C58;
    margin-top: 0; /* service-itemのpaddingがあるので0でも良いかも */
    margin-bottom: 10px;
}

.property-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

.property-buttons .btn {
    margin: 5px; /* ボタン周りの余白 */
    padding: 10px 18px;
}


/* --- レスポンシブ対応 (ここに全てのスマホ用スタイルをまとめる) --- */
@media (max-width: 768px) {
    /* ヘッダーのモバイルメニュー */
    header .container {
        position: relative;
    }
    header nav {
        display: none !important;
        position: absolute;
        top: 100%; 
        left: 0;
        width: 100%;
        background-color: #fff; 
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        padding: 10px 0;
        z-index: 999; 
    }
    header nav.active { 
        display: block !important;
    }
    header nav ul {
        flex-direction: column; 
        align-items: center; 
    }
    header nav ul li {
        margin: 10px 0; 
    }
    .mobile-menu-toggle { 
        display: block; 
        background: none;
        border: none;
        font-size: 24px; 
        cursor: pointer;
        padding: 5px;
        color: #4A4A4A; 
    }

    /* ヒーローカルーセルのスマホ表示 */
    #hero-carousel .slide-content h2 { font-size: 2rem; }
    #hero-carousel .slide-content p { font-size: 1.1rem; }
    
    /* サービスと施工事例プレビューグリッドのスマホ表示 (1列に) */
    .service-grid, .portfolio-grid {
        grid-template-columns: 1fr; 
    }
    .service-icon-wrapper { /* サービス画像のラッパー */
        max-width: 100%;
        /* height: 200px; */ /* 必要なら高さを指定 */
    }
    .portfolio-item { /* 施工事例プレビューのアイテム */
        /* height: 200px; */ /* 必要なら高さを指定 */
    }
    .gallery-grid { /* 施工事例ページのギャラリー */
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .gallery-item img { /* 施工事例ページのギャラリー画像 */
        height: 180px;
    }
    .voice-grid { /* ゲストの声 */
         grid-template-columns: 1fr;
    }

    /* 事業内容ページのステップアイテム */
    .step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .step-number-icon {
        margin-right: 0;
        margin-bottom: 20px;
        width: auto;
    }
    .step-icon {
        max-width: 70px;
    }

    /* 会社概要ページのテーブル */
    .company-table th,
    .company-table td {
        padding: 12px 15px;
    }
    .company-table th {
        width: 35%;
    }
    /* もしテーブルが横にはみ出す場合は */
    /* #company-info .container { overflow-x: auto; } */

    /* ★運営物件一覧ページのスマホ表示 */
    .property-item {
        flex-direction: column; /* 画像とテキストを縦積みに */
    }
    /* スマホでは交互レイアウトの order 指定はリセット（またはそのままでも表示順はHTML依存になる） */
    .property-item:nth-child(even) .property-image,
    .property-item:nth-child(odd) .property-image {
        order: 0; 
    }
    .property-item:nth-child(even) .property-details,
    .property-item:nth-child(odd) .property-details {
        order: 0;
    }

    .property-image {
        width: 100%;
        height: 200px; /* スマホ時の画像高さを指定 (調整可能) */
        flex: none;    /* flexの割合指定を解除 */
        min-height: unset; /* min-heightを解除 */
    }
    .property-details {
        padding: 20px;
        text-align: center; /* スマホではテキストを中央揃えにする場合 */
    }
    .property-buttons { /* スマホでボタンを中央揃えにする場合 */
        text-align: center;
    }
    .property-buttons .btn {
        display: inline-block; /* ボタンをインラインブロックに戻す (横並びにする場合) */
        width: auto;          /* 幅をautoに戻す */
        margin-left: 5px;
        margin-right: 5px;
        margin-bottom: 10px; /* ボタン間の下マージン */
    }
    .property-buttons .btn:last-child {
        margin-bottom: 0;
    }
    /* もしスマホでもボタンを縦にフル幅で並べたい場合は以下を有効化
    .property-buttons .btn {
        display: block;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 10px;
    }
    */
}