/* Nexme - Global typography and UI consistency layer.
   Loaded last on every page. Content and DOM structure remain unchanged. */

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-body);
  line-height: 1.6;
  font-synthesis: none;
}

button,
input,
select,
textarea {
  font-family: var(--font-primary);
}

body[class] h1,
body[class] h2,
body[class] h3,
body[class] h4,
body[class] h5,
body[class] h6 {
  margin-block: 0;
  color: var(--color-navy-950);
  font-family: var(--font-primary);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body[class] h1 {
  line-height: 1.1;
  letter-spacing: -0.035em;
}

body[class] h2 {
  line-height: 1.24;
  letter-spacing: -0.022em;
}

body[class] h3 {
  line-height: 1.35;
  letter-spacing: -0.012em;
}

body[class] h4,
body[class] h5,
body[class] h6 {
  line-height: 1.42;
}

body[class] p,
body[class] li,
body[class] dd,
body[class] dt,
body[class] label,
body[class] input,
body[class] select,
body[class] textarea {
  overflow-wrap: anywhere;
}

body[class] p,
body[class] li,
body[class] dd {
  line-height: 1.6;
}

body[class] small,
body[class] .eyebrow,
body[class] [class*="__meta"],
body[class] [class*="-meta"] {
  line-height: 1.45;
}

/* Shared header */
.site-nav__list a {
  font-size: var(--font-small);
  line-height: 1.25;
  white-space: nowrap;
}

.site-header__actions .button,
.site-nav__mobile-actions .button {
  font-size: var(--font-small);
}

/* Shared footer */
.site-footer__column h2 {
  font-size: var(--font-body-sm);
  line-height: 1.35;
}

.site-footer__brand p,
.site-footer__column a,
.contact-list li {
  font-size: var(--font-small);
  line-height: 1.65;
}

.site-footer__bottom {
  font-size: var(--font-caption);
}

/* Shared project-detail typography */
.project-detail-page .project-detail-hero h1 {
  font-size: var(--font-display);
}

.project-detail-page .project-detail-hero__subtitle {
  font-size: var(--font-card-title);
  line-height: 1.45;
}

.project-detail-page .project-tabs a,
.project-detail-page .project-tabs button {
  font-size: var(--font-small);
  line-height: 1.25;
}

.project-detail-page main > section:not(.project-detail-hero):not(.project-key-stats) > .container > header h2,
.project-detail-page main > section:not(.project-detail-hero):not(.project-key-stats) > .container > h2,
.project-detail-page .project-documents-heading h2,
.project-detail-page .qna-heading h2,
.project-detail-page .policy-heading h2,
.project-detail-page .project-news-heading h2,
.project-detail-page .project-360__header h2 {
  font-size: var(--font-section-title);
}

/* Readability floor for labels and interactive controls. */
body[class] button,
body[class] input,
body[class] select,
body[class] textarea {
  line-height: 1.35;
}

body[class] table {
  font-variant-numeric: tabular-nums;
}

body[class] th {
  font-weight: 700;
}

/* Prevent long Vietnamese headings and links from forcing horizontal overflow. */
.card,
[class*="card"],
[class*="panel"],
[class*="column"] {
  min-width: 0;
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .site-nav__list { gap: 14px; }
  .site-nav__list a { font-size: var(--font-caption); }
}

@media (max-width: 767px) {
  .site-nav__list a { font-size: var(--font-body); }
  .site-footer__column h2 { font-size: var(--font-body); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/* Bổ sung Nexme Academy vào menu chính - giữ menu gọn trên Desktop. */
@media (min-width: 1024px) {
  .site-header__inner { gap: 18px; }
  .site-nav__list { gap: clamp(12px, 1.25vw, 20px); }
  .site-nav__list a { font-size: var(--font-caption); }
}

@media (min-width: 1440px) {
  .site-nav__list { gap: 22px; }
  .site-nav__list a { font-size: var(--font-small); }
}
