/* =========================================================
   WordPress integration layer
   ========================================================= */

/* Admin bar */
.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

html {
  scroll-padding-top: 132px;
}

/* Emoji flag fallback */
.country-flag {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 27px;
  line-height: 1;
}

/* Header phone button */
button.header-phone {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Make WordPress menus if used later behave like the static nav */
.main-nav ul {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav li {
  margin: 0;
}

.main-menu-fallback {
  display: flex;
  gap: 24px;
}

/* WordPress core helpers */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  display: block;
  top: 5px;
  left: 5px;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 15px 23px 14px;
  clip: auto !important;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.alignleft {
  float: left;
  margin: 0 24px 16px 0;
}

.alignright {
  float: right;
  margin: 0 0 16px 24px;
}

.aligncenter {
  display: block;
  margin-inline: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.prose img {
  height: auto;
  border-radius: var(--radius-sm);
}

.prose .wp-block-image {
  margin: 28px 0;
}

.prose .wp-block-image figcaption {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.prose .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}

.prose .wp-block-table th,
.prose .wp-block-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 12.5px;
}

.prose .wp-block-table th {
  background: var(--paper);
  text-align: left;
}

/* Page content (about / pinggu / legal pages) */
.page-content {
  width: min(100% - 48px, 820px);
  margin-inline: auto;
  padding: 52px 0 76px;
}

.page-content > * + * {
  margin-top: 20px;
}

.page-content h2 {
  margin-top: 40px;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
}

.page-content h3 {
  margin-top: 28px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-content p,
.page-content li {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.9;
}

.page-content a {
  color: var(--coral);
}

/* Existing /pinggu/ lead form: bring it into the new visual system */
.page-content .zxx-lead-wrap {
  background: var(--paper-deep) !important;
  padding: 32px 0 !important;
}

.page-content .zxx-lead-card {
  max-width: 760px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-content .zxx-lead-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
}

.page-content .zxx-lead-sub {
  color: var(--muted);
}

.page-content .zxx-field input,
.page-content .zxx-field select,
.page-content .zxx-field textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}

.page-content .zxx-btn {
  border-radius: 999px;
  background: var(--coral);
}

.page-content .zxx-btn:hover {
  background: var(--coral-deep);
}

/* Text-only checklist in imported content */
.checklist--text li::before {
  content: "✓";
  flex-shrink: 0;
  width: 15px;
  margin-top: 4px;
  color: var(--pine);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* Country content: automatic section numbers */
.prose--dynamic {
  counter-reset: section 1;
}

.prose--dynamic h2 {
  counter-increment: section;
}

.prose--dynamic h2::before {
  content: counter(section, decimal-leading-zero) " / SECTION";
  display: block;
  margin-bottom: 6px;
  color: var(--coral);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.prose--dynamic h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Assessment CTA panel (replaces the demo form on the live homepage) */
.assessment-cta {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}

.assessment-cta h3 {
  margin-top: 8px;
  font-size: 24px;
}

.assessment-cta p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.assessment-cta .btn {
  margin-top: 12px;
}

.assessment-cta__note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.7;
}

/* Placeholder school cards when the school library has no posts yet */
.school-card--placeholder {
  opacity: 0.82;
}

.school-card--placeholder .school-cover {
  filter: saturate(0.7);
}

.school-card--placeholder .school-tuition {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

/* School directory */
.school-directory-empty {
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

.school-directory-empty h2 {
  font-size: 24px;
}

.school-directory-empty p {
  max-width: 560px;
  margin: 8px auto 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

/* Tools */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tool-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.tool-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tool-card__head h2 {
  margin-top: 8px;
  font-size: 24px;
}

.tool-card__intro {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.tool-form {
  margin-top: 18px;
}

.tool-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.tool-form .btn {
  margin-top: 14px;
}

.tool-result {
  display: none;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: #fbf6ea;
}

.tool-result.is-visible {
  display: block;
}

.tool-result__label {
  color: #7d5b24;
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-result > strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tool-timeline strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.tool-result p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.7;
}

.tool-result__note {
  color: var(--muted) !important;
  font-size: 10px !important;
}

.tool-timeline {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tool-timeline li {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line);
  font-size: 11.5px;
  line-height: 1.6;
}

.tool-timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tool-timeline b {
  color: var(--coral);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tool-card {
    padding: 20px;
  }

  .tool-form__grid {
    grid-template-columns: 1fr;
  }

  .tool-timeline li {
    grid-template-columns: 64px 1fr;
  }
}

/* School directory data hall */
.data-hall {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.data-hall__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.data-hall__head h2 {
  margin-top: 8px;
  font-size: 26px;
}

.data-hall__head p {
  max-width: 360px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.data-hall-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.data-hall-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.data-hall-card:hover {
  border-color: var(--pine);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.data-hall-card span {
  color: var(--muted-light);
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.data-hall-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}

.data-hall-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.data-hall-card b {
  margin-top: auto;
  padding-top: 10px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 600;
}

/* Pagination */
.pagination .page-numbers {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 11px;
}

.pagination .page-numbers.current {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.pagination .page-numbers:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* Footer WeChat panel */
.footer-wechat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-wechat__mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}

.footer-wechat p {
  flex: 1;
  min-width: 0;
  color: rgba(247, 242, 232, 0.62);
  font-size: 11px;
  line-height: 1.75;
}

.footer-wechat strong {
  display: block;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

.footer-wechat button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold-soft);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* School profile */
.school-hero__cover {
  background: linear-gradient(135deg, var(--cover-a, #1f4d40), var(--cover-b, #3c8a75));
}

.school-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.school-data-grid__item {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.school-data-grid__item span {
  display: block;
  color: var(--muted-light);
  font-size: 9.5px;
}

.school-data-grid__item strong {
  display: block;
  margin-top: 1px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.school-data-grid__item:last-child,
.school-data-grid__item:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

/* Long stat values */
.stat-strip__item strong {
  overflow-wrap: anywhere;
}

.page-hero .stat-strip__item strong {
  font-size: 16px;
  line-height: 1.45;
}

/* WordPress block groups in prose */
.prose .wp-block-group {
  margin: 24px 0;
}

/* Mobile adjustments for dynamic content */
@media (max-width: 1024px) {
  .data-hall-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .data-hall__head {
    display: block;
  }

  .data-hall__head p {
    margin-top: 6px;
  }
}

@media (max-width: 760px) {
  .data-hall-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-content {
    width: min(100% - 36px, 820px);
    padding: 36px 0 56px;
  }

  .school-data-grid {
    grid-template-columns: 1fr;
  }

  .school-data-grid__item {
    border-bottom: 1px dashed var(--line);
  }

  .school-data-grid__item:last-child {
    border-bottom: 0;
  }

  .assessment-cta {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .data-hall-grid {
    grid-template-columns: 1fr;
  }
}
