/* 全站公共:重置、版心、页头、页脚。颜色和尺寸一律引用 tokens.css 的变量。
   页头页脚的 HTML 在 partials/,改完跑 node globalconnect/tools/sync.js 写进每一页。 */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  zoom: var(--fit, 1); /* 窗口比设计宽度窄时整页等比缩小,数值由 js/fit.js 算 */
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
a { color: inherit; }

.wrap  { width: min(var(--content), 100% - 2 * var(--gutter)); margin-inline: auto; }
.frame { width: min(var(--frame), 100% - 2 * var(--gutter)); margin-inline: auto; }
.accent { color: var(--accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 页头 ----------
   全站固定在视口顶端;往下滚就收成一条紧凑的黑底条(js/site.js 加 is-stuck)。
   在页面顶端时和原站一样:有大图的页面(body.has-hero)透明、压在图上、底下一条白线;
   没有大图的页面(文章页)是一条黑底,顶端不留白边(黑条直接贴住页面顶端),
   body 让出的高度相应减掉那条白边,正文与黑条的间距保持不变。 */
html { scroll-padding-top: calc(var(--header-stuck-h) + 16px); } /* 键盘聚焦、锚点跳转不钻到页头底下 */
body:not(.has-hero) { padding-top: calc(var(--header-h) - var(--top-gap)); }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  color: var(--paper);
  background: var(--ink);
  border-bottom: 6px solid var(--paper);
  transition: background-color 0.3s;
}
.has-hero .site-header { background: transparent; border: 0; }

.site-header__inner {
  height: 94px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: height 0.3s, padding 0.3s, border-color 0.3s;
}
.has-hero .site-header__inner {
  height: 96px;
  padding-bottom: 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.28);
}

/* 滚动后:深蓝黑半透明 + 毛玻璃,收成一条矮条,去掉白边和白线 */
.site-header.is-stuck {
  background: rgb(var(--night) / 0.78);
  border-width: 0;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.site-header.is-stuck .site-header__inner {
  height: var(--header-stuck-h);
  padding-bottom: 0;
  border-bottom-color: transparent;
}

.site-header__logo { flex: none; }
.site-header__logo img { width: 120px; transition: width 0.3s; }
.is-stuck .site-header__logo img { width: 84px; }

.site-nav { position: relative; display: flex; gap: 44px; }
.site-nav a {
  position: relative;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--paper);
}

/* 当前页下面一条青色细线。没有脚本时每个链接各画各的;
   js/site.js 接管后换成一条 .site-nav__bar,在当前页和悬停项之间滑动 */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) {
  .site-nav a:hover { color: var(--paper); }
  .site-nav a:hover::after { transform: scaleX(1); }
}
.site-nav.has-bar a::after { display: none; }
.site-nav__bar {
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.site-nav.is-ready .site-nav__bar {
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s;
}

/* ---------- 页脚 ---------- */
.site-footer { background: var(--ink); color: var(--paper); }

.site-footer__inner {
  display: grid;
  grid-template-columns: 405px 282px 195px 1fr;
  padding-block: 103px 67px;
}

.site-footer__logo img { width: 175px; margin-left: 4px; }

.site-footer h2 { font-size: 24px; line-height: 28px; font-weight: 700; margin-top: 5px; }

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.footer-label { font-size: 14px; line-height: 16px; margin-top: 40px; }

.footer-address {
  font-style: normal;
  font-size: 16px;
  line-height: 36.5px;
  margin-top: 31px;
}
.footer-address span { display: block; }

.footer-label--email { margin-top: 31px; }
.footer-email { display: inline-block; font-size: 16px; line-height: 19px; margin-top: 19px; }

.footer-menu { list-style: none; padding: 0; margin-top: 39px; }
.footer-menu li { line-height: 19px; }
/* 原站三项不等距(Home→Events 73、Events→Press Room 50),照原样 */
.footer-menu li:nth-child(2) { margin-top: 73px; }
.footer-menu li:nth-child(3) { margin-top: 50px; }
.footer-menu a { font-size: 16px; line-height: 19px; text-decoration: underline; }

.footer-follow p { font-size: 14px; line-height: 16px; margin-top: 38px; max-width: 318px; }

.footer-social { display: flex; gap: 12px; margin-top: 61px; }
.footer-legal { margin-top: 36px; font-size: 14px; line-height: 19px; }
.footer-legal a { text-decoration: underline; }
.footer-social img { width: 34px; height: 34px; }
.footer-social a { transition: opacity 0.2s; }
.footer-social a:hover { opacity: 0.8; }

/* ---------- 窄屏 ---------- */
@media (max-width: 767px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; row-gap: 48px; padding-block: 72px; }
  .site-footer__logo { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-header__logo img { width: 88px; }
  .is-stuck .site-header__logo img { width: 72px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 15px; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .footer-menu li:nth-child(n) { margin-top: 0; }
  .footer-menu li + li { margin-top: 20px; }
  .footer-social { margin-top: 24px; }
}
