@charset "utf-8";

/* --- 1. コンテンツの潜り込みを解消 --- */
.lower-page {
    /* ヘッダーの高さ分、全体を下に押し下げます */
    /* 140pxでも隠れる場合は、この数値を大きくしてください */
    padding-top: 140px; 
    background-color: #fff;
}

/* ページタイトルエリア */
.page-header {
    text-align: center;
    margin-bottom: 100px;
    padding: 20px 0;
}
.page-header .en {
    display: block;
    font-size: 14px;
    color: #162d50;
    letter-spacing: 0.4em;
    margin-bottom: 10px;
    font-weight: 600;
}
.page-header h2 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #333;
}

/* --- 社長挨拶 --- */
.president-message {
    margin-bottom: 120px;
    padding: 0 20px;
}

.message-flex {
    display: flex;
    align-items: center;
    gap: 80px;
    max-width: 1000px;
    margin: 0 auto;
}

.message-text {
    flex: 1;
}

.message-text h3 {
    font-size: 24px;
    color: #162d50;
    line-height: 1.6;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.message-text p {
    font-size: 15px;
    line-height: 2;
    color: #444;
    margin-bottom: 20px;
    text-align: justify;
}

.president-name {
    margin-top: 40px;
    font-weight: 600;
    font-size: 18px;
    color: #333;
    text-align: right !important;
}

.message-img {
    width: 380px; /* 写真のサイズ固定 */
}

.message-img img {
    width: 100%;
    height: auto;
    box-shadow: 20px 20px 0 #f9f9fb; /* 写真の背面に薄いグレーの飾り */
}

/* --- 2. 会社概要（バランス調整） --- */
.company-info {
    margin-bottom: 120px;
}
.table-container {
    max-width: 960px; 
    margin: 0 auto;
    background: #fff;
    padding: 0;
}
.company-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 3px solid #162d50; /* 上部にアクセントを置いて「隠れてない感」を出す */
}
.company-table th, .company-table td {
    padding: 25px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    line-height: 1.8;
}
.company-table th {
    width: 220px;
    background-color: #f9f9fb;
    color: #162d50;
    text-align: left;
    font-weight: 600;
    vertical-align: top;
}
.company-table td {
    color: #444;
}

/* --- 3. 沿革（歴史のみ・端折らない） --- */
.company-history {
    margin-bottom: 150px;
}
.history-timeline {
    margin-top: 60px;
}
.history-row {
    display: flex;
    gap: 60px;
    margin-bottom: 80px;
    align-items: flex-start;
}
.history-row.rev { flex-direction: row-reverse; }
.history-img { width: 45%; }
.history-img img { 
    width: 100%; 
    height: 400px; 
    object-fit: cover; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
.history-content { width: 55%; }
.history-list dt {
    font-weight: 600;
    color: #162d50;
    font-size: 17px;
    margin-bottom: 8px;
    border-left: 4px solid #162d50;
    padding-left: 12px;
}
.history-list dd {
    margin-bottom: 35px;
    color: #555;
    line-height: 1.8;
    padding-left: 16px;
    padding-bottom: 20px;
}

/* --- 4. 施工実績（カード表示） --- */
.company-works {
    margin-bottom: 150px;
    padding-top: 80px;
    border-top: 1px solid #eee;
}
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}
.work-card {
    background: #fff;
    border: 1px solid #eee;
    transition: all 0.4s ease;
}
.work-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
}
.work-img img { width: 100%; height: 220px; object-fit: cover; }
.work-info { padding: 25px; }
.work-date { font-size: 12px; color: #999; display: block; margin-bottom: 10px; }
.work-name { font-size: 15px; font-weight: 600; color: #333; line-height: 1.6; }

/* --- 5. セクションタイトル共通 --- */
.section-title {
    text-align: center;
    margin-bottom: 60px;
}
.section-title span {
    font-size: 12px;
    color: #162d50;
    letter-spacing: 0.3em;
    display: block;
    margin-bottom: 10px;
}
.section-title h2 {
    font-size: 28px;
    font-weight: 500;
}

.section-desc {
    max-width: 800px;
    margin: 20px auto 0;
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    text-align: left; /* 読みやすさ重視で左寄せ（中央寄せも可） */
    padding: 0 20px;
    border-left: 2px solid #162d50;
    margin-top: 30px;
}

/* 画像の親要素：はみ出しを隠す */
.zoom-frame {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 通常時の画像：少しだけ拡大を戻した状態（1.0倍） */
.history-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 1.5s ease; /* 1.5秒かけてゆっくり動く */
    transform: scale(1.0);
}

/* ■実績カード：クリック可能であることを示すカーソルに */
.work-card {
    cursor: pointer;
    display: block; /* <a>タグのためブロック化 */
    text-decoration: none; /* リンク下線を消す */
}

/* ■詳細モーダル（全画面オーバーレイ） */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 背景を暗く */
    display: none; /* 初期は非表示 */
    z-index: 10000; /* 最前面に */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    max-width: 900px;
    width: 100%;
    max-height: 90vh; /* 画面からはみ出さないよう高さを制限 */
    position: relative;
    animation: fadeIn 0.4s ease;
    overflow: auto; /* コンテンツが多い場合は内部スクロール */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: -40px; right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

.modal-body {
    display: flex; /* 写真とテキストを横並びに */
}

.modal-img-area {
    width: 50%;
}
.modal-img-area img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 写真をエリアに合わせる */
    display: block;
}

.modal-text-area {
    width: 50%;
    padding: 50px;
}
.modal-text-area h3 {
    font-size: 20px;
    color: #162d50;
    line-height: 1.5;
    margin-bottom: 25px;
    font-weight: 600;
}
.modal-text-area p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

/* JavaScriptでこのクラスがついた瞬間にズームされる */
.history-img.is-visible img {
    transform: scale(1.15); /* 1.15倍にズーム */
}

/* --- スマホ対応（レスポンシブ） --- */
@media screen and (max-width: 960px) {
    .lower-page { padding-top: 100px; } /* スマホ用余白 */
    .history-row, .history-row.rev { flex-direction: column; gap: 30px; }
    .history-img, .history-content { width: 100%; }
    .history-img img { height: 300px; }
    .works-grid { grid-template-columns: repeat(2, 1fr); }
    .section-desc { font-size: 13px; }
    .message-flex {
        flex-direction: column-reverse; /* スマホでは文章が先、写真が後にくる配置 */
        gap: 40px;
    }
    .message-img {
        width: 100%;
        max-width: 400px;
    }
    .message-text h3 {
        font-size: 20px;
    }
}

@media screen and (max-width: 768px) {
    .modal-body {
        flex-direction: column; /* スマホでは縦並びに */
    }
    .modal-img-area, .modal-text-area {
        width: 100%;
    }
    .modal-img-area img {
        height: 250px; /* 写真の高さを調整 */
    }
    .modal-text-area {
        padding: 30px;
    }
    .modal-close {
        top: 10px; right: 10px;
        color: #fff;
        background: rgba(0,0,0,0.5);
        width: 30px; height: 30px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 50%;
    }
}

@media screen and (max-width: 640px) {
    .works-grid { grid-template-columns: 1fr; }
    .company-table th, .company-table td { 
        display: block; 
        width: 100%; 
        padding: 15px 10px; 
    }
    .company-table th { border-bottom: none; background: #f9f9fb; }
    .page-header h2 { font-size: 24px; }
}