@media (min-width: 57.8125em) {
  .sidebar {
    max-width: 330px;
  }
}

/* Hide non-active language navs by default; JS overrides display */
.lang-nav-zh,
.lang-nav-ja {
  display: none;
}

.sidebar .author__urls,
.sidebar .author__urls-wrapper,
.sidebar .profile_box {
  max-width: 100%;
}

.sidebar .author__urls li,
.sidebar .author__urls a {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sidebar .author__urls .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
}

.sidebar .author__urls .contact-item > a {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  min-width: 0;
}

.sidebar .author__urls .contact-item i {
  flex-shrink: 0;
  margin-top: 0.15em;
}

.sidebar .author__urls .contact-item > a i {
  flex-shrink: 0;
  margin-top: 0.15em;
}

.sidebar .sidebar-cv-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  width: 100%;
  margin: 0.9em 0 0.75em;
  padding: 0.65em 1em;
  text-decoration: none;
}

.sidebar .sidebar-cv-link i {
  margin: 0;
}

.page__content .award-cont {
  display: block;
  margin-left: 2.8em;
}

.page__content > [data-lang] > p,
.page__content > [data-lang] > ul li,
.page__content .paper-box-text ul li {
  text-align: justify;
  text-justify: auto;
}

.page__content > [data-lang] > .experience-list li {
  text-align: start;
}

.page__content .experience-entry {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr);
  column-gap: 0.35em;
  align-items: baseline;
}

.page__content .experience-date {
  white-space: nowrap;
}

.page__content .experience-body {
  min-width: 0;
}

.page__content .experience-detail {
  display: block;
  margin-top: 0.1em;
  color: #5f6368;
  font-size: 0.95em;
  line-height: 1.45;
}

.page__content .experience-detail::before {
  content: none;
}

@media (max-width: 35em) {
  .page__content .experience-entry {
    grid-template-columns: 1fr;
  }
}

.paper-box-text p a,
.paper-box-text p .paper-title {
  font-size: 1.3em;
}
/* ── Language switcher ── */
#lang-switcher {
  position: fixed;
  top: 0.6em;
  right: 1em;
  z-index: 100;
  display: flex;
  gap: 0.3em;
}

#lang-switcher button {
  padding: 0.25em 0.65em;
  font-size: 0.8em;
  font-family: "Trebuchet MS", Helvetica, sans-serif;
  border: 1px solid #bdc1c4;
  border-radius: 4px;
  background: #fff;
  color: #494e52;
  cursor: pointer;
  transition: all 0.2s;
}

#lang-switcher button:hover {
  background: #f2f3f3;
}

#lang-switcher button.active {
  background: #224b8d;
  color: #fff;
  border-color: #224b8d;
}

/* hide inactive lang blocks */
[data-lang] { display: none; }
[data-lang].lang-active { display: block; }

/* ── paper-box: 50/50 split on wide screens ── */
@media (min-width: 48em) {
  .paper-box .paper-box-image {
    min-width: unset !important;
    max-width: 35% !important;
    width: 65% !important;
    flex: 0 0 50%;
  }
  .paper-box .paper-box-image img {
    max-width: 100%;
    width: 100%;
    object-fit: cover;
  }
  .paper-box .paper-box-text {
    max-width: 50% !important;
    flex: 0 0 50%;
  }
}

/* ── Responsive paper-box fix: stack on narrow screens ── */
@media (max-width: 47.99em) {
  .paper-box {
    flex-direction: column;
    align-items: center;
  }
  .paper-box .paper-box-text {
    max-width: 100% !important;
    padding-left: 0 !important;
    order: 2;
  }
  .paper-box .paper-box-image {
    min-width: unset !important;
    max-width: 100% !important;
    width: 80% !important;
    order: 1;
  }
  .paper-box .paper-box-image img {
    max-width: 100%;
    width: 80%;
  }

}

/* ── Sidebar map widget ── */
.sidebar-map-widget {
  margin-top: 1em;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  /* height is set dynamically by JS after scale is applied */
}

/* Hide on narrow screens where the sidebar is not pinned to the side */
@media (max-width: 57.8em) {
  .sidebar-map-widget {
    display: none;
  }
}

.date-placeholder {
  visibility: hidden;
}
