.about-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0.55rem 0 0.45rem;
}

.home-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.home-main > h1 {
  margin-top: 0;
}

.home-subtitle {
  margin-top: -0.35rem;
  margin-bottom: 0.95rem;
  font-size: 1.05rem;
  color: #4b5563;
}

.home-quicklinks {
  width: auto;
  margin: 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  padding: 0.95rem;
  background: #f8f9fb;
  position: sticky;
  top: 64px;
}

.home-quicklinks h2 {
  margin: 0 0 0.6rem;
  font-size: 1.06rem;
}

.home-quicklinks ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-quicklinks li {
  margin: 0.35rem 0;
}

.home-quicklinks a {
  display: block;
  padding: 0.45rem 0.6rem;
  border: 1px solid #dde2ea;
  border-radius: 8px;
  background: #ffffff;
  text-decoration: none;
  font-size: 0.94rem;
}

.home-hero {
  margin: 0 0 1.15rem;
}

.home-hero-lead {
  margin: 0 0 0.65rem;
  font-size: 1.13rem;
  line-height: 1.52;
  font-weight: 600;
}

.home-hero p {
  margin: 0 0 0.72rem;
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.2rem 0 1.2rem;
}

.home-pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 0.7rem 0 1.2rem;
}

.home-pillar-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  padding: 0.85rem;
  background: #ffffff;
}

.home-pillar-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.home-pillar-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.home-impact-list {
  display: grid;
  gap: 0.9rem;
  margin: 0.7rem 0 1.2rem;
}

.home-impact-item {
  border-left: 3px solid #2d6cdf;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  background: #f8f9fb;
  line-height: 1.52;
}

.home-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.58rem;
  margin: 0.55rem 0 1rem;
}

.home-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  padding: 0.22rem 0.68rem;
  font-size: 0.88rem;
  background: #ffffff;
}

.home-stack-note {
  margin: 0.3rem 0 1.15rem;
  color: #5b6472;
  font-size: 0.92rem;
}

.about-links a {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  text-decoration: none;
}

.video-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
}

.video-grid iframe {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .video-grid {
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .video-grid iframe {
    flex: 0 0 280px;
  }
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.edu-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  padding: 0.8rem;
}

.edu-card img {
  max-width: 88px;
  max-height: 88px;
  object-fit: contain;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1.2rem;
  align-items: center;
}

.profile-grid a {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
}

.profile-grid img {
  max-width: 76px;
  max-height: 76px;
  object-fit: contain;
}

.logo-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.logo-strip img {
  max-height: 70px;
  width: auto;
  object-fit: contain;
}

.current-affiliation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  background: #111111;
}

.current-affiliation img {
  max-height: 68px;
}

.affiliation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
}

.affiliation-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 0.6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  background: #ffffff;
}

.affiliation-card img {
  max-width: 100%;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.tag-chip {
  display: inline-block;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  text-decoration: none;
  line-height: 1.2;
}

.tag-size-1 {
  font-size: 0.75rem;
}

.tag-size-2 {
  font-size: 0.85rem;
}

.tag-size-3 {
  font-size: 0.95rem;
}

.tag-size-4 {
  font-size: 1.05rem;
}

.tag-size-5 {
  font-size: 1.2rem;
}

/* Imported WordPress content often carries oversized images/galleries. */
.md-content .wp-block-image,
.md-content .wp-block-gallery,
.md-content figure {
  max-width: 100%;
  overflow-x: auto;
}

.md-content .wp-block-image img,
.md-content .wp-block-gallery img,
.md-content figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

.md-content .aligncenter,
.md-content .wp-block-image.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

/* Keep navigation stable: hide per-page TOC sidebar and use full-width content. */
.bs-sidebar {
  display: none !important;
}

.container .row > .col-md-3 {
  display: none;
}

.container .row > .col-md-9[role="main"] {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Remove Previous/Next nav links from top-right navbar. */
a.nav-link[rel="prev"],
a.nav-link[rel="next"] {
  display: none !important;
}

.blog-overview-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.2rem;
  align-items: start;
}

.blog-overview-sidebar {
  position: sticky;
  top: 80px;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  padding: 1rem;
  background: #f8f9fb;
}

.blog-overview-sidebar h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.blog-overview-sidebar ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.blog-overview-sidebar li {
  margin: 0.35rem 0;
}

.blog-overview-sidebar a {
  display: block;
  padding: 0.45rem 0.6rem;
  border: 1px solid #dde2ea;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.blog-overview-main h2 {
  margin-top: 1.1rem;
}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-quicklinks {
    width: 100%;
    margin: 0 0 1rem;
    position: static;
  }

  .home-hero-lead {
    font-size: 1.02rem;
  }

  .blog-overview-layout {
    grid-template-columns: 1fr;
  }

  .blog-overview-sidebar {
    position: static;
  }
}

.experience-list {
  display: grid;
  gap: 1.2rem;
}

.experience-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 0.9rem 0.2rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.experience-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.experience-logo img {
  max-width: 120px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.edu-logo-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.edu-logo-stack img {
  max-width: 120px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.experience-logo-frame-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  min-height: 76px;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: #111111;
}

.experience-detail {
  line-height: 1.55;
}

.experience-detail strong {
  font-size: 1.03rem;
}

.edu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  min-height: 76px;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--md-default-fg-color--lightest);
  background: #f8f9fb;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.86rem;
}

@media (max-width: 700px) {
  .experience-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .experience-logo {
    justify-content: flex-start;
  }
}

.contact-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.2rem;
  align-items: start;
}

.contact-photo-card,
.contact-main-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  padding: 1rem;
  background: #ffffff;
}

.contact-photo-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin-bottom: 0.8rem;
}

.contact-photo-card p {
  margin: 0;
  font-size: 0.95rem;
}

.contact-main-card h2,
.contact-main-card h3 {
  margin-top: 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.contact-links a {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  text-decoration: none;
}

@media (max-width: 780px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.travel-photo {
  margin: 1rem auto 1.25rem;
}

.travel-photo img {
  display: block;
  max-width: min(100%, 980px);
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
}

.travel-photo figcaption {
  margin-top: 0.45rem;
  font-size: 0.93rem;
  color: #555;
  text-align: center;
}

/* Improve rendering for the Inner Mongolia travel post images/captions. */
h1#my-trip-to-inner-mongolia ~ p > img {
  display: block;
  max-width: min(100%, 980px);
  width: auto;
  height: auto;
  margin: 0.8rem auto 0.45rem;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

h1#my-trip-to-inner-mongolia ~ p:has(> img) {
  text-align: center;
  font-size: 0.93rem;
  color: #555;
  margin-bottom: 1.15rem;
}
