/*
Theme Name: CHIHUI SCREENS
Theme URI: https://www.chihuiscreen.com
Author: CHIHUI Dev
Description: Custom WordPress theme for Anping Chihui Invisible Screen Factory (CHIHUI SCREENS). Strict visual compliance: Primary Green #078B65, Dark Navy #101E3A, White, Light #F5F7FA, Secondary Text #64748B, Border #E5EAF0.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: proprietary
Text Domain: chihui
*/

/* =========================================================
   1. Design tokens — do not introduce other colors
   ========================================================= */
:root {
  --ch-green: #078B65;
  --ch-green-dark: #06694E;
  --ch-navy: #101E3A;
  --ch-white: #FFFFFF;
  --ch-light: #F5F7FA;
  --ch-muted: #64748B;
  --ch-border: #E5EAF0;
  --ch-wa: #25D366;
  --ch-radius: 14px;
  --ch-radius-sm: 10px;
  --ch-shadow: 0 6px 24px rgba(16, 30, 58, 0.08);
  --ch-shadow-hover: 0 12px 32px rgba(16, 30, 58, 0.14);
  --ch-container: 1200px;
}

/* =========================================================
   2. Base
   ========================================================= */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ch-navy);
  background: var(--ch-white);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ch-green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ch-green-dark); }
h1, h2, h3, h4 { color: var(--ch-navy); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.ch-container {
  max-width: var(--ch-container);
  margin: 0 auto;
  padding: 0 24px;
}
.ch-section { padding: 72px 0; }
.ch-section--light { background: var(--ch-light); }

.ch-eyebrow {
  display: inline-block;
  color: var(--ch-green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .82rem;
  margin-bottom: 12px;
}
.ch-section-head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.ch-section-head p { color: var(--ch-muted); font-size: 1.05rem; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.2;
}
.btn--primary { background: var(--ch-green); color: var(--ch-white); }
.btn--primary:hover { background: var(--ch-green-dark); color: var(--ch-white); }
.btn--outline { background: transparent; color: var(--ch-navy); border-color: var(--ch-border); }
.btn--outline:hover { border-color: var(--ch-green); color: var(--ch-green); }
.btn--ghost-light { background: rgba(255,255,255,.14); color: var(--ch-white); border-color: rgba(255,255,255,.55); }
.btn--ghost-light:hover { background: rgba(255,255,255,.26); color: var(--ch-white); }
.btn--wa { background: var(--ch-wa); color: #fff; padding: 10px 20px; }
.btn--wa:hover { background: #1fbc59; color: #fff; }

/* =========================================================
   3. Header
   ========================================================= */
.ch-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ch-white);
  border-bottom: 1px solid var(--ch-border);
}
.ch-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
}
.ch-logo { display: flex; align-items: center; gap: 10px; }
.ch-logo__mark {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--ch-green);
  color: var(--ch-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem; letter-spacing: .02em;
}
.ch-logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.ch-logo__name { font-weight: 800; font-size: 1.18rem; color: var(--ch-navy); letter-spacing: .04em; }
.ch-logo__tag { font-size: .68rem; color: var(--ch-muted); letter-spacing: .16em; text-transform: uppercase; }

.ch-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.ch-nav a {
  color: var(--ch-navy);
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 0;
  display: block;
}
.ch-nav a:hover, .ch-nav .current-menu-item > a, .ch-nav .current_page_item > a { color: var(--ch-green); }
.ch-nav .menu-item-has-children, .ch-nav .page_item_has_children { position: relative; }
.ch-nav .sub-menu, .ch-nav .children {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--ch-white);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-sm);
  box-shadow: var(--ch-shadow);
  min-width: 280px;
  padding: 8px 0;
  margin: 0;
}
.ch-nav li:hover > .sub-menu, .ch-nav li:hover > .children { display: block; }
.ch-nav .sub-menu li, .ch-nav .children li { display: block; padding: 0; }
.ch-nav .sub-menu a, .ch-nav .children a { padding: 10px 20px; font-weight: 500; }
.ch-nav .sub-menu .menu-item-has-children > .sub-menu { top: 0; left: 100%; }

.ch-header__actions { display: flex; align-items: center; gap: 12px; }
.ch-header__search-toggle {
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ch-navy);
}
.ch-header__search-toggle:hover { background: var(--ch-light); }
.ch-searchbar { display: none; border-top: 1px solid var(--ch-border); background: var(--ch-white); }
.ch-searchbar.is-open { display: block; }
.ch-searchbar form { display: flex; gap: 10px; padding: 14px 0; }
.ch-searchbar input[type="search"] {
  flex: 1; padding: 11px 16px; border: 1px solid var(--ch-border);
  border-radius: 999px; font-size: .95rem; outline: none;
}
.ch-searchbar input[type="search"]:focus { border-color: var(--ch-green); }

.ch-burger {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 42px; height: 42px; border-radius: 8px;
}
.ch-burger span { display: block; width: 22px; height: 2px; background: var(--ch-navy); margin: 5px auto; border-radius: 2px; }

/* =========================================================
   4. Hero
   ========================================================= */
.ch-hero {
  position: relative;
  background: linear-gradient(115deg, var(--ch-navy) 0%, #16305C 55%, var(--ch-green-dark) 130%);
  color: var(--ch-white);
  overflow: hidden;
}
.ch-hero__inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
  padding: 96px 24px;
}
.ch-hero h1 { color: var(--ch-white); font-size: 3rem; margin-bottom: 18px; }
.ch-hero__sub {
  color: rgba(255,255,255,.85);
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: .02em;
  margin-bottom: 8px;
}
.ch-hero__desc { color: rgba(255,255,255,.72); max-width: 520px; margin-bottom: 32px; }
.ch-hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.ch-hero__badges { display: flex; gap: 26px; margin-top: 44px; flex-wrap: wrap; }
.ch-hero__badge { display: flex; flex-direction: column; }
.ch-hero__badge strong { font-size: 1.5rem; color: var(--ch-white); }
.ch-hero__badge span { font-size: .82rem; color: rgba(255,255,255,.65); letter-spacing: .06em; text-transform: uppercase; }
.ch-hero__media {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  aspect-ratio: 4 / 3;
  background: rgba(255,255,255,.08);
}
.ch-hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   5. Cards & grids
   ========================================================= */
.ch-grid { display: grid; gap: 24px; }
.ch-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ch-grid--4 { grid-template-columns: repeat(4, 1fr); }

.ch-card {
  background: var(--ch-white);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.ch-card:hover { transform: translateY(-4px); box-shadow: var(--ch-shadow-hover); }
.ch-card__media { aspect-ratio: 16 / 10; background: var(--ch-light); overflow: hidden; }
.ch-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ch-card__body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.ch-card__body h3 { margin-bottom: 8px; font-size: 1.12rem; }
.ch-card__body p { color: var(--ch-muted); font-size: .92rem; margin-bottom: 14px; flex: 1; }
.ch-card__link { font-weight: 700; color: var(--ch-green); font-size: .92rem; }

/* Feature blocks */
.ch-feature { text-align: center; padding: 28px 22px; background: var(--ch-white); border: 1px solid var(--ch-border); border-radius: var(--ch-radius); }
.ch-feature__icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 14px;
  background: rgba(7, 139, 101, .1);
  color: var(--ch-green);
  display: flex; align-items: center; justify-content: center;
}
.ch-feature h3 { font-size: 1.05rem; }
.ch-feature p { color: var(--ch-muted); font-size: .9rem; margin: 0; }

/* About split */
.ch-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.ch-split__media { border-radius: 18px; overflow: hidden; box-shadow: var(--ch-shadow); aspect-ratio: 4 / 3; background: var(--ch-light); }
.ch-split__media img { width: 100%; height: 100%; object-fit: cover; }
.ch-split h2 { margin-bottom: 12px; }
.ch-split .ch-lead { color: var(--ch-muted); font-size: 1.02rem; }
.ch-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0; }
.ch-stat { background: var(--ch-light); border: 1px solid var(--ch-border); border-radius: var(--ch-radius-sm); padding: 18px 20px; }
.ch-stat strong { display: block; font-size: 1.7rem; color: var(--ch-green); line-height: 1.2; }
.ch-stat span { color: var(--ch-muted); font-size: .88rem; }

/* Checklist */
.ch-checklist { list-style: none; margin: 0 0 28px; padding: 0; }
.ch-checklist li { position: relative; padding-left: 30px; margin-bottom: 10px; color: var(--ch-navy); }
.ch-checklist li::before {
  content: "";
  position: absolute; left: 0; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(7,139,101,.12);
}
.ch-checklist li::after {
  content: "";
  position: absolute; left: 4.5px; top: 8px;
  width: 8px; height: 5px;
  border-left: 2px solid var(--ch-green);
  border-bottom: 2px solid var(--ch-green);
  transform: rotate(-45deg);
}

/* OEM / process */
.ch-process { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); }
.ch-step {
  background: var(--ch-white); border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-sm); padding: 22px; position: relative;
}
.ch-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-weight: 800; font-size: 1.5rem; color: rgba(7,139,101,.28);
}
.ch-step h3 { font-size: 1rem; margin: 6px 0 6px; }
.ch-step p { color: var(--ch-muted); font-size: .86rem; margin: 0; }

/* FAQ */
.ch-faq { max-width: 820px; margin: 0 auto; }
.ch-faq details {
  background: var(--ch-white);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-sm);
  margin-bottom: 12px;
  padding: 0 22px;
}
.ch-faq details[open] { border-color: rgba(7,139,101,.4); }
.ch-faq summary {
  cursor: pointer; font-weight: 700; padding: 18px 0; list-style: none;
  position: relative; padding-right: 34px; color: var(--ch-navy);
}
.ch-faq summary::-webkit-details-marker { display: none; }
.ch-faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  color: var(--ch-green); font-size: 1.4rem; font-weight: 400;
}
.ch-faq details[open] summary::after { content: "−"; }
.ch-faq .ch-faq__a { color: var(--ch-muted); padding-bottom: 18px; margin: 0; }

/* Blog cards */
.ch-post-card { background: var(--ch-white); border: 1px solid var(--ch-border); border-radius: var(--ch-radius); overflow: hidden; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.ch-post-card:hover { transform: translateY(-4px); box-shadow: var(--ch-shadow-hover); }
.ch-post-card__media { aspect-ratio: 16 / 9; background: var(--ch-light); }
.ch-post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.ch-post-card__body { padding: 20px 22px; flex: 1; }
.ch-post-card__meta { color: var(--ch-muted); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.ch-post-card__body h3 { font-size: 1.05rem; margin-bottom: 8px; }
.ch-post-card__body h3 a { color: var(--ch-navy); }
.ch-post-card__body h3 a:hover { color: var(--ch-green); }
.ch-post-card__body p { color: var(--ch-muted); font-size: .9rem; margin: 0; }

/* CTA band */
.ch-cta-band {
  background: linear-gradient(115deg, var(--ch-navy) 0%, #16305C 60%, var(--ch-green-dark) 135%);
  border-radius: 20px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.ch-cta-band h2 { color: var(--ch-white); margin-bottom: 8px; }
.ch-cta-band p { color: rgba(255,255,255,.75); margin: 0; }

/* Placeholder media (temporary until genuine photos supplied) */
.ch-ph {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #EDF2F7 0%, #E2E8F0 100%);
  color: var(--ch-muted);
  font-size: .85rem;
  text-align: center;
  padding: 20px;
}
.ch-ph svg { width: 64px; height: 64px; opacity: .55; }
.ch-ph--dark { background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.04)); color: rgba(255,255,255,.6); }
.ch-ph small { opacity: .7; font-size: .72rem; letter-spacing: .04em; }

/* =========================================================
   6. Footer
   ========================================================= */
.ch-footer { background: var(--ch-navy); color: rgba(255,255,255,.72); margin-top: 72px; }
.ch-footer a { color: rgba(255,255,255,.72); }
.ch-footer a:hover { color: var(--ch-white); }
.ch-footer__main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding: 60px 0 44px;
}
.ch-footer h4 { color: var(--ch-white); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 18px; }
.ch-footer ul { list-style: none; margin: 0; padding: 0; }
.ch-footer li { margin-bottom: 10px; font-size: .92rem; }
.ch-footer__brand .ch-logo__name { color: var(--ch-white); }
.ch-footer__brand p { font-size: .92rem; margin-top: 16px; max-width: 300px; }
.ch-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .85rem;
}

/* Floating WhatsApp button */
.ch-wa-float {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 200;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--ch-wa);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .45);
  transition: transform .2s;
}
.ch-wa-float:hover { transform: scale(1.08); color: #fff; }
.ch-wa-float svg { width: 30px; height: 30px; }
.ch-wa-float::after {
  content: attr(data-tip);
  position: absolute;
  right: 70px;
  white-space: nowrap;
  background: var(--ch-navy);
  color: #fff;
  font-size: .8rem;
  padding: 7px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.ch-wa-float:hover::after { opacity: 1; }

/* Icon helper */
.icon-svg { width: 26px; height: 26px; }

/* =========================================================
   7. Forms
   ========================================================= */
.ch-form { max-width: 860px; margin: 0 auto; background: var(--ch-white); border: 1px solid var(--ch-border); border-radius: var(--ch-radius); padding: 36px; box-shadow: var(--ch-shadow); }
.ch-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ch-form__field { display: flex; flex-direction: column; gap: 6px; }
.ch-form__field--full { grid-column: 1 / -1; }
.ch-form label { font-weight: 600; font-size: .88rem; color: var(--ch-navy); }
.ch-form label .req { color: var(--ch-green); }
.ch-form input, .ch-form select, .ch-form textarea {
  padding: 12px 14px;
  border: 1px solid var(--ch-border);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ch-navy);
  background: var(--ch-white);
  outline: none;
  width: 100%;
}
.ch-form input:focus, .ch-form select:focus, .ch-form textarea:focus { border-color: var(--ch-green); }
.ch-form__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.ch-form__hint { color: var(--ch-muted); font-size: .8rem; margin: 0; }
.ch-form__status { display: none; margin-top: 16px; padding: 14px 18px; border-radius: 10px; font-size: .92rem; }
.ch-form__status.is-ok { display: block; background: rgba(7,139,101,.1); color: var(--ch-green-dark); border: 1px solid rgba(7,139,101,.3); }
.ch-form__status.is-error { display: block; background: #FDF0F0; color: #B42318; border: 1px solid #F2C1C1; }

/* Page hero for inner pages */
.ch-page-hero { background: var(--ch-light); border-bottom: 1px solid var(--ch-border); padding: 56px 0 48px; }
.ch-page-hero h1 { font-size: 2.2rem; margin-bottom: 10px; }
.ch-page-hero p { color: var(--ch-muted); margin: 0; max-width: 720px; }
.ch-breadcrumb { font-size: .85rem; color: var(--ch-muted); margin-bottom: 14px; }
.ch-breadcrumb a { color: var(--ch-muted); }
.ch-breadcrumb a:hover { color: var(--ch-green); }

/* Simple content page */
.ch-content { max-width: 860px; }
.ch-content h2 { font-size: 1.5rem; margin-top: 1.8em; }

/* =========================================================
   8. Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .ch-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .ch-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .ch-process { grid-template-columns: repeat(2, 1fr); }
  .ch-hero h1 { font-size: 2.4rem; }
  .ch-footer__main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .ch-header__inner { height: 64px; }
  .ch-burger { display: block; }
  .ch-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--ch-white);
    border-bottom: 1px solid var(--ch-border);
    box-shadow: var(--ch-shadow);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .ch-nav.is-open { display: block; }
  .ch-nav ul { flex-direction: column; gap: 0; padding: 10px 24px 18px; }
  .ch-nav li { border-bottom: 1px solid var(--ch-border); }
  .ch-nav li:last-child { border-bottom: none; }
  .ch-nav a { padding: 14px 0; }
  .ch-nav .sub-menu, .ch-nav .children {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 8px 16px;
    min-width: 0;
  }
  .ch-header__search { display: none; }
  .ch-header__actions .btn--primary { padding: 9px 16px; font-size: .84rem; }
  .ch-header__actions .btn--wa { display: none; }

  .ch-hero__inner { grid-template-columns: 1fr; padding: 56px 24px; }
  .ch-hero h1 { font-size: 2rem; }
  .ch-hero__media { order: -1; }
  .ch-split { grid-template-columns: 1fr; gap: 32px; }
  .ch-section { padding: 52px 0; }
  .ch-cta-band { padding: 40px 28px; }
  .ch-form { padding: 24px 20px; }
  .ch-form__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  h1 { font-size: 1.8rem; }
  .ch-grid--3, .ch-grid--4 { grid-template-columns: 1fr; }
  .ch-process { grid-template-columns: 1fr; }
  .ch-stats { grid-template-columns: repeat(2, 1fr); }
  .ch-footer__main { grid-template-columns: 1fr; gap: 28px; }
  .ch-hero__badges { gap: 18px; }
  .ch-wa-float { right: 18px; bottom: 18px; width: 52px; height: 52px; }
}
