/* =========================================================
   Hata Laboratory Website CSS
   Clean unified version
   - Based on the provided style files
   - Fixed duplicate definitions and CSS syntax errors
   - Prevents movies/images from overflowing the main content area
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --blue: #0f5f9e;
  --blue-dark: #0a3d66;
  --light-blue: #eaf5fc;
  --yellow: #f4c542;

  --text: #1f2933;
  --muted: #667085;

  --bg: #f5f7fa;
  --white: #ffffff;
  --border: #d8e2ec;

  --content-width: 1180px;
  --side-width: 310px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
video,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
  display: block;
}

/* ---------- Header ---------- */
.top-bar {
  background: var(--blue-dark);
  color: #fff;
  font-size: 13px;
}

.top-bar-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 6px 24px;
  text-align: right;
}

.site-header {
    position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 4px solid var(--blue);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}

.site-logo img {
  display: block;
  width: min(520px, 52vw);
  max-height: 72px;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
}

.nav a {
  display: block;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 600;
  border-radius: 4px;
    font-size: 16px;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(90deg, rgba(10, 61, 102, 0.85), rgba(10, 61, 102, 0.45)),
    url("image/20240518-2.jpg") center / cover no-repeat;
  min-height: 430px;
  display: flex;
  align-items: center;
}

.hero-inner {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 72px 24px;
  color: #fff;
}

.hero-label {
  display: inline-block;
  background: var(--yellow);
  color: #1f2933;
  font-weight: 800;
  padding: 4px 12px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.18;
  letter-spacing: 0.02em;
}

.hero p {
  max-width: 740px;
  font-size: 18px;
  margin: 0;
}

/* Hero slider */
.hero-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 520px;
  background: #000;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero-slide::after {
  display: none;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slider .hero-inner {
  position: relative;
  z-index: 1;
}

/* ---------- Layout ---------- */
.main-wrap {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 44px 24px 80px;
  overflow-x: clip;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-width);
  gap: 36px;
  align-items: start;
}

.two-column > * {
  min-width: 0;
}

/* ---------- Common sections ---------- */
.section {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 30px;
  margin-bottom: 28px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.section-title {
  margin: 0 0 22px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--blue);
  color: var(--blue-dark);
  font-size: 26px;
  line-height: 1.35;
}

.section-title small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.section-lead {
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 18px;
}

/* ---------- News ---------- */
.news-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.news-item {
  display: grid;
  grid-template-columns: 140px 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.news-date {
  font-weight: 800;
  color: var(--blue-dark);
}

.news-category {
  display: inline-block;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--light-blue);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.news-text {
  min-width: 0;
}

.news-text img {
  display: block;
  max-width: 260px;
  margin-top: 12px;
  border-radius: 6px;
}

.news-scroll {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--blue) var(--light-blue);
}

.news-scroll .news-list {
  border-top: none;
}

.news-scroll .news-item:last-child {
  border-bottom: none;
}

.news-scroll::-webkit-scrollbar {
  width: 8px;
}

.news-scroll::-webkit-scrollbar-track {
  background: var(--light-blue);
  border-radius: 999px;
}

.news-scroll::-webkit-scrollbar-thumb {
  background: var(--blue);
  border-radius: 999px;
}

.news-archive-list .news-item {
  background: #fff;
}

.news-year,
.news-year-box,
.news-year-nav,
.publication-year {
  scroll-margin-top: 120px;
}

.news-year-nav {
  margin-top: 18px;
}

.news-year-nav a {
  display: inline-block;
  margin: 4px 6px 4px 0;
}

.news-year-box {
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
}

.news-year-box summary {
  cursor: pointer;
  padding: 16px 20px;
  font-size: 1.4rem;
  font-weight: bold;
  background: #f5f5f5;
  list-style: none;
}

.news-year-box summary span {
  font-size: 0.9rem;
  color: #777;
  margin-left: 8px;
}

.news-year-box summary::-webkit-details-marker {
  display: none;
}

.news-year-box summary::after {
  content: "＋";
  float: right;
}

.news-year-box[open] summary::after {
  content: "－";
}

.news-year-box .news-list {
  padding: 20px;
}

/* ---------- Links/cards ---------- */
.more-link {
  margin-top: 18px;
  text-align: right;
}

.more-link a {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--blue);
  background: #fff;
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.link-card {
  display: block;
  background: var(--light-blue);
  border-left: 5px solid var(--blue);
  padding: 18px;
  color: var(--text);
  min-height: 120px;
}

.link-card strong {
  display: block;
  color: var(--blue-dark);
  font-size: 19px;
  margin-bottom: 6px;
}

.link-list {
  display: grid;
  gap: 12px;
}

.link-list a {
  display: block;
  padding: 16px 18px;
  background: var(--light-blue);
  border-left: 5px solid var(--blue);
  color: var(--text);
}

.link-list strong {
  display: block;
  color: var(--blue-dark);
  font-size: 18px;
}

.link-list span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Sidebar ---------- */
.side-box {
  background: var(--white);
  border: 1px solid var(--border);
  margin-bottom: 22px;
  min-width: 0;
}

.side-title {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  padding: 10px 16px;
}

.side-body {
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
}

.sidebar-section {
  background: #f8f8f8;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.sidebar-title {
  font-size: 1.2rem;
  margin-bottom: 15px;
  border-bottom: 2px solid #ccc;
  padding-bottom: 8px;
}

.sidebar-year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-year-nav a {
  display: inline-block;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #333;
  font-size: 0.9rem;
  transition: 0.2s;
}

.sidebar-year-nav a:hover {
  background: #333;
  color: #fff;
  text-decoration: none;
}

/* ---------- Page title ---------- */
.page-title {
  background: var(--blue-dark);
  color: #fff;
  padding: 46px 24px;
}

.page-title-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-title h1 {
  margin: 0;
  font-size: 36px;
}

.page-title p {
  margin: 6px 0 0;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 26px;
  align-items: center;
}

.about-grid figure {
  margin: 0;
}

.about-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.about-lab p {
  margin-bottom: 0.9em;
}

/* ---------- Publications ---------- */
.year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 32px;
}

.year-nav a {
  display: inline-block;
  padding: 6px 12px;
  background: var(--light-blue);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
}

.publication-list {
  padding-left: 1.4em;
}

.publication-list li {
  margin-bottom: 14px;
}

/* ---------- Archive ---------- */
.archive-content {
  max-height: none;
}

.archive-content p {
  margin: 0 0 12px;
}

.archive-content img {
  display: block;
  max-width: 560px;
  width: 100%;
  height: auto;
  margin: 10px auto 26px;
  border-radius: 6px;
}

.archive-content a {
  word-break: break-word;
}

/* ---------- Research ---------- */
.research-intro {
  margin-bottom: 70px;
}

.research-flex {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.research-text {
  line-height: 1.9;
  min-width: 0;
}

.research-image {
  min-width: 0;
}

.research-image img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.eyebrow {
  color: #0a5b8f;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.lead-text {
  font-size: 1.2rem;
  line-height: 2;
  color: #333;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 30px;
}

.topic-card {
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-top: 4px solid #0a5b8f;
  min-width: 0;
}

.topic-number {
  color: #0a5b8f;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.topic-card h3 {
  font-size: 1.35rem;
  margin-bottom: 4px;
  color: #123;
}

.topic-subtitle {
  color: #0a5b8f;
  font-weight: 600;
  margin-bottom: 14px;
}

.topic-card p {
  line-height: 1.8;
}

/* ---------- Facility/card image ---------- */
.facility-photo {
  border-radius: 6px;
  margin: 10px 0 18px;
}

.card img.facility-photo,
.card .facility-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---------- Members ---------- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 22px;
}

.member-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 18px;
}

.member-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 12px;
}

.member-section {
  background: #fff;
  padding: 40px;
  margin-bottom: 40px;
  border: 1px solid var(--border);
}

.member-category {
  font-size: 1.5rem;
  color: var(--blue-dark);
  border-bottom: 3px solid var(--blue);
  padding-bottom: 10px;
  margin-bottom: 35px;
}

.member-item {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 45px;
}

.member-photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.member-info {
  min-width: 0;
}

.member-info h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.5rem;
  color: var(--text);
}

.member-name-en {
  font-size: 1.05rem;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 12px;
}

.member-position {
  font-size: 1.2rem;
  color: #555;
}

.member-mail span {
  display: inline-block;
  min-width: 72px;
  margin-right: 10px;
  padding: 2px 10px;
  background: var(--blue-dark);
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

.compact-member .member-detail {
  display: none;
}

.student-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.student-item:first-of-type {
  padding-top: 0;
}

.student-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.student-photo {
  width: 150px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.student-item h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: var(--text);
}

.student-item h3 span {
  margin-left: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.student-item p {
  margin: 3px 0;
}

.student-research {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Movie: overflow-safe ---------- */
/*
  Recommended HTML:
  <div class="movie-card">
    <video src="movie/movie2.mp4" autoplay muted loop playsinline controls></video>
  </div>

  If videos are inside .research-flex / .section / .main-wrap, these rules
  keep them within the available content width.
*/
.movie-card,
.video-card,
.movie-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 36px auto;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.movie-card video,
.video-card video,
.movie-wrap video,
.section video,
.main-wrap video,
.research-flex video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* For iframes such as YouTube embeds */
.movie-card iframe,
.video-card iframe,
.movie-wrap iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

/* If the video source has an extremely wide canvas, constrain its height visually. */
.movie-card.is-wide video,
.video-card.is-wide video,
.movie-wrap.is-wide video {
  max-height: 70vh;
}

/* ---------- Year links ---------- */
.year-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.year-links p {
  margin: 0;
}

.year-links a {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f3f3f3;
  color: #333;
  transition: 0.2s;
}

.year-links a:hover {
  background: #333;
  color: #fff;
  text-decoration: none;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  padding: 10px 14px;
  background: #333;
  color: #fff;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.back-to-top:hover {
  opacity: 1;
  text-decoration: none;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--blue-dark);
  color: #fff;
  text-align: center;
  padding: 34px 24px;
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
  .header-inner {
    display: block;
  }

  .site-logo img {
    width: min(420px, 92vw);
    max-height: 64px;
  }

  .nav {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .two-column,
  .about-grid,
  .research-flex,
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero-slider {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 768px) {
  .main-wrap {
    padding: 32px 16px 64px;
  }

  .section {
    padding: 24px 18px;
  }

  .member-section {
    padding: 24px 18px;
  }

  .member-item,
  .student-item {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .member-photo,
  .student-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .member-info h3 span,
  .student-item h3 span {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }

  .movie-card,
  .video-card,
  .movie-wrap {
    border-radius: 12px;
    margin: 28px auto;
  }
}

.movie-block{
  margin: 50px auto;
  width: 100%;
}

.movie-card{
  width:100%;
  overflow:hidden;
  border-radius:16px;
  background:#000;
}

.movie-card video{
  width:100%;
  height:auto;
  display:block;
}

.movie-title{
  margin-top:18px;
  margin-bottom:8px;

  font-size:1.15rem;
  color:#123;
}

.movie-caption{
  margin-top:0;
  color:#667085;
  font-size:0.95rem;
  line-height:1.7;
}

/* ---------- Language switch ---------- */
.nav a.language-switch {
  margin-left: 8px;
  border: 1px solid var(--blue);
  color: var(--blue);
  background: #fff;
  font-weight: 700;
}

.nav a.language-switch:hover,
.nav a.language-switch:focus {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 900px) {
  .nav {
    flex-wrap: wrap;
  }
  .nav a.language-switch {
    margin-left: 0;
  }
}
