/* =========================================================
   信州数理科学研究センター  共通デザイン
   色や文字の大きさを変えたいときは、下の「:root」の値だけを変える
   ========================================================= */
:root {
  --ink: #1d1d1f;          /* 本文の文字色 */
  --ink-2: #4a4a50;        /* 補足の文字色 */
  --ink-3: #86868b;        /* 薄い文字色 */
  --bg: #ffffff;           /* 背景 */
  --bg-2: #f5f5f7;         /* 薄いグレーの背景 */
  --line: #d2d2d7;         /* 罫線 */
  --accent: #2c5e50;       /* アクセント色（信州の森の緑） */
  --accent-2: #3f7f6c;
  --accent-soft: #e8f0ed;
  --night: #121a17;        /* フッターなどの暗い色 */
  --radius: 18px;
  --max: 1120px;
  --font: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.75;
  letter-spacing: .01em; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* 日本語・英語の切り替え（<span class="ja">…</span><span class="en">…</span>） */
html[lang="ja"] .en, html[lang="en"] .ja { display: none !important; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.site-header .wrap { display: flex; align-items: center; height: 56px; gap: 24px; }
.brand { color: var(--ink); font-weight: 700; font-size: 15px; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.current { color: var(--ink); font-weight: 600; }
.lang-btn {
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  border-radius: 999px; padding: 3px 11px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 17px; padding: 12px 0; border-bottom: 1px solid #eee; }
  .lang-btn { align-self: flex-start; margin-top: 14px; font-size: 13px; padding: 5px 14px; }
}

/* ---------- トップの大きな写真 ---------- */
.hero {
  position: relative; min-height: min(86vh, 780px); display: flex; align-items: flex-start;
  background: #3b6fb3 url("img/mountains.jpg") center 60% / cover no-repeat; color: #fff; overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(6,18,36,.62) 0%, rgba(6,18,36,.35) 45%, rgba(6,18,36,0) 75%),
  linear-gradient(180deg, rgba(6,18,36,.25) 0%, rgba(6,18,36,0) 40%, rgba(0,0,0,.2) 100%); }
@media (max-width: 700px) { .hero::after { background: linear-gradient(180deg, rgba(6,18,36,.55) 0%, rgba(6,18,36,.4) 55%, rgba(0,0,0,.1) 100%); } }
.hero .wrap { position: relative; z-index: 1; padding-top: clamp(72px, 14vh, 140px); width: 100%; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .92; margin-bottom: 18px; }
.hero h1 { word-break: keep-all; overflow-wrap: anywhere; max-width: 900px; font-size: clamp(34px, 5.4vw, 64px); font-weight: 700; letter-spacing: -.02em; text-shadow: 0 2px 30px rgba(0,0,0,.15); }
.hero .lead { font-size: clamp(15px, 1.5vw, 18px); max-width: 560px; margin-top: 22px; opacity: .96; line-height: 1.8; }

/* ---------- 下層ページの見出し帯 ---------- */
.page-hero { background: var(--bg-2); padding: 72px 0 48px; }
.page-hero.chalk { background: #1f3a33 url("img/chalkboard.jpg") center / cover no-repeat; color: #fff; position: relative; }
.page-hero.chalk::before { content: ""; position: absolute; inset: 0; background: rgba(12,26,22,.55); }
.page-hero .wrap { position: relative; }
.page-hero h1 { font-size: clamp(32px, 5vw, 56px); }
.page-hero p { margin: 14px 0 0; color: var(--ink-2); max-width: 680px; }
.page-hero.chalk p { color: rgba(255,255,255,.85); }
.page-hero .eyebrow { color: var(--accent); }
.page-hero.chalk .eyebrow { color: #b9dccd; }

/* ---------- セクション ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.more { font-size: 15px; font-weight: 500; white-space: nowrap; }
.more::after { content: " ›"; }

/* ---------- 次回の談話会カード ---------- */
.feature {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px;
  background: var(--bg); border-radius: var(--radius); padding: 44px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.06);
}
.feature .tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.bigdate { font-family: "Inter", sans-serif; line-height: 1; }
.bigdate .md { font-size: 64px; font-weight: 700; letter-spacing: -.03em; }
.bigdate .y { font-size: 15px; color: var(--ink-3); margin-top: 10px; }
.bigdate .wd { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.feature h3 { font-size: clamp(22px, 2.6vw, 30px); margin: 4px 0 14px; }
.meta { color: var(--ink-2); font-size: 15px; }
.meta div { margin: 2px 0; }
@media (max-width: 700px) {
  .feature { grid-template-columns: 1fr; gap: 18px; padding: 28px 22px; }
  .bigdate .md { font-size: 48px; }
}

/* ---------- お知らせ ---------- */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news li { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.news time { color: var(--ink-3); font-size: 14px; font-family: "Inter", sans-serif; padding-top: 2px; }
.news .body a { margin-left: .4em; white-space: nowrap; }
@media (max-width: 640px) { .news li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- カード（訪問者など） ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--bg); border-radius: 14px; padding: 22px 22px 20px; border: 1px solid rgba(0,0,0,.06); }
.card .when { font-size: 13px; color: var(--ink-3); font-family: "Inter", sans-serif; }
.card .name { font-size: 18px; font-weight: 700; margin-top: 6px; }
.card .inst { font-size: 14px; color: var(--ink-2); }
.card .field { margin-top: 12px; font-size: 13px; display: inline-block; background: var(--bg-2); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); }

/* ---------- 黒板の帯（セミナー） ---------- */
.band { position: relative; color: #fff; background: #1f3a33 url("img/chalkboard.jpg") center / cover no-repeat; padding: 104px 0; }
.band::before { content: ""; position: absolute; inset: 0; background: rgba(10,22,18,.6); }
.band .wrap { position: relative; }
.band h2 { font-size: clamp(28px, 3.6vw, 44px); }
.band p { color: rgba(255,255,255,.82); max-width: 620px; margin-top: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.pill {
  color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 9px 18px; font-size: 15px;
  background: rgba(255,255,255,.06); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: .15s;
}
.pill:hover { background: #fff; color: var(--ink); text-decoration: none; }

/* ---------- 年度の切り替えボタン ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.chip {
  font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  border-radius: 999px; padding: 5px 14px; cursor: pointer; font-family: "Inter", var(--font);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar select { font: inherit; font-size: 15px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.count { color: var(--ink-3); font-size: 14px; margin: -20px 0 24px; }

/* ---------- 談話会の一覧 ---------- */
.talks { display: flex; flex-direction: column; gap: 16px; }
.talk { display: grid; grid-template-columns: 150px 1fr; gap: 32px; background: var(--bg); border: 1px solid rgba(0,0,0,.07); border-radius: var(--radius); padding: 32px; }
.talk.upcoming { border: 2px solid var(--accent); }
.talk .bigdate .md { font-size: 40px; }
.talk .no { font-size: 13px; color: var(--accent); font-weight: 600; letter-spacing: .04em; }
.talk h3 { font-size: 21px; margin: 6px 0 10px; }
.talk .speaker { font-weight: 600; }
.talk .speaker small { font-weight: 400; color: var(--ink-2); font-size: 14px; margin-left: .4em; }
.talk dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.talk dt { color: var(--ink-3); }
.talk dd { margin: 0; }
details.abstract { margin-top: 16px; }
details.abstract summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 500; list-style: none; }
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::before { content: "＋ "; }
details.abstract[open] summary::before { content: "－ "; }
details.abstract .text { margin-top: 10px; font-size: 15px; color: var(--ink); white-space: pre-line; }
@media (max-width: 700px) {
  .talk { grid-template-columns: 1fr; gap: 10px; padding: 24px 20px; }
  .talk .bigdate { display: flex; gap: 10px; align-items: baseline; }
  .talk .bigdate .md { font-size: 30px; }
  .talk .bigdate .y, .talk .bigdate .wd { margin: 0; }
}

/* ---------- 表（訪問者・研究集会・資料） ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { display: grid; grid-template-columns: 200px 1fr 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rows.two li { grid-template-columns: 200px 1fr; }
.rows .when { font-size: 14px; color: var(--ink-3); font-family: "Inter", var(--font); }
.rows .name { font-weight: 600; }
.rows .sub { color: var(--ink-2); font-size: 14px; }
.rows .note { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
@media (max-width: 760px) {
  .rows li, .rows.two li { grid-template-columns: 1fr; gap: 2px; }
}
.year-head { font-size: 22px; margin: 48px 0 12px; }
.year-head:first-child { margin-top: 0; }

/* ---------- センターについて ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 28px; margin: 56px 0 18px; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.facts { display: grid; grid-template-columns: 180px 1fr; gap: 0; border-top: 1px solid var(--line); margin: 0; }
.facts dt, .facts dd { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--ink-3); font-size: 14px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dt { border: 0; padding-bottom: 0; } }

/* ---------- フッター ---------- */
.site-footer { background: var(--night); color: rgba(255,255,255,.72); padding: 64px 0 40px; font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.site-footer .title { color: #fff; font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer nav a { display: block; padding: 3px 0; }
.site-footer .copy { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.45); font-size: 12px; }
@media (max-width: 700px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* ---------- 読み込み中・エラー ---------- */
.loading { color: var(--ink-3); padding: 24px 0; }
.notice { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 14px; padding: 22px 24px; margin: 24px auto; max-width: var(--max); }
.notice input { margin-top: 10px; }
.empty { color: var(--ink-3); }
