/* 共通レイアウト・スタイル */

:root {
  --text: #333;
  --muted: #555;
  --border: #e5e5e5;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --footer-bg: #2b2b2b;
  --footer-text: #f0f0f0;
  --max: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

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

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

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ----- ナビ ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1.25rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--text);
}

.site-logo img {
  height: 40px;
  width: auto;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: center;
}

.main-nav a {
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.25rem 0;
}

.main-nav a:hover {
  color: var(--link);
}

.main-nav a.is-active {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  border-bottom: 2px solid var(--link);
}

/* ----- Home: フル幅ヒーロー（参考サイトと同様の配置） ----- */
/* body 直下では left:50% + 負マージンの「ブレイクアウト」は使わない（右へずれる） */
.hero-full {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 2rem 0;
  min-height: 280px;
  height: clamp(280px, 42vw, 440px);
  background-color: #64748b;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.hero-overlay {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 150px;
  padding: 1.5rem 1.25rem;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.hero-full h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  padding: 0.25em 0;
}

.hero-sub {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  padding: 0.25em 0;
}

@media (max-width: 768px) {
  .hero-full {
    min-height: 240px;
    height: clamp(240px, 55vw, 360px);
  }
}

/* ----- コンテンツ ----- */
.page-section {
  padding: 2rem 0 3rem;
}

.section-lead {
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
  border-top: 1px solid var(--border);
}

.content-block h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.content-block h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.content-block h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.content-block p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.overview-figure {
  margin: 1rem auto 1.5rem;
  padding: 0;
  max-width: 560px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.overview-figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 700px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }
}

.topic-card {
  --topic-col-width: min(350px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.topic-card figure {
  margin: 0 0 1rem;
  width: var(--topic-col-width);
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #eee;
}

.topic-card figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.topic-card h4 {
  margin: 0 0 0.5rem;
  width: var(--topic-col-width);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

.topic-card p {
  width: var(--topic-col-width);
  text-align: left;
  font-size: 0.95rem;
  margin: 0;
}

/* ----- News 一覧（Home） ----- */
.news-block h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 700px) {
  .news-list {
    grid-template-columns: 1fr;
  }
}

.news-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fafafa;
}

.news-item-thumb {
  flex: 0 0 35%;
  max-width: 120px;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.news-item-body {
  flex: 1;
  min-width: 0;
}

.news-item-body h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.news-meta {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.35rem;
}

.news-more {
  display: inline-block;
  margin: 1.5rem auto 0;
  text-align: center;
  padding: 0.65rem 1.25rem;
  border: 2px solid #ea580c;
  color: #c2410c;
  font-weight: 600;
  border-radius: 4px;
}

.news-more:hover {
  background: #fff7ed;
  text-decoration: none;
  color: #9a3412;
}

.news-more-wrap {
  text-align: center;
}

.news-list-page {
  grid-template-columns: 1fr;
}

.news-item--archive {
  margin-bottom: 0;
}

.news-item--archive .news-item-body h3 {
  margin-top: 0;
}

.news-item--archive .news-item-body h3 a {
  color: inherit;
  text-decoration: none;
}

.news-item--archive .news-item-body h3 a:hover {
  color: var(--link);
  text-decoration: underline;
}

.news-page-lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.news-year-heading {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

.news-page .news-list-page {
  margin-top: 0;
}

.news-loading,
.news-load-error {
  color: var(--muted);
  margin: 0;
  grid-column: 1 / -1;
}

.news-load-error {
  color: #b91c1c;
}

.news-pagination-wrap {
  margin-top: 1.5rem;
}

.news-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--border);
}

.news-pagination-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
}

.news-pagination-num,
.news-pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--link);
  text-decoration: none;
}

.news-pagination-num:hover,
.news-pagination-link:hover {
  background: #f8fafc;
  text-decoration: none;
}

.news-pagination-num.is-current {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
  font-weight: 600;
  cursor: default;
  pointer-events: none;
}

.news-pagination-link.is-disabled {
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

/* News 記事ページ：1カラム（見出し→アイキャッチ→本文→一覧へ） */
.news-article .news-meta {
  margin-bottom: 0.35rem;
}

.news-article h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.8vw, 1.65rem);
  line-height: 1.35;
}

.news-article .news-article-body {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1.15rem;
  max-width: 40rem;
  /* 旧版の 2 カラム grid がキャッシュに残っている場合の打ち消し */
  grid-template-columns: none;
  grid-template-rows: none;
}

.news-article .news-article-figure {
  margin: 0;
  padding: 0;
  max-width: 240px;
  width: 100%;
  align-self: flex-start;
  float: none;
  grid-column: unset;
  grid-row: unset;
  justify-self: unset;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}

.news-article .news-article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
}

.news-article .news-article-prose {
  min-width: 0;
  grid-column: unset;
  grid-row: unset;
  float: none;
}

.news-article .news-article-prose p {
  margin: 0;
  text-wrap: pretty;
  line-height: 1.75;
  color: var(--text);
}

.news-article .news-article-back {
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  grid-column: unset;
  grid-row: unset;
  float: none;
}

.news-article .news-article-back a {
  color: var(--link);
  font-weight: 500;
}

.news-article .news-article-back a:hover {
  text-decoration: underline;
}

/* ----- 下層ページ ----- */
.simple-page h1 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}

.simple-page p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.simple-page ul {
  list-style: disc;
  margin: 0 0 1rem 1.5rem;
  padding: 0;
  color: var(--muted);
}

/* ----- Member 年度サイドバー ----- */
.member-layout-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.member-page-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.member-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

/* メンバー年度ナビ: Home の研究トピック2枚目（hp 系）のスレートトーンに合わせる */
.member-sidebar {
  flex: 0 0 11.5rem;
  background: #66768e;
  border-left: 4px solid #9aa8bc;
  border-radius: 2px;
  overflow: hidden;
}

.member-year-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.member-year-nav li {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.member-year-nav li:last-child {
  border-bottom: none;
}

.member-year-nav button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.65rem 1rem;
  border: none;
  background: #66768e;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.25);
}

.member-year-nav button:hover {
  background: #7586a0;
}

.member-year-nav button.is-active {
  background: #4f5c70;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.35);
}

.member-main {
  flex: 1;
  min-width: 0;
}

.member-year-panel {
  margin: 0;
}

.member-year-panel[hidden] {
  display: none !important;
}

.member-year-empty {
  color: var(--muted);
  margin: 0;
  padding: 0.5rem 0;
}

@media (max-width: 700px) {
  .member-layout {
    flex-direction: column;
    gap: 1.25rem;
  }

  .member-sidebar {
    flex: none;
    width: 100%;
  }

  .member-year-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  .member-year-nav li {
    flex: 1 1 auto;
    min-width: calc(33.333% - 1px);
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
  }

  .member-year-nav li:last-child {
    border-right: none;
  }

  .member-year-nav button,
  .member-year-nav.achievements-anchor-nav a {
    text-align: center;
    padding: 0.55rem 0.4rem;
    font-size: 0.8rem;
  }
}

.member-page h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.75rem 0 0.65rem;
  color: var(--text);
}

.member-year-panel > h2:first-of-type {
  margin-top: 0;
}

.member-list {
  margin-bottom: 0.25rem;
}

.member-list a {
  font-weight: 600;
}

.contact-map-heading {
  margin: 1.5rem 0 0.65rem;
}

.contact-map {
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #eee;
}

.contact-map iframe {
  display: block;
  width: 100%;
  height: 450px;
  max-height: min(450px, 70vh);
  border: 0;
}

/* ----- Achievements（アンカー見出し・左リンク） ----- */
.achievements-back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1100;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: #4f5c70;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.achievements-back-to-top:hover {
  background: #5d6b82;
  color: #fff;
  text-decoration: none;
}

.achievements-back-to-top:focus-visible {
  outline: 2px solid var(--link, #2563eb);
  outline-offset: 2px;
}

.achievements-year-panel {
  scroll-margin-top: 5.5rem;
  margin-bottom: 2.75rem;
}

.achievements-year-panel:last-child {
  margin-bottom: 0;
}

.achievements-year-banner {
  margin: 0 0 1.25rem;
  padding: 0.55rem 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: #4a5568;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.member-year-nav.achievements-anchor-nav a {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.65rem 1rem;
  border: none;
  background: #66768e;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.member-year-nav.achievements-anchor-nav a:hover {
  background: #7586a0;
  color: #fff;
  text-decoration: none;
}

.member-year-nav.achievements-anchor-nav a.is-active {
  background: #4f5c70;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.35);
}

.achievements-page .achievements-section {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.achievements-page .achievements-section:first-of-type {
  margin-top: 0.5rem;
}

.achievements-page .paper-list {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.achievements-page .paper-list li {
  margin-bottom: 0.6rem;
}

/* ----- フッター ----- */
.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 0;
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-list li {
  margin-bottom: 0.35rem;
}

.footer-list a {
  color: var(--footer-text);
}

.footer-list a:hover {
  color: #fff;
}

.footer-copy {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #444;
  color: #aaa;
  font-size: 0.85rem;
}
