/* Single post: fixed Important Notice sidebar */
@media (min-width: 782px) {
  body.single-post .wp-container-core-columns-is-layout-a75b0a9a > .wp-block-column:nth-child(2) {
    align-self: stretch !important;
  }
  body.single-post .wp-container-core-columns-is-layout-a75b0a9a > .wp-block-column:nth-child(2) > .wp-block-group {
    position: sticky !important;
    top: 32px !important;
    align-self: flex-start !important;
  }
}
@media (max-width: 781px) {
  body.single-post .wp-container-core-columns-is-layout-a75b0a9a > .wp-block-column:nth-child(2) > .wp-block-group {
    position: static !important;
    top: auto !important;
  }
}

/* Chinese single-post title */
body.single-post:has(.chinese-article-marker) h1.wp-block-post-title {
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-wrap: wrap;
}

/* Single post titles: left aligned with more breathing room */
body.single-post h1.wp-block-post-title {
  text-align: left !important;
  line-height: 1.16 !important;
}


/* Single post title width: match Chinese and English */
body.single-post h1.wp-block-post-title {
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* Language switch buttons */
.english-article-marker,
.chinese-article-marker {
  text-align: right !important;
  margin-bottom: 28px !important;
}

.english-article-marker a,
.chinese-article-marker a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #222;
  border-radius: 3px;
  background: #fff;
  color: #222 !important;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none !important;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.english-article-marker a:hover,
.english-article-marker a:focus,
.chinese-article-marker a:hover,
.chinese-article-marker a:focus {
  background: #222;
  color: #fff !important;
  border-color: #222;
}

.english-article-marker a {
  font-size: 0;
}

.english-article-marker a::after {
  content: "中文浏览";
  font-size: 14px;
}

@media (max-width: 600px) {
  .english-article-marker a,
  .chinese-article-marker a {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13px;
  }
  .english-article-marker a::after {
    font-size: 13px;
  }
}


/* Language switch fallback for WordPress-rendered posts */
body.single-post .wp-block-post-content > div:first-child > a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #222;
  border-radius: 3px;
  background: #fff;
  color: #222 !important;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none !important;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
body.single-post .wp-block-post-content > div:first-child > a:hover,
body.single-post .wp-block-post-content > div:first-child > a:focus {
  background: #222;
  color: #fff !important;
  border-color: #222;
}
body.single-post .wp-block-post-content > div:first-child > a[href*="-chinese/"] {
  font-size: 0;
}
body.single-post .wp-block-post-content > div:first-child > a[href*="-chinese/"]::after {
  content: "中文浏览";
  font-size: 14px;
}
@media (max-width: 600px) {
  body.single-post .wp-block-post-content > div:first-child > a {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13px;
  }
  body.single-post .wp-block-post-content > div:first-child > a[href*="-chinese/"]::after {
    font-size: 13px;
  }
}


/* Article spacing and typography */
@media (min-width: 782px) {
  body.single-post .wp-block-post-title {
    margin-bottom: 50px !important;
  }
  body.single-post .wp-block-post-content {
    padding-top: 0 !important;
  }
  body.single-post .wp-block-post-content > div:first-child {
    margin-bottom: 18px !important;
  }
  body.single-post .wp-block-post-content > div:first-child + p.has-medium-font-size {
    margin-top: 0 !important;
    font-size: 20px !important;
    line-height: 1.6 !important;
  }
  body.single-post .wp-block-post-content > div:first-child + p.has-medium-font-size strong {
    font-weight: 600 !important;
  }
  body.single-post .wp-block-post-content:has(> div:first-child > a:not([href*="-chinese/"])) h2.wp-block-heading {
    font-size: 26px !important;
    line-height: 1.45 !important;
  }
  body.single-post .wp-block-post-content:has(> div:first-child > a:not([href*="-chinese/"])) h3.wp-block-heading {
    font-size: 21px !important;
    line-height: 1.4 !important;
  }
}


/* Chinese article heading fallback */
@media (min-width: 782px) {
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h2.wp-block-heading {
    font-size: 26px !important;
    line-height: 1.45 !important;
  }
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h3.wp-block-heading {
    font-size: 21px !important;
    line-height: 1.4 !important;
  }
}


/* Chinese article direct headings */
@media (min-width: 782px) {
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h2 {
    font-size: 26px !important;
    line-height: 1.45 !important;
  }
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h3 {
    font-size: 21px !important;
    line-height: 1.4 !important;
  }
}


/* Chinese article compact heading scale */
@media (min-width: 782px) {
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h2 {
    font-size: 20px !important;
    line-height: 1.5 !important;
  }
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h3 {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }
}


/* Mobile article typography */
@media (max-width: 781px) {
  body.single-post .wp-block-post-title {
    margin-bottom: 32px !important;
  }
  body.single-post .wp-block-post-content {
    padding-top: 0 !important;
  }
  body.single-post .wp-block-post-content > div:first-child {
    margin-bottom: 16px !important;
  }
  body.single-post .wp-block-post-content > div:first-child > a {
    min-height: 32px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  body.single-post .wp-block-post-content > div:first-child > a[href*="-chinese/"] {
    font-size: 0 !important;
  }
  body.single-post .wp-block-post-content > div:first-child > a[href*="-chinese/"]::after {
    font-size: 12px !important;
  }
  body.single-post .wp-block-post-content > div:first-child + p.has-medium-font-size {
    margin-top: 0 !important;
    font-size: 17px !important;
    line-height: 1.65 !important;
  }
  body.single-post .wp-block-post-content > div:first-child + p.has-medium-font-size strong {
    font-weight: 600 !important;
  }
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h2 {
    font-size: 19px !important;
    line-height: 1.5 !important;
  }
  body.single-post .wp-block-post-content > .chinese-article-marker ~ h3 {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }
}


/* Mobile nested Chinese headings */
@media (max-width: 781px) {
  body.single-post .wp-block-post-content > .chinese-article-marker ~ * h3 {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }
}


/* Mobile English body type */
@media (max-width: 781px) {
  body.single-post .wp-block-post-content > .english-article-marker ~ p:not(.has-medium-font-size),
  body.single-post .wp-block-post-content > .english-article-marker ~ ul,
  body.single-post .wp-block-post-content > .english-article-marker ~ ol,
  body.single-post .wp-block-post-content > .english-article-marker ~ blockquote,
  body.single-post .wp-block-post-content > .english-article-marker ~ * p,
  body.single-post .wp-block-post-content > .english-article-marker ~ * li {
    font-size: 15.5px !important;
    line-height: 1.7 !important;
  }
}


/* Unified article typography baseline */
@media (min-width: 782px) {
  body.single-post .wp-block-post-title {
    font-size: 38px !important;
    line-height: 1.16 !important;
    margin-bottom: 50px !important;
  }

  body.single-post .wp-block-post-content p:not(.has-small-font-size):not(.has-medium-font-size),
  body.single-post .wp-block-post-content li {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content h2 {
    font-size: 20px !important;
    line-height: 1.5 !important;
  }
  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content h3 {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }

  body.single-post:has(.wp-block-post-content > div:first-child > a[href*="-chinese/"]) .wp-block-post-content h2 {
    font-size: 24px !important;
    line-height: 1.45 !important;
  }
  body.single-post:has(.wp-block-post-content > div:first-child > a[href*="-chinese/"]) .wp-block-post-content h3 {
    font-size: 19px !important;
    line-height: 1.5 !important;
  }

  body.single-post .wp-block-post-content > div:first-child + p:not(.has-small-font-size),
  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content > p.has-medium-font-size:first-of-type,
  body.single-post .wp-block-post-content > p.has-small-font-size + p:has(strong) {
    font-size: 20px !important;
    line-height: 1.6 !important;
  }
  body.single-post .wp-block-post-content > div:first-child + p strong,
  body.single-post .wp-block-post-content > p.has-small-font-size + p:has(strong) strong {
    font-weight: 600 !important;
  }
}

@media (max-width: 781px) {
  body.single-post .wp-block-post-title {
    font-size: 25px !important;
    line-height: 1.2 !important;
    margin-bottom: 32px !important;
  }

  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content p:not(.has-small-font-size):not(.has-medium-font-size),
  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content li {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }
  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content h2 {
    font-size: 19px !important;
    line-height: 1.5 !important;
  }
  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content h3 {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }

  body.single-post:has(.wp-block-post-content > div:first-child > a[href*="-chinese/"]) .wp-block-post-content p:not(.has-small-font-size):not(.has-medium-font-size),
  body.single-post:has(.wp-block-post-content > div:first-child > a[href*="-chinese/"]) .wp-block-post-content li {
    font-size: 15.5px !important;
    line-height: 1.7 !important;
  }
  body.single-post:has(.wp-block-post-content > div:first-child > a[href*="-chinese/"]) .wp-block-post-content h2 {
    font-size: 20px !important;
    line-height: 1.45 !important;
  }
  body.single-post:has(.wp-block-post-content > div:first-child > a[href*="-chinese/"]) .wp-block-post-content h3 {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }

  body.single-post .wp-block-post-content > div:first-child + p:not(.has-small-font-size),
  body.single-post:has(.wp-block-post-content > .chinese-article-marker) .wp-block-post-content > p.has-medium-font-size:first-of-type,
  body.single-post .wp-block-post-content > p.has-small-font-size + p:has(strong) {
    font-size: 17px !important;
    line-height: 1.65 !important;
  }
  body.single-post .wp-block-post-content > div:first-child + p strong,
  body.single-post .wp-block-post-content > p.has-small-font-size + p:has(strong) strong {
    font-weight: 600 !important;
  }
}


/* Article publication metadata */
body.single-post .wp-block-post-content p.has-small-font-size {
  font-size: 13px !important;
  line-height: 1.5 !important;
}
@media (max-width: 781px) {
  body.single-post .wp-block-post-content p.has-small-font-size {
    font-size: 12.5px !important;
    line-height: 1.5 !important;
  }
}


/* Article previous / home / next navigation */
.article-post-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "previous home next";
  gap: 12px;
  align-items: stretch;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.22);
}
.article-post-navigation__previous { grid-area: previous; }
.article-post-navigation__home { grid-area: home; }
.article-post-navigation__next { grid-area: next; }
.article-post-navigation__empty { visibility: hidden; }
.article-post-navigation a {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid #1e1e1e;
  color: #1e1e1e;
  background: transparent;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.article-post-navigation__previous a { justify-content: flex-start; text-align: left; }
.article-post-navigation__next a { justify-content: flex-end; text-align: right; }
.article-post-navigation__home a { color: #ffffff; background: #1e1e1e; white-space: nowrap; }
.article-post-navigation a:hover,
.article-post-navigation a:focus-visible { color: #ffffff; background: #1e1e1e; }
.article-post-navigation__home a:hover,
.article-post-navigation__home a:focus-visible { color: #1e1e1e; background: #ffffff; }
@media (max-width: 781px) {
  .article-post-navigation {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "home home"
      "previous next";
    gap: 10px;
    margin-top: 36px;
    padding-top: 22px;
  }
  .article-post-navigation a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }
}


/* Mobile Important Notice card */
@media (max-width: 781px) {
  body.page-id-11 .wp-block-column:has(> .important-notice-card) {
    flex-basis: 100% !important;
    border-left: 0 !important;
    padding-left: 0 !important;
  }
  body.page-id-11 .important-notice-card {
    box-sizing: border-box;
    margin-top: 4px;
    padding: 20px;
    background: #f6f6f4;
  }
  body.page-id-11 .important-notice-card h2 {
    margin: 0 0 16px !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
  }
  body.page-id-11 .important-notice-card p {
    margin: 0 0 14px !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    text-align: left !important;
  }
  body.page-id-11 .important-notice-card p:last-child {
    margin-bottom: 0 !important;
  }
  body.page-id-11 .important-notice-card a {
    font-weight: 600;
  }
  body.page-id-11 .important-notice-card + .wp-block-group {
    margin-top: 32px !important;
  }
}


/* Important Notice cards: desktop blog and all article pages */
@media (min-width: 782px) {
  body.page-id-11 .wp-block-column:has(> .important-notice-card) {
    border-left: 0 !important;
    padding-left: 0 !important;
  }
  body.page-id-11 .important-notice-card {
    box-sizing: border-box;
    padding: 24px;
    background: #f6f6f4;
  }
  body.page-id-11 .important-notice-card h2 {
    margin: 0 0 18px !important;
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  body.page-id-11 .important-notice-card p {
    margin: 0 0 16px !important;
    font-size: 15.5px !important;
    line-height: 1.65 !important;
    text-align: left !important;
  }
  body.page-id-11 .important-notice-card p:last-child {
    margin-bottom: 0 !important;
  }
}

body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] {
  border-left: 0 !important;
  padding-left: 0 !important;
}
body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child {
  box-sizing: border-box;
  margin: 0 !important;
  padding: 24px 24px 0 !important;
  background: #f6f6f4;
  font-size: 24px !important;
  line-height: 1.3 !important;
}
body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child ~ p {
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 24px 16px !important;
  background: #f6f6f4;
  font-size: 15.5px !important;
  line-height: 1.65 !important;
  text-align: left !important;
}
body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child + p {
  padding-top: 18px !important;
}
body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child ~ p:last-of-type {
  padding-bottom: 24px !important;
}
body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child ~ p a {
  font-weight: 600;
}

@media (max-width: 781px) {
  body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child {
    padding: 20px 20px 0 !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
  }
  body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child ~ p {
    padding: 0 20px 14px !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
  }
  body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child + p {
    padding-top: 16px !important;
  }
  body.single-post main .wp-block-column > .wp-block-group[style*="border-left-color"] > h2:first-child ~ p:last-of-type {
    padding-bottom: 20px !important;
  }
}
