/* ==========================================================================
   CWC Tech Corporation (全網科技) — 靜態網站樣式
   色彩取自 logo.png 實際像素採樣（teal #1899b2 → blue #023894 漸層，
   文字色 #023894），其餘數值取自 design.md 查證欄位。
   ========================================================================== */

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

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

body,
h1, h2, h3, h4, p, ul, figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---- Design tokens ---- */
:root {
  --color-teal: #1899b2;
  --color-blue: #023894;
  --color-text: #222222;
  --color-text-soft: #666666;
  --color-border: #e0e0e0;
  --color-bg-clients: #cccccc;
  --color-btn-bg: #cccccc;
  --color-btn-text: rgba(0, 0, 0, 0.8);
  --font-heading: "Arvo", Georgia, "PingFang TC", "Microsoft JhengHei", "微軟正黑體", serif;
  --font-body: "Noto Sans TC", "Hiragino Kaku Gothic Pro", sans-serif;
  --container-wide: 1200px;
  --container-narrow: 800px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.7;
  background: #ffffff;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.35;
  color: #000000;
}

.container {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 5%;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border-radius: 4px;
  border: none;
  padding: 12px 20px;
  font-size: 117%;
  font-family: var(--font-body);
  transition: all 0.15s;
}

.btn-fill {
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
}

.btn-fill:hover {
  background: #bfbfbf;
}

.btn-outline-hero {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.btn-outline-hero:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-blue);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.primary-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
}

.primary-nav.is-open {
  max-height: 240px;
}

.primary-nav ul {
  display: flex;
  flex-direction: column;
  padding: 8px 5%;
}

.primary-nav a {
  display: block;
  padding: 12px 0;
  font-weight: 700;
  color: var(--color-blue);
  border-bottom: 1px solid var(--color-border);
}

.primary-nav li:last-child a {
  border-bottom: none;
}

@media (min-width: 800px) {
  .nav-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    background: transparent;
  }

  .primary-nav ul {
    flex-direction: row;
    gap: 32px;
    padding: 0;
  }

  .primary-nav a {
    padding: 0;
    border-bottom: none;
  }
}

/* ---- Hero sections (full-width background photo + real HTML text) ---- */
.hero,
.page-hero,
.banner {
  position: relative;
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  color: #ffffff;
}

.hero-overlay,
.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 10, 30, 0.35) 0%, rgba(0, 10, 30, 0.55) 100%);
}

.hero--home {
  background-image: url("../images/hero-home.jpg");
  padding: 64px 0 48px;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  letter-spacing: 0.3em;
  font-size: 14px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  color: #ffffff;
  margin-bottom: 24px;
  max-width: 20ch;
}

.hero-cta {
  margin-bottom: 48px;
}

.hero-blocks {
  display: grid;
  gap: 32px;
}

@media (min-width: 720px) {
  .hero-blocks {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-block {
  background: rgba(0, 0, 0, 0.35);
  padding: 24px;
  border-radius: 6px;
}

.hero-divider {
  border: none;
  border-top: 2px solid #ffffff;
  margin: 0 0 16px;
  width: 60px;
}

.hero-block-title {
  color: #000000;
  background: #ffffff;
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 2px 6px;
  font-size: 18px;
  line-height: 1.6;
}

.hero-block-text {
  color: #ffffff;
  margin: 16px 0 20px;
  font-size: 15px;
}

.hero-block-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.hero-badge {
  opacity: 0.85;
}

/* ---- Clients section ---- */
.clients {
  background: var(--color-bg-clients);
  padding: 56px 0;
  text-align: center;
}

.clients h2 {
  font-size: 28px;
  margin-bottom: 32px;
}

.client-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: center;
}

@media (min-width: 640px) {
  .client-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

.client-list li {
  background: #ffffff;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Footer ---- */
.site-footer {
  padding: 28px 0;
  text-align: center;
  color: var(--color-text-soft);
  font-size: 14px;
  border-top: 1px solid var(--color-border);
}

/* ---- Products page ---- */
.page-intro {
  padding: 48px 0 24px;
  text-align: center;
}

.page-intro h1 {
  font-size: 30px;
}

.banner--products {
  background-image: url("../images/products-banner.jpeg");
  min-height: 160px;
  display: flex;
  align-items: center;
}

.banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
}

.banner-text {
  font-size: clamp(16px, 3vw, 22px);
  letter-spacing: 0.05em;
  color: #ffffff;
}

.products {
  padding: 56px 0 72px;
}

.product-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 720px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.product-card img {
  border-radius: 6px;
  margin-bottom: 20px;
  width: 100%;
  height: auto;
}

.product-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.product-card p {
  color: var(--color-text-soft);
}

/* ---- Contact page ---- */
.page-hero--contact {
  background-image: url("../images/hero-contact.jpeg");
  min-height: 280px;
}

.connect {
  background: #1a1a1a;
  color: #ffffff;
  padding: 56px 0;
}

.connect-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 30px;
  color: #ffffff;
  text-align: center;
  margin-bottom: 40px;
}

.connect-decor {
  height: 60px;
  width: auto;
}

.connect-grid {
  display: grid;
  gap: 40px;
  text-align: center;
  align-items: start;
  justify-items: center;
}

@media (min-width: 720px) {
  .connect-grid {
    grid-template-columns: 1fr auto 1fr auto 1fr;
  }

  .connect-divider {
    display: block !important;
  }
}

.connect-item img {
  margin: 0 auto 16px;
}

.connect-item h2 {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 8px;
}

.connect-item:nth-child(1) p {
  color: #ffffff;
}

.connect-item p {
  color: #f2f2f2;
}

.connect-item p a:hover {
  text-decoration: underline;
}

.connect-divider {
  display: none;
  align-self: center;
  opacity: 0.6;
}

.contact-form-section {
  padding: 56px 0 72px;
}

.form-intro {
  text-align: center;
  margin-bottom: 32px;
  color: var(--color-text-soft);
}

.contact-form {
  display: grid;
  gap: 20px;
}

.contact-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font: inherit;
  color: var(--color-text);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--color-teal);
  outline-offset: 1px;
}

.contact-form button {
  justify-self: start;
}

.form-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-soft);
}
