/* ====================
    基本設定
    ==================== */
body {
    /* system-ui を追加し、OSネイティブフォントで最速描画を優先 */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #fff;
}

h1, h2 {
    /* ページタイトル(h1/h2)のみ中央寄せを維持 */
    text-align: center;
}

h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #212529;
}

h3 {
    font-size: 20px;
    font-weight: bold;
    margin-top: 30px;
    margin-bottom: 5px;
    /* h3のtext-alignを削除し、親要素(section)のtext-align: left;を継承させる */
}

main {
    padding: 20px;
    max-width: 960px;
    margin: 0 auto;
}

section {
    padding: 20px 0;
    text-align: left;
}

p {
    margin: 10px 0;
}

.button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #212529;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: #343a40;
}

.contact {
    margin-top: 40px;
    text-align: center;
}

.contact a {
    color: #fff;
    text-decoration: none;
}

.contact a:hover {
    text-decoration: underline;
}

/* ====================
    ヘッダー＆ナビゲーション
    ==================== */
header {
    background-color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo img {
    max-width: 200px;
    height: auto;
    display: block;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    margin-left: 25px;
    position: relative;
}

nav a {
    color: #212529;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #343a40;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    list-style: none;
    padding: 10px 0;
    min-width: 200px;
}

.dropdown li {
    margin: 0;
}

.dropdown a {
    display: block;
    padding: 10px 15px;
    white-space: nowrap;
    color: #212529;
}

.dropdown a:hover {
    background-color: #f8f9fa;
}

nav li:hover .dropdown {
    display: block;
}

/* ★修正: ナビゲーション内のお問い合わせボタン用スタイル (色を #457b9d に調整) */
nav a.button-nav {
    /* 基本のnav aスタイルをリセットし、ボタン化 */
    background-color: #457b9d; /* 落ち着いた青に変更 */
    color: white;
    padding: 8px 15px; 
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

nav a.button-nav:hover {
    background-color: #1d3557; /* ホバー時は濃いネイビー */
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 100;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #212529;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ====================
    ヒーローセクション
    ==================== */
.hero {
    background-image: url('0001Top.webp');
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.5); 
    color: white; 
    text-align: center;
    padding: 100px 20px;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero p {
    font-size: 1.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* ====================
    トップページサービスプレビュー (高さ揃えのためFlexboxを適用)
    ==================== */
/* サービスアイテム全体を Flexbox に設定 */
.service-items {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; 
    justify-content: center;
    padding: 20px 0;
}

.service-preview {
    /* 3分割のための幅と最小幅を設定 */
    flex: 1 1 calc(33.333% - 20px); 
    min-width: 300px;
    margin-bottom: 20px; /* アイテム間の縦スペースを確保 */
}

.service-preview a {
    /* カード自体のデザイン */
    display: flex; 
    flex-direction: column;
    height: 100%; /* 親要素(div)の高さ全体を使用し、高さを揃えるキー設定 */
    
    text-decoration: none;
    color: inherit;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.service-preview a:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.service-preview h3 {
    color: #212529;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.service-preview p {
    /* 説明文が余ったスペースを埋める（高さ揃えに必須） */
    flex-grow: 1; 
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
}

/* ====================
    会社概要ページ
    ==================== */
.about-content,
.why-us {
    padding: 40px 20px;
    max-width: 960px;
    margin: 0 auto;
}

.about-content h2,
.why-us h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: #212529;
}

.mission-vision,
.strength-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.mission-vision .item,
.strength-items .item {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex: 1 1 45%; 
    min-width: 300px;
}

.mission-vision .item h3,
.strength-items .item h3 {
    color: #212529;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: left; 
}

/* ====================
    サービスページ (サービス単体ページのデザイン)
    ==================== */
.services-content {
    padding: 40px 20px;
    max-width: 960px;
    margin: 0 auto;
}

.services-content h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: #212529;
}

/* サービスページ内の複数アイテムを並べるためのレイアウト */
.service-items .item {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* トップページとは異なり、2列レイアウトを想定 */
    flex: 1 1 calc(50% - 20px); 
    min-width: 300px;
}

.service-items .item h3 {
    color: #212529;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: left; 
}

/* ====================
    フッター
    ==================== */
footer {
    background-color: #212529;
    color: white;
    padding: 40px 20px;
}

.footer-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-item {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-item h3 {
    color: #fff;
    border-bottom: 2px solid #fff; 
    padding-bottom: 10px;
}

.footer-item a {
    color: #fff;
    text-decoration: none;
    display: block;
}

.qr-code {
    width: 100px;
    height: 100px;
    background-color: #fff;
    margin-bottom: 10px;
}

/* ====================
    ブログリストのデザイン
    ==================== */
.blog-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.blog-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1 1 300px;
    max-width: 400px;
}

.blog-item a {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: #333;
}

.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.blog-item h3 {
    text-align: left;
    color: #212529;
    font-size: 1.5rem;
    margin-top: 0;
}

.blog-item p {
    font-size: 0.9rem;
    color: #6c757d;
}

.blog-item .post-date {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
}

/* ====================
    画像用共通スタイル
    ==================== */
.service-image {
    display: block;
    margin: 20px auto;
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* ====================
    SNSロゴ用スタイル (media.html)
    ==================== */
.item-logo {
    display: block;
    margin: 0 auto 10px auto;
    width: 80px; 
    height: 80px;
    object-fit: contain;
}

/* ====================
    ブログ記事ページ固有のスタイル（追加部分）
    ==================== */
/* -------------------
    記事コンテンツの全体設定
    ------------------- */
.article-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    line-height: 1.8;
    font-size: 17px; 
    color: #333; 
}
.article-header {
    text-align: center;
    margin-bottom: 40px;
}
.article-header h1 {
    font-size: 32px; 
    color: #212529;
    margin-bottom: 10px;
    line-height: 1.3;
}
.article-meta {
    color: #6c757d;
    font-size: 15px; 
    display: block;
    margin-top: 5px;
}

/* -------------------
    記事本文内の見出し・リスト
    ------------------- */
/* ★修正: .article-container内のh1, h2, h3を強制的に左寄せに統一 */
.article-container h1,
.article-container h2,
.article-container h3 {
    text-align: left !important; 
}

.article-container h2 {
    /* 統一されたh2デザイン (ネイビーブルー系) */
    font-size: 24px;
    color: #1d3557; 
    border-bottom: 2px solid #1d3557; 
    padding-bottom: 8px;
    margin-top: 45px;
    margin-bottom: 25px;
    font-weight: bold;
    text-align: left; /* article-container内のh2は左寄せにする */
}
.article-container h3 {
    /* 統一されたh3デザイン */
    font-size: 19px;
    color: #212529;
    margin-top: 30px;
    margin-bottom: 15px;
    border-left: 5px solid #e9ecef; 
    padding-left: 10px;
    font-weight: 600;
    text-align: left; /* h3も左寄せに統一 */
}
.article-container p {
    margin-bottom: 20px;
}
.article-container ul {
    list-style: disc;
    margin-left: 20px;
    padding-left: 0;
    margin-bottom: 20px;
}
.article-container ul li {
    margin-bottom: 8px;
}
.article-container ol {
    list-style: decimal;
    margin-left: 20px;
    padding-left: 0;
    margin-bottom: 20px;
}
.article-container ol li {
    margin-bottom: 8px;
}

/* -------------------
    ボックスデザイン
    ------------------- */
/* サポート・CTAボックスのデザイン統一 (青緑系) */
.support-box {
    background-color: #f8f9fa; 
    border-left: 5px solid #457b9d; 
    padding: 25px;
    border-radius: 5px;
    margin-top: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.support-box h3 {
    color: #457b9d; 
    border-left: none;
    padding-left: 0;
    margin-top: 0;
}
.support-box ul li a {
    color: #457b9d !important; /* リンク色をボックスの色に合わせる */
    font-weight: bold;
    text-decoration: underline;
}

/* 内部リンクセクション (ネイビーブルー系) */
.internal-links {
    margin-top: 50px;
    border-top: 1px solid #ddd;
    padding-top: 25px;
}
.internal-links a {
    color: #1d3557; 
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
.internal-links a:hover {
    text-decoration: underline;
}

/* ====================
    メディアクエリ (モバイル対応)
    ==================== */
@media (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 10px 20px;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 60px;
        right: 0; 
        width: 70%;
        height: 100vh;
        background-color: #f8f9fa;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 99;
        
        /* 🔥 パフォーマンス向上: rightではなくtransformで非表示/表示を制御 */
        transform: translateX(100%); 
        transition: transform 0.3s ease-in-out;
        will-change: transform; 
    }

    nav.active {
        /* メニュー表示: 画面内に移動 */
        transform: translateX(0);
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        width: 100%;
        margin: 0;
    }

    nav ul li {
        margin: 10px 0;
        width: 100%;
    }

    .dropdown {
        position: static;
        display: block;
        box-shadow: none;
        background-color: transparent;
        border-left: 2px solid #212529;
        padding-left: 10px;
        margin-left: 10px;
    }

    .dropdown a {
        padding: 5px 15px;
    }

    /* ★最終修正: モバイル時のお問い合わせボタンの調整（幅を強制的に修正） */
    nav ul li a.button-nav {
        display: block !important; /* display: blockを強制 */
        text-align: center !important;
        margin-top: 10px !important;
        width: auto !important; 
        max-width: 250px !important; /* ボタンの最大幅を制限して、はみ出しを強制的に防ぐ */
        margin-left: auto !important; /* 中央寄せを強制 */
        margin-right: auto !important; /* 中央寄せを強制 */
    }

    /* モバイルサービスカードの調整 */
    .service-items {
        padding: 0 20px; 
    }
    
    .service-preview {
        flex: 1 1 100%; /* 1列表示に */
        min-width: unset; 
        margin-bottom: 20px; 
    }
    
    .service-preview a {
        padding: 15px; /* モバイルでのパディングを調整 */
    }

    .service-preview h3 {
        font-size: 1.5rem;
    }

    /* フッターのモバイル対応設定（既存のコードを維持） */
    footer .footer-content {
        flex-direction: column;
        text-align: center;
    }

    footer .footer-item {
        margin-bottom: 20px;
    }
    
    .blog-item {
        max-width: 100%;
    }
    
    /* -------------------
        ブログ記事のモバイルフレンドリーな調整
        ------------------- */
    @media (max-width: 600px) {
        .article-container {
            font-size: 16px;
            padding: 0 15px;
        }
        .article-header h1 {
            font-size: 24px;
        }
        .article-container h2 {
            font-size: 20px;
        }
        .article-container h3 {
            font-size: 17px;
        }
    }
}
/* ★★★ 最終緊急修正: モバイルメニュー内ボタンのサイズ強制修正 ★★★ */
@media (max-width: 768px) {
    nav.active ul li a.button-nav {
        max-width: 200px !important; /* 幅をさらに強制的に制限 */
    }
}