/* 基本設定 */
body {
    font-family: 'Yu Gothic', 'Meiryo', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

h1, h2, h3, h4 {
    font-family: 'Yu Gothic UI', 'Meiryo', sans-serif; /* 明朝体を使用する場合はここで指定 */
    color: #1a237e; /* ネイビーブルー */
}

a {
    color: #1a237e; /* ネイビーブルー */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 共通セクションのパディング */
.section-padding {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box; /* ここにも追加しておくと安心 */
}

.bg-light {
    background-color: #f0f4f8; /* やや明るい背景色 */
}

/* ボタン */
.btn-primary {
    display: inline-block;
    background-color: #1a237e; /* ネイビーブルー */
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #0d1257; /* 濃いネイビーブルー */
}

.btn-secondary {
    display: inline-block;
    border: 1px solid #1a237e; /* ネイビーブルー */
    color: #1a237e; /* ネイビーブルー */
    padding: 12px 25px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #1a237e; /* ネイビーブルー */
    color: #fff;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: #1a237e;
    font-weight: bold;
}

.read-more::after {
    content: ' >';
}

/* ヘッダー全体 */
#mainHeader {
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 15px 5%;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 800;
  box-sizing: border-box;
}

/* ヘッダー内コンテンツ配置 */
.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* 左側：ブランドブロック */
.brand-block {
  display: flex;
  align-items: center;
}

.header-left {
    display: flex; /* ハンバーガーボタンとブランドブロックを横並びにする */
    align-items: center; /* 垂直方向中央揃え */
    gap: 15px; /* ボタンとロゴの間に少しスペースを開ける */
}

.brand-hanawa {
  font-size: 32px;
  font-weight: bold;
  color: #d63384;
  margin-right: 20px;
}

.brand-hanawa a {
    font-size: 24px; /* ロゴテキストのサイズ */
    font-weight: bold;
    color: #1a237e; /* ロゴの色 */
    text-decoration: none;
    white-space: nowrap; /* テキストが改行されないように */
}

.brand-labels {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.anshin {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.mirai {
  font-size: 16px;
  color: #666;
}

/* 右側：インフォメーション */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.header-right p {
  margin: 0px 0;
  font-size: 14px;
  color: #333;
}

.header-right .tel {
  font-weight: bold;
  font-size: 18px;
}

.header-right .contact-link a {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

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

/* ナビゲーション */
#mainNav {
    background-color: #1a237e; /* ネイビーブルー */
    position: fixed; /* ページ上部に固定 */
    width: 100%;
    top: 80px; /* ヘッダーの高さ分下げる */
    left: 0;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#mainNav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

#mainNav ul li {
    flex: 1 1 auto;                 /* 各 li を等分に広げる */
    min-width: 160px;               /* 最小幅を決める（必要に応じて調整） */
    text-align: center;             /* テキストを中央揃え */
}

#mainNav ul li a {
    display: flex;                  /* flexを使って上下左右中央 */
    align-items: center;            /* 縦中央 */
    justify-content: center;        /* 横中央 */
    color: #fff;
    padding: 20px 10px;             /* 高さを出すため縦パディング大きめ */
    font-weight: bold;
    height: 100%;                   /* li の高さいっぱいに広げる */
    text-decoration: none;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    line-height: 1.4;               /* 複数行テキストを整える */
    word-break: keep-all;           /* 単語の途中で改行しない */
}

#mainNav ul li a:hover,
#mainNav ul li a.active { /* アクティブページの色 */
    background-color: #0d1257; /* 濃いネイビーブルー */
    text-decoration: none;
}

/* メインコンテンツのパディング調整（固定ヘッダー・ナビゲーションのため） */
#mainContent {
    padding-top: 140px; /* ヘッダー(80px) + ナビゲーション(60px) の合計 */
}

/* ヒーローセクション */
.hero-section {
    background: url('../images/hero.png') no-repeat center center/cover; /* 背景画像はimagesフォルダに配置 */
    color: #fff;
    text-align: center;
    padding: 100px 5%;
    height: 350px; /* 高さ調整 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-section h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #fff;
}

.hero-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* サポート概要 */
.overview-points {
    display: flex; /* GridではなくFlexboxに統一 */
    flex-wrap: wrap; /* 要素の折り返しを許可 */
    justify-content: center; /* 要素を中央寄せにする */
    gap: 30px; /* アイテム間の余白 */
    margin-top: 40px;
    padding: 0 20px; /* 左右に20pxのパディングを追加 */
    box-sizing: border-box; /* パディングを幅に含める */
}

.overview-points > div {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 250px; /* 高さを揃えたい場合 */
    flex: 1 1 calc(50% - 30px); /* 2列表示にするための設定 (gap分を考慮) */
    min-width: 280px; /* 各要素の最小幅 */
    max-width: 450px; /* 各要素の最大幅（任意） */
    text-align: center;
    box-sizing: border-box; /* パディングを幅に含める */
}

.overview-points > div h4 {
    font-size: 1.4em;
    margin-top: 0;
    color: #1a237e;
}

/* 選ばれる理由 */
.reason-list {
    display: flex; /* GridではなくFlexboxに統一 */
    flex-wrap: wrap; /* 要素の折り返しを許可 */
    justify-content: center; /* 要素を中央寄せにする */
    gap: 30px; /* アイテム間の余白 */
    margin-top: 40px;
    padding: 0 20px; /* 左右に20pxのパディングを追加 */
    box-sizing: border-box; /* パディングを幅に含める */
}

.reason-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 300px; /* 高さを揃えたい場合 */
    flex: 1 1 calc(50% - 30px); /* 2列表示にするための設定 (gap分を考慮) */
    min-width: 280px; /* 各要素の最小幅 */
    max-width: 450px; /* 各要素の最大幅（任意） */
    text-align: center;
    box-sizing: border-box; /* パディングを幅に含める */
}

.reason-item .icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: #1a237e;
}

/* フォーム */
.contact-form {
    max-width: 600px;
    margin: 40px auto;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: calc(100% - 20px); /* パディング考慮 */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
}

.form-group .required {
    color: #e53935; /* 赤色 */
    font-size: 0.9em;
    margin-left: 5px;
}

.contact-form button[type="submit"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    cursor: pointer;
    border: none;
    background-color: #1a237e;
    color: #fff;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.contact-form button[type="submit"]:hover {
    background-color: #0d1257;
}

/* 各サービス詳細ページヒーロー */
.page-hero {
    background-color: #e0f2f7; /* 明るい水色 */
    padding: 100px 5%;
    text-align: center;
    margin-bottom: 40px;
}

.page-hero h2 {
    font-size: 2.5em;
    color: #1a237e;
    margin-bottom: 20px;
}

.page-hero p {
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto;
    color: #333;
}

/* サービス内容リスト */
#service-details ul {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}

#service-details ul li {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 5px solid #1a237e; /* アクセントカラー */
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#service-details ul li strong {
    font-size: 1.1em;
    color: #1a237e;
}

/* フローリスト */
.flow-list {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    counter-reset: flow-step;
}

.flow-list li {
    position: relative;
    padding: 20px 20px 20px 60px;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.flow-list li::before {
    counter-increment: flow-step;
    content: counter(flow-step);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #1a237e;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2em;
}

/* FAQ */
.faq-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.faq-item h4 {
    margin-top: 0;
    color: #1a237e;
    cursor: pointer; /* クリックで開閉する想定 */
}

.faq-item p {
    margin-bottom: 0;
    /* display: none; 初期は非表示 */
}

/* フッター */
#mainFooter {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 25px 5%;
    font-size: 0.9em;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

#mainFooter .footer-links a {
    color: #fff;
    margin: 0 10px;
}

#mainFooter .footer-links a:hover {
    text-decoration: underline;
}

.card-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.card-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    text-align: center;
}

.card-list2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.card-link2 {
    text-decoration: none;
    color: inherit;
}

.card-item2 {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    padding: 20px;
    transition: transform 0.3s ease;
}

.card-item2 img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 15px;
}

.card-item2 h3 {
    color: #1a237e;
    font-size: 1.4em;
    margin-bottom: 10px;
}

.card-item2 p {
    font-size: 1em;
    color: #555;
}

.card-item2:hover {
    transform: translateY(-5px);
}


/* ハンバーガーボタン（デフォルトで非表示） */
.hamburger {
    position: relative; /* 固定ヘッダー内に位置させるため */
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative; /* z-indexを有効にするために必要 */
    z-index: 999; /* サイドメニューやオーバーレイよりも最も手前に */
    /* z-index はモバイルメニューより低い値にしておく */
    /* 通常はPCで非表示にするので、メディアクエリで制御 */
}

.hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: #333; /* ボタンの線の色 */
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    margin: 3px 0;
}

/* ハンバーガーボタンがアクティブになった時のスタイル */
.hamburger.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}
.hamburger.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* サイドメニューのスタイル (既存のものを再掲、必要に応じて調整) */
.side-menu {
    position: fixed;
    top: 0;
    left: -100%; /* 初期状態は画面外に隠す */
    width: 280px; /* サイドメニューの幅 */
    height: 100vh;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    transition: left 0.3s ease-in-out;
    z-index: 950; /* ヘッダーより手前に表示 */
    overflow-y: auto; /* メニューが多い場合にスクロール可能に */
}

.side-menu.is-open {
    left: 0; /* メニューが開いた時に画面内に表示 */
}

.side-menu-header {
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: #1a237e; /* ネイビーブルー */
    color: #fff;
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu li a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.side-menu li a:hover {
    background-color: #f0f0f0;
}

/* オーバーレイのスタイル (既存のものを再掲、必要に応じて調整) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900; /* ヘッダーより手前、サイドメニューより奥 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.logo-pc-only {
  display: none;
}

/* メディアクエリでPC表示時の調整 */
@media (min-width: 769px) {
    .hamburger {
        display: none; /* PCではハンバーガーボタンを非表示 */
    }
    .side-menu,
    .overlay {
        display: none; /* PCではサイドメニューとオーバーレイを非表示 */
    }
    /* PC用のグローバルナビゲーションをヘッダー内に配置する場合は、別途CSSを記述 */
    /* 例: .header-content .main-nav-pc ul { display: flex; } など */
  .logo-pc-only {
    display: block;
    margin-left: 10px; /* 任意で調整 */
  }

  .logo-pc-only img {
    height: 40px; /* お好みで */
    vertical-align: middle;
  }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    #mainHeader {
        padding: 10px 5%;
    }
    .header-content .logo h1 {
        font-size: 20px;
    }
    .header-content .contact-info p {
        font-size: 14px;
    }

    /* ヘッダー全体の配置調整 */
    .header-content {
        flex-direction: column; /* スマホではヘッダーの要素を縦並びにする */
        align-items: flex-start; /* 左寄せにする */
        gap: 10px; /* 要素間の隙間 */
    }

    .header-left {
        /* スマホではハンバーガーとブランドブロックを横並びにするが、
           ヘッダー全体が縦並びになるので、このままでOK */
        align-self: flex-start; /* 左寄せ */
    }

    .brand-block {
        flex-direction: column; /* スマホではHANAWAとbrand-labelsを縦並びにする */
        align-items: flex-start; /* 左寄せ */
        gap: 5px;
    }

    .brand-hanawa {
        margin-right: 0; /* PCで設定した右マージンを解除 */
    }

    .brand-labels {
        flex-direction: column; /* あんしん と 未来サポート は引き続き縦並び */
        justify-content: flex-start; /* 上揃え */
        margin-left: 0; /* PCで設定した左マージンを解除 */
        align-items: flex-start; /* 左寄せ */
    }

    /* あんしん と 未来サポート の縦書きを解除 */
    .anshin,
    .mirai {
        writing-mode: horizontal-tb; /* 念のため横書きを強制 */
        text-orientation: mixed;
        white-space: nowrap; /* テキストを強制的に1行に表示 */
    }

    /* section-padding のスマホ向け調整 */
    .section-padding {
        padding: 40px 15px; /* スマホでは固定値のパディングに変更 */
        /* max-width はそのまま */
    }
    /* 固定ナビゲーションを解除（必要に応じて） */
    #mainNav {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        z-index: auto !important;
    }
    #mainNav ul {
        flex-direction: column;
        align-items: center;
    }
    #mainNav ul li a {
        padding: 10px 15px;
        width: 100%;
        text-align: center;
    }

    #mainContent {
        padding-top: 120px; /* ヘッダー+ナビの合計に合わせて調整 */
    }

    .hero-section h2 {
        font-size: 2.2em;
    }
    .hero-section p {
        font-size: 1em;
    }

    .overview-points, .reason-list {
        flex-direction: column; /* 要素を縦並びに変更 */
        align-items: center; /* 中央寄せ */
        padding: 0 15px; /* スマホでは左右のパディングを少し狭くする */
        gap: 20px; /* 要素間の隙間を調整 */
    }
    .overview-points > div, .reason-item {
        width: 100%; /* 幅を100%にする */
        max-width: none; /* 最大幅の制限を解除 */
        padding: 20px; /* 各アイテム内のパディングを調整 */
        height: auto; /* 高さを自動調整に戻す（コンテンツ量によって可変に） */
    }

    .flow-list li {
        padding-left: 45px;
    }
    .flow-list li::before {
        left: 10px;
        width: 25px;
        height: 25px;
        font-size: 1em;
    }

    /* card-list の縦並び */
    .card-list {
        display: flex; /* GridからFlexboxに変更 */
        flex-direction: column; /* 縦並びにする */
        gap: 20px;
        align-items: center; /* 中央寄せ */
        /* padding: 0 15px; ここはsection-paddingに任せるので削除 */
    }
    .card-item {
        width: 90%; /* 親要素の幅いっぱいに広げる */
        max-width: 400px; /* 必要に応じて最大幅を設定 */
        /* box-sizing: border-box; はすでに上で定義済み */
    }

    /* card-list2 の縦並び */
    .card-list2 {
        display: flex; /* GridからFlexboxに変更 */
        flex-direction: column; /* 縦並びにする */
        gap: 20px;
        align-items: center; /* 中央寄せ */
        /* padding: 0 15px; ここはsection-paddingに任せるので削除 */
    }
    .card-link2 {
        width: 90%; /* 親要素の幅いっぱいに広げる */
        max-width: 400px; /* 必要に応じて最大幅を設定 */
        text-decoration: none;
        box-sizing: border-box; /* card-link2にも追加 */
    }
    .card-item2 {
        width: 90%; /* card-link2の幅いっぱいに広げる */
        /* max-width: none; は不要、card-link2がmax-widthを持つ */
        /* box-sizing: border-box; はすでに上で定義済み */
    }

  /* #support-reasons のカード縦並び */
  #support-reasons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  #support-reasons {
    width: 100%;
    max-width: 400px;
  }

  /* #support-service のカード縦並び */
  #support-service {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  #support-service {
    width: 100%;
    max-width: 400px;
    text-decoration: none;
  }
  #support-service {
    width: 100%;
  }
    /* デスクトップ用ナビゲーションを非表示 */
    .desktop-nav {
        display: none !important;
    }
    
    /* ハンバーガーボタンを表示 */
    .hamburger {
        display: flex !important;
    position: relative; /* 固定ヘッダー内に位置させるため */
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    /* z-index はモバイルメニューより低い値にしておく */
    /* 通常はPCで非表示にするので、メディアクエリで制御 */
    }
    /* ナビゲーションが固定されている場合の解除 */
    #mainNav.scrolled {
        position: relative !important;
        top: auto !important;
        transform: none !important;
    }
}