/*
Theme Name: Lab Theme
Description: 研究室ホームページ用テーマ。日英併記(Polylang)、メンバー・ニュース・研究業績の投稿タイプ(プラグイン Lab Core)に対応。
Version: 1.0.2
Requires PHP: 7.4
Text Domain: lab-theme
*/

/* 研究室ホームページ 共通スタイル */
:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --ink: #16232b;
  --muted: #566771;
  --rule: #d3dde2;
  --direct: #d9822b;   /* 直接音 */
  --reverb: #1d7a8c;   /* 反射・残響 */
  --link: #14627a;
  --maxw: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--direct); }
:focus-visible { outline: 3px solid var(--direct); outline-offset: 3px; border-radius: 2px; }

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

/* ヘッダー */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(244, 247, 248, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: 0.02em; }
.nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--direct); color: var(--ink); }
.nav .lang { border: 1px solid var(--ink); padding: 2px 12px; border-radius: 999px; font-size: 14px; }
.nav .lang:hover { background: var(--ink); color: #fff; }

/* ヒーロー */
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.25; margin: 0 0 12px; letter-spacing: 0.01em; }
.hero .affil { color: var(--muted); margin: 0 0 20px; }
.hero .lead { max-width: 34em; font-size: 18px; margin: 0 0 40px; }
.ir { width: 100%; height: auto; display: block; }
.ir .base { stroke: var(--rule); stroke-width: 1.5; }
.ir line.d, .ir line.r { stroke-linecap: round; stroke-width: 5; }
.ir line.d { stroke: var(--direct); }
.ir line.r { stroke: var(--reverb); opacity: 0; animation: echo 0.5s ease-out forwards; animation-delay: calc(0.5s + var(--i) * 0.11s); }
.ir text { font-family: inherit; font-size: 15px; }
.ir .t-d { fill: var(--direct); font-weight: 700; }
.ir .t-r { fill: var(--reverb); font-weight: 700; }
@keyframes echo { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ir line.r { animation: none; opacity: 1; }
}

/* セクション */
section.block { padding: 56px 0; border-top: 1px solid var(--rule); }
section.block .wrap { display: grid; grid-template-columns: 200px 1fr; gap: 24px 40px; }
section.block h2 { margin: 0; font-size: 26px; line-height: 1.4; }
.body > :first-child { margin-top: 0; }
.body p { max-width: 40em; }

/* ニュース */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 8.5em 1fr; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.news li:first-child { padding-top: 0; }
.news time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* 研究 */
.topics { margin: 0; padding: 0; list-style: none; }
.topics li { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.topics li:first-child { padding-top: 0; }
.topics h3 { margin: 0 0 4px; font-size: 19px; }
.topics h3 small { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 8px; }
.topics p { margin: 0; max-width: 40em; }

/* メンバー */
.role { margin: 0 0 28px; }
.role h3 { margin: 0 0 8px; font-size: 16px; color: var(--reverb); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 12em 1fr; gap: 2px 16px; }
.people .name { font-weight: 700; }
.people .note { color: var(--muted); }

/* 業績 */
.pubs h2 { margin: 36px 0 4px; font-size: 18px; }
.pubs h2:first-child { margin-top: 0; }
.pubs h3 { margin: 18px 0 6px; font-size: 15px; color: var(--muted); font-weight: 500; }
.pub-list { margin: 0; padding: 0; list-style: none; }
.pub-list li { margin: 0 0 10px; max-width: 46em; }

/* アクセス */
dl.access { margin: 0; display: grid; grid-template-columns: 8em 1fr; gap: 8px 16px; }
dl.access dt { color: var(--muted); }
dl.access dd { margin: 0; }

footer { border-top: 1px solid var(--rule); padding: 28px 0 48px; color: var(--muted); font-size: 14px; }

/* スマホ */
@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  section.block { padding: 40px 0; }
  section.block .wrap { grid-template-columns: 1fr; gap: 16px; }
  .news li { grid-template-columns: 1fr; }
  .people li { grid-template-columns: 1fr; }
  dl.access { grid-template-columns: 1fr; gap: 0; }
  dl.access dd { margin-bottom: 12px; }
}

/* 書き換え箇所の目印(公開前に <mark class="ph"> ごと削除してください) */
mark.ph { background: #fff0b8; color: inherit; padding: 0 2px; border-radius: 2px; }

/* ---- WordPress 用の追加スタイル ---- */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
body.lab-en { line-height: 1.7; font-family: "Zen Kaku Gothic New", "Helvetica Neue", Arial, "Hiragino Sans", sans-serif; }

.nav .menu { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.nav .menu li { margin: 0; }
.nav .current-menu-item > a, .nav .current_page_item > a { border-bottom-color: var(--direct); }

section.block h1 { margin: 0; font-size: 26px; line-height: 1.4; }
section.block.first { border-top: 0; padding-top: 48px; }
section.block.wide .wrap { grid-template-columns: 1fr; gap: 16px; }
section.block.wide .body { max-width: 44em; }

.meta { margin: 0; color: var(--muted); }
.more { margin-top: 20px; }

.news a { color: var(--ink); text-decoration-color: var(--rule); }
.news a:hover { color: var(--direct); text-decoration-color: currentColor; }
.news.explore li { grid-template-columns: 8.5em 1fr; }
.news.explore span { color: var(--muted); }

.entry-content > :first-child { margin-top: 0; }
.entry-content h2, .entry-content h3 { margin: 1.8em 0 0.4em; line-height: 1.4; }
.entry-content h2 { font-size: 22px; }
.entry-content h3 { font-size: 19px; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

.role-title { margin: 0 0 8px; font-size: 16px; color: var(--reverb); }
.people .name a { color: var(--ink); }
.people .name a:hover { color: var(--direct); }

.member-head { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 28px; }
.member-photo img { display: block; width: 168px; height: 168px; object-fit: cover; border-radius: 4px; }
.member-sub { margin: 4px 0 16px; color: var(--muted); }

.navigation.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 24px; }
.navigation.pagination .page-numbers { text-decoration: none; padding: 2px 8px; border-bottom: 2px solid transparent; }
.navigation.pagination .current { border-bottom-color: var(--direct); font-weight: 700; }
.screen-reader-text { position: absolute; left: -9999px; }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.links li { margin: 0; }
