/* ==============================================
   Custom styles — Zhonghai Synergy Group (ZSG)
   Layered on top of the Webflow Solar Valley base.
   ============================================== */

/* ---- Tokens ---- */
:root {
  --zsg-blue:      #005a9c;
  --zsg-blue-dark: #00407a;
  --zsg-ink:       #111418;
  --zsg-body:      #2b2f36;
  --zsg-line:      #e6e9ee;
}

/* ---- Base typography ---- */
body {
  background-color: #ffffff;
  color: var(--zsg-ink);
  font-size: 16px;
  line-height: 1.7;
}

p,
.f-paragraph-large-2 {
  color: var(--zsg-body);
  font-size: 1.125rem;
  line-height: 1.75;
}

.f-paragraph-large-2 {
  max-width: 56rem;
}

.f-paragraph-large-2 a {
  color: var(--zsg-blue);
  text-decoration: underline;
}

.f-header-title-wrapper-center .f-paragraph-large-2 {
  max-width: 54rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-section .f-paragraph-large-2 {
  font-size: 20px;
}

/* ---- Layout containers ---- */
.wrapper {
  max-width: 1400px;
}

.content-body {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.container-wide {
  max-width: 1400px;
}

#zsgContactForm {
  margin-top: 20px;
}

#zsgContactForm .f-contact-form-grid,
#zsgContactForm .f-margin-bottom-44,
#zsgContactForm .f-margin-bottom-49 {
  margin-bottom: 24px;
}

/* Override template dark backgrounds — must sit above hero rules */
.f-section-large,
.f-section-large-2 {
  background-color: #ffffff;
  background-image: none;
}

/* ---- Headings ---- */
h1, h2, h3,
.home-header-h1,
.f-h1-heading-2,
.home-about-title {
  color: var(--zsg-ink);
}

.home-header-h1,
.f-h1-heading-2 {
  font-size: 44px;
  line-height: 1.15;
  margin-top: 15px;
  max-width: 54rem;
}

.home-about-title {
  font-size: 40px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.f-heading-detail-small-2 {
  color: var(--zsg-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.0;
}

.home-about-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 14px;
  background-color: var(--zsg-blue);
  border-radius: 2px;
}

/* ---- Buttons ---- */
.secondary-btn {
  background-color: var(--zsg-blue);
  border: 1px solid var(--zsg-blue);
  border-radius: 8px;
  padding: 12px 26px;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.secondary-btn,
.secondary-btn div {
  color: #ffffff;
}

.secondary-btn:hover {
  background-color: var(--zsg-blue-dark);
  border-color: var(--zsg-blue-dark);
}

.f-button-neutral-4 {
  background-color: #1a73c4;
  border: 1px solid #1a73c4;
}

.f-button-neutral-4:hover {
  background-color: #005a9c;
  border-color: #005a9c;
}

.f-contact-submit-wrapper {
  justify-content: flex-end;
}

/* ---- Navbar ---- */
.w-nav {
  background-color: #ffffff;
  border-bottom: 1px solid var(--zsg-line);
}

.f-navigation {
  padding-top: 12px;
  padding-bottom: 12px;
}

.f-navigation-link {
  color: var(--zsg-ink);
  font-weight: 600;
}

.f-navigation-link:hover,
.f-navigation-link.w--current {
  color: var(--zsg-blue);
}

.f-navigation-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.f-navigation-logo-link-middle {
  display: flex;
  align-items: center;
  margin: 0 20px;
}

.f-navigation-logo-link-middle img {
  width: 60px;
  height: 65px;
}

/* ---- Language switcher ---- */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 24px;
  padding-left: 24px;
  border-left: 1px solid var(--zsg-line);
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #555;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.lang-btn:hover {
  background: #f0f0f0;
  color: #000;
}

.lang-btn.active {
  background: var(--zsg-blue);
  color: #fff;
  border-color: var(--zsg-blue);
}

/* ---- Footer ---- */
.f-footer-small {
  background-color: #ffffff;
  border-top: 1px solid var(--zsg-line);
  padding-top: 5px;
  padding-bottom: 5px;
}

.f-footer-small .f-container-large {
  padding-top: 5px;
  padding-bottom: 5px;
}

.f-footer-bottom {
  padding-top: 5px;
  padding-bottom: 5px;
}

.f-footer-link {
  color: var(--zsg-ink);
}

.f-footer-link:hover {
  color: var(--zsg-blue);
}

/* Prevent CJK labels from breaking mid-character */
.f-footer-link,
.f-footer-link div {
  white-space: nowrap;
}

.f-footer-detail {
  color: #6b7280;
}

.f-footer-vertical-divider,
.f-footer-horizontal-divider {
  background-color: var(--zsg-line);
  margin-top: 5px;
  margin-bottom: 5px;
}

.f-footer-menu {
  flex-wrap: nowrap;
}

.f-footer-logo img {
  width: 41.5px;
  height: 45;
}

/* ---- Hero ---- */
.hero-section {
  background-image: url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  height: 600px;
  display: flex;
  align-items: center;
}

.about-hero    { background-image: url('../images/about-hero.jpg'); }
.business-hero { background-image: url('../images/business-hero.png'); }
.contact-hero  { background-image: url('../images/contact-hero.jpg'); }

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 0;
}

.hero-section .f-container-regular-2 {
  position: relative;
  z-index: 1;
}

.hero-section .f-heading-detail-small-2,
.hero-section .home-header-h1,
.hero-section .f-h1-heading-2,
.hero-section .f-paragraph-large-2 {
  color: #ffffff;
}

/* ---- Home previews ---- */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 120px;
  align-items: start;
}

/* ---- Chinese font stacks ---- */
html[lang="zh-CN"] body { font-family: "Noto Sans SC", "Open Sans", sans-serif; }
html[lang="zh-TW"] body { font-family: "Noto Sans TC", "Open Sans", sans-serif; }
html[lang="en"]    body { font-family: "Open Sans", sans-serif; }

/* ==============================================
   Desktop nav — 3-col grid (min-width: 992px)
   1fr | logo | 1fr centres the logo exactly.
   ============================================== */
@media screen and (min-width: 992px) {
  .f-navigation-logo-link-mobile { display: none; }

  .f-navigation-menu.w-nav-menu {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    float: none;
  }

  .nav-side {
    display: flex;
    align-items: center;
    gap: 32px;
    min-width: 0;
  }

  .nav-side-left  { justify-content: flex-end; }
  .nav-side-right { justify-content: flex-start; }
  .nav-side-right .lang-switcher { margin-left: auto; }

  .f-navigation-logo-link-middle { margin: 0 48px; }
}

/* ==============================================
   Tablet / hamburger menu (max-width: 991px)
   ============================================== */
@media screen and (max-width: 991px) {
  .preview-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .home-header-h1,
  .f-h1-heading-2,
  .home-about-title {
    font-size: 32px;
  }

  .f-navigation-logo-link-middle { display: none; }

  .f-navigation-logo-link-mobile img {
    width: 50.8px;
    height: 55;
  }

  .f-navigation-menu.w-nav-menu {
    background-color: #ffffff;
    padding: 8px 20px 16px;
    border-top: 1px solid var(--zsg-line);
  }

  .nav-side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .f-navigation-link {
    padding: 11px 4px;
    font-size: 14px;
    border-bottom: 1px solid var(--zsg-line);
    text-align: center
  }

  .lang-switcher {
    justify-content: center;
    gap: 8px;
    margin: 8px 0 0;
    padding: 10px 0 0;
    border-left: none;
    border-top: 1px solid var(--zsg-line);
    width: 100%;
  }

  .lang-btn {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* ==============================================
   Phones (max-width: 767px)
   ============================================== */
@media screen and (max-width: 767px) {
  body {
    font-size: 17px;
    line-height: 1.75;
  }

  h1, h2, h3,
  p,
  .f-paragraph-large-2,
  .home-about-title,
  .home-header-h1,
  .f-h1-heading-2 {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Hero */
  .hero-section {
    height: auto;
    min-height: 420px;
    padding: 72px 20px;
  }

  .hero-section::before { background: rgba(0, 0, 0, 0.55); }

  .f-heading-detail-small-2 {
    font-size: 14px;
    line-height: 1.4;
  }

  .home-header-h1,
  .f-h1-heading-2 {
    font-size: 30px;
    line-height: 1.2;
    margin-top: 8px;
  }

  .hero-section .f-paragraph-large-2 {
    font-size: 16px;
    line-height: 1.65;
  }

  /* Body sections */
  .f-section-large,
  .f-section-large-2 {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .content-body,
  .wrapper {
    max-width: 100%;
  }

  .home-about-title {
    font-size: 24px;
    line-height: 1.3;
  }

  .f-paragraph-large-2 {
    font-size: 17px;
    line-height: 1.75;
    max-width: 100%;
  }

  .secondary-btn {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  /* Contact form */
  .f-contact-form-grid {
    grid-template-columns: 1fr;
    grid-row-gap: 16px;
  }

  /* 16px prevents iOS from auto-zooming on input focus */
  .f-field-input,
  .f-text-area {
    font-size: 16px;
  }

  .f-field-input { min-height: 52px; }
  .f-text-area  { min-height: 140px; }

  .f-contact-submit-wrapper { justify-content: stretch; }

  .f-button-neutral-4 {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
  }

  /* Footer — compact horizontal row */
  .f-footer-bottom {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
  }

  /* Shrink footer logo on mobile */
  .f-footer-logo img {
    width: 36.9px;
    height: 40px;
  }

  /* Override webflow's width:100% and margin:10px 0 so links sit inline */
  .f-footer-link {
    width: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .f-footer-menu {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 10px;
  }

  .f-footer-vertical-divider { display: none; }

  .f-footer-link,
  .f-footer-link div {
    font-size: 13px;
  }
}

/* ==============================================
   Narrow phones (max-width: 479px)
   ============================================== */
@media screen and (max-width: 479px) {
  .hero-section {
    padding: 60px 18px;
    min-height: 380px;
  }

  .home-header-h1,
  .f-h1-heading-2 { font-size: 27px; }

  .home-about-title { font-size: 22px; }

  body,
  .f-paragraph-large-2 {
    font-size: 16px;
    line-height: 1.7;
  }
}