/* ============================================================
   Really Reliable（瑞利来）— Shared Site Styles
   Nav, footer, typography (lang-aware), bilingual toggle
   Loaded by: index.html (after style.css) and all product pages
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ── Typography: language-aware ───────────────────────────── */
/* ZH base (default; used when .lang-zh class is on html) */
body {
  font-family: "Songti SC", "STSong", "SimSun", "宋体", Georgia, serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.75;
  font-size: 18px;
}

h1, h2, h3, h4 {
  font-family: "Songti SC", "STSong", "SimSun", "宋体", Georgia, serif;
  line-height: 1.25;
  color: #0d1f3c;
}

/* EN override — Times New Roman for all text */
html:not(.lang-zh) body {
  font-family: "Times New Roman", Times, Georgia, serif;
}

html:not(.lang-zh) h1,
html:not(.lang-zh) h2,
html:not(.lang-zh) h3,
html:not(.lang-zh) h4 {
  font-family: "Times New Roman", Times, Georgia, serif;
}

h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout helpers ───────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section      { padding: 80px 0; }
.section--alt { background: #f4f7fb; }

/* ── Section headers (larger + more breathing room) ──────── */
.section-label {
  display: inline-block;
  /* Always sans-serif for the small label regardless of language */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 12px;
}

.section-title {
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.section-lead {
  max-width: 700px;
  color: #333;
  font-size: 1.15rem;
  margin-bottom: 44px;
  line-height: 1.8;
}

.divider {
  width: 52px;
  height: 4px;
  background: #2563eb;
  border-radius: 2px;
  margin: 16px 0 36px;
}

/* ── Nav ──────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 31, 60, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.nav-brand {
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 1.05rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-brand .brand-sub { color: #60a5fa; }

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  /* Always sans-serif for nav readability */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-transform: uppercase;
  transition: color 0.2s;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover     { color: #fff; }
.nav-links a.nav-active {
  color: #fff;
  border-bottom-color: #2563eb;
}

/* ── Language Toggle ──────────────────────────────────────── */
.lang-toggle {
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.lang-toggle:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
}

/* ── Bilingual show / hide ────────────────────────────────── */
html.lang-zh  .lang-en { display: none !important; }
html:not(.lang-zh) .lang-zh { display: none !important; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #070f1e;
  color: #94a3b8;
  padding: 36px 0;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 1rem;
  color: #e2e8f0;
  font-weight: bold;
}

.footer-copy { color: #64748b; }

/* ── Email notice ─────────────────────────────────────────── */
.email-notice {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
  font-style: italic;
}

/* ── Back link (used on product pages) ───────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.back-link:hover { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links  { display: none; }
  .section    { padding: 52px 0; }
  .footer-inner { flex-direction: column; text-align: center; }
  .lang-toggle  { font-size: 0.75rem; padding: 4px 10px; }
}
