/* Continuous home page and shared section navigation. */
:root {
  --site-header-height: 80px;
}

html {
  scroll-padding-top: calc(var(--site-header-height) + 20px);
}

body {
  padding-top: 0;
}

.masthead {
  position: sticky;
  top: 0;
  height: auto;
  z-index: 30;
  animation: none;
  background: var(--paper, #faf9f5);
}

.masthead .masthead__inner-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: .7rem 1rem;
}

.masthead__inner-wrap::after {
  display: none;
}

.masthead__brand {
  flex-shrink: 0;
  color: var(--ink, #263b36);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.section-nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #a2bbae transparent;
}

.section-nav .section-nav__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.8rem, 2.3vw, 1.8rem);
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-nav__links li {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-nav__links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .15rem;
  border-bottom: 2px solid transparent;
  color: var(--ink, #263b36);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.section-nav__links a:hover,
.section-nav__links a[aria-current="location"] {
  border-bottom-color: var(--accent, #246653);
  color: var(--accent, #246653);
}

.site-skip-link {
  position: fixed;
  top: .5rem;
  left: 1rem;
  z-index: 40;
  padding: .6rem 1rem;
  transform: translateY(-200%);
  border: 1px solid var(--accent, #246653);
  background: white;
  color: var(--ink, #263b36);
}

.site-skip-link:focus {
  transform: translateY(0);
}

.home-page,
.home-section,
.home-section__body {
  min-width: 0;
}

.home-intro__hint {
  margin-top: 1.4rem;
  color: var(--muted, #66736c);
  font-size: .875rem;
}

.home-page .home-section {
  margin-top: 3.5rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--rule, #dce2d9);
}

.home-section__header {
  margin-bottom: 1.6rem;
}

.home-section__header .home-section__label {
  margin: 0;
  color: var(--accent, #246653);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .06em;
}

.home-page .home-section__header h2 {
  margin: .25rem 0 0;
  padding: 0;
  border: 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.35;
  letter-spacing: -.02em;
}

.home-section__body > :first-child {
  margin-top: 0;
}

.home-page .profile-compact {
  font-size: 1rem;
}

.home-page .profile-compact h3,
.home-page .course-category > h3,
.home-page .research-library__section-heading h3 {
  margin: 1.8rem 0 .8rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule, #dce2d9);
  color: var(--ink, #263b36);
  font-size: 1.2rem;
  line-height: 1.5;
}

.home-page .course-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.home-page .course-card,
.home-page .resource-card {
  min-width: 0;
}

.home-page .course-card h4,
.home-page .course-list h4,
.home-page .resource-card h4,
.home-page .scholarhero-product h4 {
  margin: 0 0 .6rem;
  font-family: Georgia, 'Songti SC', 'Noto Serif CJK SC', serif;
  font-size: 1.15rem;
  line-height: 1.5;
}

.home-page .course-card h4 a,
.home-page .course-list h4 a {
  color: var(--ink, #263b36);
  text-decoration: none;
}

.home-page .scholarhero-products__header h3 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.2rem;
}

.home-page .scholarhero-product__description {
  font-size: 1rem;
}

.home-section__site-link {
  margin-top: 1.2rem;
}

.home-page .blog-index__hero {
  margin-bottom: 2rem;
  padding: 1.8rem;
}

.home-page .blog-index__intro {
  font-size: 1.25rem;
}

.home-page .blog-index__stats a {
  border: 1px solid #d9e1d9;
  background: #edf3ec;
  color: #193b35;
}

.home-page .blog-index__stats a:hover {
  background: white;
  color: #193b35;
}

.home-page .blog-card--latest .blog-card__main {
  min-height: 0;
  padding: 1.5rem;
}

.home-page .blog-card--latest .blog-card__title {
  font-size: 1.45rem;
}

.home-page .blog-wechat__title {
  font-size: 1.5rem;
}

.home-page .blog-wechat__expanded {
  margin: 1.5rem 0 3rem;
}

.home-page .blog-year__heading {
  font-size: 1.7rem;
}

.home-page .research-library__hero > h3 {
  display: none;
}

.home-page .research-library {
  margin-top: 0;
}

@media (max-width: 760px) {
  :root {
    --site-header-height: 104px;
  }

  .masthead .masthead__inner-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    padding: .6rem 1rem .25rem;
  }

  .masthead__brand {
    align-self: flex-start;
  }

  .section-nav__links a {
    font-size: .875rem;
  }

  .masthead .section-nav {
    overflow-x: visible;
  }

  .masthead .section-nav .section-nav__links {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0 .35rem;
    width: 100%;
    min-width: 0;
  }

  .home-page .home-section {
    margin-top: 2.5rem;
    padding-top: 1.8rem;
  }

  .home-page .course-grid {
    grid-template-columns: 1fr;
  }

  .home-page .blog-index__hero {
    padding: 1.4rem;
  }
}

@media print {
  html {
    scroll-padding-top: 0;
  }

  .masthead {
    position: static;
  }

  .section-nav,
  .site-skip-link,
  .home-intro__hint {
    display: none;
  }
}
