@charset "UTF-8";

/* ==========================================
   1. ページ全体のコントロール（一番外側の親）
   ========================================== */
.TopPage {
    display: flex;
    flex-direction: column;   /* ページ全体を上から下へ縦並びにする */
    width: 100%;
}

/* ==========================================
   2. メメインビジュアル（枠がボタンに被らない設定）
   ========================================== */
.MainVisual {
    width: calc(100% - 8.6vw);
    /* ★ 下の余白を 40px から 15px に縮めて距離を接近させます */
    margin: 0 0 15px 0; 
    border: 2px solid #333333;
    padding: 20px;
    background-color: #ffffff;
    box-sizing: border-box;
}

/* タイトル枠：文字に合わせた長さで中央に置く */
.TitleBox {
    display: table;
    margin: 0 auto 20px auto;
    background-color: #00e667;
    padding: 15px 40px; /* 余白を少し広げてゆとりを持たせました */
    border: 3px solid #333333; /* 枠線も少し太くしてバランスを調整 */
    max-width: 90%; /* スマホ画面で横幅からはみ出るのを防ぎます */
    box-sizing: border-box;
}

.MainTitle {
    font-size: 50px; /* 35pxから50pxに大きく変更 */
    font-weight: bold;
    text-align: center;
    margin: 0;
    color: #ffffff;
    line-height: 1.2; /* 文字が大きくなった際の行間を最適化 */
    /* 文字のサイズに合わせて、黒い縁取りをより太くクッキリと修正 */
    text-shadow: 
        -3px -3px 0 #333333,  3px -3px 0 #333333,
        -3px  3px 0 #333333,  3px  3px 0 #333333,
        -3px  0 0 #333333,  3px  0 0 #333333,
         0 -3px 0 #333333,  0  3px 0 #333333;
}

/* スマホ用の設定（画面幅が600px以下の場合、文字を少し縮小） */
@media screen and (max-width: 600px) {
    .MainTitle {
        font-size: 32px; /* スマホで1行に収まりやすいサイズ */
    }
    .TitleBox {
        padding: 10px 20px;
    }
}

.Pictures {
    display: flex;
    gap: 15px;
    width: 100%;
}

.Pictures img {
    /* 枠線(2px×2)と隙間(15px)を考慮して計算 */
    width: calc(50% - 8px); 
    height: auto;
    border: 2px solid #333333;
    box-sizing: border-box;
}

/* ==========================================
   3. 会社案内 & 経営理念（PC時は横並び）
   ========================================== */
.CompanyGuide {
    display: flex;
    flex-direction: row;      /* PC時は横に並べる */
    gap: 30px;                /* 箱と箱の間の隙間 */
    width: auto;              /* 中身の合計幅に合わせる */
    margin-left: 0;
    margin-right: auto;
    box-sizing: border-box;
    padding: 20px;
}

/* 両方の箱に同じ装飾と「画面幅の40%」を適用 */
.CompanyProfile, .ManagementPhilosophy {
    width: 40vw;              
    min-height: 500px;
    box-sizing: border-box;
    background-color: #ffffff;
    padding: 20px;
    color: #333333;
}

/* ==========================================
   4. 文字・見出しの共通スタイル
   ========================================== */

/* 共通タイトルの装飾（緑背景＋黒縁） */
.CompanyProfile > .SubTitle:first-child,
.ManagementPhilosophy > .SubTitle:first-child {
    font-size: 26px;
    margin: 10px auto 25px auto;
    width: 90%;
    padding: 8px 0;
    text-align: center; 
    background-color: #00e667;
    border: 2px solid #333333;
    color: #ffffff;
    text-shadow: -1.5px -1.5px 0 #333, 1.5px -1.5px 0 #333, -1.5px 1.5px 0 #333, 1.5px 1.5px 0 #333;
}

/* グレーの見出し枠（役員氏名、未来像など） */
.CompanyProfile .SubTitle:not(:first-child),
.ManagementPhilosophy .SubTitle:not(:first-child) {
    border: 2px solid #333333;
    padding: 6px 12px;
    margin-top: 20px;
    background-color: #f5f5f5;
    font-size: 16px;
    font-weight: bold;
}

/* 内容の枠線（中身を繋げる） */
.CompanyProfile .SubTitle:not(:first-child) ~ h3,
.CompanyProfile .SubTitle:not(:first-child) ~ p,
.ManagementPhilosophy .SubTitle:not(:first-child) ~ p {
    border: 2px solid #333333;
    border-top: none;
    padding: 8px 15px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
}

/* ★役職名（h3）：少し右にずらして控えめに配置 */
h3 {
    font-size: 17px !important;
    color: #888888;
    font-weight: normal;
    margin-left: 15px;
    margin-bottom: -2px;
    padding: 5px 0 0 0 !important;
}

/* ★氏名・本文（p）：左端からハッキリと配置 */
p {
    font-size: 16px;
    font-weight: bold;
    color: #333333;
    margin-left: 0;
    padding: 0 0 8px 0 !important;
}

/* 経営理念など、h3がない場所のテキスト調整 */
.ManagementPhilosophy p {
    padding: 10px 0 !important;
    font-weight: normal;
    font-size: 15px;
}

/* ==========================================
   5. リンク移動ボタン（画面右端に固定）
   ========================================== */
.linkidou {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    width: 6.6vw;       
    min-width: 60px;
    height: auto;
    z-index: 9999;
}

.link {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 各ボタン共通設定 */
.p4, .p5, .p6 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 16vw; 
    min-height: 120px;
    font-weight: bold;
    color: #fff;
    border: 1px solid #094;
    box-shadow: -3px 3px #007032;
    transition: 0.5s ease-in-out;
    background-color: #00e667;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

/* 特別なレイアウト指定 */
.p4 { flex-direction: column; }
.p5, .p6 { flex-direction: row; }

/* 回転の設定 */
.kaiten {
    transform: rotate(90deg);
    white-space: nowrap;
}

.char {
    transform: rotate(270deg);
    display: inline-block;
    text-decoration: underline;
}

/* ホバー設定 */
.p4:hover, .p5:hover, .p6:hover {
    box-shadow: none;
    color: #00e667;
    background-color: #094;
    transform: translateX(-5px); 
}

/* ==========================================
   6. マップコンテナ（Googleマップエリア）
   ========================================== */
.MapContainer {
    display: flex;
    flex-direction: column !important; 
    gap: 50px;             
    padding: 0 20px;       
    margin: 30px auto;     
}

.factory-set {
    width: 100%;
    display: flex;
    flex-direction: column !important; 
    gap: 15px;             
}

.factory-set iframe {
    width: 75% !important;         
    aspect-ratio: 1 / 1 !important; 
    height: auto !important;        
    margin: 0 auto 0 0 !important; 
    border-radius: 8px;
}

/* 住所テキストの装飾 */
.factory-item h3 {
    margin: 0 0 6px 0;
    font-size: 22px;
    color: #333;
}
.factory-item p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.5;
}
.common-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ccc;
}

/* ==========================================
   7. 📱 スマホ版（796px以下）：縦並びへ切り替え
   ========================================== */
@media screen and (max-width: 796px) {
    .Map {
        flex-direction: column;
        padding: 10px;
    }

    .Map iframe {
        height: 350px;
    }

    .image-container {
        flex-direction: column; 
        gap: 50px;
        padding: 0 20px;
        margin: 30px auto;
    }

    .image-container img {
        width: 100%;
        max-width: 400px;
    }
} /* 💡 不足していた閉じカッコを補いました */

/* ==========================================
   8. 📱 スマホ画面（横幅767px以下）最終統合版
   ========================================== */
@media screen and (max-width: 767px) {
    /* ページ全体の左寄せ */
    .TopPage {
        align-items: flex-start !important;
    }
    
    .Map {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        max-width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    .Map iframe {
        width: 90% !important;
        height: 300px;
        border: 0;
    }
  
    /* メインビジュアル */
    .MainVisual {
        height: auto !important;
        width: calc(100% - 17vw) !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        margin-bottom: 10px !important;
        padding: 8px !important;
    }

    /* タイトル枠 */
    .TitleBox {
        width: 100% !important;
        height: 35px !important;
        margin-bottom: 10px !important;
        padding: 0 10px;
        box-sizing: border-box;
        display: block;
    }

    .MainTitle {
        font-size: 15px !important;
        white-space: nowrap;
        line-height: 35px !important;
    }

    /* 画像エリア */
    .Pictures {
        margin-top: 5px !important;
        height: auto !important; 
        flex-direction: column !important; 
        width: 100% !important;
    }

    .Pictures img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        margin-bottom: 5px !important;
        border: 2px solid #333333;
    } 

    /* 会社案内 & 経営理念 */
    .CompanyGuide {
        flex-direction: column !important;
        width: calc(100% - 17vw) !important; 
        margin-left: 0 !important;
        margin-right: auto !important;
        gap: 20px !important;
        padding: 5px 0 !important;
    }

    .CompanyProfile, .ManagementPhilosophy {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 15px !important;
    }

    .CompanyProfile .SubTitle:not(:first-child),
    .ManagementPhilosophy .SubTitle:not(:first-child) {
        margin-top: 15px !important;
    }

    .CompanyProfile > .SubTitle:first-child,
    .ManagementPhilosophy > .SubTitle:first-child {
        width: 100%;
        font-size: 24px !important;
        text-align: center;
    }
  
    .linkidou {
        width: 15vw;
        position: fixed;
        top: 50%;
        right: 0;
        transform: translateY(-75%); 
        z-index: 9999;
    }
    
    /* 共通のスマホボタン調整（セクション5の重複をカバー） */
    .p4, .p5, .p6 {
        height: 25vw;
        font-size: 11px;
    }
} /* 💡 一番最後の不足していた閉じカッコを補いました */

