/* ==========================================
    すこやか教育相談 共通スタイル
    1. 全体 / 2. ヘッダー / 3. ナビゲーション
    4. メイン / 5. スマホメニュー / 6. パーツ
    7. フッター / 8. レスポンシブ
   ========================================== */

/* --- 1. 全体定義 --- */
html {
    /* スクロールバーによる横ズレを防止 */
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Yu Gothic", "Meiryo", sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

/* 改行制御：PC用/スマホ用 */
.pc-br { display: inline; }
.sp-br { display: none; }


/* --- 2. 固定ヘッダー --- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    z-index: 1000;
}

/* ヘッダーコンテナ（角丸・境界線） */
.header-container {
    max-width: 1000px;
    margin: 10px auto 0 auto;
    height: 75px;
    position: relative;
    display: flex;
    box-sizing: border-box;
    border: 1px solid #eeeeee;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

/* ロゴエリア：黄緑背景 */
.header-logo-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8BC34A; /* テーマカラー：黄緑 */
    color: #ffffff;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

/* ヘッダー固定によるコンテンツの隠れ防止用スペーサー */
.header-spacer { 
    height: 150px; 
}


/* --- 3. ナビゲーション --- */

/* 3-1. PC用ナビゲーション（緑色） */
.pc-nav {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #2E8B57; /* テーマカラー：濃い緑 */
    display: flex;
    box-sizing: border-box;
    border-left: 1px solid #eeeeee;
    border-right: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    border-right: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.nav-item:last-child { border-right: none; }
.nav-item:hover { background-color: #1B5E20; }

/* 3-2. ハンバーガーボタン（スマホ用） */
.hamburger-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: #2E8B57; 
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: none; /* デフォルト非表示（レスポンシブで表示） */
    z-index: 10;
    padding: 0;
    transition: all 0.2s;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hamburger-icon { font-size: 24px; display: block; line-height: 1; }
.hamburger-text { font-size: 10px; display: block; margin-top: 2px; font-weight: bold; }


/* --- 4. メインコンテンツエリア --- */
.main-wrapper {
    max-width: 1000px;
    margin: 20px auto;
    background-color: #ffffff;
    padding: 20px;
    box-sizing: border-box;
    border: 1px solid #eeeeee;
    border-radius: 12px;
}

.top-banner-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}


/* --- 5. スマホ用オーバーレイメニュー --- */

/* メニュー展開時の背景（バックドロップ） */
.menu-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1998;
}
.menu-backdrop.show { display: block; }

/* メニュー本体（中央ポップアップ） */
.menu-overlay {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 85%; max-width: 300px; max-height: 80vh;
    background-color: #fff;
    z-index: 1999;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}
.menu-overlay.show { display: flex !important; }

/* メニュー内スクロールエリア */
.menu-scroll-area {
    overflow-y: auto;
    padding: 15px 12px;
    flex: 1;
}

.menu-overlay a {
    display: block;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f1f8e9; /* すこやか教育緑の極薄色 */
    color: #2E8B57;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #dcedc8;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
}

/* メニュー下部固定ボタン（2分割） */
.menu-footer {
    display: flex; 
    flex-direction: row;
    width: 100%;
    height: 60px;
    border-top: 3px solid #ccc; 
    flex-shrink: 0;
    box-sizing: border-box;
}

/* フッター内共通設定（aとbuttonの差異を吸収） */
.menu-top-link, 
.menu-close-btn {
    flex: 1; 
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 15px !important;
    font-weight: bold !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    box-sizing: border-box !important;
    line-height: 1 !important;
    -webkit-appearance: none;
    appearance: none;
}

/* 左側：トップページ（テーマ緑） */
.menu-top-link {
    background-color: #8BC34A !important;
    color: #ffffff !important;
}

/* 右側：閉じる（グレー） */
.menu-close-btn {
    background-color: #444444 !important; 
    color: #ffffff !important;           
}

/* 装飾用アイコンパーツ */
.back-arrow {
    display: inline-block;
    width: 8px; height: 8px;
    border-top: 2px solid #fff; border-left: 2px solid #fff;
    transform: rotate(-45deg); margin-right: 8px;
}
.close-x { font-size: 20px; margin-right: 6px; line-height: 1; }


/* --- 6. 共通パーツスタイル --- */

/* セクション見出し */
.section-title {
    background-color: #f9f9f9;
    border-left: 5px solid #8BC34A;
    padding: 8px 15px;
    margin: 30px 0 15px 0;
    font-weight: bold;
    font-size: 1.2rem;
}

/* 相談時間等の案内ボックス */
.time-box {
    background: #f1f8e9;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 5px solid #2e7d32;
    margin: 15px 0;
    line-height: 1.5;
}

/* 画像コンテナ */
.line-image-container { margin-top: 25px; text-align: left; }
.line-image-container img {
    max-width: 100%; width: 300px; height: auto;
    border: 1px solid #ddd; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.line-image-container img:hover { transform: scale(1.02); }

/* PDFリンク・リスト */
.report-list { list-style: none; padding: 0; margin: 20px 0; }
.report-item { margin-bottom: 12px; }
.report-link {
    display: flex; align-items: center; padding: 15px 20px;
    background: #fff; border: 1px solid #e0e0e0;
    border-left: 6px solid #2E8B57; text-decoration: none;
    color: #333; font-weight: bold; border-radius: 4px;
    transition: all 0.2s; box-sizing: border-box;
}
.report-link:hover {
    background-color: #f9fff9; transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.report-link::after {
    content: "PDF"; margin-left: auto; background: #d32f2f;
    color: #fff; font-size: 0.7rem; padding: 2px 6px;
    border-radius: 3px; font-weight: normal;
}

/* 上に戻るボタン */
#back-to-top {
    position: fixed; 
    bottom: 25px; right: 25px; z-index: 900; 
    width: 50px; height: 50px; 
    background-color: rgba(46, 139, 87, 0.8); /* 緑の半透明 */
    border: 2px solid #fff; border-radius: 50%; 
    cursor: pointer; 
    opacity: 0; visibility: hidden; transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
#back-to-top::after {
    content: "";
    width: 10px; height: 10px;
    border-top: 3px solid #fff; border-left: 3px solid #fff;
    transform: translateY(2px) rotate(45deg);
}
#back-to-top.show { opacity: 1; visibility: visible; }
#back-to-top:hover { background-color: #1B5E20; transform: translateY(-3px); }


/* --- 7. フッター --- */
footer {
    max-width: 1000px;
    margin: 40px auto 20px auto;
    background-color: #708090;
    color: #fff;
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    box-sizing: border-box;
    border-radius: 12px;
}


/* --- 8. レスポンシブ設定（スマホ表示） --- */
@media screen and (max-width: 768px) {
    /* ナビゲーション切り替え */
    .pc-nav { display: none; }
    .hamburger-btn { display: flex; }

    /* ヘッダー・メイン幅調整 */
    .header-spacer { height: 95px; }
    .header-container { margin: 5px auto 0 auto; border-radius: 12px; }
    .header-container, .main-wrapper, footer { max-width: 95%; }
    
    /* ロゴ・文字の調整 */
    .header-logo-brand { font-size: 1.3rem; justify-content: flex-start; padding-left: 15px; }
    
    /* 改行制御 */
    .pc-br { display: none; }
    .sp-br { display: inline; }
    
    /* LINE相談：時間を縦に並べる */
    .time-box span { display: block; margin-left: 0 !important; }
}

/* PC閲覧時にメニュー関連の残骸が表示されないようガード */
@media screen and (min-width: 769px) {
    .menu-overlay, .menu-backdrop { display: none !important; }
}

@media print {
    /* 固定ヘッダーの固定を解除し、印刷時は隠す（または通常配置にする） */
    .sticky-header {
        position: static !important; /* 固定を解除 */
        display: none !important;    /* 印刷にメニューが不要なら非表示に */
    }

    /* メニューボタンや「トップへ戻る」ボタン、フッターのメニューも印刷から除外 */
    .hamburger-btn, 
    #back-to-top, 
    .menu-backdrop, 
    .menu-overlay,
    .pc-nav {
        display: none !important;
    }

    /* ヘッダーの余白（spacer）も不要なので消す */
    .header-spacer {
        display: none !important;
    }

    /* メインコンテンツの幅を100%にして、余計な余白を削る */
    .main-wrapper {
        width: 100% !important;
        margin: 10 !important;
        padding: 10 !important;
    }

    /* 背景色を白、文字色を黒にしてインクを節約 */
    body {
        background-color: #fff !important;
        color: #000 !important;
    }

    /* ページ改ざんの防止（大きなセクションの途中で切れないようにする） */
    .qa-container, .column-section {
        page-break-inside: avoid;
    }
}