/*
Theme Name: Sunway
Theme URI: https://sunway.joowp.com
Author: Sixe teams
Author URI: https://www.sixe.cn
Description: 深圳市桑威科技有限公司官方主题。轻量、响应式，专为 Elementor 页面构建：页面主体交由 Elementor 全宽渲染，主题负责站点导航与页脚，保证迁移后的页面不被容器挤压。由 Sixe teams（北京六翼信息技术有限公司）开发维护。
Version: 1.0.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sunway
Requires PHP: 7.4
Tags: custom-menu, custom-logo, featured-images, translation-ready, blog, one-column, full-width-template
*/

/* ---------- Variables ---------- */
:root {
  --sunway-primary: #1257d6;
  --sunway-primary-dark: #0e44aa;
  --sunway-ink: #1f2937;
  --sunway-muted: #6b7280;
  --sunway-bg: #ffffff;
  --sunway-soft: #f5f7fa;
  --sunway-border: #e5e7eb;
  --sunway-footer: #0f172a;
  --sunway-container: 1200px;
  --sunway-header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sunway-bg);
  color: var(--sunway-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
/* Content images migrated from Joomla are inline by intent (logo walls,
   consecutive <img> in one paragraph) — do not force them onto separate lines. */
.elementor-widget-text-editor img,
.entry-content img { display: inline-block; vertical-align: middle; }
a { color: var(--sunway-primary); text-decoration: none; }
a:hover { color: var(--sunway-primary-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--sunway-ink); line-height: 1.35; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em 1.4em; }

/* ---------- Contact Form 7 ---------- */
.wpcf7-form label { display: block; margin-bottom: 14px; font-size: .95rem; color: var(--sunway-ink); }
.wpcf7-form input[type="text"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  display: block; width: 100%; max-width: 480px; margin-top: 6px;
  padding: 10px 12px; font-size: .95rem; color: var(--sunway-ink);
  background: #fff; border: 1px solid var(--sunway-border); border-radius: 4px;
}
.wpcf7-form input:focus, .wpcf7-form textarea:focus {
  outline: none; border-color: var(--sunway-primary);
  box-shadow: 0 0 0 2px rgba(18, 87, 214, .15);
}
.wpcf7-form input.wpcf7-not-valid { border-color: #dc2626; }
.wpcf7-form .wpcf7-not-valid-tip { font-size: .85rem; color: #dc2626; }
.wpcf7-form .wpcf7-submit {
  display: inline-block; margin-top: 4px; padding: 11px 34px;
  font-size: 1rem; color: #fff; background: var(--sunway-primary);
  border: none; border-radius: 4px; cursor: pointer; transition: background .2s;
}
.wpcf7-form .wpcf7-submit:hover { background: var(--sunway-primary-dark); }
.wpcf7 .wpcf7-response-output {
  margin: 14px 0 0; padding: 10px 14px; font-size: .9rem;
  border: 1px solid var(--sunway-border); border-radius: 4px; background: var(--sunway-soft);
}

/* ---------- Layout ---------- */
.sunway-container {
  width: 100%;
  max-width: var(--sunway-container);
  margin: 0 auto;
  padding: 0 24px;
}
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: static !important; display: inline-block;
  width: auto; height: auto; margin: 8px; padding: 10px 16px;
  background: var(--sunway-primary); color: #fff; border-radius: 6px; z-index: 100;
}

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--sunway-border);
  position: sticky; top: 0; z-index: 999;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--sunway-header-h); gap: 24px;
}
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-branding img { max-height: 44px; width: auto; }
.site-title {
  font-size: 1.15rem; font-weight: 700; color: var(--sunway-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title:hover { color: var(--sunway-primary); }
.site-tagline { margin: 0; font-size: .75rem; color: var(--sunway-muted); line-height: 1.2; }

.main-navigation ul {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.main-navigation li { position: relative; }
.main-navigation a {
  display: block; padding: 10px 14px; font-size: .95rem;
  color: var(--sunway-ink); border-radius: 6px; transition: color .2s, background .2s;
}
.main-navigation a:hover { color: var(--sunway-primary); background: var(--sunway-soft); }
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a { color: var(--sunway-primary); font-weight: 600; }

/* Mobile toggle */
.menu-toggle {
  display: none; background: none; border: 1px solid var(--sunway-border);
  border-radius: 6px; width: 42px; height: 38px; padding: 9px 10px; cursor: pointer;
}
.menu-toggle span {
  display: block; width: 100%; height: 2px; background: var(--sunway-ink);
  border-radius: 2px; transition: transform .25s, opacity .2s;
}
.menu-toggle span + span { margin-top: 5px; }
body.sunway-menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sunway-menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.sunway-menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Elementor pages: full width, no squeeze ---------- */
.sunway-elementor > .elementor { margin: 0; }
.sunway-content { padding: 48px 24px; }
.entry-header { margin-bottom: 24px; }
.entry-title { margin: 0; }

/* ---------- Posts ---------- */
.sunway-post { padding: 48px 24px; max-width: 820px; margin: 0 auto; }
.entry-meta { color: var(--sunway-muted); font-size: .875rem; margin-bottom: 20px; }
.entry-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--sunway-border); font-size: .9rem; }
.post-navigation { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }

.sunway-post-list { padding: 48px 24px; max-width: 900px; margin: 0 auto; }
.sunway-post-item { padding: 24px 0; border-bottom: 1px solid var(--sunway-border); }
.sunway-post-item:first-of-type { padding-top: 0; }
.sunway-post-item h2 { margin-bottom: 8px; font-size: 1.35rem; }
.archive-title { padding: 40px 24px 0; max-width: 900px; margin: 0 auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--sunway-footer); color: #cbd5e1; margin-top: 64px; }
.site-footer a { color: #e2e8f0; }
.site-footer a:hover { color: #fff; }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px; padding: 48px 24px;
}
.site-footer__name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.site-footer__brand p { margin: 6px 0 0; font-size: .875rem; color: #94a3b8; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin: 0; padding: 0; }
.footer-menu a { font-size: .9rem; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); }
.site-footer__bottom .sunway-container {
  padding: 18px 24px; display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: space-between; font-size: .82rem; color: #94a3b8;
}

/* ---------- Comments / forms ---------- */
input, textarea, select, button { font: inherit; }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1; padding: 10px 14px; border: 1px solid var(--sunway-border);
  border-radius: 6px; background: #fff;
}
.search-submit, .sunway-button {
  padding: 10px 18px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--sunway-primary); color: #fff;
}
.search-submit:hover, .sunway-button:hover { background: var(--sunway-primary-dark); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .main-navigation {
    display: none; width: 100%; order: 3;
    border-top: 1px solid var(--sunway-border); padding: 8px 0 16px;
  }
  body.sunway-menu-open .main-navigation { display: block; }
  .site-header__inner { flex-wrap: wrap; min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
  .main-navigation ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-navigation a { padding: 12px 8px; border-radius: 0; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* Elementor editor preview: keep canvas clean */
.elementor-editor-active .site-header { position: relative; }
