
/* --- Page width container & wide-screen safeguards --- */
:root {
  --page-max: 1100px;
  --page-pad: clamp(20px, 5vw, 48px);
  --measure: 68ch; /* comfortable text line length */
}
/* Constrain global containers */
.site-header .container,
.site-footer .container,
main,
section,
article {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}
/* Optional: keep paragraph line length comfortable on very wide screens */
main p {
  max-width: var(--measure);
}
/* Media blocks should not overflow */
img, video { max-width: 100%; height: auto; }
/* Avoid unexpected horizontal scrollbars */
html, body { overflow-x: hidden; }
/* Keep news grid constrained and centered */
.news { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-pad); }


/* --- Header single-line tweaks --- */
.site-header .container { flex-wrap: nowrap; }
.brand { white-space: nowrap; }
.site-nav { margin-left: auto; }
.site-nav ul { flex-wrap: nowrap; gap: .6rem; }
.site-nav a { white-space: nowrap; padding: .45rem .55rem; }


.site-header { position: sticky; top: 0; background: var(--header-bg, #fff); border-bottom: 1px solid rgba(0,0,0,.06); z-index: 999; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; }
.brand { font-weight: 700; font-size: 1.1rem; }
#nav-toggle { display:none; }
.nav-toggle-label { display:none; cursor:pointer; padding:.5rem .75rem; border-radius:.5rem; }
.nav-toggle-label span { display:block; width:24px; height:2px; margin:5px 0; background: currentColor; }
.site-nav ul { display:flex; gap:1rem; list-style:none; margin:0; padding:0; }
.site-nav a { text-decoration:none; padding:.5rem .25rem; }
  .nav-toggle-label { display:block; }
  .site-nav { display:none; }
  #nav-toggle:checked + .nav-toggle-label + .site-nav { display:block; }
  .site-nav ul { flex-direction: column; padding: .5rem 0; }
  .site-nav a { padding:.75rem 0; display:block; }
.skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { left:16px; top:16px; width:auto; height:auto; padding:8px 12px; background:#fff; outline:2px solid; border-radius:6px; z-index:1000; }
.news { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:1rem; }
.news-card { border:1px solid rgba(0,0,0,.08); border-radius:12px; padding:1rem; background:#fff; }
.news-card .date { font-size:.9rem; opacity:.8; display:block; margin-bottom:.25rem; }
.news-card .text { line-height:1.6; }
.ctas { display:flex; gap:.75rem; flex-wrap:wrap; margin: 1rem 0; }
.cta-btn { display:inline-block; border:1px solid rgba(0,0,0,.12); border-radius:999px; padding:.6rem 1rem; text-decoration:none; }


/* --- Footer centering & layout --- */
footer {
  border-top: 1px solid rgba(0,0,0,.06);
  background: #fafafa;
  margin-top: 2rem;
}
footer p, footer .footer-inner, .site-footer .container {
  box-sizing: border-box;
  max-width: var(--page-max, 1200px);
  margin: 0 auto;
  padding: 1rem var(--page-pad, 24px);
  text-align: center;
}


/* --- Header stacked layout: nav on next line --- */
.site-header .container { 
  display:flex; 
  flex-direction: column;      /* stack brand, (hamburger), nav */
  align-items: center;         /* center horizontally */
  gap: .5rem;
}
.brand { 
  white-space: nowrap; 
  width: 100%;
  text-align: center;
}
/* nav row takes full width and centers items */
.site-nav { 
  margin-left: 0; 
  width: 100%;
}
.site-nav ul { 
  justify-content: center; 
}
/* place hamburger button to the right on small screens */
.nav-toggle-label { 
  align-self: flex-end;
}

/* keep mobile behavior: nav hidden until toggled at <=1200px (already defined) */
/* no change needed for the existing breakpoint rules */


/* --- Brand typography (JP+EN stacked) --- */
.brand { font-weight: 800; font-size: clamp(1.6rem, 2.4vw, 2.0rem); line-height: 1.2; }
.brand-jp { display:block; }
.brand-en { display:block; font-weight: 500; font-size: clamp(0.95rem, 1.5vw, 1.15rem); opacity: .85; margin-top: .2rem; }


/* --- Readability improvements: whitespace, rhythm, and text measure --- */
html { scroll-behavior: smooth; }
body { line-height: 1.75; }
main { padding-block: clamp(16px, 4vh, 32px); }

/* Keep common text content within comfortable line length */
main :is(p, ul, ol, blockquote, pre, figure, table) {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
/* Headings also follow comfortable width */
main :is(h1, h2, h3, h4) {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  line-height: 1.25;
  letter-spacing: .01em;
}

/* Vertical rhythm */
main > * { margin-block: clamp(12px, 2.2vh, 24px); }
main p + p { margin-top: .6em; }
main :is(h2,h3) { margin-top: clamp(1.6rem, 2.8vw, 2.2rem); margin-bottom: .6rem; }

/* Lists */
main ul, main ol { padding-left: 1.2em; }
main li { margin-block: .3em; }
main li > ul, main li > ol { margin-top: .2em; }

/* Tables: avoid edge-to-edge overflow, keep scrollable on small screens */
main table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  -webkit-overflow-scrolling: touch;
}
main th, main td { padding: .5rem .75rem; border-bottom: 1px solid rgba(0,0,0,.08); }
main thead th { font-weight: 600; background: rgba(0,0,0,.03); position: sticky; top: 0; }
main tr:nth-child(even) td { background: rgba(0,0,0,.015); }

/* Images & figures spacing */
main figure { margin: 1rem auto; }
main img, main video { display: block; max-width: 100%; height: auto; border-radius: 6px; }

/* News grid spacing */
.news { margin-block: 1rem 1.5rem; }

/* Optional: soft max-width for long code/pre */
main pre { white-space: pre-wrap; word-break: break-word; }


/* --- Access page refinements: map ratio & address block --- */
.access-map, .map-wrap { max-width: var(--page-max); margin-inline: auto; }
.map-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #f2f2f2; border-radius: 8px; overflow: hidden; }
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.access-address { display: block; font-style: normal; white-space: break-spaces; }
.section-title { text-align: left; max-width: var(--measure); margin-inline: auto; }


/* --- Footer universal centering (hardened) --- */
.site-footer { border-top: 1px solid rgba(0,0,0,.06); background: #fafafa; margin-top: 2rem; }
.site-footer .footer-inner { 
  box-sizing: border-box; 
  max-width: var(--page-max, 1100px); 
  margin: 0 auto; 
  padding: 1rem var(--page-pad, 24px); 
  text-align: center; 
}
.site-footer p { margin: .25rem 0; }


/* --- Subpage spacing & block constraints (apply to all pages) --- */
/* Constrain and center all top-level blocks in <main> (except intentionally full-bleed) */
main > *:not(.full-bleed):not(header):not(footer) {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}
/* Ensure common wrappers don't run edge-to-edge */
main :is(section, article) {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

/* Definition lists for addresses/specs */
main dl { max-width: var(--measure); margin-inline: auto; }
main dt { font-weight: 600; margin-top: .6rem; }
main dd { margin-left: 1rem; margin-top: .2rem; }

/* Extra breathing room for subpage headings */
main :is(h1,h2) { margin-top: clamp(1.6rem, 3.2vw, 2.4rem); }
main h1 + .ctas { margin-top: .75rem; }

/* Allow explicit full-bleed sections when needed by adding .full-bleed */
.full-bleed { max-width: none !important; margin-inline: 0 !important; padding-inline: 0 !important; }

.page-section { box-sizing: border-box; width:100%; max-width: var(--page-max); margin-inline:auto; padding-inline: var(--page-pad); }


/* --- Header nav uniform sizing --- */
:root {
  --nav-fs: clamp(0.95rem, 1.05vw, 1.05rem);
  --nav-pad-y: .55rem;
  --nav-pad-x: .85rem;
}
.site-nav li { list-style: none; }
.site-nav a {
  display: inline-block;
  font-size: var(--nav-fs);
  line-height: 1.2;
  padding: var(--nav-pad-y) var(--nav-pad-x);
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a:hover { background: rgba(0,0,0,.06); }
.site-nav a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 999px; }

/* To make all buttons equal width, uncomment below and adjust ch value
.site-nav a { min-width: 8em; text-align: center; }
*/


/* --- Active nav state (current page) --- */
.site-nav a[aria-current="page"],
.site-nav a.is-active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-thickness: 2px;
  background: rgba(0,0,0,.06);
  border-radius: 999px;
}


/* --- Active nav color variant (no underline) --- */
:root{
  --nav-active-fg: #0b63c6;           /* 見やすい青系（WCAGコントラスト確保） */
  --nav-active-bg: rgba(11,99,198,.12);
}
.site-nav a[aria-current="page"],
.site-nav a.is-active{
  text-decoration: none;
  color: var(--nav-active-fg);
  background: var(--nav-active-bg);
  font-weight: 700;
  border-radius: 999px;
}
/* Hover時は少しだけ濃く */
.site-nav a[aria-current="page"]:hover,
.site-nav a.is-active:hover{
  background: rgba(11,99,198,.18);
}


/* --- Footer logo placement --- */
.site-footer .footer-brand {
  display: block;
  margin: .5rem auto .25rem;
  text-align: center;
}
.site-footer .footer-brand img {
  height: clamp(28px, 4vw, 44px);
  width: auto;
  vertical-align: middle;
}


/* --- Footer logo as image map (no <a> wrapper) --- */
.site-footer .footer-brand { display:block; margin:.5rem auto .25rem; text-align:center; }
.site-footer .footer-brand img { height:clamp(28px,4vw,44px); width:auto; vertical-align:middle; cursor: pointer; }


/* === Publications layout refinements (v13) === */
body.page-publications h3.pub-year + ul,
body.page-publications h3.pub-year + ol,
body.page-publications h3.pub-year + dl{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}


/* === Publications layout refinements (v14) === */
/* Keep lists centered while background remains transparent */
body.page-publications h3.pub-year + ul,
body.page-publications h3.pub-year + ol,
body.page-publications h3.pub-year + dl {
  text-align: center !important;   /* ensure centering */
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Entries: centered blocks (text left) */
body.page-publications h3.pub-year + ul > li,
body.page-publications h3.pub-year + ol > li,
body.page-publications h3.pub-year + dl > dd {
  display: inline-block !important;
  text-align: left !important;
  max-width: 1000px !important;
  width: 100% !important;
  margin: .5rem auto !important;
  box-sizing: border-box !important;
  float: none !important;
  clear: both !important;
}


/* === Publications layout refinements (v15) === */
/* 年度目次（Year TOC）の幅とレイアウトを完全統一 */
/* 1) TOCコンテナは常にページ全幅（左右パディングなし）、中央寄せのインライン要素で構成 */
body.page-publications nav.year-toc {
  max-width: none !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* 2) TOCのリストも全幅＋中央寄せ、余計な内側余白を除去 */
body.page-publications .year-toc-list {
  display: block !important;
  max-width: none !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
  list-style: none !important;
  box-sizing: border-box !important;
}

/* 3) TOCの各項目はインラインブロックで均一に並べる */
body.page-publications .year-toc-list > li {
  display: inline-block !important;
  margin: .25rem .5rem !important;
  padding: 0 !important;
}

/* 4) TOCリンクのサイズ・余白を年によらず統一 */
body.page-publications .year-toc-list > li > a {
  display: inline-block !important;
  padding: .375rem .625rem !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

/* 5) 2025だけ幅が狭く見える要因を無効化（念のため） */
body.page-publications nav.year-toc *[href="#y2025"] {
  max-width: none !important;
  width: auto !important;
  padding-left: .625rem !important;
  padding-right: .625rem !important;
}

/* 6) 祖先コンテナによるmax-width制限が残っている場合の保険 */
body.page-publications nav.year-toc,
body.page-publications .year-toc-list {
  container-type: normal; /* no-op fallback */
}


/* === Publications layout refinements (v16) === */
/* Root cause addendum: 2025 entries include .pub-actions that adds left margin and inline-flex;
   this can make the block look visually narrower. Normalize this per publications page. */
body.page-publications .pub-actions{
  display: inline-flex !important;
  gap: .35rem !important;
  margin-left: 0 !important;        /* remove left shift */
  justify-content: center !important;/* center the action buttons row */
  width: 100% !important;            /* allow row to span item width */
  flex-wrap: wrap !important;
}

/* Keep the BibTeX pre block from forcing extra width */
body.page-publications .pub-bibtex > pre{
  max-width: 100% !important;
  width: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* === Publications hard normalization (v17) === */
/* A) Year headings: absolute unification (size/weight/spacing/alignment) */
body.page-publications h3.pub-year,
body.page-publications h3#y2025,
body.page-publications h3#y2024,
body.page-publications h3#y2023,
body.page-publications h3#y2022,
body.page-publications h3#y2021,
body.page-publications h3#y2020,
body.page-publications h3#y2019,
body.page-publications h3#y2018,
body.page-publications h3#y2017,
body.page-publications h3#y2016,
body.page-publications h3#y2015,
body.page-publications h3#y2014,
body.page-publications h3#y2013,
body.page-publications h3#y2012,
body.page-publications h3#y2011,
body.page-publications h3#y2010,
body.page-publications h3#y2009,
body.page-publications h3#y2008,
body.page-publications h3#y2007,
body.page-publications h3#y2006,
body.page-publications h3#y2005 {
  font-size: 1.6rem !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
  text-align: center !important;
  width: 100% !important;
  margin: 2rem auto .75rem !important;
  padding: 0 !important;
}

/* Guard against global h3 rules: reset inherited transforms */
body.page-publications h3.pub-year{
  text-transform: none !important;
  font-variant: normal !important;
}

/* B) Year TOC: normalize container + list + links so 2025 == 2024以前 */
/* Container & list: full-width, centered, no inner padding differences */
body.page-publications nav.year-toc,
body.page-publications .year-toc-list{
  max-width: none !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* Prefer flex layout consistently; wrap as needed with uniform gap */
body.page-publications .year-toc-list{
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: .5rem .75rem !important;
  list-style: none !important;
}

/* TOC items & links: enforce uniform metrics regardless of year */
body.page-publications .year-toc-list > li{
  display: inline-flex !important;
}

/* Remove any special-casing on #y2025 link or 2024以前 */
body.page-publications .year-toc-list a[href="#y2025"],
body.page-publications .year-toc-list a[href="#y2024"],
body.page-publications .year-toc-list a[href^="#y20"],
body.page-publications .year-toc-list a[href^="#y19"]{
  font-size: 1rem !important;
  padding: .375rem .625rem !important;
  border-radius: 8px !important;
}

/* Safety: get rid of residual margins/paddings that cause perceived width differences */
body.page-publications nav.year-toc *{
  margin-inline: 0 !important;
  padding-block: auto;
}


/* === Publications ultimate normalization (v18) === */
/* A) Year headings: lock all metrics and font family, defeat media/descendant overrides */
:where(body.page-publications) :where(h3.pub-year, h3[id^="y20"], h3[id^="y19"]){
  font-family: inherit !important;
  font-size: 1.6rem !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
  text-transform: none !important;
  font-variant: normal !important;
  text-align: center !important;
  width: 100% !important;
  margin: 2rem auto .75rem !important;
  padding: 0 !important;
}

/* B) Year TOC: ensure identical width/flow across years and break out of any parent max-width */
:where(body.page-publications) nav.year-toc{
  max-width: none !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
  contain: none !important;
}

/* C) Neutralize any special-case link styles by year */
:where(body.page-publications) .year-toc-list a[href^="#y"]{
  font-size: 1rem !important;
  padding: .375rem .625rem !important;
  border-radius: 8px !important;
}

/* D) Ensure yearly lists keep centered blocks (set earlier versions, reaffirm here) */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl){
  text-align: center !important;
  max-width: none !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}


/* === Publications single-column enforcement (v19) === */
/* List containers: block flow only (no flex/grid/columns) */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl){
  display: block !important;
  column-count: 1 !important;
  -webkit-column-count: 1 !important;
  column-gap: 0 !important;
  -webkit-column-gap: 0 !important;
  flex: none !important;
  display: block !important;
}

/* Kill accidental flex/grid on lists */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl){
  display: block !important;
}

/* Items: block, one per row; centered container with left text */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl) > :where(li,dd){
  display: block !important;
  width: 100% !important;
  max-width: 1000px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
  clear: both !important;
  text-align: left !important;
}

/* Safety: remove inline-block that could allow side-by-side */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl) > :where(li,dd){
  white-space: normal !important;
}

/* Extra safety for 2024以前のみを1カラム強制（冗長だが確実に） */
:where(body.page-publications) #y2025 ~ h3.pub-year + :where(ul,ol,dl){
  display: block !important;
}


/* === Publications single-column hard lock (v20) === */
/* List containers: NO flex/grid/columns under any media state */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl){
  display: block !important;
  /* columns */
  column-count: 1 !important;
  -webkit-column-count: 1 !important;
  column-width: auto !important;
  -webkit-column-width: auto !important;
  columns: auto !important;
  column-gap: 0 !important;
  -webkit-column-gap: 0 !important;
  /* flex */
  flex: none !important;
  flex-direction: initial !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  /* grid */
  display: block !important;
  grid-template-columns: none !important;
  grid-auto-flow: row !important;
  grid-column-gap: 0 !important;
  grid-row-gap: 0 !important;
  /* text alignment doesn't affect block stacking */
  text-align: center !important;
}

/* Items: one per row, centered container with left text */
:where(body.page-publications) :where(h3.pub-year) + :where(ul,ol,dl) > :where(li,dd){
  /* ensure they are NOT inline-block, NOT flex/grid items */
  display: block !important;
  float: none !important;
  clear: both !important;
  flex: 0 0 auto !important;
  flex-basis: auto !important;
  grid-column: 1 / -1 !important;
  /* width & centering */
  width: 100% !important;
  max-width: 1000px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  /* read-friendly */
  text-align: left !important;
  white-space: normal !important;
  vertical-align: top !important;
}

/* Stronger guard for 2024以前 explicitly (if DOM uses general lists elsewhere) */
:where(body.page-publications) #y2025 ~ h3.pub-year + :where(ul,ol,dl){
  display: block !important;
  column-count: 1 !important;
  grid-template-columns: none !important;
}


/* === Publications single-column ultimate lock (v21) === */
/* 0) Define a helper to target ONLY publications lists (avoid TOC) */
:where(body.page-publications) :where(h3.pub-year) + :where(ul:not(.year-toc-list),ol,dl){
  /* kill any column/flex/grid behavior on the list container */
  display: block !important;
  column-count: 1 !important;
  -webkit-column-count: 1 !important;
  columns: auto !important;
  column-width: auto !important;
  -webkit-column-width: auto !important;
  column-gap: 0 !important;
  -webkit-column-gap: 0 !important;
  flex: none !important;
  flex-direction: initial !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  grid-template-columns: none !important;
  grid-auto-flow: row !important;
  grid-column-gap: 0 !important;
  grid-row-gap: 0 !important;
  float: none !important;
  clear: both !important;
  text-align: center !important; /* center container; items will be left text */
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 1) Ensure ancestor wrappers don't impose columns/flex/grid */
:where(body.page-publications) :where(.publications, .pub-list, .achievements, .timeline, .content, .container, .wrapper, .main){
  column-count: 1 !important;
  -webkit-column-count: 1 !important;
  columns: auto !important;
  column-gap: 0 !important;
  -webkit-column-gap: 0 !important;
  display: block !important;
  flex: none !important;
  grid-template-columns: none !important;
  grid-auto-flow: row !important;
}

/* 2) Items: strictly one per row */
:where(body.page-publications) :where(h3.pub-year) + :where(ul:not(.year-toc-list),ol,dl) > :where(li,dd){
  display: block !important;
  width: 100% !important;
  max-width: 1000px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
  clear: both !important;
  text-align: left !important;
  white-space: normal !important;
}

/* 3) Extra: force 2024以前 (after #y2025) to single column redundantly */
:where(body.page-publications) #y2025 ~ h3.pub-year + :where(ul:not(.year-toc-list),ol,dl){
  display: block !important;
  column-count: 1 !important;
  grid-template-columns: none !important;
}


/* === Year TOC width unification (v23) === */
/* Ensure every year link (e.g., 2025 / 2024) renders with identical metrics */
body.page-publications .year-toc-list > li > a{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  font-size: 1rem !important;
  line-height: 1.2 !important;
  font-variant-numeric: tabular-nums !important; /* equal digit widths */
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  padding: .375rem .625rem !important;
  /* 4-digit year: fix a consistent content width;
     + a small allowance so 2010–2029 look identical */
  min-width: calc(4ch + 1.25rem) !important;
}

/* Remove any special-casing by year */
body.page-publications .year-toc-list a[href="#y2025"],
body.page-publications .year-toc-list a[href="#y2024"]{
  font-size: 1rem !important;
  padding: .375rem .625rem !important;
  min-width: calc(4ch + 1.25rem) !important;
  letter-spacing: 0 !important;
}

/* Keep TOC container centered full-width (for uniform perception) */
body.page-publications nav.year-toc,
body.page-publications .year-toc-list{
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}


/* === Year TOC exact width equalization (v24) === */
/* Root cause: flex wrapping + font glyph metrics made 4ch-based min-width differ across devices.
   Fix: give every year link the SAME explicit width via a CSS var. */
:root{ --toc-year-width: 6rem; } /* adjust if you want wider/narrower pills */
body.page-publications .year-toc-list{
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: .5rem .75rem !important;
}


/* === v27: Constrain the Year TOC before 2024 to 1000px (tagged toc-for-2024) === */
body.page-publications nav.year-toc.toc-for-2024{
  max-width: 1000px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

/* === v35: Header nav horizontal by default; stack only on small screens === */
.site-header .container {
  display: flex !important;
  flex-direction: row !important;   /* horizontal default */
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 1rem !important;
}
.site-nav ul {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: .6rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.site-nav a {
  display: inline-block !important;
  white-space: nowrap !important;
  padding: .45rem .6rem !important;
}

/* Mobile behavior: stack brand/nav and use hamburger only under 900px */
@media (max-width: 900px){
  .site-header .container {
    flex-direction: column !important;  /* stacked only on small screens */
    align-items: center !important;
    gap: .5rem !important;
  }
  .nav-toggle-label { display: block !important; }
  .site-nav { display: none !important; }
  #nav-toggle:checked + .nav-toggle-label + .site-nav { display: block !important; }
}

/* (Optional) clarify TOC box with white background within the 1000px container */
body.page-publications nav.year-toc {
  background: #fff !important;
  border-radius: 8px !important;
}


/* === v36: Desktop nav always horizontal; burger only on mobile === */

/* Base header layout */
.site-header .container{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  flex-wrap:nowrap !important;
  gap:1rem !important;
}

/* Desktop (>=901px): show horizontal menu, hide burger */
@media (min-width: 901px){
  #nav-toggle{ display:none !important; }
  .nav-toggle-label{ display:none !important; }
  .site-nav{ display:block !important; }
  .site-nav ul{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    gap:.8rem !important;
    list-style:none !important;
    margin:0 !important;
    padding:0 !important;
  }
  .site-nav li{ display:block !important; }
  .site-nav a{
    display:inline-block !important;
    white-space:nowrap !important;
    padding:.45rem .6rem !important;
  }
}

/* Mobile (<=900px): burger toggles vertical list */
@media (max-width: 900px){
  .nav-toggle-label{ display:block !important; }
  .site-nav{ display:none !important; }
  /* Typical structure: input#nav-toggle + label + nav.site-nav */
  #nav-toggle:checked + .nav-toggle-label + .site-nav{ display:block !important; }
  .site-nav ul{ display:block !important; }
  .site-nav li{ display:block !important; }
  .site-nav a{ display:block !important; }
}


/* === v37: Desktop header stacks brand (lab name) above the menu === */
/* Desktop (>=901px): stack brand over nav and center the nav row; hide burger */
@media (min-width: 901px){
  .site-header .container{
    display:flex !important;
    flex-direction: column !important;   /* brand on top, nav underneath */
    align-items: center !important;
    justify-content: center !important;
    gap: .6rem !important;
  }
  #nav-toggle{ display: none !important; }
  .nav-toggle-label{ display: none !important; }
  .site-nav{ display: block !important; width: 100% !important; }
  .site-nav ul{
    display:flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;          /* allow wrap if many items */
    justify-content: center !important;  /* center under the lab name */
    gap: .8rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .site-nav li{ display: block !important; }
  .site-nav a{
    display: inline-block !important;
    white-space: nowrap !important;
    padding: .45rem .6rem !important;
  }
}

/* Mobile (<=900px): unchanged — burger toggles vertical list */
@media (max-width: 900px){
  .nav-toggle-label{ display:block !important; }
  .site-nav{ display:none !important; }
  #nav-toggle:checked + .nav-toggle-label + .site-nav{ display:block !important; }
  .site-nav ul{ display:block !important; }
  .site-nav li{ display:block !important; }
  .site-nav a{ display:block !important; }
}


/* --- custom white box style for 教育・指導体制 --- */
.edu-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.edu-box h2 {
  margin-top: 0;
}


/* --- Talks (Plan C) minimal layout --- */
.cell-title { font-weight: 600; text-wrap: balance; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell-meta { color: #555; font-size: .92rem; margin-top: .2rem; }


/* --- Talks layout (Plan A) --- */
.talk-list { display: grid; gap: 16px; }
.talk { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 12px 14px;
        border: 1px solid var(--border,#e5e7eb); border-radius: 12px; background: #fff; }
.talk-meta { display: grid; gap: 8px; align-content: start; }
.chip { display: inline-block; padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 999px; font-size: .875rem; }
.talk-title { margin: .2rem 0; line-height: 1.5; text-wrap: balance; }
.meta { font-size: .95rem; line-height: 1.6; color: #444; }
@media (max-width: 860px){
  .talk { grid-template-columns: 1fr; }
}


/* --- Conferences: submeta under title --- */
.talk-submeta { color:#555; font-size:.95rem; margin-top:.25rem; line-height:1.5; }


/* === Welcome spacing tweaks (scoped) === */
#welcome > details.accordion > summary{
  /* Reduce the gap below the summary "ようこそ" */
  margin-bottom: .2rem !important;
  padding-bottom: .25rem !important;
}
#welcome .accordion-panel,
#welcome .accordion-content{
  /* Soften vertical padding right under summary */
  padding-top: 4px !important;
}
#welcome .welcome-text p:first-child{
  /* Prevent extra top margin on first paragraph */
  margin-top: 0 !important;
}
/* Optional: balance the first paragraph's wrapping for cleaner look (supported browsers) */
#welcome .welcome-text p{
  text-wrap: balance;
}


/* === Welcome spacing: tighten gap between summary and first paragraph === */
#welcome details.accordion > summary{ 
  margin-block-end: .2rem !important;
  padding-bottom: .2rem !important;
  display: flex; 
  align-items: flex-start; /* 上揃え */
}
#welcome details.accordion > .content{ 
  margin-top: 0 !important; 
  padding-top: 4px !important;
}
/* 上揃え＆余白圧縮：最初の要素の上マージンを打ち消す */
#welcome details.accordion > .content > *:first-child{
  margin-top: 0 !important;
}

/* inline actions on about page */
.page-actions ul{ list-style:none; display:flex; gap:.5rem; padding:0; margin:.75rem 0 1rem; flex-wrap:wrap; }
.page-actions a.btn-secondary{ display:inline-block; padding:.45rem .8rem; border:1px solid rgba(0,0,0,.2); border-radius:10px; text-decoration:none; }
.page-actions a.btn-secondary:hover{ background:#f4f6ff; border-color:#1259ff; }


/* normalize EN/JA language switch link appearance across pages */
header .site-nav a#switch-en,
header .site-nav a#switch-ja{
  color: inherit !important;
  text-decoration: none;
}
header .site-nav a#switch-en:visited,
header .site-nav a#switch-ja:visited{
  color: inherit !important;
}
header .site-nav a#switch-en:hover,
header .site-nav a#switch-ja:hover{
  color: #1259ff;
}


/* Unify language switch with other nav links (no special blue) */
header .site-nav a#switch-en,
header .site-nav a#switch-ja{
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
header .site-nav a#switch-en:visited,
header .site-nav a#switch-ja:visited{
  color: var(--text) !important;
}
header .site-nav a#switch-en:hover,
header .site-nav a#switch-ja:hover{
  color: inherit !important;
  background: rgba(0,0,0,.06) !important;
}

