/* ----------------------------------------
    1. 全体レイアウト
---------------------------------------- */
body {
    font-family: "Yu Gothic", "Meiryo", sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #222;
}

/* スクリーンリーダー専用（読み上げ用） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* フォーカス時の視認性（キーボード操作用） */
a:focus, button:focus {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

html {
    scrollbar-gutter: stable;
}

/* PCでは隠し、スマホ（768px以下）でのみ改行を有効にする */
.sp-br {
    display: none;
}

@media screen and (max-width: 768px) {
    .sp-br {
        display: inline;
    }
}

/* ----------------------------------------
    2. 固定ヘッダー（背景：白 / 文字：黒）
---------------------------------------- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff; /* 塗りつぶしなし（白） */
    z-index: 1000;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo-group {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #222; /* 文字色は黒 */
}

.pref-logo {
    height: 50px; /* メニューボタンと高さを揃える */
    width: auto;
    margin-right: 12px;
}

.center-name {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ヘッダー固定による重なり防止スペーサー */
.header-spacer {
    height: 70px;
}

@media screen and (max-width: 768px) {
    .header-container { height: 60px; }
    .pref-logo { height: 40px; }
    .center-name { font-size: 17px; }
    .header-spacer { height: 60px; }
    .breadcrumb { display: none; }
}

/* ----------------------------------------
    3. PC用ナビゲーション（目次エリアの囲み）
---------------------------------------- */
.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 40px 0;
    flex-wrap: wrap;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* ボタンの共通設定 */
.button-container a.button-link {
    display: flex;
    flex-direction: column; /* 中身を縦に並べる */
    align-items: center;
    justify-content: center;
    text-align: center;
    
    /* 幅の設定：固定を解除して柔軟にする */
    width: auto;
    min-width: 220px; 
    min-height: 75px; /* 2行になっても崩れない高さ */
    
    background-color: #fff;
    color: #1E4DB7;
    text-decoration: none;
    border: 2px solid #1E4DB7;
    border-radius: 6px;
    font-weight: bold;
    box-sizing: border-box;
    padding: 10px 15px;
    transition: all 0.2s ease;
    line-height: 1.3;
    
    /* 基本は改行させない */
    white-space: nowrap; 
}

/* 補足テキスト（sub-text）がある場合の設定 */
.button-link .sub-text {
    display: block;      /* 改行させる */
    white-space: normal; /* ここだけは改行禁止を解除 */
    font-size: 0.75rem;
    font-weight: normal;
    margin-top: 4px;
}

/* 現在地のスタイル */
.button-container a.button-link[aria-current="page"] {
    background-color: #1E4DB7;
    color: #fff;
}

.button-container a.button-link:hover {
    background-color: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* PC専用表示の切り替え */
.pc-only { display: none !important; }
@media screen and (min-width: 768px) {
    .pc-only { display: flex !important; }
}

/* ----------------------------------------
    4. 装飾パーツ（タイトル・見出し）
---------------------------------------- */
.breadcrumb {
    font-size: 14px;
    margin: 15px 0 20px 0;
}
.breadcrumb a { color: #064fc4; text-decoration: underline; }

/* ページタイトル下線 */
.page-title {
    text-align: center;
    margin: 10px 0; 
    padding: 5px 0;
}
.page-title h2 {
    font-size: 26px;
    font-weight: 600;
    color: #1E4DB7;
    margin: 0;
    position: relative;
    padding-bottom: 12px;
    display: inline-block;
}
.page-title h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #1E4DB7;
}

/* 本文見出しの左線 */
h3 {
    border-left: 6px solid #1E4DB7;
    padding-left: 15px;
    margin: 50px 0 20px 0;
    font-size: 22px;
    color: #333;
    scroll-margin-top: 90px;
}

/* PDFリンクボタンの装飾 */
.pdf-download-area {
    margin: 40px 0;
    text-align: center;
}
   
.pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    background-color: #1E4DB7;
    color: #fff !important;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s, background-color 0.2s;
}

.pdf-btn:hover {
    background-color: #153a8a;
    transform: translateY(-2px);
    text-decoration: none;
}

/* PDFアイコン（擬似要素） */
.pdf-btn::before {
    content: "PDF";
    font-size: 0.7rem;
    background: #fff;
    color: #1E4DB7;
    padding: 2px 4px;
    border-radius: 3px;
    margin-right: 12px;
    line-height: 1;
}

/* ----------------------------------------
    5. スマホ用メニュー（ハンバーガー）
---------------------------------------- */
.hamburger-btn {
    background-color: #1E4DB7; /* 白背景に映える青 */
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 55px; height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.hamburger-icon { font-size: 22px; line-height: 1; }
.hamburger-text { font-size: 10px; font-weight: bold; margin-top: 2px; }

.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: 80%; max-width: 280px; max-height: 80vh;
    background-color: #fff;
    z-index: 1999;
    flex-direction: column;
    border-radius: 8px;
    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: 10px 12px; /* ボタンの高さを 16px → 10px に縮小 */
    margin-bottom: 6px;  /* ボタン間の隙間を 10px → 6px に縮小 */
    background-color: #f8f9fa;
    color: #1E4DB7;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #eee;
    font-size: 15px;     /* 文字サイズを 16px相当 → 14px に */
    font-weight: bold;
    text-align: center;
}
.menu-close-btn {
    padding: 16px; background-color: #f1f1f1; color: #333;
    border: none; border-top: 1px solid #ddd;
    cursor: pointer; font-size: 16px; font-weight: bold;
}

/* ホバー時に少し明るくする */
.head-top-btn:hover {
    background-color: #3162d1;
}


@media screen and (min-width: 768px) {
    .hamburger-container, .menu-overlay, .menu-backdrop { display: none !important; }
}

/* ----------------------------------------
    6. 戻るボタン（右下・「^」記号）
---------------------------------------- */
#back-to-top {
    position: fixed; 
    bottom: 25px; 
    right: 25px; 
    z-index: 900; 
    width: 50px; height: 50px; 
    background-color: rgba(34, 34, 34, 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: 12px; height: 12px;
    border-top: 3px solid #fff;
    border-left: 3px solid #fff;
    transform: translateY(3px) rotate(45deg);
}

#back-to-top.show { opacity: 1; visibility: visible; }
#back-to-top:hover { background-color: #000; transform: translateY(-3px); }

/* --- ページ内目次（toc-list）の専用装飾 --- */
.accordion-content {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.toc-list {
    margin: 0;
    padding: 0;
    list-style: none; /* 箇条書きのポツを消去 */
}

.toc-list li {
    margin-bottom: 6px;
    line-height: 1.6;
    padding-left: 0; /* 左側の余白をゼロにする */
}

/* ポツ（::before）を削除または無効化 */
.toc-list li::before {
    content: none !important;
}

/* リンク：本文と同じサイズ・太さ */
.toc-list li a {
    font-size: 1rem;
    color: #064fc4;
    text-decoration: none;
    font-weight: normal;
    display: inline;
}

.toc-list li a:hover {
    text-decoration: underline;
    color: #003399;
}

/* --- 7. メニュー内固定フッター（2分割・高さ完全同期版） --- */

.menu-footer {
    display: flex; 
    flex-direction: row;
    width: 100%;
    height: 60px;
    /* ↓ 境界線を太く、少し濃い色（#ccc）に変更 */
    border-top: 3px solid #ccc; 
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.1); /* 上方向に薄い影を出す */
}

/* 共通設定：リンク(a)とボタン(button)の差異をリセット */
.menu-top-link, 
.menu-close-btn {
    flex: 1; /* 50%ずつ */
    height: 100% !important; /* 親(60px)の高さいっぱいに広げる */
    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;        /* 文字の高さによるズレを防止 */
}

/* 左側：トップページ（青背景） */
.menu-top-link {
    background-color: #1E4DB7 !important;
    color: #ffffff !important;
    /* 右側に薄い線を引いて区切る */
    box-shadow: 1px 0 0 rgba(255,255,255,0.2); 
}

/* 右側：閉じる（ダークグレー背景） */
.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;
}

/* スクロールエリアの最大化 */
.menu-scroll-area {
    overflow-y: auto;
    flex: 1;
    padding: 15px 12px;
}
/* PCではメニューを隠す設定 */
@media screen and (min-width: 768px) {
    .hamburger-container, .menu-overlay, .menu-backdrop { display: none !important; }
}
}