/* ============================================================
   top.css — MengLab Homepage
   Palette: Navy ink structure + Ritsumeikan Red accent.
            All colour values live in tokens.css — do not
            hardcode hex here.
   Rhythm: NAVY hero → WHITE nav → LIGHT-GRAY publications
           → WHITE news → NAVY labinfo → DEEP-NAVY footer
   ============================================================ */


/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}
body {
  /* "Yu Gothic UI"/"Yu Gothic" render thin and washed out on Windows;
     Meiryo ahead of them keeps Japanese text at a consistent weight. */
  font-family: 'Roboto', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans',
               Meiryo, 'Yu Gothic', sans-serif;
  color: #1a1a1a;
  line-height: 1.7;
  overflow-x: clip;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ============================================================
   HEADER
   ============================================================ */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 80px;
  background: transparent;
  transition: background 0.3s, box-shadow 0.3s;
}
#header.scrolled {
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.header-inner {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}
/* The lab name is set as text rather than using logo.jpg: that
   bitmap is black-on-white and would read as a hard white block on
   the navy header (blend modes can't fix it — #header is a fixed,
   z-indexed stacking context, so the image composites against its
   own transparent backdrop, not the hero behind it). */
.header-logo-icon { display: none; }
/* Wordmark set as three stacked lines, matching the hero "MengLab"
   treatment: page font (Roboto) at bold with tight tracking. */
.header-logo-text {
  display: flex;
  flex-direction: column;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.06;
  color: #fff;
  white-space: nowrap;
}
/* Narrow desktop: shrink the lockup before the hamburger kicks in. */
@media (max-width: 1000px) {
  .header-logo-text { font-size: 14.5px; }
  .header-inner { gap: 20px; }
}

/* Nav links */
.header-nav { margin-left: auto; }
.header-list { display: flex; gap: 2px; align-items: center; }
.header-list > li { position: relative; }
.header-list > li > a {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(255,255,255,.9);
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}
.header-list > li > a:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Calendar icon button */
.header-cal-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 7px 10px !important;
  color: rgba(255,255,255,.75) !important;
  border-radius: 6px !important;
  transition: background 0.2s, color 0.2s !important;
}
.header-cal-btn:hover {
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
}

/* Dropdown */
.header-list .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border-top: 3px solid var(--red);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  border-radius: 0 0 6px 6px;
  padding: 6px 0;
  z-index: 100;
}
.header-list .has-dropdown:hover .dropdown-menu { display: block; }
.header-list .dropdown-menu li a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  color: #444444;
  transition: background 0.15s, color 0.15s;
}
.header-list .dropdown-menu li a:hover {
  background: var(--bg-soft);
  color: var(--red);
}

/* Hamburger */
.header-cal-mobile {
  display: none;
  align-items: center; justify-content: center;
  width: 46px; height: 46px;
  color: #fff; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 4px;
  transition: background .15s;
}
.header-cal-mobile:hover { background: rgba(255,255,255,.15); }

.ham-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 46px; height: 46px;
  gap: 6px;
  background: var(--red);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}
.ham-btn span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s;
}
.ham-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ham-btn.open span:nth-child(2) { opacity: 0; }
.ham-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile drawer */
.mob-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 260px; height: 100%;
  background: var(--navy);
  z-index: 999;
  padding: 90px 28px 40px;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), visibility 0s 0.35s;
  border-left: 1px solid rgba(255,255,255,.1);
}
.mob-drawer.open { transform: translateX(0); visibility: visible; transition: transform 0.35s cubic-bezier(0.22,1,0.36,1); }
.mob-drawer ul { display: flex; flex-direction: column; }
.mob-drawer ul li a {
  display: block;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  border-bottom: 1px solid rgba(255,255,255,.1);
  transition: color 0.2s, padding-left 0.2s;
}
.mob-drawer ul li a:hover { color: #fff; padding-left: 6px; }
.mob-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 998; opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.mob-overlay.open { opacity: 1; pointer-events: auto; }

/* ============================================================
   SECTION 1 — HERO  (navy band)
   Compact by design: the hero must not fill the viewport, so
   the "What We Do" accordion is already visible on load.
   ============================================================ */
.top-mv {
  position: relative;
  width: 100%;
  min-height: 52vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 白い斜線グリッド装飾 */
.top-mv::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* 大きなリング */
.top-mv::after {
  content: '';
  position: absolute;
  top: -160px; right: -160px;
  width: 680px; height: 680px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
  animation: rotateRing 40s linear infinite;
}

/* 内側の小さなリング */
.top-mv-ring2 {
  position: absolute;
  bottom: -80px; left: -80px;
  width: 400px; height: 400px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  animation: rotateRing 25s linear infinite reverse;
  pointer-events: none;
}

/* Hero SVG デコレーションレイヤー */
.hero-deco {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* 六角形ゆっくり回転 */
.hero-hex {
  animation: hexSpin 22s linear infinite;
  transform-box: fill-box;
  transform-origin: 92% 52%;
}
@keyframes hexSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* スキャンライン上下移動 */
.hero-scan {
  animation: scanMove 9s ease-in-out infinite;
}
@keyframes scanMove {
  0%   { transform: translateY(-25vh); opacity: 0; }
  15%  { opacity: 0.8; }
  85%  { opacity: 0.8; }
  100% { transform: translateY(25vh); opacity: 0; }
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.top-mv-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 102px 24px 48px;
  max-width: 860px;
}

.top-mv-en {
  font-size: clamp(38px, 5.6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}
.top-mv-en::after {
  content: '';
  display: block;
  width: 46px; height: 2px;
  background: rgba(255,255,255,.5);
  margin: 13px auto 13px;
  border-radius: 2px;
}
.top-mv-ja {
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 300;
  letter-spacing: .16em;
  color: rgba(255,255,255,.75);
  margin-bottom: 9px;
}
.top-mv-sub {
  font-size: clamp(12px, 1.4vw, 13.5px);
  color: rgba(255,255,255,.55);
  letter-spacing: .05em;
  line-height: 1.75;
  margin-bottom: 4px;
}

/* Hero CTA buttons */
.top-mv-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.mv-btn {
  display: inline-block;
  padding: 11px 28px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  border-radius: 3px;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.mv-btn:hover { transform: translateY(-2px); }
.mv-btn-solid {
  background: #fff;
  color: var(--red-dark);
}
.mv-btn-solid:hover { background: #eef1f4; }
.mv-btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.45);
  color: rgba(255,255,255,.9);
}
.mv-btn-outline:hover { border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }

/* Scroll indicator — hidden: the hero no longer fills the
   viewport, so the next section is already visible on load. */
.top-mv-scroll { display: none; }

/* ============================================================
   SECTION 2 — NAV CARDS  (white background)
   ============================================================ */
.top-nav {
  background: #ffffff;
  padding: 44px 0 72px;
}
.top-nav-inner {
  max-width: 1280px;
  width: 92%;
  margin: 0 auto;
}
.top-nav-hd {
  text-align: center;
  margin-bottom: 28px;
}
.top-nav-hd .sec-label {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--red);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}
.top-nav-hd h2 {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: #1a1a1a;
}

/* White nav cards grid */
/* ═══ What We Do — accordion ═══ */
.wwd-acc {
  display: flex; gap: 8px; height: 420px;
}
.wwd-item {
  position: relative; flex: 1 1 0; border-radius: 8px; overflow: hidden;
  text-decoration: none; cursor: pointer; min-width: 0;
  transition: flex .55s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.wwd-item:hover { flex: 10 1 0; }

.wwd-bg { position: absolute; inset: 0; }
.wwd-bg img { width: 100%; height: 100%; object-fit: cover; }
.wwd-bg-ph { position: absolute; inset: 0; }
.wwd-bg-ph::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.1) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}
/* overlay */
.wwd-item::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(120,12,8,.88) 0%, rgba(60,6,4,.45) 50%, rgba(40,4,3,.30) 100%);
  transition: background .4s;
}
.wwd-item:hover::before {
  background: linear-gradient(to top, rgba(138,15,9,.92) 0%, rgba(90,8,5,.6) 55%, rgba(60,6,4,.4) 100%);
}

/* top label (collapsed = vertical, expanded = horizontal) */
.wwd-label {
  position: absolute; z-index: 3; top: 18px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 0; color: #fff;
  flex-direction: column; gap: 12px;
  transition: padding .4s;
}
.wwd-name {
  font-size: 15px; font-weight: 800; white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
  writing-mode: vertical-rl;          /* collapsed: vertical */
  transition: writing-mode 0s;
}
.wwd-plus { font-size: 18px; font-weight: 300; opacity: .85; transition: transform .4s; order: -1; }

/* expanded: switch label back to horizontal at the top */
.wwd-item:hover .wwd-label {
  flex-direction: row; align-items: center; justify-content: space-between;
  padding: 0 22px; top: 18px;
}
.wwd-item:hover .wwd-name { writing-mode: horizontal-tb; }
.wwd-item:hover .wwd-plus { transform: rotate(45deg); order: 0; }

.wwd-num {
  position: absolute; z-index: 3; bottom: 16px; left: 18px;
  font-size: 13px; font-weight: 800; color: rgba(255,255,255,.55);
  letter-spacing: .1em; transition: opacity .3s;
}
.wwd-item:hover .wwd-num { opacity: 0; }

/* expanded content */
.wwd-content {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding: 22px 26px; color: #fff;
  opacity: 0; transform: translateY(14px);
  transition: opacity .35s .12s, transform .35s .12s; pointer-events: none;
}
.wwd-item:hover .wwd-content { opacity: 1; transform: translateY(0); }
.wwd-en { font-size: 11px; letter-spacing: .14em; opacity: .8; margin-bottom: 3px; }
.wwd-title { font-size: 19px; font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.wwd-count {
  display: inline-block; background: #fff; color: var(--red);
  font-size: 11px; font-weight: 800; padding: 1px 9px; border-radius: 999px; margin-left: 8px;
  vertical-align: middle;
}
.wwd-desc {
  font-size: 13px; line-height: 1.8; color: rgba(255,255,255,.92);
  max-width: 540px; margin-bottom: 12px;
}
.wwd-more { font-size: 13px; font-weight: 700; color: #fff; }
.wwd-more::after { content: ''; }

@media (max-width: 820px) {
  .wwd-acc { flex-direction: column; height: auto; }
  .wwd-item { flex: none; min-height: 200px; }
  .wwd-item::before, .wwd-item:hover::before {
    background: linear-gradient(to top, rgba(120,12,8,.9) 0%, rgba(40,4,3,.4) 100%);
  }
  /* mobile: every card always fully expanded, uniform style */
  .wwd-content { opacity: 1 !important; transform: none !important; position: relative; }
  .wwd-label { display: none !important; }
  .wwd-num { display: none; }
}

.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.nav-card-w {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e8e0e0;
  border-top: 4px solid var(--red);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, border-top-color 0.25s;
  color: #1a1a1a;
}
.nav-card-w:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px var(--accent-soft);
  border-top-color: var(--red-dark);
}

.nav-card-w-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center;
  background: #f2f0f0;
  display: block;
}

.nav-card-w-body {
  padding: 18px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nav-card-w-en {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.nav-card-w:hover .nav-card-w-en { color: var(--red); }
.nav-card-w-jp {
  font-size: 12px;
  color: #777777;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.nav-card-w-desc {
  font-size: 12px;
  color: #444444;
  line-height: 1.65;
  flex: 1;
}
.nav-card-w-arrow {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
  letter-spacing: .04em;
  transition: letter-spacing 0.2s;
}
.nav-card-w:hover .nav-card-w-arrow { letter-spacing: .1em; }

/* ============================================================
   SECTION 3 — PUBLICATIONS  (light gray background)
   ============================================================ */
.top-achievement {
  background: #f2f0f0;
  padding: 80px 0;
}
.top-achievement-inner {
  max-width: 1280px;
  width: 92%;
  margin: 0 auto;
}
.top-achievement-hd {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.top-achievement-label {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--red);
  text-transform: uppercase;
  font-weight: 600;
}
.top-achievement-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: #1a1a1a;
}
.top-achievement-more {
  margin-left: auto;
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
  transition: letter-spacing 0.2s;
}
.top-achievement-more:hover { letter-spacing: .06em; }

.achieveSwiper { overflow: visible; }
.achieveSwiper .swiper-slide { width: 320px; flex-shrink: 0; }

/* White publication cards */
.ach-card {
  position: relative;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #e8e0e0;
  border-left: 4px solid var(--red);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
}
.ach-card:hover {
  box-shadow: 0 8px 28px rgba(174,19,12,.1);
  transform: translateY(-3px);
}
.ach-card-overlay { display: none; }

/* 論文サムネイル */
.ach-card-img-wrap {
  width: 100%; height: 160px; flex-shrink: 0; overflow: hidden;
}
.ach-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: top center;
  background: #f7f4f4;
  display: block;
  flex-shrink: 0;
  transition: transform .25s;
}
.ach-card-img-wrap:hover .ach-card-img { transform: scale(1.04); }
.ach-card-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #f4f6f8 0%, var(--light-gray) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ach-card-img-placeholder span {
  font-size: 11px;
  color: #bbb;
  letter-spacing: .06em;
}

.ach-card-body {
  padding: 18px 18px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ach-date {
  font-size: 11px;
  color: var(--red);
  letter-spacing: .1em;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.ach-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.6;
  margin-bottom: 10px;
  flex: 1;
}
.ach-venue {
  font-size: 12px;
  color: #777777;
  border-top: 1px solid #f0e8e8;
  padding-top: 10px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.ach-doi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  align-self: flex-start;
}
.ach-doi:hover { background: var(--red); color: #fff; }
.ach-doi svg { flex-shrink: 0; }

.achNext, .achPrev { color: var(--red) !important; }
.achNext::after, .achPrev::after { font-size: 18px !important; }

/* ============================================================
   SECTION 4 — NEWS  (white background)
   ============================================================ */
.top-news {
  background: #ffffff;
  padding: 80px 0;
}
.top-news-inner {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
}

/* Shared section header (light sections) */
.section-hd {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-label {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--red);
  text-transform: uppercase;
  font-weight: 600;
}
.section-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: #1a1a1a;
}
.section-more {
  margin-left: auto;
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
  transition: letter-spacing 0.2s;
}
.section-more:hover { letter-spacing: .06em; }
/* Same link again below the card list, so a visitor who has scrolled
   through all the cards doesn't have to scroll back up to the header
   to reach "View All" — centered here instead of the header's
   flex-pushed-right placement. */
.section-more-bottom {
  display: block;
  text-align: center;
  margin-top: 32px;
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
  transition: letter-spacing 0.2s;
}
.section-more-bottom:hover { letter-spacing: .06em; }

/* News feed — same magazine-card style as news.php's list, just capped
   to the homepage's "latest N" feed instead of the full archive. */
.news-cards { display: flex; flex-direction: column; gap: 18px; }
.news-card {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  background: #fafafa;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  text-decoration: none;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
a.news-card { cursor: pointer; }
.news-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); border-color: #e2dede; transform: translateY(-1px); }
.nc-body { padding: 34px 38px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.nc-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .03em; color: #888; margin-bottom: 16px; }
.nc-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.nc-title { font-size: 24px; font-weight: 600; line-height: 1.5; color: #1a1a1a;
  letter-spacing: .01em; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.news-card:hover .nc-title { color: var(--red); }
.nc-title strong { color: var(--red); font-weight: 700; }
.nc-excerpt { font-size: 14.5px; line-height: 1.8; color: #888; margin-bottom: 22px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.nc-date { font-size: 12.5px; color: #aaa; letter-spacing: .03em; }

.nc-media { position: relative; background: #eee; min-height: 260px; }
.nc-media img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.nc-media-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.nc-media-ph::after { content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.16) 1.5px, transparent 1.5px);
  background-size: 20px 20px; }
.nc-media-label { position: relative; z-index: 1; color: rgba(255,255,255,.85);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 900px) {
  .news-card { grid-template-columns: 1fr 240px; }
  .nc-body { padding: 26px 28px; }
  .nc-title { font-size: 20px; }
  .nc-excerpt { -webkit-line-clamp: 3; }
}
@media (max-width: 720px) {
  .news-card { grid-template-columns: 1fr; }
  .nc-media { min-height: 180px; order: -1; }
  .nc-body { padding: 22px 24px; }
  .nc-title { font-size: 19px; -webkit-line-clamp: 3; }
  .nc-excerpt { -webkit-line-clamp: 3; }
}

/* ============================================================
   SECTION 5 — LAB INFO  (red background)
   ============================================================ */
.top-labinfo {
  background: var(--navy-mid);
  padding: 88px 0;
}
.top-labinfo-inner {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto;
}
.labinfo-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
/* If the visitor widget fails to load its panel stays hidden, so the
   About text reflows to the full width instead of leaving a gap.
   .no-visit is set by script for browsers without :has(). */
.labinfo-grid:has(> .labinfo-visit[hidden]),
.labinfo-grid.no-visit {
  grid-template-columns: 1fr;
}
/* visitor map widget panel */
.labinfo-visit {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.labinfo-visit .lv-head {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.65); font-weight: 600; align-self: flex-start;
}
/* map.js injects #mapmyvisitors-widget next to its own <script> tag and
   sizes itself from the parent's width. The panel is a centred flex
   column, so the widget is left at its natural size rather than being
   stretched. */
.labinfo-visit #mapmyvisitors-widget { max-width: 100%; }
.labinfo-visit #mapmyvisitors-widget img { max-width: 100%; height: auto; }
.labinfo-visit .mapmyvisitors-map-container { border-radius: 8px; overflow: hidden; }

.labinfo-text .section-label { color: rgba(255,255,255,.65); }
.labinfo-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
  line-height: 1.2;
}
.labinfo-desc {
  font-size: 13.5px;
  color: rgba(255,255,255,.80);
  line-height: 1.95;
  margin-bottom: 26px;
}
/* Key technologies — label/value rows */
.labinfo-tech {
  border-top: 1px solid rgba(255,255,255,.16);
  margin-bottom: 26px;
}
.lt-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.lt-key {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.60);
  padding-top: 3px;
}
.lt-val {
  font-size: 13.5px;
  line-height: 1.8;
  color: rgba(255,255,255,.86);
}

/* Member counts — one compact inline row */
.labinfo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  color: inherit;
}
.ls-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12.5px;
  color: rgba(255,255,255,.68);
  letter-spacing: .02em;
}
.ls-item b {
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: -.02em;
}
.labinfo-stats:hover .ls-item b { color: #fff; }
.labinfo-stats:hover .ls-item { color: rgba(255,255,255,.9); }
.stat-item {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  padding: 28px 20px;
  text-align: center;
  border-radius: 4px;
  transition: background 0.2s;
}
.stat-item:hover { background: rgba(255,255,255,.18); }
.stat-num {
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 10px;
}
.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ============================================================
   FOOTER  (darkest red)
   ============================================================ */
#footer {
  background: var(--navy-deep);
  padding: 72px 0 44px;
  color: rgba(255,255,255,.6);
}
.footer-inner { max-width: 1200px; width: 90%; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 3.2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand-wrap {
  display: flex; align-items: center;
  margin-bottom: 10px;
}
/* Three-line wordmark, matching the header lockup. */
.footer-brand-text {
  display: flex; flex-direction: column;
  font-size: 18px; font-weight: 700;
  letter-spacing: -.03em; line-height: 1.06;
  color: #fff;
}
.footer-sub-tag {
  font-size: 12px; letter-spacing: .04em;
  color: rgba(255,255,255,.60);
  margin-bottom: 14px; font-weight: 500;
}
.footer-addr { font-size: 13px; line-height: 1.9; }
.footer-addr-row {
  display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap;
}
.footer-addr-row .footer-addr { flex: 0 0 auto; min-width: 0; }
/* flex: 0 0 380px (no shrink) let the map hold its 380px width even
   when the address text beside it didn't leave that much room in this
   column — with nowrap that overflowed the row and visually spilled
   the map into the next grid column instead of wrapping under the
   address. 1 1 380px lets it shrink instead, and flex-wrap: wrap above
   is the fallback once there truly isn't room for both. */
.footer-map { flex: 1 1 380px; max-width: 380px; }
.footer-map iframe {
  width: 100%; height: 240px; border: 0; border-radius: 10px;
  filter: grayscale(.2); display: block;
}
@media (max-width: 980px) {
  .footer-map { flex: 1 1 240px; max-width: none; }
}
.footer-map-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: 12px; color: rgba(255,255,255,.8); text-decoration: none;
  border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 5px 12px;
  transition: background .15s, border-color .15s;
}
.footer-map-link:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.footer-nav-col h4 {
  font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  margin-bottom: 16px; font-weight: 600;
}
.footer-nav-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-nav-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.72);
  transition: color 0.2s;
}
.footer-nav-col ul li a:hover { color: #fff; }
.footer-bottom {
  padding-top: 26px; font-size: 12px;
  text-align: center; color: rgba(255,255,255,.45);
}


/* Nav cards hover */
.nav-cards-grid .nav-card-w {
  transition: box-shadow 0.25s, border-top-color 0.25s;
}
.nav-cards-grid .nav-card-w:hover { transform: translateY(-5px); }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .nav-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .header-nav { display: none; }
  .ham-btn { display: flex; }
  .header-cal-mobile { display: flex; }   /* show calendar icon next to hamburger */
  .header-inner { gap: 10px; width: auto; padding: 0 14px; }
  .header-logo { margin-right: auto; min-width: 0; }
  .header-logo-text { font-size: 13px; }
  .nav-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .labinfo-grid { grid-template-columns: 1fr; gap: 44px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .nav-cards-grid { grid-template-columns: 1fr; }
  .achieveSwiper .swiper-slide { width: 280px; }
  .labinfo-stats { gap: 16px; }
  .ls-item b { font-size: 20px; }
  .ls-item { font-size: 11.5px; }
  .lt-row { grid-template-columns: 1fr; gap: 4px; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-logo-text { font-size: 11.5px; }
}

/* Language switcher — segmented JA | EN, matching the inner pages.
   The homepage header is 80px tall and translucent over the hero, so
   the control gets a lighter border than on the solid navbar. */
.header-list .nav-lang { display: flex; align-items: center; margin-left: 8px; }
.header-list .nav-lang .lang-switch {
  display: inline-flex; align-items: stretch; line-height: 1;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 5px; overflow: hidden;
}
.header-list .nav-lang .lang-switch a {
  display: flex; align-items: center; padding: 5px 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  color: rgba(255,255,255,.72);
  transition: color .15s, background .15s;
}
.header-list .nav-lang .lang-switch a + a { border-left: 1px solid rgba(255,255,255,.35); }
.header-list .nav-lang .lang-switch a:hover { color: #fff; background: rgba(255,255,255,.16); }
.header-list .nav-lang .lang-switch a.on { color: var(--navy); background: #fff; }

/* Cookie consent — homepage loads top.css only, so the bar is styled here too. */
.cc-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: var(--navy-deep); color: rgba(255,255,255,.88);
  border-top: 1px solid rgba(255,255,255,.16); box-shadow: 0 -4px 20px rgba(0,0,0,.28); }
.cc-inner { max-width: 1200px; width: 90%; margin: 0 auto; padding: 14px 0;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cc-text { font-size: 12.5px; line-height: 1.7; margin: 0; flex: 1 1 380px; }
.cc-detail { flex: 1 1 100%; margin: 0; font-size: 11.5px; line-height: 1.7; color: rgba(255,255,255,.62); }
.cc-link { background: none; border: none; padding: 0 0 0 6px; cursor: pointer;
  font: inherit; font-size: 12px; color: rgba(255,255,255,.72); text-decoration: underline; }
.cc-link:hover { color: #fff; }
.cc-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cc-btn { padding: 7px 18px; border-radius: 5px; cursor: pointer; font: inherit;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.cc-solid { background: #fff; color: var(--navy); border: 1px solid #fff; }
.cc-solid:hover { background: #e9edf1; }
.cc-ghost { background: transparent; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.34); }
.cc-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 640px) { .cc-inner { padding: 12px 0; gap: 12px; } .cc-actions { width: 100%; } .cc-btn { flex: 1; } }

/* ── Lightbox (click-to-view image), shared with publication.php ── */
.lb-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10,14,20,.92);
  display: none; align-items: center; justify-content: center;
  padding: 40px 20px; cursor: zoom-out;
  overflow-y: auto;
}
/* [hidden] only wins over an explicit display when this rule also owns
   display; without it "display:flex" above beats the browser's default
   [hidden]{display:none} and the overlay would show on every page load. */
.lb-overlay:not([hidden]) { display: flex; }
.lb-panel {
  display: flex; flex-direction: column; align-items: center;
  max-width: min(92vw, 900px); margin: auto; cursor: default;
}
.lb-img {
  max-width: 100%; max-height: 68vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lb-caption {
  margin-top: 16px; color: rgba(255,255,255,.82);
  font-size: 13px; max-width: 700px; text-align: center; line-height: 1.6;
}
.lb-abstract {
  margin-top: 12px; padding: 14px 18px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; max-width: 700px; width: 100%;
  color: rgba(255,255,255,.72); font-size: 12.5px; line-height: 1.8;
  text-align: left; box-sizing: border-box;
}
.lb-close {
  position: fixed; top: 18px; right: 22px; z-index: 2001;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-close:hover { background: rgba(255,255,255,.22); }
.js-lightbox { cursor: zoom-in; }

/* ===== LAB VISIT INFO (top page, between hero and research cards) ===== */
.top-visit {
  background: #ffffff;
  padding: 16px 0;
}
.top-visit-inner {
  max-width: 1280px;
  width: 92%;
  margin: 0 auto;
}
.visit-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  background: #fdf8e8;
  border: 1px solid #ecdfa8;
  border-radius: 10px;
  padding: 14px 24px;
}
.visit-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 1 280px;
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid #ecdfa8;
}
.visit-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.visit-heading {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
}
.visit-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.visit-info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}
.visit-label {
  flex: 0 0 auto;
  color: #8a7e4f;
  font-weight: 600;
  letter-spacing: .02em;
}
.visit-value {
  color: #2a2a2a;
}
.visit-link {
  color: var(--red);
  text-decoration: none;
}
.visit-link:hover { text-decoration: underline; }

.visit-schedule {
  flex: 1 1 460px;
  min-width: 0;
}
.visit-schedule-note {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--red);
  background: rgba(174,19,12,.09);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.visit-schedule-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.visit-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: #fff;
  border: 1px solid #ecdfa8;
  border-radius: 7px;
  padding: 5px 6px;
}
.visit-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.visit-day {
  font-size: 10px;
  font-weight: 600;
  color: #8a7e4f;
  letter-spacing: .02em;
}
.visit-time {
  font-size: 11px;
  font-weight: 600;
  color: #3a3a3a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .visit-card { flex-direction: column; align-items: stretch; }
  .visit-left { flex: 1 1 auto; padding-right: 0; border-right: none; padding-bottom: 14px; border-bottom: 1px solid #ecdfa8; }
  .visit-schedule-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .visit-schedule-grid { grid-template-columns: repeat(2, 1fr); }
}
