/* =============================================================
   broad.css — Broad-Institute-inspired design system
   Lab of Veterinary Biochemistry, Kitasato University
   ============================================================= */

/* ── Google Fonts (loaded via <link> in each page) ────────── */

/* ── Reset & box model ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg, picture { display: block; max-width: 100%; }

/* ── Design tokens ───────────────────────────────────────── */
:root {
  --ink:        #217196;   /* near-black — header / footer / banners */
  --ink2:       #0F1E30;   /* slightly lighter dark */
  --accent:     #C8102E;   /* Broad-style crimson red */
  --accent-hov: #247575;
  --white:      #FFFFFF;
  --off-white:  #F4F6F9;
  --text:       #151E28;
  --muted:      #5B6778;
  --border:     #DDE3EC;
  --shadow:     0 2px 14px rgba(0,0,0,.07);
  --radius:     3px;
  --max-w:      1100px;
  --header-h:   64px;
  --font-jp:    'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic Medium', sans-serif;
  --font-en:    'Inter', system-ui, -apple-system, sans-serif;
  --ease:       .22s ease;
}

/* ── Base ────────────────────────────────────────────────── */
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-jp);
  background: var(--off-white);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── Language toggle ─────────────────────────────────────── */
html[lang="ja"] .en { display: none !important; }
html[lang="en"] .ja { display: none !important; }

/* ── Override stale CMS wrappers ─────────────────────────── */
#page, .bg-window, .bg-document { all: unset; display: block; }

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--header-h);
  background: var(--ink);
  display: flex; align-items: center;
}

.hd-inner {
  width: 100%; max-width: 1360px; margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: center; gap: 16px;
}

/* Logo */
.hd-logo { flex-shrink: 0; display: flex; align-items: center; }
.hd-logo a { display: flex; align-items: center; }
.hd-logo img { height: 36px; width: auto; }

/* Desktop nav */
.hd-nav { flex: 1; display: flex; justify-content: center; }
.hd-nav ul { list-style: none; display: flex; align-items: center; gap: 0; }
.hd-nav a {
  display: block; padding: 8px 13px;
  color: rgba(255,255,255,.78); font-size: .78rem; font-weight: 500;
  letter-spacing: .03em; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.hd-nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,.35); }
.hd-nav li.active a { color: #fff; border-bottom-color: var(--accent); }

/* Right controls */
.hd-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.lang-toggle {
  display: flex; align-items: center;
  border: 1px solid rgba(255,255,255,.22); border-radius: 2px;
  overflow: hidden;
}
.lang-btn {
  padding: 5px 13px; border: none; background: transparent;
  color: rgba(255,255,255,.6); font-size: .7rem; font-weight: 700;
  cursor: pointer; letter-spacing: .06em;
  transition: all var(--ease); font-family: var(--font-en);
}
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn:hover:not(.active) { color: #fff; background: rgba(255,255,255,.1); }

.hd-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 5px; border: none; background: none;
}
.hd-hamburger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,.8); border-radius: 1px; transition: all var(--ease);
}

/* =============================================================
   MOBILE NAV DRAWER
   ============================================================= */
.mob-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 950;
}
.mob-nav {
  position: fixed; top: 0; right: -300px; width: 300px; height: 100vh;
  background: var(--ink); z-index: 960;
  transition: right .3s ease; overflow-y: auto;
  padding-top: var(--header-h);
}
.mob-nav.open { right: 0; }
.mob-nav ul { list-style: none; }
.mob-nav a {
  display: block; padding: 15px 28px;
  color: rgba(255,255,255,.8); text-decoration: none;
  font-size: .93rem; border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background var(--ease), color var(--ease);
}
.mob-nav a:hover,
.mob-nav li.active a { background: rgba(255,255,255,.07); color: #fff; }
.mob-nav li.active > a { color: var(--accent); }

/* =============================================================
   PAGE BANNER (inner pages)
   ============================================================= */
.page-banner {
  margin-top: var(--header-h);
  background: var(--ink2);
  padding: 52px 32px 36px;
  border-bottom: 3px solid var(--accent);
}
.page-banner-inner {
  max-width: var(--max-w); margin: 0 auto;
}
.page-banner .pg-sub {
  display: block; font-size: .78rem; letter-spacing: .14em;
  color: rgba(255,255,255,.55); margin-bottom: 8px;
  font-family: var(--font-en); text-transform: uppercase;
}
.page-banner h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800; letter-spacing: -.015em;
  color: #fff; line-height: 1.15;
}

/* Breadcrumb */
.breadcrumb {
  max-width: var(--max-w); margin: 0 auto;
  padding: 12px 32px;
  background: var(--ink);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.breadcrumb a,
.breadcrumb span {
  font-size: .72rem; color: rgba(255,255,255,.5);
  text-decoration: none; font-family: var(--font-en); letter-spacing: .02em;
}
.breadcrumb a:hover { color: rgba(255,255,255,.85); }
.breadcrumb .sep { color: rgba(255,255,255,.25); }
.breadcrumb .current { color: rgba(255,255,255,.8); }

/* =============================================================
   MAIN CONTENT WRAPPER
   ============================================================= */
.page-main {
  max-width: var(--max-w); margin: 0 auto;
  padding: 52px 32px 80px;
  background: var(--white);
  min-height: 60vh;
}

/* Content typography */
.page-main h2 {
  font-size: 1.2rem; font-weight: 700;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
  color: var(--text); margin: 40px 0 14px;
  line-height: 1.4;
}
.page-main h2:first-child { margin-top: 0; }

.page-main h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--text); margin: 28px 0 10px;
  padding-left: 10px; border-left: 3px solid var(--border);
}

.page-main h4 {
  font-size: .93rem; font-weight: 700;
  color: var(--text); margin: 20px 0 8px;
}

.page-main p {
  font-size: .93rem; line-height: 1.9; margin-bottom: .9em; color: var(--text);
}
.page-main p:last-child { margin-bottom: 0; }

.page-main a {
  color: #1a5cb0; text-decoration: underline; text-underline-offset: 2px;
}
.page-main a:hover { color: var(--accent); }

.page-main ul, .page-main ol {
  margin: 8px 0 14px; padding-left: 22px;
}
.page-main li { font-size: .93rem; line-height: 1.85; margin-bottom: 4px; }

.page-main hr {
  border: none; border-top: 1px solid var(--border); margin: 28px 0;
}

.page-main table {
  border-collapse: collapse; font-size: .85rem; margin: 12px 0;
}
.page-main table td, .page-main table th {
  border: 1px solid var(--border); padding: 6px 10px; vertical-align: middle;
}

/* Section divider bar */
.section-bar {
  height: 3px; background: var(--accent);
  margin: 40px 0 28px; border: none;
}

/* ── Staff profile cards ──────────────────────────────────── */
.staff-card {
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  background: var(--off-white);
  margin: 32px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.staff-card + .staff-card { margin-top: 24px; }
.staff-card h2 {
  border: none; padding: 0; margin: 0 0 4px;
  font-size: 1.1rem; font-weight: 800;
}
.staff-card .staff-en { font-size: .82rem; color: var(--muted); margin-bottom: 12px; font-family: var(--font-en); }
.staff-card .research-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-size: .78rem; font-weight: 600; padding: 5px 14px;
  border-radius: var(--radius); margin-bottom: 12px;
  transition: background var(--ease); letter-spacing: .03em;
}
.staff-card .research-link:hover { background: var(--accent-hov); color: #fff; }
.staff-card ol { margin-left: 18px; }
.staff-card ol li { font-size: .9rem; line-height: 1.8; margin-bottom: 3px; }

/* ── Publication list ─────────────────────────────────────── */
.pub-year-section { margin: 0 0 40px; }
.pub-year-title {
  font-size: 1.1rem; font-weight: 800;
  color: var(--white); background: var(--ink);
  padding: 8px 16px; display: inline-block;
  letter-spacing: .06em; font-family: var(--font-en);
  margin-bottom: 14px;
}
.pub-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem; line-height: 1.75;
}
.pub-item:last-child { border-bottom: none; }
.pub-item a { color: #1a5cb0; }
.pub-item a:hover { color: var(--accent); }

/* ── Protocol notebook ───────────────────────────────────── */
.protocol-sidebar {
  margin-top: 48px; padding-top: 24px;
  border-top: 2px solid var(--border);
}
.protocol-sidebar h3 {
  border: none; padding: 0; margin-bottom: 14px;
  font-size: .88rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
}
.protocol-sidebar ul { list-style: none; padding: 0; margin: 0; }
.protocol-sidebar li a {
  display: block; padding: 8px 12px;
  font-size: .88rem; text-decoration: none; color: var(--text);
  border-left: 3px solid transparent;
  transition: border-color var(--ease), background var(--ease);
}
.protocol-sidebar li a:hover { border-left-color: var(--accent); background: var(--off-white); color: var(--text); }
.protocol-sidebar li.active a { border-left-color: var(--accent); font-weight: 600; color: var(--accent); text-decoration: none; }

/* ── History timeline ─────────────────────────────────────── */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  padding: 10px 0 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem; line-height: 1.8;
}
.timeline li:last-child { border-bottom: none; }

/* ── Contact info ─────────────────────────────────────────── */
.contact-block {
  background: var(--off-white); padding: 24px 28px;
  margin-bottom: 28px;
}
.contact-block dt {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent); margin-bottom: 4px;
  font-family: var(--font-en);
}
.contact-block dd {
  font-size: .93rem; line-height: 1.7; margin-bottom: 14px;
}
.contact-block dd:last-child { margin-bottom: 0; }

/* ── Album / photo grid ───────────────────────────────────── */
.album-section { margin-bottom: 56px; }
.album-section h2 { margin-top: 0; }
.album-slide-wrap {
  margin-top: 16px; overflow: hidden;
}

/* ── CMS tab/slideshow passthrough (don't break bind.js) ──── */
/* Minimal styling so CMS tabs remain functional */
.b-tab_navigation ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; }
.b-tab_navigation li a {
  display: inline-block; padding: 6px 16px;
  background: var(--off-white); border: 1px solid var(--border);
  font-size: .82rem; text-decoration: none; color: var(--text);
  transition: background var(--ease);
}
.b-tab_navigation li a:hover,
.b-tab_navigation li.b-tab_selected a { background: var(--accent); color: #fff; border-color: var(--accent); }

.tab-content { display: none; }
.tab-content.b-tab_selected { display: block; }

/* CMS blockquote used for publications */
.c-blockquote {
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: .88rem; line-height: 1.75;
}
.c-blockquote a { color: #1a5cb0; }

/* CMS list classes minimal override */
.c-list-numbers { padding-left: 22px; }
.c-list-sign { list-style: none; padding-left: 14px; }
.c-list-sign li::before { content: '– '; color: var(--accent); }
.c-list-no_mark { list-style: none; padding-left: 0; }

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.55);
  padding: 40px 32px 32px;
}
.ft-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.ft-copy { font-size: .72rem; letter-spacing: .03em; font-family: var(--font-en); }
.ft-social { display: flex; align-items: center; gap: 8px; }
.ft-social-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: rgba(255,255,255,.55); text-decoration: none;
  font-size: .75rem; font-family: var(--font-en); letter-spacing: .02em;
  transition: color var(--ease);
}
.ft-social-link:hover { color: rgba(255,255,255,.9); }
.ft-social-link svg { flex-shrink: 0; }
.ft-top {
  color: rgba(255,255,255,.45); text-decoration: none;
  font-size: .72rem; padding: 5px 14px;
  border: 1px solid rgba(255,255,255,.15); border-radius: 1px;
  letter-spacing: .06em; font-family: var(--font-en); text-transform: uppercase;
  transition: all var(--ease);
}
.ft-top:hover { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); }
.ft-counter { font-size: .7rem; opacity: .3; }

/* =============================================================
   INDEX-SPECIFIC: Hero slideshow
   ============================================================= */
.site-hero {
  margin-top: var(--header-h);
  position: relative; overflow: hidden;
  height: min(60vh, 520px);
  background: var(--ink);
}
.slideshow { width: 100%; height: 100%; position: relative; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease-in-out; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide a { display: block; width: 100%; height: 100%; }
.slide a img { pointer-events: none; }

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(6,13,24,.1) 0%, rgba(6,13,24,0) 35%, rgba(6,13,24,.7) 100%);
  display: flex; align-items: flex-end; padding: 40px 48px;
  pointer-events: none;
}
.hero-title { color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.hero-title .sub {
  display: block; font-size: .82rem; letter-spacing: .18em;
  opacity: .85; margin-bottom: 6px; text-transform: uppercase;
  font-family: var(--font-en);
}
.hero-title .main {
  display: block; font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -.01em; line-height: 1.2;
}

.slide-dots {
  position: absolute; bottom: 20px; right: 48px;
  display: flex; gap: 7px;
}
.slide-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.35); border: none; cursor: pointer; padding: 0;
  transition: background var(--ease), transform var(--ease);
}
.slide-dot.active { background: #fff; transform: scale(1.3); }

/* Index main layout */
.index-main {
  max-width: var(--max-w); margin: 0 auto;
  padding: 52px 32px 80px;
  display: grid; grid-template-columns: 1fr 360px; gap: 32px;
  align-items: start;
  background: var(--white);
}

/* ── Card component (used on index) ─────────────────────── */
.card {
  border-top: 3px solid var(--accent);
  background: var(--white);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.card-head h2 {
  font-size: .98rem; font-weight: 700; color: var(--text);
  letter-spacing: .04em; border: none; padding: 0; margin: 0;
  text-transform: uppercase;
}
.card-body { padding: 22px 24px; }
.card-body p { font-size: .91rem; line-height: 1.9; margin-bottom: .85em; }
.card-body p:last-child { margin-bottom: 0; }

/* News list on index */
.news-list { list-style: none; }
.news-item { padding: 13px 0; border-bottom: 1px solid var(--border); }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-date { font-size: .7rem; font-weight: 700; color: var(--accent); font-family: var(--font-en); letter-spacing: .05em; margin-bottom: 2px; }
.news-link { font-size: .85rem; line-height: 1.6; color: var(--text); text-decoration: none; display: block; }
.news-link:hover { color: var(--accent); }
.news-link.ext::after { content: ' ↗'; font-size: .7em; opacity: .5; }

/* ── Modern CSS gradient slides ─────────────────────────────── */
.slide-css {
  position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease-in-out;
  overflow: hidden;
}
.slide-css.active { opacity: 1; }
.slide-css svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Crowdfunding banner ──────────────────────────────────────── */
.cf-banner {
  background: linear-gradient(90deg, #8B0000 0%, #C8102E 60%, #a50d24 100%);
  padding: 0;
}
.cf-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 20px 32px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cf-icon {
  font-size: 2rem; flex-shrink: 0;
  width: 48px; height: 48px;
  background: rgba(255,255,255,.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cf-text { flex: 1; min-width: 200px; }
.cf-text strong {
  display: block; color: #fff; font-size: 1rem; font-weight: 700;
  letter-spacing: .02em; margin-bottom: 2px;
}
.cf-text p {
  color: rgba(255,255,255,.85); font-size: .84rem; margin: 0; line-height: 1.5;
}
.cf-btn {
  flex-shrink: 0;
  display: inline-block; padding: 10px 24px;
  background: #fff; color: var(--accent);
  font-weight: 700; font-size: .85rem; text-decoration: none;
  border-radius: 2px; letter-spacing: .03em;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}
.cf-btn:hover { background: rgba(255,255,255,.88); color: var(--accent-hov); }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 960px) {
  .hd-nav { display: none; }
  .hd-hamburger { display: flex; }
  .index-main { grid-template-columns: 1fr; }
  .site-hero { height: min(50vw, 360px); }
  .hero-overlay { padding: 24px; }
  .slide-dots { right: 24px; }
  .hd-inner { padding: 0 20px; }
}

@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .page-banner { padding: 36px 20px 24px; }
  .breadcrumb { padding: 10px 20px; }
  .page-main { padding: 32px 20px 60px; }
  .index-main { padding: 28px 20px 60px; gap: 20px; }
  .hero-overlay { padding: 18px 20px; }
  .ft-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer { padding: 32px 20px; }
}
