/* =============================================================================
   テンプレート「なみ」v0.1（takamiya 用。仕様: cms/docs/仕様_takamiyaテンプレート.md）
   白い上のメニュー（POINT の赤い字つき）。右の列に第 1 階層の一覧（今いるセクションだけ下を開く）。
   ページ名の帯は淡い灰色。上のメニューの下の階層は画像のタイル（画面の幅いっぱい）。
   フッターは濃い灰色（ロゴは白く）。スマホ（991px 以下）はハンバーガーの中へ文字の一覧。
   書体は游ゴシックだけ（Google Fonts は読まない）。
   ============================================================================= */
:root {
  --c-main: #03ab00;         /* 今いる所・リンク・上のメニューの線 */
  --c-mega-bg: #eff5ff;      /* 上のメニューの下の階層の地 */
  --c-title-bg: #f5f5f5;     /* ページ名の帯の地 */
  --c-line: #edede0;         /* 右の列の線 */
  --c-footer: #282828;       /* フッターの地 */
  --c-point: #e60012;        /* 上のメニューの右の文字（POINT） */
  --c-text: #555555;
  --c-muted: #999999;
  --c-bg: #ffffff;
  --c-link: var(--c-main);
  --c-primary: var(--c-main);
  --c-soft: #f5f5f5;
  --font-body: "游ゴシック体", YuGothic, "Yu Gothic Medium", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-heading: var(--font-body);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; color: #000; padding: .5em 1em; }
.page { background: var(--c-bg); min-height: 100vh; }
.nav-toggle, .nav-btn { display: none; }

/* ---- ヘッダー：白。左にロゴ（縦の線で区切る）、右に上のメニュー。今いる所は緑。POINT は赤い字 ---- */
.site-header { position: relative; background: #fff; border-bottom: 1px solid #f5f5f5; }
.header-in { display: flex; align-items: center; height: 100px; padding: 0 30px; }
.brand { display: flex; align-items: center; height: 60px; padding-right: 24px; margin-right: 6px; border-right: 1px solid #ddd; text-decoration: none; color: var(--c-text); }
.brand img { display: block; max-height: 60px; width: auto; height: auto; max-width: 260px; object-fit: contain; }
.head-nav { display: flex; align-items: center; margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; align-items: stretch; height: 100px; }
.main-nav > ul > li { display: flex; align-items: center; }
.main-nav > ul > li > a { display: flex; align-items: center; height: 100px; padding: 0 12px; font-size: 13px; font-weight: 700; color: #444; letter-spacing: 1px; text-decoration: none; }
.main-nav > ul > li > a:hover { color: var(--c-main); }
.main-nav .is-active > a, .main-nav .is-current > a { color: var(--c-main); }
.main-nav .has-sub > a::after { display: none; }
.main-nav .mega-tiles { border-top: 2px solid var(--c-main); background: var(--c-mega-bg); box-shadow: 0 13px 42px 11px rgba(0, 0, 0, .05); }
.main-nav .mega-tiles .mega-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; padding: 30px 30px 36px; }
.main-nav .mega-tile { width: 120px; }
.main-nav .mega-tile-img { width: 120px; height: 120px; aspect-ratio: auto; background: #ddd; border: 1px solid #e5e5e5; }
.main-nav .mega-tile > span:last-child { margin-top: 8px; font-size: 16px; font-weight: 600; line-height: 1.4; color: #222; }
.head-links { display: flex; align-items: center; margin-left: 6px; }
.head-links ul { display: flex; list-style: none; margin: 0; padding: 0; }
.head-links a { display: block; padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--c-point); letter-spacing: 1px; text-decoration: none; }

/* ---- 写真のあるページ（トップ）：ヘッダーを写真の上に透明に重ねる（仕様 Q2 は B）。
   スクロールすると（is-scrolled・base.html の小さな JS）黒い地 #333 のヘッダーが上に固定される ---- */
body.has-hero .site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 50; background: transparent; border-bottom-color: transparent; transition: background-color .3s; }
/* トップのメインビジュアル（data-height="full"）を画面いっぱいにする。ヘッダーは上に重なるので、画面の高さちょうどでよい（課題 32） */
.t-nami [data-block="hero"][data-height="full"] { --hero-h: 100svh; }
body.has-hero.is-scrolled .site-header { position: fixed; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
/* スクロールで縮む（パソコン幅のみ・全ページ）。ページの上は高さ 100px、縮んだら 64px。
   写真のないページは、ヘッダーを画面の上に固定し、本文が隠れないよう body の上の余白を縮める */
@media (min-width: 992px) {
  /* 上のメニューの右の「POINT」は、元のサイトと同じ絵（ロゴ）にする。文字は隠す（スマホの一覧では文字のまま） */
  .head-links a { width: 100px; height: 30px; padding: 0; margin-left: 12px; font-size: 0; background: url(/images/menu/pointlogo.png) center / contain no-repeat; }
  body.has-hero .brand { border-right-color: rgba(255, 255, 255, .6); }
  body.has-hero .main-nav > ul > li > a { color: #f7f7f7; }
  .header-in, .brand, .brand img, .main-nav > ul, .main-nav > ul > li > a, body { transition: height .3s, max-height .3s, color .3s, padding-top .3s; }
  body.is-scrolled .header-in, body.is-scrolled .main-nav > ul, body.is-scrolled .main-nav > ul > li > a { height: 72px; }
  /* ロゴの高さは管理画面の「ロゴの大きさ」（インラインの style）で決まる。上限は 100px（特大 80px が入るように）。縮んだら 40px */
  .brand { height: auto; }
  /* ロゴは見える部分だけの画像（logo-trim.png。上下の透明を削った）を、幅 250px で出す。ロゴの大きさの設定は PC では効かない */
  .brand img { content: url(logo-trim.png); width: 180px !important; height: auto !important; max-height: none !important; }
  body.is-scrolled .brand img { width: 130px !important; }
  /* 上の表示だけ、ロゴを 1.25 倍（今の公開サイトの 150×100 に近づける。設定の大きさの違いは残る） */
  /* トップ（写真の上）の上の表示は、ロゴを白く（フッターのロゴと同じ作り） */
  body.has-hero:not(.is-scrolled) .brand img { content: url(logo-white.png); }
  body.is-scrolled .brand { border-right-color: #ddd; }
  body.is-scrolled .main-nav > ul > li > a { color: #444; }
  body.is-scrolled .site-header { box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
  body:not(.has-hero) .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; }
  body:not(.has-hero) { padding-top: 100px; }
  body:not(.has-hero).is-scrolled { padding-top: 72px; }
}

/* ---- ページ名の帯：淡い灰色。見出しは左、パンくずは右下 ---- */
.ptitle { position: relative; background: var(--c-title-bg); border-bottom: 1px solid #eee; padding: 64px 0; }
.ptitle h1 { max-width: 1200px; margin: 0 auto; padding: 0 30px; box-sizing: border-box; font-size: 32px; font-weight: 600; line-height: 1.3; letter-spacing: 1px; color: #333; }
.ptitle .crumb { position: absolute; right: max(30px, calc(50% - 570px)); bottom: 14px; font-size: 14.4px; color: #555; }
.crumb ol, .crumb-bar ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.crumb li + li::before { content: "/"; margin: 0 .5em; }
.crumb a { color: #555; text-decoration: none; }
.crumb-bar { padding: 10px 0; font-size: 14.4px; color: #555; }
.crumb-bar ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 auto; padding: 0 30px; box-sizing: border-box; max-width: 1200px; }
.crumb-bar li + li::before { content: "/"; margin: 0 .5em; }
.crumb-bar a { color: #555; text-decoration: none; }
.crumb:empty, .crumb-bar:empty { display: none; }

/* ---- 骨組み：本文と右の列（1fr ＋ 287px、間 30px）。上下 80px の余白 ---- */
.frame { display: grid; grid-template-columns: minmax(0, 1fr) 287px; column-gap: 30px; align-items: start; padding: 80px 30px; max-width: 1200px; margin: 0 auto; }
.frame-left { grid-template-columns: 287px minmax(0, 1fr); }
.frame-left .side-col { order: -1; }
.main-col { min-width: 0; }
.full { padding: 80px 30px; max-width: 1200px; margin: 0 auto; }
.side-col { min-width: 0; }
.side-area:not(:empty) { margin-top: 24px; }
.side-area img { max-width: 100%; height: auto; }
.side-area:empty { display: none; }

/* ---- 右の列（横のメニュー）：第 1 階層は全部並び、今いるセクションだけ下の階層を全部開く（Q1）
   nav.tree の中身を CSS で絞る。下の階層は隠し、今いる第 1 階層の中だけ開く ---- */
.side-tree ul { list-style: none; margin: 0; padding: 0; }
.side-tree li { border-bottom: 1px solid var(--c-line); }
.side-tree a { position: relative; display: block; padding: 8px 0 8px 18px; font-size: 14.4px; font-weight: 700; color: #666; text-decoration: none; line-height: 1.6; }
.side-tree a::before { content: "▸"; position: absolute; left: 0; top: 8px; color: #666; }
.side-tree a:hover { color: var(--c-main); }
.side-tree .t1 > a { padding-left: 18px; }
.side-tree .t2 > a { padding-left: 43px; }
.side-tree .t2 > a::before { left: 25px; }
.side-tree .t3 > a { padding-left: 68px; }
.side-tree .t3 > a::before { left: 50px; }
.side-tree > ul > li:first-child { display: none; }
.side-tree ul ul { display: none; }
.side-tree li.t1.is-active ul { display: block; }
.side-tree .is-current > a, .side-tree .is-active > a { color: var(--c-main); }

/* ---- 本文 ---- */
.cms-content { color: var(--c-text); font-family: var(--font-body); line-height: 1.8; overflow-wrap: anywhere; --block-gap: 1.6rem; }
.cms-content p { margin: 0 0 1em; }
.cms-content a { color: var(--c-main); text-decoration: none; }
.cms-content a:hover { text-decoration: underline; }
.cms-content h2 { font-size: 1.6em; font-weight: 600; line-height: 1.5; color: #333; margin: 0 0 .8em; padding: 0 0 .3em; border: 0; border-bottom: 1px solid #ccc; background: none; }
.cms-content h3 { font-size: 1.3em; font-weight: 600; line-height: 1.5; color: #333; margin: 0 0 .6em; padding: 0; border: 0; background: none; }
.cms-content h4 { font-size: 1.05em; font-weight: 600; color: #333; margin: 0 0 .5em; }
.cms-content table { width: 100%; border-collapse: collapse; }
.cms-content th, .cms-content td { padding: 8px; border-bottom: 1px solid #dee2e6; text-align: left; vertical-align: top; }
.cms-content figcaption { color: var(--c-muted); }
/* 見出しの部品（トップ・全幅のページ）は中央寄せ・下に短い線 */
.layout-full-width .cms-content h2 { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: 1px; color: #333; border: 0; padding: 0; margin: 0 0 1em; }
.layout-full-width .cms-content h2::after { content: ""; display: block; width: 40px; height: 2px; margin: 12px auto 0; background: var(--c-main); }
/* 画像のカード（cards）と お知らせのカード：4 列、画像は 1:1 の淡い枠、題は 15px・600 */
[data-block="cards"]:not([data-cols]) { --cols: 4; }
[data-block="cards"] .b-card img { aspect-ratio: 1 / 1; border: 1px solid #eee; }
[data-block="cards"] .b-card h3 { font-size: 15px; font-weight: 600; color: #333; line-height: 1.5; margin: .8rem 0 .4rem; }
[data-block="cards"] .b-card p { font-size: 13px; color: var(--c-muted); }
.b-news-cards li .b-news-title { font-size: 15px; font-weight: 600; color: #333; }
.b-news-cards time, .b-news-cards .b-news-date { font-size: 13px; color: var(--c-muted); }

/* 画像＋文章（textpic）は 50％ずつ（共通の 2:3・3:2 を上書き。スマホは _base のとおり縦に並ぶ） */
@media (min-width: 761px) {
  [data-block="textpic"], [data-block="textpic"][data-pos="right"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
/* 写真の角は丸くしない（共通の 8px を 0 にする。画像の部品・ギャラリーも同じ） */
[data-block="textpic"] .b-media img, [data-block="image"] img, [data-block="gallery"] img { border-radius: 0; }
/* お知らせの写真（カード）は正方形（共通は 4:3。トップ・一覧のどちらも同じ） */
.b-news-img { aspect-ratio: 1 / 1; }

/* ---- フッター：濃い灰色。上に淡い線。左に白いロゴと著作権、右に住所（Q3：ロゴは白く） ---- */
.site-footer { background: var(--c-footer); border-top: 5px solid rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .75); font-size: 14px; line-height: 1.8; }
.footer-top { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 50px 30px 40px; max-width: none; }
.footer-logo img { filter: brightness(0) invert(1); max-height: 60px; width: auto; height: auto; }
.footer-right .site-info { color: rgba(255, 255, 255, .75); }
.site-info p { margin: 0 0 .3em; }
.site-info a { color: inherit; }
.footer-nav:not(:has(li)) { display: none; }
.footer-nav ul { list-style: none; margin: 1em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3em 1.2em; }
.footer-nav a { color: inherit; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.copy { margin: 1em 0 0; font-size: 13px; color: rgba(255, 255, 255, .75); }
.footer-left .copy { margin-top: 1.2em; }

/* ---- スマホ（991px 以下）：ロゴとハンバーガーだけ。開くと上のメニューの文字の一覧（タイルは出さない）。右の列は本文の下 ---- */
@media (max-width: 991px) {
  .header-in { height: auto; min-height: 0; padding: 10px 12px; }
  .brand { height: 48px; padding-right: 0; margin-right: 0; border-right: 0; flex: 1; min-width: 0; }
  .brand img { max-height: 48px; max-width: calc(100vw - 90px); }
  .nav-btn { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; flex: none; width: 44px; height: 44px; margin-left: 8px; background: var(--c-main); cursor: pointer; }
  .nav-btn span { display: block; width: 24px; height: 2px; background: #fff; transition: transform .2s, opacity .2s; }
  .nav-btn b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
  .nav-toggle:checked ~ .page .nav-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .page .nav-btn span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .page .nav-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-toggle:focus-visible ~ .page .nav-btn { outline: 2px solid var(--c-main); }
  .head-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin: 0; background: #fff; border-top: 1px solid #eee; box-shadow: 0 8px 20px rgba(0, 0, 0, .08); flex-direction: column; align-items: stretch; }
  .nav-toggle:checked ~ .page .head-nav { display: block; }
  .main-nav > ul { display: block; height: auto; }
  .main-nav > ul > li { display: block; border-bottom: 1px solid #eee; }
  .main-nav > ul > li > a { height: auto; padding: 14px 18px; font-size: 14px; letter-spacing: .5px; }
  .main-nav .sub, .main-nav .mega { display: block; position: static; }
  .main-nav .sub a, .main-nav .mega a { padding-left: 2.2em !important; font-size: .9em; }
  .main-nav .mega-tiles { border-top: 0; background: #fff; box-shadow: none; }
  .main-nav .mega-tiles .mega-in { display: block; padding: 0; }
  .main-nav .mega-tile-img { display: none; }
  .main-nav .mega-tile > span:last-child { margin-top: 0; font-size: .9em; font-weight: 400; color: #333; }
  .head-links { margin: 0; border-top: 1px solid #eee; }
  .head-links ul { display: block; }
  .head-links li { border-bottom: 1px solid #eee; }
  .head-links a { padding: 14px 18px; font-size: 14px; }
  .ptitle { padding: 32px 12px; text-align: center; }
  .ptitle h1 { font-size: 23.5px; padding: 0; }
  .ptitle .crumb { position: static; margin-top: 12px; justify-content: center; }
  .crumb-bar { padding: 8px 12px; text-align: center; }
  .crumb-bar ol { justify-content: center; padding: 0; }
  .frame, .frame-left { display: block; padding: 32px 12px; }
  .side-col { margin-top: 40px; }
  .frame-left .side-col { order: 0; }
  .full { padding: 32px 12px; }
  .layout-full-width .cms-content h2 { font-size: 23px; }
  .footer-top { grid-template-columns: 1fr; gap: 20px; padding: 32px 16px; text-align: center; }
  .footer-nav ul { justify-content: center; }
  [data-block="cards"]:not([data-cols]) { --cols: 2; }
  .cms-content { --block-gap: 1.2rem; }
}
