/* ===== Reset / Base ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #000;
  font-size: 14px;
  background: #fff;
}

a {
  color: #b40000;
  text-decoration: underline;
}

a:hover {
  text-decoration: none;
}


/* ===== Shared Page Wrapper ===== */
.page-wrapper {
  width: 100%;
  max-width: none;
  padding: 0 24px;
  margin: 0;
}


/* ===== Banner (split images) ===== */
.site-banner {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: #fff;
}

.site-banner .banner-left {
  flex: 1 1 auto;
  height: 160px;
  min-width: 0;
  overflow: hidden;
}

.site-banner .banner-left img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left top;
  background: #fff;
}

.site-banner .banner-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #fff;
}

.site-banner .banner-right img {
  height: 160px;
  width: auto;
  display: block;
}


/* ===== Shared Main Layout ===== */
.main-row {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 24px 0 40px 10px;
  font-size: 16px;
}


/* ===== Sidebar ===== */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 2px solid #b40000;
  padding: 0 16px 24px 10px;
  margin-right: 16px;
}

.sidebar-topspace {
  height: 24px;
}

.sidebar-gap {
  height: 16px;
}

.nav-item {
  margin-bottom: 16px;
}

.nav-item a {
  display: block;
  color: #b40000;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
}

.nav-item a:hover {
  text-decoration: underline;
}

.sidebar-logo-block {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

.sidebar-logo-block img {
  display: inline-block;
  max-width: 95%;
  height: auto;
}

.sidebar-logo-small img {
  width: 45% !important;
  max-width: 90px;
}

.visitor-block {
  text-align: center;
  color: #b40000;
  font-size: 12px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}


/* ===== Shared Headings / Text ===== */
.page-name,
.section-title,
.pageName {
  color: #b40000;
  font-size: 24px;
  font-weight: bold;
}

.page-name {
  margin: 0 0 14px 0;
}

.section-title {
  margin: 0 0 20px 0;
}

.pageName {
  padding: 24px 0 12px 10px;
}

.subsubpageName {
  font-size: 18px;
  font-weight: bold;
  margin: 22px 0 8px 0;
  color: #000;
}

.researchName,
.subheading {
  font-weight: bold;
  color: #000;
}

.researchName {
  margin: 16px 0 8px 0;
}

.subheading {
  font-size: 15px;
  margin: 0 0 0.75rem 0;
  border-top: 1px solid #b40000;
  padding-top: 0.75rem;
}

.researchTextcontent,
.intro-text,
.bodyText,
.section-note {
  text-align: justify;
  color: #000;
}

.researchTextcontent,
.intro-text {
  margin: 0 0 14px 0;
}

.bodyText,
.section-note {
  font-size: 16px;
}

.bodyText {
  line-height: 1.6;
  padding: 0 0 8px 10px;
}

.section-note {
  margin: 0 0 1.5rem 0;
}


/* ===== Shared Image Utilities ===== */
.img-center {
  text-align: center;
  margin: 10px 0 18px 0;
}

.img-center img {
  height: auto;
  display: inline-block;
}

/* 圖片比例工具：Research / Facility 可直接共用 */
.fig-40 img { max-width: 40%; }
.fig-50 img { max-width: 50%; }
.fig-60 img { max-width: 50%; }
.fig-65 img { max-width: 50%; }
.fig-70 img { max-width: 50%; }
.fig-80 img { max-width: 50%; }
.fig-90 img { max-width: 60%; }

/* 若某些圖沒有 fig-* class，就給一個預設值 */
.img-center:not(.fig-40):not(.fig-50):not(.fig-60):not(.fig-65):not(.fig-70):not(.fig-80):not(.fig-90) img {
  max-width: 50%;
}


/* ===== Shared Footer ===== */
.footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #b40000;
  padding-top: 12px;
  margin-top: 30px;
}


/* ===== Home Page ===== */
.main-graphic {
  text-align: center;
  margin: 18px 0 22px 0;
}

.main-graphic img {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.partner-logos {
  text-align: center;
  margin: 12px 0 24px 0;
}

.partner-logos img {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 0 auto;
}


/* ===== Bio Page ===== */
.bio-photo {
  display: block;
  width: min(520px, 20%);
  height: auto;
  margin: 12px 0 18px 0;
}


/* ===== Members Page ===== */
.members-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 900px;
  margin: 0 0 2rem 0;
}

.members-col {
  flex: 1 1 360px;
  min-width: 300px;
}

.alumni-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 0 2rem 0;
}

.alumni-col {
  flex: 1 1 320px;
  min-width: 260px;
}

.member {
  display: flex;
  align-items: flex-start;
  margin: 0 0 1.2rem 0;
}

.member img {
  width: 75px;
  height: 95px;
  object-fit: cover;
  border: 1px solid #999;
  margin-right: 12px;
  flex-shrink: 0;
}

.info {
  font-size: 14px;
  color: #000;
  line-height: 1.4;
}

.info .name {
  font-weight: bold;
  font-size: 15px;
  color: #000;
  margin: 0 0 0.4rem 0;
}

.role {
  margin: 0 0 0.4rem 0;
}

.email {
  margin: 0 0 0.2rem 0;
}


/* ===== Links Page ===== */
.links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.links-col h3 {
  margin: 0 0 10px 0;
}

.links-list {
  margin: 0 0 18px 18px;
}

.links-list li {
  margin: 6px 0;
}

.links-logos img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px auto 0 auto;
}


/* ===== Publications Page (legacy support) ===== */
.page-publications table[width="90%"] {
  width: 100% !important;
  max-width: 1400px;
  margin: 0 auto !important;
}

.page-publications table {
  border-collapse: collapse;
}

body img[alt="Header image"] {
  display: block;
  width: 100%;
  height: auto;
}

#navigation {
  width: 200px;
  border-right: 2px solid #b40000;
  padding: 0 16px 24px 10px;
  box-sizing: border-box;
}

#navigation .navText {
  padding: 0 !important;
}

#navigation .navText a,
#navigation a.navText {
  display: block;
  color: #b40000;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
  margin: 0 0 16px 0;
}

.webCounter {
  text-align: center;
  color: #b40000;
  font-size: 12px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.bodyText a {
  color: #b40000;
  text-decoration: underline;
}

.yeartitle {
  display: inline-block;
  color: #b40000;
  font-size: 18px;
  font-weight: bold;
  margin: 18px 0 10px 0;
  padding-top: 10px;
  border-top: 1px solid #b40000;
}

.bodyTextcontact {
  font-size: 15px;
  line-height: 1.6;
  color: #000;
  padding: 6px 10px 10px 10px;
  vertical-align: top;
}

td.bodyTextcontact:first-child {
  width: 56px !important;
  color: #555;
  font-weight: bold;
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
}

.bodyTextcontact u {
  text-decoration: underline;
}

.bodyTextcontact strong {
  font-weight: 700;
}

.page-publications table tr td:empty {
  padding: 0 !important;
}


/* ===== Publications Page (new layout, if used) ===== */
.pub-years {
  margin: 0 0 24px 0;
  font-size: 13px;
  line-height: 1.6;
}

.pub-year {
  color: #b40000;
  font-size: 18px;
  font-weight: bold;
  margin: 28px 0 10px 0;
  text-align: center;
}

.pub-list {
  margin-bottom: 22px;
}

.pub-item {
  display: flex;
  gap: 12px;
  margin: 8px 0;
  line-height: 1.6;
}

.pub-num {
  width: 40px;
  flex: 0 0 40px;
  text-align: right;
  font-size: 12px;
  color: #000;
}

.pub-text {
  flex: 1;
  font-size: 13px;
  color: #000;
}


/* ===== Photos / General Image Safety ===== */
.photo-item img,
.links-logos img,
.member img,
.bio-photo,
.main-graphic img,
.partner-logos img {
  height: auto;
}


/* ===== Mobile / Responsive ===== */
@media (max-width: 900px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .site-banner .banner-left {
    height: 120px;
  }

  .site-banner .banner-right img {
    height: 120px;
  }

  .main-row {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    border-right: 0;
    border-bottom: 2px solid #b40000;
    margin-right: 0;
    padding-bottom: 24px;
  }

  .content {
    padding-left: 0;
  }

  .members-grid,
  .alumni-grid {
    max-width: none;
  }

  .member img {
    width: 68px;
    height: 86px;
  }

  #navigation {
    width: auto;
    border-right: 0;
    border-bottom: 2px solid #b40000;
    margin-bottom: 16px;
  }

  .pageName,
  .bodyText,
  .bodyTextcontact {
    padding-left: 0;
  }

  /* 手機上 research / facility 圖片可以放大一點，不然太小 */
  .fig-40 img,
  .fig-50 img,
  .fig-60 img,
  .fig-65 img,
  .fig-70 img,
  .fig-80 img,
  .fig-90 img,
  .img-center:not(.fig-40):not(.fig-50):not(.fig-60):not(.fig-65):not(.fig-70):not(.fig-80):not(.fig-90) img {
    max-width: 90%;
  }

  .bio-photo {
    width: min(520px, 50%);
  }
}

/* ===== Contact / Openings / Simple content pages ===== */
.return-top {
  margin: 24px 0 0 0;
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid #b40000;
  margin-top: 30px;
  padding-top: 12px;
}

.footer-text {
  font-size: 12px;
  color: #666;
}

/* ===== Contact Page ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 20px 0 24px 0;
}

.contact-card {
  border: 1px solid #ddd;
  padding: 18px 20px;
  background: #fff;
}

.contact-card h3 {
  margin: 0 0 12px 0;
  color: #b40000;
  font-size: 18px;
}

.contact-card p {
  margin: 0 0 14px 0;
  line-height: 1.6;
}

.contact-logos {
  text-align: center;
  margin: 20px 0 24px 0;
}

.contact-logos img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ===== Photos Page ===== */
.photo-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 24px;
  align-items: start;
}

.photo-item {
  text-align: center;
  margin: 0;
}

.photo-item h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: bold;
  color: #000;
}

.photo-item a {
  display: inline-block;
}

.photo-item img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

/* Two columns on wider screens */
@media (min-width: 1000px) {
  .photo-gallery {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

/* ===== Mobile ===== */
@media (max-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Research + Facility Image Size Fix ===== */
.page-research .hero-diagram img {
  max-width: 50%;
}

.page-facility .facility-images {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.page-facility .facility-images img {
  width: 420px;
  height: 300px;
  object-fit: contain;
  display: block;
}