/* reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* base */
body {
  font-family: 'Inter', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #1f2937;
  background: #ffffff;
}

/* links */
a { color: #2e7dbf; text-decoration: none; }
a:visited { color: #2e7dbf; }
a:hover { color: #1a3a5c; text-decoration: underline; }
a:active { color: #c0392b; }

/* ==== header ==== */
.site-header {
  width: 100%;
  height: 320px;
  background-color: #1a3a5c;
  background-image: url("images/bekkilab2025wide.jpg");
  background-size: cover;
  background-position: center center;
  position: relative;
}
.header-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(10,20,40,0.25), rgba(10,20,40,0.72));
}
.header-text {
  position: absolute;
  bottom: 28px;
  left: 44px;
  color: white;
}
.header-text h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: white;
}

/* ==== page layout ==== */
.page-wrapper {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
}

/* ==== sidebar ==== */
.sidebar {
  width: 215px;
  flex-shrink: 0;
  padding: 24px 14px;
  border-right: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
}
.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 0 4px;
  margin: 20px 0 4px;
}
.sidebar ul { list-style: none; }
.sidebar ul li a {
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #374151;
}
.sidebar ul li a:hover {
  background: #f3f4f6;
  color: #1a3a5c;
  text-decoration: none;
}
.book-entry {
  margin: 6px 4px 14px;
  font-size: 12px;
  line-height: 1.6;
}
.book-entry img {
  display: block;
  max-width: 128px;
  border: 1px solid #e5e7eb;
  margin-bottom: 5px;
}

/* ==== main content ==== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 56px;
}

/* ==== headings ==== */
.section-title {
  font-size: 17px;
  font-weight: 600;
  color: #1a3a5c;
  border-bottom: 2px solid #1a3a5c;
  padding-bottom: 7px;
  margin: 36px 0 14px;
}
.section-title:first-child { margin-top: 0; }
.subsection-title {
  font-size: 13px;
  font-weight: 700;
  color: #2e7dbf;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 24px 0 8px;
}

/* ==== publication TOC ==== */
.toc-wrap {
  display: flex;
  gap: 24px;
  background: #f4f6f9;
  border-left: 3px solid #2e7dbf;
  padding: 14px 18px;
  margin-bottom: 28px;
  font-size: 13px;
}
.toc-wrap dl { flex: 1; }
.toc-wrap dt {
  font-weight: 700;
  color: #1a3a5c;
  background: none;
  border: none;
  padding: 0;
  margin: 8px 0 2px;
  font-size: 13px;
}
.toc-wrap dt:first-child { margin-top: 0; }
.toc-wrap dd {
  margin-left: 10px;
  padding: 1px 0;
  border: none;
  font-size: 12px;
}

/* ==== publication list ==== */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item {
  border-left: 3px solid #dbeafe;
  padding: 9px 0 9px 14px;
  margin-bottom: 10px;
}
.pub-item:hover { border-left-color: #2e7dbf; }
.pub-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
  margin-bottom: 3px;
}
.pub-authors { font-size: 13px; color: #374151; }
.pub-source  { font-size: 13px; color: #6b7280; }
.pub-badge {
  display: inline-block;
  font-size: 11px;
  padding: 0px 6px;
  border: 1px solid #93c5fd;
  border-radius: 3px;
  color: #2e7dbf;
  margin-left: 4px;
  line-height: 1.8;
  vertical-align: middle;
}
.pub-badge:hover {
  background: #2e7dbf;
  color: white;
  border-color: #2e7dbf;
  text-decoration: none;
}

/* ==== definition lists (career, fundings, project/index) ==== */
dt {
  font-weight: 600;
  color: #1a3a5c;
  background: #f4f6f9;
  border-left: 3px solid #2e7dbf;
  padding: 4px 10px;
  margin-top: 10px;
  font-size: 14px;
}
dd {
  padding: 5px 8px 5px 14px;
  font-size: 14px;
  color: #374151;
  margin-left: 0;
  border-left: 1px solid #e5e7eb;
}

/* font.title used in project/index XML source */
font.title {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #1a3a5c;
  border-bottom: 2px solid #1a3a5c;
  padding-bottom: 7px;
  margin: 28px 0 12px;
}

/* ==== index page (page element) ==== */
.page-tagline {
  font-size: 21px;
  font-weight: 600;
  color: #1a3a5c;
  line-height: 1.45;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid #dbeafe;
}
.ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}
a.ext-link-btn {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border: 1.5px solid #2e7dbf;
  border-radius: 20px;
  color: #2e7dbf;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
a.ext-link-btn:hover {
  background: #2e7dbf;
  color: white;
  text-decoration: none;
}

.page-about {
  font-size: 14px;
  color: #374151;
  line-height: 1.85;
  margin-bottom: 30px;
}
.index-grid {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 32px;
}
.index-themes { flex: 3; min-width: 0; }
.index-news   { flex: 2; min-width: 0; }
.theme-card {
  border-left: 3px solid #2e7dbf;
  background: #f9fafb;
  border-radius: 0 4px 4px 0;
  padding: 12px 16px;
  margin-bottom: 12px;
}
a.theme-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 4px;
}
a.theme-name:hover { color: #2e7dbf; text-decoration: none; }
.theme-desc { font-size: 13px; color: #6b7280; margin: 0; line-height: 1.6; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}
.news-list li:last-child { border-bottom: none; }
.news-text { flex: 1; }
a.news-link { font-size: 12px; margin-left: 4px; font-weight: 600; }
.news-date {
  flex-shrink: 0;
  font-size: 11px;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 1px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
/* resources section */
.res-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.res-card {
  flex: 1;
  min-width: 200px;
  border-left: 3px solid #6b7280;
  background: #f9fafb;
  border-radius: 0 4px 4px 0;
  padding: 12px 16px;
}

.index-contact {
  background: #f4f6f9;
  border-left: 3px solid #2e7dbf;
  border-radius: 0 4px 4px 0;
  padding: 16px 20px;
  font-size: 13px;
  color: #374151;
}
.index-contact img { display: block; margin-bottom: 8px; }

/* ==== inline citations and reference list ==== */
a.cite { font-size: 11px; vertical-align: super; color: #2e7dbf; text-decoration: none; }
a.cite:hover { text-decoration: underline; }
.cite-missing { font-size: 11px; vertical-align: super; color: #c0392b; }
.ref-list { padding-left: 24px; font-size: 13px; line-height: 1.75; color: #374151; margin-top: 10px; }
.ref-list li { margin-bottom: 8px; }
.ref-title { font-style: italic; }

/* ==== language toggle ==== */
.lang-toggle {
  position: absolute;
  top: 14px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.lang-toggle .lang-current { color: #ffffff; }
.lang-toggle .lang-sep { color: rgba(255,255,255,0.4); }
.lang-toggle a { color: rgba(255,255,255,0.55); text-decoration: none; }
.lang-toggle a:hover { color: #ffffff; text-decoration: none; }
.lang-toggle-sidebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.lang-toggle-sidebar .lang-current { color: #1a3a5c; }
.lang-toggle-sidebar .lang-sep { color: #9ca3af; }
.lang-toggle-sidebar a { color: #9ca3af; text-decoration: none; }
.lang-toggle-sidebar a:hover { color: #1a3a5c; }

/* ==== syllabus table ==== */
.syllabus-table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 28px;
  font-size: 14px;
}
.syllabus-table td {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
}
.cell-label {
  background: #1a3a5c;
  color: white;
  font-weight: 600;
  width: 120px;
  white-space: nowrap;
}

/* ==== responsive ==== */

/* Desktop: hide the summary toggle (content always visible via open attribute) */
@media (min-width: 701px) {
  .nav-summary { display: none; }
}

/* Mobile */
@media (max-width: 700px) {
  .site-header { height: 180px; }
  .header-text h1 { font-size: 20px; }

  .page-wrapper { flex-direction: column; }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    position: static;
    max-height: none;
    padding: 0 14px;
  }
  .nav-summary {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1a3a5c;
    cursor: pointer;
    padding: 10px 4px;
    list-style: none;
    user-select: none;
  }
  .nav-summary::-webkit-details-marker { display: none; }
  .nav-summary::marker { content: none; }

  .nav-details[open] .nav-summary { border-bottom: 1px solid #e5e7eb; margin-bottom: 4px; }

  .book-entry { display: none; }

  .main-content { padding: 20px 16px 40px; }
  .index-grid { flex-direction: column; gap: 20px; }
  .toc-wrap { flex-direction: column; gap: 12px; }
  .page-tagline { font-size: 17px; }
}
