/* =============================================================================
   テンプレート「わかば」 v0.1（kitaqshinsyo 用。仕様: cms/docs/仕様_kitaqshinsyoテンプレート.md）
   灰色の上のメニュー、緑の線の見出し、右に白い箱のメニュー、緑のフッター。
   画像は持たず CSS だけで描く（ロゴ・帯の木の絵は設定とデータで入れる）。ヘッダー・上のメニュー・フッターの地は画面の端まで。スマホ対応。文字サイズ・背景色の切り替えは theme.js（<html> の data-fs・data-bg）。
   ============================================================================= */
:root {
  --c-accent: #4a8e23;      /* 見出しの線・印 */
  --c-header: #5cc717;      /* ヘッダーの地 */
  --c-nav: #e6e6e6;         /* 上のメニューの帯 */
  --c-footer: #24a700;      /* フッター上段 */
  --c-footer-2: #66cc00;    /* フッター下段 */
  --c-text: #333333;
  --c-link: #0a3d91;
  --c-line: #dddddd;
  --c-soft: #f3f6f0;
  --c-bg: #ffffff;
  --font-body: "BIZ UDPGothic", "BIZ UDGothic", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --page: 980px;
  --side: 220px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 文字の大きさ（theme.js が data-fs を付ける。部品は rem なので全体が大きくなる） */
html[data-fs="l"] { font-size: 120%; }
html[data-fs="xl"] { font-size: 140%; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font-family: var(--font-body); font-size: .9375rem; line-height: 1.8; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: .5em 1em; }
.page { background: var(--c-bg); min-height: 100vh; }
/* 帯（ヘッダー・上のメニュー・フッター）以外は 980px の中央に置く */
.page > :not(.site-header):not(.site-footer) { max-width: var(--page); margin-inline: auto; }
.header-in, .main-nav > ul, .footer-nav-in, .footer-in, .copy { max-width: var(--page); margin-inline: auto; }

/* ---- ヘッダー・上のメニュー ---- */
.site-header { position: relative; }
.header-bar { background: var(--c-header); color: #fff; }
.header-in { display: flex; flex-wrap: wrap; align-items: center; padding-block: 6px; }
.brand { padding: 0 12px; text-decoration: none; color: #fff; font-size: 1.3rem; font-weight: 700; }
.brand img { display: block; width: auto; max-width: min(70vw, 420px); height: auto; object-fit: contain; }
.util-nav { margin-left: auto; margin-right: 12px; }
.util-nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.util-nav li { padding: 0 .8em; border-left: 1px solid rgba(255,255,255,.6); line-height: 1.2; }
.util-nav a { font-size: .78rem; color: #fff; text-decoration: none; }
.util-nav a:hover { text-decoration: underline; }
.main-nav { background: var(--c-nav); border-bottom: 3px solid #d9d9d9; }
.main-nav > ul { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; margin-block: 0; padding: 0 .5rem; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a { display: block; padding: .5rem 1rem; color: var(--c-text); text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.5rem; letter-spacing: 1px; transition: background .2s, color .2s; }
.main-nav > ul > li > a:hover, .main-nav > ul > .is-active > a, .main-nav > ul > .is-current > a { background: #333; color: #fff; }
.nav-toggle, .nav-btn { display: none; }

/* 切り替えのボタン（base.html では hidden。theme.js が動いたときだけ外す） */
.tool-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-right: 12px; padding: 5px 8px; background: #e8f5dc; color: #333; border-radius: 8px; font-size: .78rem; }
.tool-switch[hidden] { display: none; }
.tool-group { display: flex; align-items: center; gap: 4px; }
.tool-label { margin-right: .3em; white-space: nowrap; }
.tool-switch button { font: inherit; padding: .2em .7em; border: 1px solid #999; background: #fff; color: #333; border-radius: 3px; cursor: pointer; }
.tool-switch button[aria-pressed="true"] { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.tool-switch button:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }

/* ---- パンくず ---- */
.crumbs { font-size: .78rem; color: #555; padding: 6px 12px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25em; }
.crumbs li + li::before { content: "＞"; margin-right: .25em; color: #777; }
.crumbs a { color: var(--c-link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs:empty { display: none; }

/* ---- 2カラム ---- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 0 20px; align-items: start; padding: 0 12px; }
.cols.side-left { grid-template-columns: var(--side) minmax(0, 1fr); }
.cols.side-left .side-nav { order: -1; }
.cols > main { padding: 8px 0 50px; }
.one-col { padding: 8px 12px 50px; }
.full { padding: 20px 0 50px; }
.full > [data-block] { padding-inline: 12px; }

/* ---- 右（左）のメニュー：ベージュの外枠の中に、第1階層ごとに白い角丸の箱。今いる所は黄色の地。印は緑の丸 ---- */
.side-nav { padding-top: 8px; }
.side-title { display: none; }
.side-menu .side-title { color: #333; }
.side-menu { background: var(--c-side, #f3ecdc); border-radius: 10px; padding: 8px; }
.side-menu ul { list-style: none; margin: 0; padding: 0; }
.side-menu > ul > li { background: #fff; border-radius: 8px; padding: 2px 8px 4px; }
.side-menu > ul > li + li { margin-top: 6px; }
.side-menu a { position: relative; display: block; padding: 7px 4px 7px 18px; color: #333; text-decoration: none; font-size: .85rem; line-height: 1.5; border-top: 1px dotted #aaa; }
.side-menu > ul > li > a { border-top: 0; font-weight: 700; font-size: .95rem; }
.side-menu a::before { content: ""; position: absolute; left: 4px; top: 1.05em; width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); }
.side-menu ul ul a { padding-left: 28px; font-weight: 400; }
.side-menu ul ul a::before { left: 14px; width: 7px; height: 7px; opacity: .7; }
.side-menu ul ul ul a { padding-left: 38px; }
.side-menu ul ul ul a::before { left: 24px; }
.side-menu a:hover { background: #f6f1e4; }
.side-menu .is-current > a { background: var(--c-current, #fde9a8); color: #333; font-weight: 700; }

/* ---- 本文の見出し（画像なし：線と色で） ---- */
.t-wakaba .cms-content { line-height: 1.8; --block-gap: 1.4rem; }
.t-wakaba [data-block="heading"] h1 { font-size: 1.7rem; font-weight: 700; line-height: 1.4; margin: 14px 0 10px; padding: 8px 8px 6px 18px;
  border: 1px solid var(--c-line); border-left: 8px solid var(--c-accent); border-bottom: 3px solid var(--c-accent); background: linear-gradient(#fff, var(--c-soft)); }
.t-wakaba .cms-content h2 { font-size: 1.35rem; line-height: 1.4; padding: 10px 6px 8px 22px; margin: 14px 0 7px; position: relative;
  border: 1px solid var(--c-line); border-bottom: 3px solid var(--c-accent); background: linear-gradient(#fff, var(--c-soft)); }
.t-wakaba .cms-content h2::before { content: ""; position: absolute; left: 7px; top: 50%; translate: 0 -50%; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
.t-wakaba .cms-content h3 { font-size: 1.15rem; line-height: 1.4; padding: 8px 6px 6px 14px; margin: 14px 0 10px;
  border: 1px solid var(--c-line); border-left: 6px solid var(--c-accent); background: linear-gradient(#fff, #f1f1f1); }
.t-wakaba .cms-content h4 { font-size: 1.05rem; line-height: 1.4; padding: 6px 4px 4px 12px; margin: 12px 0 8px; border-left: 4px solid var(--c-accent); }
.t-wakaba [data-block="steps"] li > h3, .t-wakaba [data-block="cards"] .b-card h3 { border: 0; background: none; padding: 0; margin: 0; }
.t-wakaba [data-block="snippet"] > h3:first-child { margin-top: 0; }

/* ---- 見出し帯（高さ「帯」のメインビジュアル。文字は左（1段目＝濃い字、2段目＝小さな一言）。画像があるときは右に全体を見せる） ---- */
.t-wakaba [data-block="hero"][data-height="band"] { background: linear-gradient(90deg, #fff, var(--c-soft)); color: var(--c-text); border-bottom: 3px solid #c6c6c6; }
.t-wakaba [data-block="hero"][data-height="band"] .b-hero-slide::after { display: none; }
.t-wakaba [data-block="hero"][data-height="band"] .b-hero-slide img { inset: auto 0 0 auto; width: auto; height: min(100%, 90px); width: 330px; max-width: 40%; object-fit: contain; object-position: right bottom; }
/* 文字は木の分だけ幅を空けて、長い一言は折り返す（重ならない） */
@media (min-width: 761px) { .t-wakaba [data-block="hero"][data-height="band"] .b-hero-slide:has(img) .b-hero-text { width: calc(100% - min(330px, 40%) - 16px); } }
.t-wakaba [data-block="hero"][data-height="band"] .b-hero-text { display: flex; flex-direction: column; padding-inline: 20px; text-shadow: none; }
.t-wakaba [data-block="hero"][data-height="band"] .b-hero-title { order: -1; margin: 0 !important; font-size: 1.7rem; font-weight: 700; color: var(--c-text); text-transform: none; }
.t-wakaba [data-block="hero"][data-height="band"] .b-hero-sub { font-size: .9rem; letter-spacing: .05em; text-transform: none; opacity: 1; color: var(--c-text); }
.has-hero .band { display: none; }

/* ---- フッター：上段は緑の帯に白いリンク（右寄せ）、下段は住所・電話・コピーライト ---- */
.site-footer { margin-top: 20px; color: #fff; font-size: .9rem; }
.footer-nav { background: var(--c-footer); }
.footer-nav ul { list-style: none; margin: 0 auto; padding: .6rem 1rem; max-width: var(--page); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem 1.4rem; }
.footer-nav a { color: #fff; text-decoration: none; white-space: nowrap; }
.footer-nav a:hover { text-decoration: underline; }
.footer-main { background: var(--c-footer-2); }
.footer-in { padding: 1rem 1rem .5rem; }
.copy { padding-inline: 1rem; }
.site-info p { margin: 0; }
.site-info a { color: inherit; }
.footer-name { margin: 0; font-weight: 700; }
.copy { margin-block: 0; padding-block: .6rem; text-align: center; font-size: .9rem; }

/* ---- お知らせ一覧：札（.b-news-cat）をタイトルの高さまで伸ばさず、日付・札・タイトルの1行目をそろえる（PC だけ。スマホは縦並びのまま） ---- */
@media (min-width: 761px) { .t-wakaba [data-block="news"] li { align-items: baseline; } }

/* ---- スマホ ---- */
@media (max-width: 760px) {
  .brand img { max-height: 56px; }
  /* 1行目：ロゴ・（ヘッダーのリンク）・ハンバーガー／2行目：文字の大きさ・背景色 */
  .brand { order: 1; }
  .util-nav { order: 2; margin-right: 0; }
  .nav-btn { order: 3; }
  .header-in::after { content: ""; flex-basis: 100%; order: 4; height: 0; }
  .tool-switch { order: 5; max-width: calc(100% - 24px); box-sizing: border-box; margin: 6px 12px; }
  .nav-btn { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; margin-left: auto; margin-right: 8px; width: 48px; height: 44px; cursor: pointer; }
  .nav-btn span { display: block; width: 24px; height: 2px; background: #fff; transition: transform .2s, opacity .2s; }
  .nav-btn b { font-size: .6rem; font-weight: 400; line-height: 1; margin-top: 2px; }
  .nav-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
  .main-nav { display: none; }
  .nav-toggle:checked ~ .main-nav { display: block; }
  .nav-toggle:checked ~ .header-bar .nav-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .header-bar .nav-btn span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .header-bar .nav-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-toggle:focus-visible ~ .header-bar .nav-btn { outline: 2px solid #fff; }
  .main-nav > ul { flex-direction: column; flex-wrap: nowrap; padding: 0; }
  .main-nav > ul > li > a { padding: 12px 18px; border-top: 1px solid rgba(0,0,0,.12); }
  .cols, .cols.side-left { grid-template-columns: 1fr; padding: 0 12px; }
  .cols.side-left .side-nav { order: 0; }
  .cols > main { padding: 8px 0 30px; }
  .one-col { padding: 8px 12px 30px; }
  .side-title { display: block; margin: 0 0 4px; font-weight: 700; font-size: .9rem; }
  .footer-nav ul { justify-content: flex-start; }
  .t-wakaba [data-block="heading"] h1 { font-size: 1.4rem; }
  .t-wakaba [data-block="hero"][data-height="band"] .b-hero-title { font-size: 1.3rem; }
  .t-wakaba [data-block="hero"][data-height="band"] .b-hero-text { padding-inline: 14px; }
  /* 木の絵は小さく薄くして、文字を優先する */
  .t-wakaba [data-block="hero"][data-height="band"] .b-hero-slide img { opacity: .35; }
}

/* ドロップダウン・メガメニュー（灰色の帯と同じ系統の面） */
.main-nav .sub, .main-nav .mega { background: var(--c-nav); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.main-nav .sub a, .main-nav .mega a { color: var(--c-text); font-size: .9rem; padding: 8px 18px; }
.main-nav .sub a:hover, .main-nav .mega a:hover { background: #333; color: #fff; }
.main-nav .mega a { padding: 4px 0; }
.main-nav .mega-h { border-left: 3px solid var(--c-accent); padding-left: 8px !important; font-weight: 700; }
.main-nav .sub .is-current > a, .main-nav .mega .is-current > a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .main-nav .sub, .main-nav .mega { box-shadow: none; } .main-nav .sub a, .main-nav .mega a { border-top: 1px solid rgba(0,0,0,.08); padding-top: 10px; padding-bottom: 10px; } .main-nav .mega-h { border-left: 0; } }
.t-wakaba { --mega-gap: 3px; }

/* ---- サイドの部品（メニューの上・下）。スマホでは 上の部品 → 本文 → メニュー → 下の部品 の順 ---- */
.side-area:not(:empty) + .side-menu, .side-menu + .side-area:not(:empty), .side-top:not(:empty) + .side-bottom:not(:empty) { margin-top: 14px; }
@media (max-width: 760px) {
  .cols > .side-nav { display: contents; }
  .cols > .side-nav > .side-top { order: -1; }
  .cols > .side-nav > .side-menu { order: 1; margin-bottom: 20px; }
  .cols > .side-nav > .side-bottom { order: 2; }
}

/* ---- 背景色「黒」（theme.js が data-bg="dark" を付ける。色の変数を上書きして作る。リンクは黄色系） ---- */
html[data-bg="dark"] { --c-bg: #000000; --c-text: #ffffff; --c-link: #ffcc33; --c-line: #666666; --c-soft: #1c1c1c; --c-muted: #d0d0d0; --c-nav: #222222; color-scheme: dark; }
html[data-bg="dark"] .main-nav { border-bottom-color: #555; }
html[data-bg="dark"] .main-nav > ul > li > a:hover, html[data-bg="dark"] .main-nav > ul > .is-active > a, html[data-bg="dark"] .main-nav > ul > .is-current > a,
html[data-bg="dark"] .main-nav .sub a:hover, html[data-bg="dark"] .main-nav .mega a:hover { background: #ffffff; color: #000000; }
html[data-bg="dark"] .util-nav li { border-left-color: #888; }
html[data-bg="dark"] .crumbs, html[data-bg="dark"] .crumbs li + li::before { color: #d0d0d0; }
html[data-bg="dark"] .skip { background: #000; color: #fff; }
html[data-bg="dark"] .t-wakaba [data-block="heading"] h1 { background: linear-gradient(#000, var(--c-soft)); }
html[data-bg="dark"] .t-wakaba .cms-content h2 { background: linear-gradient(#000, var(--c-soft)); }
html[data-bg="dark"] .t-wakaba .cms-content h3 { background: linear-gradient(#000, var(--c-soft)); }
html[data-bg="dark"] .t-wakaba [data-block="hero"][data-height="band"] { background: linear-gradient(90deg, #000, var(--c-soft)); border-bottom-color: #888; }
html[data-bg="dark"] .tool-switch { background: #1c1c1c; color: #fff; }
html[data-bg="dark"] .tool-switch button { background: #000; color: #fff; border-color: #aaa; }
html[data-bg="dark"] .tool-switch button[aria-pressed="true"] { background: var(--c-link); border-color: var(--c-link); color: #000; }
html[data-bg="dark"] .nav-btn span { background: #fff; }
html[data-bg="dark"] .side-menu { background: #1c1c1c; border: 1px solid #555; }
html[data-bg="dark"] .side-menu > ul > li { background: #000; }
html[data-bg="dark"] .side-menu .side-title, html[data-bg="dark"] .side-menu a { color: #fff; }
html[data-bg="dark"] .side-menu a { border-top-color: #666; }
html[data-bg="dark"] .side-menu a:hover { background: #222; }
html[data-bg="dark"] .side-menu .is-current > a { background: var(--c-link); color: #000; }

/* ---- トップ（index）だけ：写真のボタン・緑の帯の見出し・1 行の新着。
   手がかり = 「メニューの無い配置（layout-no-menu）で、メインビジュアルが無い」ページ ---- */
.t-wakaba.layout-no-menu:not(.has-hero) [data-block="cards"] .b-card h3 { margin: 0; padding: .45em .5em; text-align: center; background: var(--c-accent); color: #fff; font-size: .95rem; line-height: 1.4; }
.t-wakaba.layout-no-menu:not(.has-hero) .cms-content [data-block="heading"] h2 { text-align: center; color: #fff; background: var(--c-accent); border: 0; padding: 6px 12px; }
.t-wakaba.layout-no-menu:not(.has-hero) .cms-content [data-block="heading"] h2::before { display: none; }
@media (min-width: 761px) {
  .t-wakaba.layout-no-menu:not(.has-hero) [data-block="news"] li { padding-block: .3em; gap: .8em; align-items: baseline; }
  .t-wakaba.layout-no-menu:not(.has-hero) [data-block="news"] time { order: 0; min-width: 7.5em; }
  .t-wakaba.layout-no-menu:not(.has-hero) [data-block="news"] li > a { order: 1; flex: 1; min-width: 0; }
  .t-wakaba.layout-no-menu:not(.has-hero) [data-block="news"] li .b-news-cat { order: 2; margin: 0; }
}
