/* ===== Huser Electric Inc - Main Stylesheet ===== */

/* --- CSS Variables --- */
:root {
  --navy: #2B4C7E;
  --navy-dark: #1A3358;
  --navy-light: #3A6BAF;
  --grey: #6B7B8D;
  --grey-light: #A0ADB8;
  --grey-lighter: #E8ECF0;
  --grey-bg: #F5F7FA;
  --white: #FFFFFF;
  --text-dark: #1E2A3A;
  --text-body: #3D4F63;
  --text-light: #7A8A9A;
  --shadow-sm: 0 1px 3px rgba(43, 76, 126, 0.08);
  --shadow-md: 0 4px 12px rgba(43, 76, 126, 0.1);
  --shadow-lg: 0 8px 30px rgba(43, 76, 126, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.3s ease;
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-body);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--navy-light);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.3;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* --- Header / Navigation --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-lighter);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  height: 80px;
}

/* Logo link — matches both .logo-link and .header-logo > a */
.logo-link,
.header-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link img,
.header-logo img,
.logo-image {
  height: 55px;
  width: auto;
}

/* Nav — matches both .nav-menu and .nav-list */
.nav-menu,
.nav-list {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-menu a,
.nav-list a,
.nav-link {
  display: block;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-body);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active,
.nav-list a:hover,
.nav-list a.active,
.nav-link:hover,
.nav-link.active {
  color: var(--navy);
  background: var(--grey-lighter);
}


/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* Supports both 'span' and '.hamburger' children */
.menu-toggle span,
.menu-toggle .hamburger {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--navy);
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.open span:nth-child(1),
.menu-toggle.open .hamburger:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Legacy header compatibility - unify all pages */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-lighter);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  height: 80px;
}

.header-logo a {
  display: flex;
  align-items: center;
}

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

.nav {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.hero-section {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 60px 0 50px;
  text-align: center;
}

.hero-section h1 {
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 10px;
}

.hero-section p {
  opacity: 0.85;
  font-size: 1.1rem;
  color: var(--white);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  color: var(--white);
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Salt Spring Island photo as subtle hero background */
.hero-bg-photo {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/images/saltspring-hero.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  z-index: 0;
}

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

.hero h1 {
  font-size: 3rem;
  color: var(--white);
  margin-bottom: 20px;
  font-weight: 800;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 650px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.island-photo {
  margin: 48px auto 0;
  max-width: 700px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.island-photo img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.badge svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--white);
  color: var(--navy);
}

.btn-primary:hover {
  background: var(--grey-lighter);
  color: var(--navy-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
  color: var(--white);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
}

.btn-navy:hover {
  background: var(--navy-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline-dark:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* --- Section Styles --- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--grey-bg);
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 16px;
  text-align: center;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

/* --- Service Cards --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--grey-lighter);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--navy-light);
}

.service-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--white);
}

.service-icon svg {
  width: 28px;
  height: 28px;
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--text-light);
}

/* --- Features Row --- */
.features-row {
  padding: 60px 0;
  background: var(--grey-bg);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.feature-item {
  text-align: center;
  padding: 32px 24px;
}

.feature-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.feature-label {
  font-size: 1rem;
  color: var(--text-light);
}

/* --- About Preview (home page) --- */
.about-preview {
  padding: 80px 0;
}

.about-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about-text p {
  margin-bottom: 16px;
}

/* --- About Section (about page) --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about-content p {
  margin-bottom: 16px;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grey-lighter);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  font-size: 0.9rem;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.credentials-list {
  list-style: none;
  margin-top: 20px;
}

.credentials-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-weight: 500;
}

.credentials-list svg {
  width: 20px;
  height: 20px;
  color: var(--navy);
  flex-shrink: 0;
}

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--grey-lighter);
  position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--grey);
  gap: 8px;
}

.gallery-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info-card {
  background: var(--grey-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
}

.contact-info-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.contact-detail svg {
  width: 20px;
  height: 20px;
  color: var(--navy);
  flex-shrink: 0;
}

.contact-detail a {
  color: var(--text-body);
}

.contact-detail a:hover {
  color: var(--navy);
}

.contact-form {
  background: var(--white);
  border: 1px solid var(--grey-lighter);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.contact-form h3 {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--grey-lighter);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-body);
  transition: border-color var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(43, 76, 126, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.info-card {
  background: var(--grey-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.info-card h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--navy);
}

.info-card p {
  font-size: 0.95rem;
}

.info-card a {
  color: var(--text-body);
}

.info-card a:hover {
  color: var(--navy);
}

.contact-note {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 6px;
}

.contact-section {
  padding: 80px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.gallery-section {
  padding: 80px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.about-section {
  padding: 80px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.why-choose-us {
  padding: 60px 40px;
  background: var(--grey-bg);
  text-align: center;
}

.why-choose-us h2 {
  margin-bottom: 32px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.value-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  border: 1px solid var(--grey-lighter);
}

.value-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.value-card p {
  font-size: 0.95rem;
  color: var(--text-light);
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--grey);
  gap: 8px;
}

.image-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

.checkmark {
  width: 20px;
  height: 20px;
  color: var(--navy);
  flex-shrink: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.form-submit:hover {
  background: var(--navy-dark);
}

.form-success {
  display: none;
  text-align: center;
  padding: 32px;
  color: var(--navy);
}

.form-success svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: #2E7D32;
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.cta-banner h2 {
  font-size: 2rem;
  color: var(--white);
  margin-bottom: 12px;
}

.cta-banner p {
  opacity: 0.9;
  margin-bottom: 28px;
  font-size: 1.1rem;
}

/* --- Footer (matches mockup) --- */
.site-footer {
  background: var(--text-dark);
  color: var(--grey-light);
  padding: 40px 0 0;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
  gap: 24px;
}

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

.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--grey-light);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--white);
}

.footer-contact-row {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.footer-contact-row a {
  color: var(--grey-light);
}

.footer-contact-row a:hover {
  color: var(--white);
}

.footer-contact-row span {
  color: var(--grey);
}

.footer-divider {
  color: rgba(255,255,255,0.2);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
}

/* --- Page Header (inner pages) --- */
.page-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 60px 0 50px;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 10px;
}

.page-header p {
  opacity: 0.85;
  font-size: 1.1rem;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .about-grid,
  .about-content-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.4rem;
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: 70px;
  }

  .header-container {
    padding: 0 24px;
    height: 70px;
  }

  .container {
    padding: 0 24px;
  }

  .contact-section,
  .gallery-section,
  .about-section {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .footer-top {
    padding: 0 24px 30px;
    justify-content: center;
  }

  .footer-nav {
    justify-content: center;
  }

  .footer-contact-row {
    padding: 24px;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--grey-lighter);
    box-shadow: var(--shadow-md);
    gap: 4px;
    z-index: 999;
  }

  .nav.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .nav-menu,
  .nav-list,
  .header-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--grey-lighter);
    box-shadow: var(--shadow-md);
    gap: 4px;
    z-index: 999;
  }

  .nav-menu.open,
  .nav-list.open,
  .header-nav.open {
    display: flex;
  }

  .nav-menu a,
  .nav-list a,
  .nav-link {
    padding: 12px 16px;
  }

  .hero {
    padding: 60px 0 50px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 24px;
  }

  .about-content-grid {
    grid-template-columns: 1fr;
  }

  .feature-item {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-badges {
    gap: 8px;
    justify-content: center;
  }

  .badge {
    justify-content: center;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-4 { margin-bottom: 32px; }

/* --- Editable content highlight (admin mode) --- */
[data-editable].editing {
  outline: 2px dashed var(--navy-light);
  outline-offset: 4px;
  cursor: text;
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--grey-lighter) 25%, #f0f3f7 50%, var(--grey-lighter) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- Scroll animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
