/*
 * EnVision サイト共通スタイル
 *
 * 構成:
 *   1. テーマ（色・フォント・幅）… デザインを変えるときは、まずここを編集する
 *   2. ベース / ヘッダ / フッタ
 *   3. レイアウト（本文 + サイドメニュー）
 *   4. 本文の部品（見出し・表・埋め込み・お知らせ）
 *   5. トップページ
 *   6. スマホ（〜700px）
 */

/* ========== 1. テーマ ========== */
:root {
  --color-bg: #dcf3f8;          /* ページ外側の背景 */
  --color-surface: #ffffff;     /* 本文の背景 */
  --color-text: #303030;
  --color-link: #0066cc;
  --color-link-hover: #0033cc;
  --color-border: #c0c0c0;
  --color-muted-bg: #f5f5f5;    /* メニュー・お知らせの薄い背景 */
  --color-accent: #0099cc;      /* h3 の線 */
  --color-nav-link: #4169e1;
  --color-rule: #999999;        /* h1 の線 */

  --font-base: verdana, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --font-size-base: 10pt;
  --line-height-base: 1.575;  /* 21px (10pt) */

  --width-page: 790px;
  --width-sidebar: 215px;
  --breakpoint: 700px;          /* 参考値（@media には直接書く）*/
}

/* ========== 2. ベース / ヘッダ / フッタ ========== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: 0.2px;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; border: 0; }

.page {
  max-width: var(--width-page);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding-bottom: 20px;
}

.site-header { border-bottom: 1px solid var(--color-border); }
.site-header__logo { padding: 6px 10px 2px; line-height: 0; }
.site-header__logo img { display: block; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  border-top: 1px solid var(--color-border);
  background: var(--color-muted-bg);
}
.site-nav a {
  padding: 6px 16px;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: var(--color-nav-link);
  border-left: 1px solid var(--color-border);
}

.site-footer { clear: both; margin-top: 10px; }
.site-footer__contact {
  padding: 5px 10px;
  border-bottom: 1px solid #dcdcdc;
  letter-spacing: 0.02em;
}
.site-footer__copyright {
  padding: 10px 10px 0 0;
  font-size: 8pt;
  text-align: right;
  color: #404040;
}

/* ========== 3. レイアウト ========== */
.layout { display: block; }
.layout--sidebar {
  display: grid;
  grid-template-columns: var(--width-sidebar) minmax(0, 1fr);
}

.content { padding: 0 10px 20px; min-width: 0; }

/* サイドメニュー */
.subnav { display: flex; background: var(--color-muted-bg); padding: 0 8px; }
.subnav__box { flex: 1; background: #dcdcdc; padding: 5px 0 2px; }
.subnav__title { display: block; margin: 0 auto 3px; }
.subnav__list { list-style: none; margin: 0; padding: 0; }
.subnav__list li { margin: 0; text-align: center; line-height: 0; }
.subnav__list a { display: block; padding-bottom: 0; }
.subnav__list img { display: block; margin: 0 auto; width: 190px; }
.subnav__list .on { display: none; }
.subnav__list a:hover .off { display: none; }
.subnav__list a:hover .on { display: block; }

/* ========== 4. 本文の部品 ========== */
.page-heading { margin: 0; padding: 5px 0 0; border: 0; line-height: 0; }

.content h1 {
  margin: 0 0 10px;
  padding: 10px 5px 5px;
  font-size: 12pt;
  font-weight: normal;
  line-height: 1.2;
  border-top: 2px solid var(--color-rule);
  border-bottom: 1px dotted var(--color-rule);
}
.content h2 { margin: 0; padding: 0 5px; font-size: 10pt; line-height: 1.5; }
.content h3 {
  margin: 0 5px 5px 0;
  padding: 5px 5px 3px;
  font-size: 10pt;
  line-height: 1.5;
  border-top: 2px solid var(--color-accent);
  border-bottom: 1px dotted var(--color-accent);
}
.content h4 { margin: 0; padding: 1px 0 5px; font-size: 12pt; line-height: 1.4; color: #191970; }
.content .page-heading { padding-top: 5px; }
.content p { margin: 0; padding: 1px 25px 0 10px; line-height: 1.5; }

/* 小見出しの帯 */
.title-bar {
  margin: 10px 0 8px;
  padding: 0.2em;
  font-size: 10pt;
  font-weight: normal;
  line-height: 2em;
  letter-spacing: 2px;
  background: var(--color-muted-bg);
  border-top: 1px solid #a9a9a9;
  border-bottom: 1px solid #a9a9a9;
}
.photo { border: 1px solid #696969; }

/* 段組み（リンク集など） */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 20px; padding: 0 10px; }

/* 日時・場所などの項目表 */
.info-table { width: 100%; border-collapse: collapse; margin: 0 0 10px; }
.info-table th,
.info-table td {
  padding: 3px;
  text-align: left;
  vertical-align: top;
  font-weight: normal;
}
.info-table th { width: 100px; white-space: nowrap; }

/* 組織概要などの項目表（罫線あり） */
.spec-table { width: 100%; border-collapse: collapse; margin: 0 0 10px; color: #404040; line-height: 1.5; }
.spec-table th,
.spec-table td {
  padding: 0.5em;
  text-align: left;
  vertical-align: top;
  font-weight: normal;
  border-bottom: 1px dotted #a9a9a9;
}
.spec-table th { width: 110px; border-right: 1px solid #a9a9a9; }
.spec-table tr.last th,
.spec-table tr.last td { border-bottom: 0; }

/* 列の多い表（幅が足りないときは横スクロール） */
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 460px; border-collapse: collapse; margin: 0 0 10px; }
.data-table th,
.data-table td { padding: 3px; text-align: left; vertical-align: top; font-weight: normal; }

/* 埋め込み（地図・PDFビューア） */
.embed { max-width: 100%; margin: 0 auto 10px; }
.embed iframe { display: block; width: 100%; max-width: 100%; border: 0; }

.center { text-align: center; }
.right { text-align: right; }

.small { font-size: 8pt; }

/* ========== 5. トップページ ========== */
.hero { padding: 0 10px; line-height: 0; }
.hero img { display: block; width: 100%; height: auto; }

.jigyo-nav {
  display: flex;
  margin-top: 5px;
  border-top: 2px solid #888;
  border-bottom: 2px solid #888;
  background: var(--color-muted-bg);
}
.jigyo-nav a {
  flex: 1;
  padding: 7px 4px;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  color: #333;
  border-right: 1px solid #bbb;
}
.jigyo-nav a:last-child { border-right: 0; }
.jigyo-nav a:hover { background: var(--color-nav-link); color: #fff; text-decoration: none; }

.home { padding: 10px; }
.banners { display: flex; gap: 8px; align-items: center; margin: 16px 0; padding-top: 16px; border-top: 2px solid #aaa; }
.banners a { flex: 1; min-width: 0; }
.banners img { display: block; width: 100%; border: 2px solid #aaa; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); }

.news__title { margin: 0; padding: 5px 5px 0 10px; font-size: 10pt; font-weight: normal; line-height: 1.575; border-top: 3px solid #888; background: var(--color-muted-bg); }
.news__list { margin: 0; padding: 10px; list-style: none; background: var(--color-muted-bg); line-height: 1.8; }
.news__item { padding-left: 7em; text-indent: -7em; margin-bottom: 0.3em; }
.news__note { display: block; }

.home-logo { margin-top: 16px; }
.home-logo img { height: 35px; width: auto; }

/* ========== 6. スマホ ========== */
@media screen and (max-width: 700px) {
  .page { border-left: 0; border-right: 0; }

  .site-nav { justify-content: stretch; }
  .site-nav a { flex: 1 1 auto; padding: 10px 8px; font-size: 12px; }

  /* サイドメニューを本文の上へ。ボタン画像は2列に並べる */
  .layout--sidebar { display: block; }
  .subnav { display: block; padding: 0; }
  .subnav__box { padding: 5px; }
  .subnav__title { display: none; }
  .subnav__list { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
  .subnav__list li { flex: 0 0 calc(50% - 2px); max-width: 190px; }
  .subnav__list img { width: 100%; }

  .content { padding: 0 8px 20px; }
  .content p { padding-right: 10px; }

  /* 項目表は 見出し → 内容 の縦並びにする */
  .info-table th,
  .info-table td { display: block; width: auto; }
  .info-table th { padding-bottom: 0; border-bottom: 0; font-weight: bold; }

  .home { padding: 5px; }
  .banners { flex-direction: column; }
  .banners a { flex: none; width: 100%; }
  .jigyo-nav { flex-wrap: wrap; }
  .jigyo-nav a { flex: 1 1 45%; border-bottom: 1px solid #bbb; }
}
