/* ==========================================================
   Yutaka Iida Lab.  – site stylesheet
   白地に黒文字のミニマルなエディトリアル・スタイル。
   カテゴリカラーは News のラベルと、ヘッダー下の
   細いカラーストリップ（サイトの署名的要素）にのみ使う。
   ========================================================== */

:root {
  --ink: #111111;
  --bg: #ffffff;
  --muted: #757575;
  --hairline: #e3e3e3;

  /* カテゴリカラー */
  --cat-book:    #2456a6;  /* Book    : 藍 */
  --cat-paper:   #1e7a5f;  /* Paper   : 深緑 */
  --cat-article: #b25e00;  /* Article : 琥珀 */
  --cat-event:   #7c3fa5;  /* Event   : 紫 */
  --cat-media:   #c22b45;  /* Media   : 紅 */
  --cat-other:   #8a8f98;  /* その他  : 灰 */

  --font-latin: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Yu Gothic", sans-serif;

  --max-width: 920px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.9;
  font-feature-settings: "palt";
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: #9a9a9a;
  transition: text-decoration-color .15s ease;
}
a:hover { text-decoration-color: var(--ink); }
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header { padding-top: 44px; }

.site-title {
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.1;
}
.site-title a { text-decoration: none; }

.site-lede {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.site-lede a { color: var(--muted); }

/* ナビゲーションバー：スクロールしても画面上部に追従 */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--ink);
  margin-top: 26px;
}

.site-nav {
  display: flex;
  gap: 28px;
  padding: 12px 2px 12px;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* 署名的要素：カテゴリ6色の細いストリップ */
.cat-strip {
  height: 3px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.cat-strip span:nth-child(1) { background: var(--cat-book); }
.cat-strip span:nth-child(2) { background: var(--cat-paper); }
.cat-strip span:nth-child(3) { background: var(--cat-article); }
.cat-strip span:nth-child(4) { background: var(--cat-event); }
.cat-strip span:nth-child(5) { background: var(--cat-media); }
.cat-strip span:nth-child(6) { background: var(--cat-other); }

/* ---------- Hero（トップページ：書影の帯） ---------- */

.hero {
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  padding: 30px 0;
}
.hero-track {
  display: flex;
  align-items: center;
  gap: 20px;
  width: max-content;
  animation: hero-scroll 70s linear infinite;
}
.hero:hover .hero-track { animation-play-state: paused; }
.hero-track a { display: block; flex: none; }
.hero-track img {
  height: 150px;
  width: auto;
  display: block;
  border: 1px solid var(--hairline);
  filter: grayscale(1);
  opacity: 0.92;
  transition: filter .35s ease, opacity .35s ease, transform .35s ease;
}
.hero-track a:hover img {
  filter: none;
  opacity: 1;
  transform: translateY(-3px);
}
@keyframes hero-scroll {
  to { transform: translateX(-50%); }
}

/* Aboutページ */
.about-photo {
  margin: 0 0 26px;
}
.about-photo img {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  border: 1px solid var(--hairline);
}
.about-lead {
  line-height: 1.95;
  margin-bottom: 10px;
}
.about-lead a { color: var(--ink); }
.about-subtitle {
  clear: both;
  font-size: 15px;
  font-weight: 700;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
/* 太字にする行（現在の身分・実行中の助成など） */
.def-table tr.is-bold th,
.def-table tr.is-bold td { font-weight: 700; }

/* 学会活動：階層表示 */
.society { margin: 0 0 22px; }
.society-head {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding-bottom: 6px;
}
.society-term { color: var(--ink-soft); font-size: 14px; }
.society-name { font-weight: 700; }
.society-roles {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 130px;
}
.society-roles li {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 3px 0;
  border-bottom: 1px solid var(--hairline);
}
.society-roles li.is-bold { color: var(--ink); font-weight: 700; }
@media (max-width: 720px) {
  .society-head { grid-template-columns: 1fr; gap: 2px; }
  .society-roles { padding-left: 0; }
}

/* Seminarページ */
.seminar-title {
  font-size: 17px;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.seminar-title:first-child { margin-top: 0; }
.seminar-members { margin: 0 0 8px; }
.member-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.member-role { color: var(--ink-soft); font-size: 14px; }
.member-names { font-weight: 500; }
.seminar-sub {
  font-size: 14px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--ink-soft);
}
.alumni-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 20px;
}
.alumni-list li {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 3px 0;
}
.seminar-box {
  background: #f7f7f5;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink);
  padding: 16px 18px;
  margin: 20px 0;
}
.seminar-box h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.seminar-box p { margin: 0; line-height: 1.8; }

@media (max-width: 720px) {
  .member-row { grid-template-columns: 1fr; gap: 2px; }
}

/* Worksページのカテゴリ目次と小見出し */
.works-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 26px 0 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.works-toc a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.works-toc a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.works-subtitle {
  font-size: 17px;
  font-weight: 700;
  margin: 44px 0 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

/* ---------- Sections ---------- */

main { padding-bottom: 40px; }

.section { margin-top: 56px; }

.section-title {
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--hairline);
  transform: translateY(-6px);
}

.subsection-title {
  font-size: 16px;
  font-weight: 700;
  margin: 44px 0 16px;
  padding-left: 12px;
  border-left: 3px solid var(--ink);
}

/* ---------- Category label ---------- */

.cat {
  display: inline-block;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1;
  color: #fff;
  padding: 4px 8px 3px;
  vertical-align: 2px;
  white-space: nowrap;
}
.cat-book    { background: var(--cat-book); }
.cat-paper   { background: var(--cat-paper); }
.cat-article { background: var(--cat-article); }
.cat-event   { background: var(--cat-event); }
.cat-media   { background: var(--cat-media); }
.cat-other   { background: var(--cat-other); }

/* ---------- News list ---------- */

.news-list { border-top: 1px solid var(--hairline); }

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}

.news-date {
  font-family: var(--font-latin);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-top: 3px;
  white-space: nowrap;
}

.news-body { min-width: 0; }
.news-body .cat { margin-right: 10px; }

/* ---------- Pick Up ---------- */

.pickup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 32px;
}

/* SNS埋め込み（X / Facebook） */
.sns-embeds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  margin-top: 40px;
}
.sns-embeds:empty { display: none; }
.sns-col { min-width: 0; }
.sns-title {
  font-family: var(--font-latin);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
}
.sns-col .fb-frame,
.sns-col .twitter-timeline {
  width: 100% !important;
  max-width: 500px;
}
.sns-col iframe { max-width: 100%; }

/* X埋め込みが表示されなかった場合のフォールバックカード */
.x-embed { position: relative; min-height: 60px; }
.x-fallback {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 22px 20px;
  background: #fafafa;
}
.x-fallback p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.x-btn {
  display: inline-block;
  padding: 9px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-size: 13.5px;
  text-decoration: none;
}
.x-btn:hover { opacity: 0.85; }
/* タイムラインが正しく描画されたら、その分の高さが確保される */
.twitter-timeline-rendered { display: block; }
@media (max-width: 720px) {
  .sns-embeds { grid-template-columns: 1fr; }
}

.pickup-card { min-width: 0; }

.pickup-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.pickup-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pickup-thumb {
  display: block;
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.pickup-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.pickup-title {
  font-size: 15px;
  font-weight: 700;
  margin: 12px 0 4px;
  line-height: 1.6;
}
.pickup-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.9;
}

/* ---------- Books ---------- */

.book-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: start;
}
.book-cover img {
  width: 100%;
  border: 1px solid var(--hairline);
}
.book-cover-none {
  width: 100%;
  aspect-ratio: 7 / 10;
  border: 1px dashed var(--hairline);
}
.book-info { padding-top: 2px; min-width: 0; }
.book-authors { font-size: 13px; color: var(--muted); margin: 0 0 2px; }
.book-title { font-size: 15.5px; font-weight: 700; margin: 0; line-height: 1.7; }
.book-pub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.book-note { font-size: 13px; margin: 6px 0 0; }

/* ---------- Works ---------- */

.works-covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}
.works-covers img { border: 1px solid var(--hairline); }

.work-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.work-item p { margin: 0; }

/* ---------- Tables (About / Seminar) ---------- */

.def-table { width: 100%; border-collapse: collapse; }
.def-table th,
.def-table td {
  border-bottom: 1px solid var(--hairline);
  padding: 12px 8px;
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}
.def-table th {
  width: 200px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--ink);
  margin-top: 72px;
  padding: 20px 0 48px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer p {
  margin: 0;
  font-family: var(--font-latin);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.to-top { font-size: 12px; }

/* ---------- Responsive ---------- */

.news-body,
.pickup-text,
.book-info,
.work-item {
  overflow-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 720px) {
  .site-nav { flex-wrap: nowrap; gap: 22px; }
  .site-nav a { white-space: nowrap; font-size: 13.5px; }
  .hero { padding: 20px 0; }
  .hero-track img { height: 104px; }
  .pickup-grid { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 1fr; padding: 14px 0; }
  .news-date { padding-top: 0; }
  .book-row { grid-template-columns: 96px 1fr; gap: 14px; }
  .def-table th { width: auto; display: block; border-bottom: 0; padding-bottom: 0; }
  .def-table td { display: block; padding-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .hero-track { animation: none; }
}
