/* ============================================================
   Natural Design–inspired theme for Wai Ko Engineering
   參考 naturaldesign.hk：明亮、留白、大圖 Hero、簡潔排版
   ============================================================ */

body.natural-theme {
  overflow-x: hidden;
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-2: #f3f3f3;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-border: #e8e8e8;
  --nd-max: 1140px;
  background: var(--color-bg);
}

body.natural-theme .nav {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

body.natural-theme .nav-link {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

body.natural-theme .nav-link.active {
  color: var(--color-primary);
}

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-surface);
  font-size: var(--text-label);
  font-weight: 700;
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 0.4rem 0.75rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 700;
  transition: all var(--duration) var(--ease);
}

.lang-toggle button.active {
  background: var(--color-primary);
  color: #fff;
}

.lang-toggle button:hover:not(.active) {
  color: var(--color-primary);
}

/* Hero slider — Natural Design style */
.nd-hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 0;
}

.nd-hero-slider {
  position: absolute;
  inset: 0;
}

.nd-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.nd-slide.active {
  opacity: 1;
}

.nd-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Placeholder slides — replace with images/hero/*.jpg when available */
.nd-slide-1 {
  background-image: linear-gradient(135deg, #B53845 0%, #6E2229 100%),
    url('../images/hero/hero-1.jpg');
}

.nd-slide-2 {
  background-image: linear-gradient(135deg, #8B3A44 0%, #5C1F28 100%),
    url('../images/hero/hero-2.jpg');
}

.nd-slide-3 {
  background-image: linear-gradient(135deg, #6E2229 0%, #3D1518 100%),
    url('../images/hero/hero-3.jpg');
}

.nd-hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: #fff;
  padding: calc(var(--nav-height) + var(--space-12)) var(--space-6) var(--space-16);
  max-width: 820px;
}

.nd-hero-content .reveal {
  opacity: 1;
  transform: none;
}

.nd-hero-company {
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.92;
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.nd-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  color: #fff;
}

.nd-hero-content h1,
.nd-hero-content .nd-hero-subtitle,
.nd-hero-content .nd-hero-desc,
.nd-hero-content .nd-hero-company {
  color: #fff;
}

.nd-hero-title span {
  color: #e8c060;
}

.nd-hero-desc {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.8;
  opacity: 0.92;
  margin-bottom: var(--space-8);
  max-width: 640px;
  margin-inline: auto;
}

.nd-cta-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  padding-bottom: 4px;
  transition: all var(--duration) var(--ease);
}

.nd-cta-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateX(4px);
}

.nd-hero-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: var(--space-2);
}

.nd-hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  cursor: pointer;
  padding: 14px;
  box-sizing: content-box;
  background-clip: content-box;
  transition: all var(--duration) var(--ease);
}

.nd-hero-dot.active {
  background: #fff;
  border-color: #fff;
}

/* Tagline strip — 專業 · 可靠 · 優質 */
.nd-tagline {
  padding: var(--space-16) var(--space-6);
  text-align: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.nd-tagline h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.2em;
}

.nd-tagline span {
  color: var(--color-primary);
}

/* Intro section */
.nd-intro {
  padding: var(--space-20) 0;
  background: var(--color-bg);
}

.nd-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  max-width: var(--nd-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.nd-intro-visual {
  min-height: 280px;
  border-radius: var(--radius-2xl);
  background: linear-gradient(145deg, var(--color-green-light), var(--color-surface));
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.nd-intro-visual:not(:has(.nd-intro-placeholder)) {
  aspect-ratio: 4/3;
}

.nd-intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-intro-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--color-text-muted);
}

.nd-intro-placeholder .logo-large {
  width: min(220px, 55%);
  height: auto;
  max-height: 220px;
  aspect-ratio: 1;
  margin: 0 auto var(--space-5);
  object-fit: contain;
  display: block;
}

.nd-intro-placeholder p {
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  line-height: 1.6;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 100%;
  word-break: break-word;
}

.nd-intro-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.nd-intro-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-body);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.nd-intro-list li::before {
  content: '✓';
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
}

.nd-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--text-body);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 2px;
  transition: all var(--duration) var(--ease);
}

.nd-link-arrow:hover {
  color: var(--color-primary-hover);
  transform: translateX(4px);
}

/* Services — clean cards */
.nd-services {
  padding: var(--space-20) 0;
  background: var(--color-surface);
}

.nd-section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-12);
  padding-inline: var(--space-6);
}

.nd-section-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  margin-bottom: var(--space-4);
}

.nd-section-head p {
  color: var(--color-text-muted);
  line-height: 1.8;
}

.nd-service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  max-width: var(--nd-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.nd-service-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--duration-md) var(--ease);
}

.nd-service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-green-light);
}

.nd-service-card .icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}

.nd-service-card h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
}

.nd-service-card p {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* Projects preview gallery */
.nd-gallery {
  padding: var(--space-20) 0;
  background: var(--color-bg);
}

.nd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  max-width: var(--nd-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.nd-gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
  color: #fff;
  font-size: var(--text-small);
  font-weight: 700;
  transition: transform var(--duration-md) var(--ease);
}

.nd-gallery-item:hover {
  transform: scale(1.03);
}

.nd-gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 60%);
}

.nd-gallery-item span {
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

.nd-gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-gallery-caption {
  display: block;
  font-size: var(--text-label);
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 0.15rem;
}

.nd-gallery-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

/* Contact band */
.nd-contact-band {
  padding: var(--space-20) 0;
  background: var(--color-primary-dark);
  color: #fff;
  text-align: center;
}

.nd-contact-band h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  color: #fff;
  margin-bottom: var(--space-4);
}

.nd-contact-band p {
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.nd-contact-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-10);
  font-size: var(--text-small);
}

.nd-contact-info a {
  color: rgba(255, 255, 255, 0.9);
}

.nd-contact-info a:hover {
  color: var(--color-accent);
}

/* Light footer override */
body.natural-theme .footer {
  background: #1a1a1a;
}

/* Hide old hero when using nd-hero */
body.natural-theme .hero-modern {
  display: none;
}

body.natural-theme .credentials-bar {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

body.natural-theme .credential-item {
  color: var(--color-text);
}

body.natural-theme .credential-item .icon {
  background: var(--color-green-light);
}

/* Sub-page heroes — photo backgrounds with green overlay */
body.natural-theme .page-hero-modern:not(.page-hero--contact) {
  background: linear-gradient(160deg, #B53845 0%, #6E2229 100%);
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-16);
  text-align: center;
  color: #fff;
}

body.natural-theme .page-hero-modern.page-hero--contact {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-16);
  text-align: center;
  color: #fff;
}

body.natural-theme .page-hero-modern .section-label {
  color: var(--color-accent);
}

body.natural-theme .page-hero-modern .page-hero-title {
  color: #fff;
  font-family: var(--font-display);
}

body.natural-theme .page-hero-modern .page-hero-desc {
  color: rgba(255, 255, 255, 0.88);
}

body.natural-theme .page-hero-modern .breadcrumb a {
  color: rgba(255, 255, 255, 0.75);
}

body.natural-theme .page-hero-modern .breadcrumb span {
  color: rgba(255, 255, 255, 0.55);
}

.nd-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

@media (max-width: 900px) {
  .nd-two-col {
    grid-template-columns: 1fr;
  }
}

.nd-gallery-item {
  text-decoration: none;
}

.nd-service-card[style*="grid-column: span 3"] {
  max-width: 360px;
  margin-inline: auto;
}

@media (max-width: 900px) {
  .nd-intro-grid,
  .nd-service-grid {
    grid-template-columns: 1fr;
  }

  .nd-intro-visual {
    min-height: auto;
  }

  .nd-intro-placeholder {
    padding: var(--space-8) var(--space-5);
  }

  .nd-intro-placeholder .logo-large {
    width: min(180px, 42vw);
    max-height: 180px;
  }

  .nd-service-card[style*="grid-column: span 3"] {
    grid-column: span 1 !important;
    max-width: none;
  }

  .nd-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nd-hero {
    min-height: auto;
  }

  .nd-hero-content {
    padding: calc(var(--nav-height) + var(--space-8)) var(--space-4) var(--space-10);
  }

  .nd-gallery-grid {
    grid-template-columns: 1fr;
  }

  .nd-tagline h2 {
    letter-spacing: 0.08em;
    font-size: 1.5rem;
  }

  .nd-intro-placeholder {
    padding: var(--space-6) var(--space-4);
  }

  .nd-intro-placeholder .logo-large {
    width: min(140px, 38vw);
    max-height: 140px;
    margin-bottom: var(--space-4);
  }
}
