:root{
  /* ブロック間の“1〜2px”隙間 */
  --block-gap: 2px;

  /* 小さめ wood ボタン */
  --wood-btn-h-sm: 44px;
  --wood-btn-font-sm: 16px;
  --wood-btn-minw-sm: 170px;

  --bg: #00297B;
  --bg-img: url("blue4b.gif");
  --wood: url("wood02.jpg");
  --paper: #fff;

  --accent: #009999;
  --misaki-head: #cc00cc;

  --hover-yellow: rgba(255, 255, 0, .55);
  --hover-red: #cc0000;

  --container: 1200px;
  --gap: 16px;

  --side-min: 260px;
  --radius: 10px;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }

body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP",
               "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg) var(--bg-img) repeat;
  color:#000;
}

a{ color:#0033cc; }
a:hover{ text-decoration: underline; }

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== 3 columns ===== */
.layout-3col{
  display:grid;
  grid-template-columns: minmax(var(--side-min), 2fr) 6fr minmax(var(--side-min), 2fr);
  gap: var(--gap);
  padding: 18px 0 28px;
}

/* 追加：3カラム内の「ブロック同士」に 1〜2px 隙間 */
.col{
  display:flex;
  flex-direction:column;
  gap: var(--block-gap);
}

/* 各カラム内の“ブロックを中央揃え” */
.center-in-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap: 6px;
}

/* カラムブロック */
.block{
  background: var(--paper);
  border-radius: var(--radius);
  padding: 12px;
}
.card{
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px;
}

/* ===== Header ===== */
.site-header{ padding-top: 10px; }

.header-grid{
  display:grid;
  grid-template-columns: 360px 1fr 360px;
  gap: 14px;
  align-items: center;
}

.header-photo{
  display:block;
  background: rgba(255,255,255,.15);
  padding: 10px;
  border-radius: var(--radius);
}
.header-photo img{
  width:100%;
  height:150px;
  object-fit:cover;
  display:block;
  border-radius: 6px;
}

.header-center{ text-align:center; color:#fff; }
.header-center .org{ margin:0 0 8px; font-weight:600; }
.logo-link{ display:inline-block; }
.logo{ max-width: 260px; height:auto; display:block; }

.header-right{ color:#fff; text-align:center; }
.header-right .addr{ margin:0 0 6px; font-weight:600; }
.header-right .tel{ margin:0; }
.header-right .tel-num{ color:#ff0000; font-size: 32px; font-weight: 800; }

.header-meta{
  display:flex;
  gap: 10px;
  align-items:center;
  color:#fff;
  font-size: 13px;
  padding: 10px 0 6px;
}
.header-meta .sep{ opacity:.75; }
.mail-icon{ margin-left:auto; display:inline-flex; }
.mail-icon img{ width:32px; height:32px; }

/* ===== Nav ===== */
.global-nav{
  background: #ffffcc var(--wood) repeat;
  padding: 10px 0;
  margin-top: 6px;
}
.nav-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 10px;
}

/* ハンバーガー */
.menu-toggle{
  display:none;
  align-items:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.2);
  background: #fff;
  cursor:pointer;
}
.menu-toggle__bars{
  width: 22px;
  height: 14px;
  display:inline-block;
  background:
    linear-gradient(#000 0 0) 0 0/100% 2px,
    linear-gradient(#000 0 0) 0 6px/100% 2px,
    linear-gradient(#000 0 0) 0 12px/100% 2px;
  background-repeat:no-repeat;
}
.menu-toggle__label{ font-weight:700; }

/* メニュー共通 */
.menu, .footer-menu{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.menu{ justify-content:center; }

/* ボタン見た目（木目＋hover黄色/文字赤） */
.header-bottun > a,
.footer-menu a{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 54px;
  min-width: 120px;
  padding: 0 16px;
  border-radius: 10px;
  text-decoration:none;
  font-weight: 800;
  font-size: 18px;
  color:#111;
  background: var(--wood) center/cover no-repeat;
  overflow:hidden;
}
.header-bottun > a::before,
.footer-menu a::before{
  content:"";
  position:absolute;
  inset:0;
  background: transparent;
  transition: background .15s ease;
}
.header-bottun > a:hover,
.footer-menu a:hover{
  color: var(--hover-red);
  text-decoration:none;
}
.header-bottun > a:hover::before,
.footer-menu a:hover::before{
  background: var(--hover-yellow);
}
.header-bottun > a > *,
.footer-menu a > *{ position:relative; z-index:1; }

/* ===== wood-btn（汎用） ===== */
.wood-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  min-width: 120px;
  padding: 0 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  color: #111;
  background: var(--wood) center/cover no-repeat;
  overflow: hidden;
}
.wood-btn::before{
  content:"";
  position:absolute;
  inset:0;
  background: transparent;
  transition: background .15s ease;
}
.wood-btn:hover{
  color: var(--hover-red);
  text-decoration: none;
}
.wood-btn:hover::before{
  background: var(--hover-yellow);
}
.wood-btn > *{ position: relative; z-index: 1; }

.wood-btn--sm{
  height: var(--wood-btn-h-sm);
  min-width: var(--wood-btn-minw-sm);
  font-size: var(--wood-btn-font-sm);
  padding: 0 14px;
}

/* =========================
   ドロップダウン（PC hover）
========================= */
.menu-hover > li.header-bottun{ overflow: visible; }
.menu-hover > li{ position: relative; }

.menu-hover .sub-menu{
  position:absolute;
  left:0;
  top: calc(100% + 8px);
  margin:0;
  padding:0;
  z-index:9999;
  opacity:0;
  visibility:hidden;
  transform: translateY(-6px);
  pointer-events:none;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.menu-hover > li:hover > .sub-menu,
.menu-hover > li:focus-within > .sub-menu{
  opacity:1;
  visibility:visible;
  transform: translateY(0);
  pointer-events:auto;
}

/* hoverの途切れ防止 */
.menu-hover > li.has-sub::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:100%;
  height:12px;
}

/* 子項目 */
.menu-hover .sub-menu > li{
  width: 220px;
  margin-top: 8px;
}
.menu-hover .sub-menu > li > a{
  width:100%;
  height: 54px;
  font-size: 18px;
}

/* ===== Titles / Notes ===== */
.section-title{
  width:100%;
  margin: 0 0 10px;
  background: var(--accent);
  color:#fff;
  padding: 10px;
  border-radius: var(--radius);
  font-weight: 900;
  text-align: center;
}
.section-title--tight{ margin:0; }

.note{
  background: #ffffcc;
  border: 1px solid #cfc37a;
}

/* ===== Right sidebar ===== */
.right-title{
  margin:0 0 8px;
  background: var(--accent);
  color:#fff;
  width:100%;
  padding: 10px;
  border-radius: var(--radius);
}
.right-links{
  margin:0;
  padding-left: 1.2em;
  text-align:left;
}

/* ===== Footer ===== */
.site-footer{
  padding: 18px 0 28px;
  color:#fff;
}
.footer-inner{ display:grid; gap: 14px; }
.footer-menu{ justify-content:center; }
.copyright{
  margin:0;
  text-align:center;
  font-size: 12px;
  opacity:.95;
}

/* =========================
   Sidebar wood navigation（HTMLリンク用）
   - 「建物〜送迎について」などは木目背景
========================= */
.left-col .side-nav{
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.left-col .side-nav li{ margin:0; padding:0; width:100%; }

.left-col .side-nav a{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 44px;
  padding: 10px 12px;

  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 800;
  color: #111;
  text-align: center;
  line-height: 1.25;

  background: var(--wood) center/cover no-repeat;
  overflow: hidden;
}
.left-col .side-nav a::before{
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background .15s ease;
}
.left-col .side-nav a:hover{
  color: var(--hover-red);
  text-decoration: none;
}
.left-col .side-nav a:hover::before{
  background: var(--hover-yellow);
}

/* 現在ページの強調 */
.left-col .side-nav a[aria-current="page"]::before{
  background: rgba(255, 255, 0, .35);
}

/* =========================
   「広報みさき」風のリスト（PDF用にも共通で使う）
   - もっと見る/折りたたみ無しの想定
========================= */
.list-box,
.misaki-list,
.doc-list{
  width:100%;
  list-style:none;
  margin:0;
  padding:0;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow:hidden;
}
.list-box li + li,
.misaki-list li + li,
.doc-list li + li{
  border-top: 1px solid #eee;
}

.list-box a,
.misaki-list a,
.doc-list a{
  display:flex;
  flex-direction:column;  /* 2行目(small)が自然に下へ */
  align-items:center;
  justify-content:center;
  gap: 4px;
  padding: 12px 10px;
  text-decoration:none;
  color:#000;
  text-align:center;
  line-height: 1.25;
}
.list-box a:hover,
.misaki-list a:hover,
.doc-list a:hover{
  background: rgba(0,0,255,.06);
  text-decoration: underline;
}
.list-box small,
.misaki-list small,
.doc-list small{
  font-size: 12px;
  color:#333;
}

/* header-meta 内のアクセスカウンター */
.access-counter{ height: 18px; width:auto; }

/* sub-menu の箇条書きの点を消す */
.menu-hover .sub-menu{
  list-style: none;
}


/* ===== Responsive ===== */
@media (max-width: 980px){
  .header-grid{
    grid-template-columns: 1fr;
    text-align:center;
  }
  .header-photo img{ height: 190px; }

  .layout-3col{ grid-template-columns: 1fr; }

  /* モバイル：ハンバーガー表示 */
  .menu-toggle{ display:inline-flex; }
  .menu{ width:100%; justify-content:center; }
  .menu[hidden]{ display:none !important; }

  /* モバイル：サブメニューは開閉（JSで .sub-open 付与） */
  .menu-hover .sub-menu{
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    display: none;
  }
  .menu-hover > li.has-sub.sub-open > .sub-menu{ display:block; }
  .menu-hover > li.has-sub::after{ display:none; }
}

/* =========================================================
   Mobile layout override (PCは変更しない)
   980px以下だけ：ヘッダー/メニュー/並び順を指定通りにする
========================================================= */
@media (max-width: 980px){

  /* ===== ① 三本線メニューを常に右上固定 ＋ 左に灯台写真を小さく表示 ===== */
  .menu-toggle{
    display: inline-flex !important;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 20000;

    /* 右上に収まるサイズ感 */
    padding: 8px 10px;
    gap: 10px;
    border-radius: 999px;
  }

  /* 「メニュー」ラベルはスマホでは非表示（アイコン＋写真だけに） */
  .menu-toggle__label{ display:none; }

  /* 灯台写真をボタンの左側に表示（全ページ共通でHTML修正不要） */
  .menu-toggle::before{
    content:"";
    width: 54px;
    height: 36px;
    display:inline-block;
    background: url("toudai11.jpg") center/cover no-repeat;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
  }

  /* 固定ボタンに被らないようヘッダー上に余白 */
  .site-header{ padding-top: 64px; }

  /* ===== ② ハンバーガーメニュー（開いたら縦並び＋薄グレー背景） ===== */
  /* 開いたメニュー本体を「固定のドロワー風」に */
  nav.global-nav #globalMenu{
    position: fixed;
    top: 58px;          /* ボタン直下 */
    right: 10px;
    left: 10px;
    z-index: 19999;

    max-height: calc(100vh - 70px);
    overflow: auto;

    /* 薄グレー背景 */
    background: rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 14px;
    padding: 10px;

    /* 縦並び */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* メニュー項目の見た目：木目をやめて白～薄灰に（○っぽいノイズ対策にもなる） */
  nav.global-nav #globalMenu .header-bottun > a{
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 16px;

    background: rgba(255,255,255,.92);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
  }
  /* woodボタンのhover用の::beforeを無効化（スマホの見た目をシンプルに） */
  nav.global-nav #globalMenu .header-bottun > a::before{
    content: none !important;
    display: none !important;
  }

  /* サブメニュー（開いたときも縦並び＋少しインデント） */
  nav.global-nav #globalMenu .sub-menu{
    padding-left: 10px;
    margin-top: 6px;
  }
  nav.global-nav #globalMenu .sub-menu > li > a{
    height: 46px;
    font-size: 15px;
  }

  /* ===== ③ 「日付／アクセスカウンター／since」を縦並び ===== */
  .header-meta{
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 0 10px;
  }
  .header-meta .sep{ display:none; } /* 「｜」は縦並びだと不要 */

  /* 何が入っても縦に落ちるように（アクセスカウンターがあってもOK） */
  .header-meta > *{
    display: block;
    width: 100%;
    text-align: center;
  }
  /* メールアイコンも右寄せ解除して縦に */
  .mail-icon{ margin-left: 0; }

  /* ===== ④〜⑦ 本文の並び順：メイン→左→関連リンク→フッター ===== */
  .layout-3col{
    grid-template-columns: 1fr;
  }
  /* グリッド要素の順序を入れ替え（DOMはそのまま） */
  .layout-3col > .center-col{ order: 1; grid-row: 1; }
  .layout-3col > .left-col  { order: 2; grid-row: 2; }
  .layout-3col > .right-col { order: 3; grid-row: 3; }

  /* ===== 追加：スマホ時はメニューを開いたときだけ見せる ===== */
  .menu[hidden]{ display:none !important; }

  /* （念のため）リストマーカー完全OFF */
  nav.global-nav #globalMenu,
  nav.global-nav #globalMenu ul,
  nav.global-nav #globalMenu li{
    list-style: none !important;
    margin: 0;
    padding: 0;
  }
  nav.global-nav #globalMenu li::marker{ content:"" !important; }
}
